@vectorize-io/hindsight-control-plane 0.4.2 → 0.4.3
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.
- package/package.json +1 -1
- package/standalone/.next/BUILD_ID +1 -1
- package/standalone/.next/build-manifest.json +2 -2
- package/standalone/.next/prerender-manifest.json +3 -3
- package/standalone/.next/server/app/_global-error.html +2 -2
- package/standalone/.next/server/app/_global-error.rsc +1 -1
- package/standalone/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/standalone/.next/server/app/_not-found.html +1 -1
- package/standalone/.next/server/app/_not-found.rsc +2 -2
- package/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
- package/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +2 -2
- package/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/standalone/.next/server/app/api/banks/[bankId]/consolidate/route.js +2 -3
- package/standalone/.next/server/app/api/banks/[bankId]/consolidate/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/banks/[bankId]/directives/[directiveId]/route.js +1 -1
- package/standalone/.next/server/app/api/banks/[bankId]/directives/[directiveId]/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/banks/[bankId]/directives/route.js +1 -1
- package/standalone/.next/server/app/api/banks/[bankId]/directives/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/banks/[bankId]/mental-models/[mentalModelId]/refresh/route.js +1 -1
- package/standalone/.next/server/app/api/banks/[bankId]/mental-models/[mentalModelId]/refresh/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/banks/[bankId]/mental-models/[mentalModelId]/route.js +1 -1
- package/standalone/.next/server/app/api/banks/[bankId]/mental-models/[mentalModelId]/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/banks/[bankId]/mental-models/route.js +1 -1
- package/standalone/.next/server/app/api/banks/[bankId]/mental-models/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/banks/[bankId]/observations/[modelId]/route.js +1 -1
- package/standalone/.next/server/app/api/banks/[bankId]/observations/[modelId]/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/banks/[bankId]/observations/route.js +2 -3
- package/standalone/.next/server/app/api/banks/[bankId]/observations/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/banks/[bankId]/operations/[operationId]/route.js +2 -3
- package/standalone/.next/server/app/api/banks/[bankId]/operations/[operationId]/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/banks/[bankId]/route.js +2 -3
- package/standalone/.next/server/app/api/banks/[bankId]/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/banks/route.js +2 -3
- package/standalone/.next/server/app/api/banks/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/chunks/[chunkId]/route.js +2 -3
- package/standalone/.next/server/app/api/chunks/[chunkId]/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/documents/[documentId]/route.js +2 -3
- package/standalone/.next/server/app/api/documents/[documentId]/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/documents/route.js +2 -3
- package/standalone/.next/server/app/api/documents/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/entities/[entityId]/regenerate/route.js +2 -3
- package/standalone/.next/server/app/api/entities/[entityId]/regenerate/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/entities/[entityId]/route.js +2 -3
- package/standalone/.next/server/app/api/entities/[entityId]/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/entities/route.js +2 -3
- package/standalone/.next/server/app/api/entities/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/graph/route.js +2 -3
- package/standalone/.next/server/app/api/graph/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/health/route.js +1 -2
- package/standalone/.next/server/app/api/health/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/list/route.js +2 -3
- package/standalone/.next/server/app/api/list/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/memories/[memoryId]/route.js +1 -1
- package/standalone/.next/server/app/api/memories/[memoryId]/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/memories/retain/route.js +2 -3
- package/standalone/.next/server/app/api/memories/retain/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/memories/retain_async/route.js +2 -3
- package/standalone/.next/server/app/api/memories/retain_async/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/operations/[agentId]/route.js +2 -3
- package/standalone/.next/server/app/api/operations/[agentId]/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/profile/[bankId]/route.js +2 -3
- package/standalone/.next/server/app/api/profile/[bankId]/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/recall/route.js +2 -3
- package/standalone/.next/server/app/api/recall/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/reflect/route.js +2 -3
- package/standalone/.next/server/app/api/reflect/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/stats/[agentId]/route.js +2 -3
- package/standalone/.next/server/app/api/stats/[agentId]/route.js.nft.json +1 -1
- package/standalone/.next/server/app/api/version/route.js +2 -3
- package/standalone/.next/server/app/api/version/route.js.nft.json +1 -1
- package/standalone/.next/server/app/banks/[bankId]/page_client-reference-manifest.js +1 -1
- package/standalone/.next/server/app/dashboard/page_client-reference-manifest.js +1 -1
- package/standalone/.next/server/app/dashboard.html +1 -1
- package/standalone/.next/server/app/dashboard.rsc +2 -2
- package/standalone/.next/server/app/dashboard.segments/_full.segment.rsc +2 -2
- package/standalone/.next/server/app/dashboard.segments/_head.segment.rsc +1 -1
- package/standalone/.next/server/app/dashboard.segments/_index.segment.rsc +2 -2
- package/standalone/.next/server/app/dashboard.segments/_tree.segment.rsc +2 -2
- package/standalone/.next/server/app/dashboard.segments/dashboard/__PAGE__.segment.rsc +1 -1
- package/standalone/.next/server/app/dashboard.segments/dashboard.segment.rsc +1 -1
- package/standalone/.next/server/app/index.html +1 -1
- package/standalone/.next/server/app/index.rsc +2 -2
- package/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +1 -1
- package/standalone/.next/server/app/index.segments/_full.segment.rsc +2 -2
- package/standalone/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/standalone/.next/server/app/index.segments/_index.segment.rsc +2 -2
- package/standalone/.next/server/app/index.segments/_tree.segment.rsc +2 -2
- package/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
- package/standalone/.next/server/chunks/[root-of-the-server]__02a1e7f7._.js +3 -0
- package/standalone/.next/server/chunks/{[root-of-the-server]__85fada80._.js → [root-of-the-server]__0f1b189c._.js} +2 -2
- package/standalone/.next/server/chunks/{[root-of-the-server]__9e91e653._.js → [root-of-the-server]__18142a79._.js} +2 -2
- package/standalone/.next/server/chunks/{[root-of-the-server]__fd2d4ac3._.js → [root-of-the-server]__228c769f._.js} +2 -2
- package/standalone/.next/server/chunks/[root-of-the-server]__2df99810._.js +21 -0
- package/standalone/.next/server/chunks/[root-of-the-server]__32db962b._.js +3 -0
- package/standalone/.next/server/chunks/{[root-of-the-server]__296b95db._.js → [root-of-the-server]__464d3847._.js} +2 -2
- package/standalone/.next/server/chunks/[root-of-the-server]__4f034a9d._.js +1 -1
- package/standalone/.next/server/chunks/[root-of-the-server]__4f8cb4ae._.js +1 -1
- package/standalone/.next/server/chunks/[root-of-the-server]__5e1d146d._.js +3 -0
- package/standalone/.next/server/chunks/[root-of-the-server]__6296f8c7._.js +1 -1
- package/standalone/.next/server/chunks/[root-of-the-server]__6872cebd._.js +1 -1
- package/standalone/.next/server/chunks/{[root-of-the-server]__ef34dcbb._.js → [root-of-the-server]__6ee44ea3._.js} +2 -2
- package/standalone/.next/server/chunks/{[root-of-the-server]__57dac9c2._.js → [root-of-the-server]__73093267._.js} +2 -2
- package/standalone/.next/server/chunks/{[root-of-the-server]__37560d9a._.js → [root-of-the-server]__81c0d784._.js} +2 -2
- package/standalone/.next/server/chunks/{[root-of-the-server]__a2b6ce38._.js → [root-of-the-server]__905dfb67._.js} +2 -2
- package/standalone/.next/server/chunks/[root-of-the-server]__9a7529ab._.js +1 -1
- package/standalone/.next/server/chunks/[root-of-the-server]__9ab5fe6b._.js +1 -1
- package/standalone/.next/server/chunks/[root-of-the-server]__9c3dd746._.js +3 -0
- package/standalone/.next/server/chunks/{[root-of-the-server]__116b0d31._.js → [root-of-the-server]__a044118e._.js} +2 -2
- package/standalone/.next/server/chunks/[root-of-the-server]__bae0f53c._.js +3 -0
- package/standalone/.next/server/chunks/[root-of-the-server]__be9afc00._.js +3 -0
- package/standalone/.next/server/chunks/{[root-of-the-server]__8578ca3f._.js → [root-of-the-server]__bfef8f90._.js} +2 -2
- package/standalone/.next/server/chunks/{[root-of-the-server]__687469c1._.js → [root-of-the-server]__d2485edb._.js} +2 -2
- package/standalone/.next/server/chunks/[root-of-the-server]__d4a965d7._.js +1 -1
- package/standalone/.next/server/chunks/[root-of-the-server]__d4b39930._.js +3 -0
- package/standalone/.next/server/chunks/{[root-of-the-server]__ab5df0f3._.js → [root-of-the-server]__d4f9d631._.js} +2 -2
- package/standalone/.next/server/chunks/{[root-of-the-server]__9af3dcb2._.js → [root-of-the-server]__e5a6b81d._.js} +2 -2
- package/standalone/.next/server/chunks/{[root-of-the-server]__356491b1._.js → [root-of-the-server]__f318615b._.js} +2 -2
- package/standalone/.next/server/chunks/[root-of-the-server]__faf484e1._.js +1 -1
- package/standalone/.next/server/chunks/ssr/[root-of-the-server]__3ff65f6b._.js +1 -1
- package/standalone/.next/server/pages/404.html +1 -1
- package/standalone/.next/server/pages/500.html +2 -2
- package/standalone/.next/server/server-reference-manifest.js +1 -1
- package/standalone/.next/server/server-reference-manifest.json +1 -1
- package/standalone/.next/static/chunks/{e574a89d58c6e4fc.js → 23a0ba0741952676.js} +1 -1
- package/standalone/.next/static/chunks/9a7e51393bf24b62.css +2 -0
- package/standalone/package.json +1 -1
- package/standalone/.next/server/chunks/[root-of-the-server]__478d7304._.js +0 -3
- package/standalone/.next/server/chunks/[root-of-the-server]__51072426._.js +0 -3
- package/standalone/.next/server/chunks/[root-of-the-server]__517fcb62._.js +0 -3
- package/standalone/.next/server/chunks/[root-of-the-server]__71e0e3b9._.js +0 -21
- package/standalone/.next/server/chunks/[root-of-the-server]__8241ce67._.js +0 -3
- package/standalone/.next/server/chunks/[root-of-the-server]__b9387f6f._.js +0 -3
- package/standalone/.next/server/chunks/[root-of-the-server]__e1881f02._.js +0 -3
- package/standalone/.next/server/chunks/[root-of-the-server]__e4e9fd7e._.js +0 -3
- package/standalone/.next/server/chunks/hindsight-clients_typescript_dist_79330c4c._.js +0 -3
- package/standalone/.next/static/chunks/29c428a7aa2236cf.css +0 -2
- /package/standalone/.next/static/{Y8YJLN30SHD2q3LwKQD3D → zGNfMglnlHqrqWAqOLkLX}/_buildManifest.js +0 -0
- /package/standalone/.next/static/{Y8YJLN30SHD2q3LwKQD3D → zGNfMglnlHqrqWAqOLkLX}/_clientMiddlewareManifest.json +0 -0
- /package/standalone/.next/static/{Y8YJLN30SHD2q3LwKQD3D → zGNfMglnlHqrqWAqOLkLX}/_ssgManifest.js +0 -0
|
@@ -5,6 +5,6 @@ You can add a description to the \`${mp}\` by passing a \`${mw}\` component as a
|
|
|
5
5
|
Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${mp}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
|
|
6
6
|
|
|
7
7
|
For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return I.useEffect(()=>{document.getElementById(a.current?.getAttribute("aria-describedby"))||console.warn(b)},[b,a]),null};let mC=I.forwardRef(({className:a,...b},c)=>(0,F.jsx)(mo,{className:(0,T.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",a),...b,ref:c}));mC.displayName=mo.displayName;let mD=I.forwardRef(({className:a,...b},c)=>(0,F.jsxs)(mn,{children:[(0,F.jsx)(mC,{}),(0,F.jsx)(mt,{ref:c,className:(0,T.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",a),...b})]}));mD.displayName=mt.displayName;let mE=({className:a,...b})=>(0,F.jsx)("div",{className:(0,T.cn)("flex flex-col space-y-2 text-center sm:text-left",a),...b});mE.displayName="AlertDialogHeader";let mF=({className:a,...b})=>(0,F.jsx)("div",{className:(0,T.cn)("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",a),...b});mF.displayName="AlertDialogFooter";let mG=I.forwardRef(({className:a,...b},c)=>(0,F.jsx)(mv,{ref:c,className:(0,T.cn)("text-lg font-semibold",a),...b}));mG.displayName=mv.displayName;let mH=I.forwardRef(({className:a,...b},c)=>(0,F.jsx)(mx,{ref:c,className:(0,T.cn)("text-sm text-muted-foreground",a),...b}));mH.displayName=mx.displayName;let mI=I.forwardRef(({className:a,...b},c)=>(0,F.jsx)(my,{ref:c,className:(0,T.cn)((0,X.buttonVariants)(),a),...b}));mI.displayName=my.displayName;let mJ=I.forwardRef(({className:a,...b},c)=>(0,F.jsx)(mA,{ref:c,className:(0,T.cn)((0,X.buttonVariants)({variant:"outline"}),"mt-2 sm:mt-0",a),...b}));mJ.displayName=mA.displayName;let mK=(0,L.default)("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]);function mL(){let{currentBank:a}=(0,J.useBank)(),[b,c]=(0,I.useState)([]),[d,e]=(0,I.useState)(!1),[f,g]=(0,I.useState)(""),[h,i]=(0,I.useState)(0),[j,k]=(0,I.useState)(null),[l,n]=(0,I.useState)(!1),[o,p]=(0,I.useState)(null),[q,r]=(0,I.useState)(null),[s,t]=(0,I.useState)(null),u=async()=>{if(a){e(!0);try{let b=await W.client.listDocuments({bank_id:a,q:f,limit:100});c(b.items||[]),i(b.total||0)}catch(a){console.error("Error loading documents:",a),alert("Error loading documents: "+a.message)}finally{e(!1)}}},v=async b=>{if(a){n(!0),k({id:b});try{let c=await W.client.getDocument(b,a);k(c)}catch(a){console.error("Error loading document:",a),alert("Error loading document: "+a.message),k(null)}finally{n(!1)}}},w=async()=>{if(!a||!q)return;let b=q.id;p(b),r(null);try{let c=await W.client.deleteDocument(b,a);t({success:!0,message:`Deleted document and ${c.memory_units_deleted} memory units.`}),j?.id===b&&k(null),u()}catch(a){console.error("Error deleting document:",a),t({success:!1,message:"Error deleting document: "+a.message})}finally{p(null)}};return(0,I.useEffect)(()=>{a&&u()},[a]),(0,F.jsxs)("div",{children:[d?(0,F.jsx)("div",{className:"flex items-center justify-center py-20",children:(0,F.jsxs)("div",{className:"text-center",children:[(0,F.jsx)("div",{className:"text-4xl mb-2",children:"⏳"}),(0,F.jsx)("div",{className:"text-sm text-muted-foreground",children:"Loading documents..."})]})}):b.length>0?(0,F.jsxs)("div",{className:"mb-4 text-sm text-muted-foreground",children:[h," total documents"]}):(0,F.jsx)("div",{className:"flex items-center justify-center py-20",children:(0,F.jsxs)("div",{className:"text-center",children:[(0,F.jsx)("div",{className:"text-4xl mb-2",children:"📄"}),(0,F.jsx)("div",{className:"text-sm text-muted-foreground",children:"No documents found"})]})}),b.length>0&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)("div",{className:"w-full",children:[(0,F.jsx)("div",{className:"px-5 mb-4",children:(0,F.jsx)(Y.Input,{type:"text",value:f,onChange:a=>g(a.target.value),placeholder:"Search documents (ID)...",className:"max-w-2xl"})}),(0,F.jsx)("div",{className:"overflow-x-auto px-5 pb-5",children:(0,F.jsxs)(ah,{children:[(0,F.jsx)(ai,{children:(0,F.jsxs)(ak,{children:[(0,F.jsx)(al,{children:"Document ID"}),(0,F.jsx)(al,{children:"Created"}),(0,F.jsx)(al,{children:"Context"}),(0,F.jsx)(al,{children:"Text Length"}),(0,F.jsx)(al,{children:"Memory Units"})]})}),(0,F.jsx)(aj,{children:b.length>0?b.map(a=>(0,F.jsxs)(ak,{className:`cursor-pointer hover:bg-muted/50 ${j?.id===a.id?"bg-primary/10":""}`,onClick:()=>v(a.id),children:[(0,F.jsx)(am,{title:a.id,className:"text-card-foreground",children:a.id.length>30?a.id.substring(0,30)+"...":a.id}),(0,F.jsx)(am,{className:"text-card-foreground",children:a.created_at?new Date(a.created_at).toLocaleString():"N/A"}),(0,F.jsx)(am,{className:"text-card-foreground",children:a.retain_params?.context||"-"}),(0,F.jsxs)(am,{className:"text-card-foreground",children:[a.text_length?.toLocaleString()," chars"]}),(0,F.jsx)(am,{className:"text-card-foreground",children:a.memory_unit_count})]},a.id)):(0,F.jsx)(ak,{children:(0,F.jsx)(am,{colSpan:5,className:"text-center",children:'Click "Load Documents" to view data'})})})]})})]}),j&&(0,F.jsx)("div",{className:"fixed right-0 top-0 h-screen w-[420px] bg-card border-l-2 border-primary shadow-2xl z-50 overflow-y-auto animate-in slide-in-from-right duration-300 ease-out",children:(0,F.jsxs)("div",{className:"p-5",children:[(0,F.jsxs)("div",{className:"flex justify-between items-center mb-6 pb-4 border-b border-border",children:[(0,F.jsxs)("div",{children:[(0,F.jsx)("h3",{className:"text-xl font-bold text-foreground",children:"Document Details"}),(0,F.jsx)("p",{className:"text-sm text-muted-foreground mt-1",children:"Original document text and metadata"})]}),(0,F.jsxs)(X.Button,{variant:"secondary",size:"sm",onClick:()=>k(null),className:"h-9 px-3 gap-2",children:[(0,F.jsx)(bg.X,{className:"h-4 w-4"}),"Close"]})]}),l?(0,F.jsx)("div",{className:"flex items-center justify-center py-20",children:(0,F.jsxs)("div",{className:"text-center",children:[(0,F.jsx)("div",{className:"text-4xl mb-2",children:"⏳"}),(0,F.jsx)("div",{className:"text-sm text-muted-foreground",children:"Loading document..."})]})}):(0,F.jsxs)("div",{className:"space-y-5",children:[(0,F.jsxs)("div",{className:"p-4 bg-muted/50 rounded-lg",children:[(0,F.jsx)("div",{className:"text-xs font-bold text-muted-foreground uppercase mb-2",children:"Document ID"}),(0,F.jsx)("div",{className:"text-sm font-mono break-all text-card-foreground",children:j.id})]}),j.created_at&&(0,F.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,F.jsxs)("div",{className:"p-4 bg-muted/50 rounded-lg",children:[(0,F.jsx)("div",{className:"text-xs font-bold text-muted-foreground uppercase mb-2",children:"Created"}),(0,F.jsx)("div",{className:"text-sm font-medium text-card-foreground",children:new Date(j.created_at).toLocaleString()})]}),(0,F.jsxs)("div",{className:"p-4 bg-muted/50 rounded-lg",children:[(0,F.jsx)("div",{className:"text-xs font-bold text-muted-foreground uppercase mb-2",children:"Memory Units"}),(0,F.jsx)("div",{className:"text-sm font-medium text-card-foreground",children:j.memory_unit_count})]})]}),j.original_text&&(0,F.jsxs)("div",{className:"p-4 bg-muted/50 rounded-lg",children:[(0,F.jsx)("div",{className:"text-xs font-bold text-muted-foreground uppercase mb-2",children:"Text Length"}),(0,F.jsxs)("div",{className:"text-sm font-medium text-card-foreground",children:[j.original_text.length.toLocaleString()," characters"]})]}),j.retain_params&&(0,F.jsxs)("div",{className:"p-4 bg-muted/50 rounded-lg",children:[(0,F.jsx)("div",{className:"text-xs font-bold text-muted-foreground uppercase mb-2",children:"Retain Parameters"}),(0,F.jsxs)("div",{className:"text-sm space-y-2 text-card-foreground",children:[j.retain_params.context&&(0,F.jsxs)("div",{children:[(0,F.jsx)("span",{className:"font-semibold",children:"Context:"})," ",j.retain_params.context]}),j.retain_params.event_date&&(0,F.jsxs)("div",{children:[(0,F.jsx)("span",{className:"font-semibold",children:"Event Date:"})," ",new Date(j.retain_params.event_date).toLocaleString()]}),j.retain_params.metadata&&(0,F.jsxs)("div",{className:"mt-2",children:[(0,F.jsx)("span",{className:"font-semibold",children:"Metadata:"}),(0,F.jsx)("pre",{className:"mt-1 text-xs bg-background p-2 rounded text-card-foreground",children:JSON.stringify(j.retain_params.metadata,null,2)})]})]})]}),j.tags&&j.tags.length>0&&(0,F.jsxs)("div",{className:"p-4 bg-muted/50 rounded-lg",children:[(0,F.jsx)("div",{className:"text-xs font-bold text-muted-foreground uppercase mb-2",children:"Tags"}),(0,F.jsx)("div",{className:"flex flex-wrap gap-2",children:j.tags.map((a,b)=>(0,F.jsx)("span",{className:"text-sm px-3 py-1.5 rounded-full bg-amber-500/10 text-amber-600 dark:text-amber-400 font-medium",children:a},b))})]}),(0,F.jsx)("div",{className:"pt-2 border-t border-border",children:(0,F.jsxs)(X.Button,{variant:"destructive",size:"sm",onClick:()=>{r({id:j.id,memoryCount:j.memory_unit_count})},className:"w-full gap-2",disabled:o===j.id,children:[o===j.id?(0,F.jsx)("span",{className:"animate-spin",children:"⏳"}):(0,F.jsx)(mK,{className:"h-4 w-4"}),"Delete Document"]})}),j.original_text&&(0,F.jsxs)("div",{children:[(0,F.jsx)("div",{className:"text-xs font-bold text-muted-foreground uppercase mb-2",children:"Original Text"}),(0,F.jsx)("div",{className:"p-4 bg-muted/50 rounded-lg border border-border max-h-[400px] overflow-y-auto",children:(0,F.jsx)("pre",{className:"text-sm whitespace-pre-wrap font-mono leading-relaxed text-card-foreground",children:j.original_text})})]})]})]})})]}),(0,F.jsx)(mm,{open:!!q,onOpenChange:a=>!a&&r(null),children:(0,F.jsxs)(mD,{children:[(0,F.jsxs)(mE,{children:[(0,F.jsx)(mG,{children:"Delete Document"}),(0,F.jsxs)(mH,{children:["Are you sure you want to delete document"," ",(0,F.jsxs)("span",{className:"font-mono font-semibold",children:['"',q?.id,'"']}),"?",(0,F.jsx)("br",{}),(0,F.jsx)("br",{}),"This will also delete"," ",q?.memoryCount!==void 0?(0,F.jsxs)("span",{className:"font-semibold",children:[q.memoryCount," memory units"]}):"all memory units"," ","extracted from this document.",(0,F.jsx)("br",{}),(0,F.jsx)("br",{}),(0,F.jsx)("span",{className:"text-destructive font-semibold",children:"This action cannot be undone."})]})]}),(0,F.jsxs)(mF,{children:[(0,F.jsx)(mJ,{children:"Cancel"}),(0,F.jsx)(mI,{onClick:w,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})}),(0,F.jsx)(mm,{open:!!s,onOpenChange:a=>!a&&t(null),children:(0,F.jsxs)(mD,{children:[(0,F.jsxs)(mE,{children:[(0,F.jsx)(mG,{children:s?.success?"Document Deleted":"Error"}),(0,F.jsx)(mH,{children:s?.message})]}),(0,F.jsx)(mF,{children:(0,F.jsx)(mI,{onClick:()=>t(null),children:"OK"})})]})})]})}function mM(){let{currentBank:a}=(0,J.useBank)(),[b,c]=(0,I.useState)([]),[d,e]=(0,I.useState)(!1),[f,g]=(0,I.useState)(null),[h,i]=(0,I.useState)(!1),[j,k]=(0,I.useState)(1),[l,n]=(0,I.useState)(0),o=Math.ceil(l/50),p=(j-1)*50,q=async(b=1)=>{if(a){e(!0);try{let d=await W.client.listEntities({bank_id:a,limit:50,offset:(b-1)*50});c(d.items||[]),n(d.total||0)}catch(a){console.error("Error loading entities:",a),alert("Error loading entities: "+a.message)}finally{e(!1)}}},r=async b=>{if(a){i(!0);try{let c=await W.client.getEntity(b,a);g(c)}catch(a){console.error("Error loading entity detail:",a),alert("Error loading entity detail: "+a.message)}finally{i(!1)}}},s=a=>{k(a),q(a)};(0,I.useEffect)(()=>{a&&(k(1),q(1),g(null))},[a]);let t=a=>a?new Date(a).toLocaleDateString():"N/A";return(0,F.jsxs)("div",{children:[(0,F.jsx)("div",{children:d?(0,F.jsx)("div",{className:"flex items-center justify-center py-20",children:(0,F.jsxs)("div",{className:"text-center",children:[(0,F.jsx)("div",{className:"text-4xl mb-2",children:"..."}),(0,F.jsx)("div",{className:"text-sm text-muted-foreground",children:"Loading entities..."})]})}):b.length>0?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)("div",{className:"mb-4 text-sm text-muted-foreground",children:[l," ",1===l?"entity":"entities"]}),(0,F.jsx)("div",{className:"overflow-x-auto",children:(0,F.jsxs)(ah,{children:[(0,F.jsx)(ai,{children:(0,F.jsxs)(ak,{children:[(0,F.jsx)(al,{children:"Name"}),(0,F.jsx)(al,{children:"Mentions"}),(0,F.jsx)(al,{children:"First Seen"}),(0,F.jsx)(al,{children:"Last Seen"})]})}),(0,F.jsx)(aj,{children:b.map(a=>(0,F.jsxs)(ak,{onClick:()=>r(a.id),className:`cursor-pointer hover:bg-muted/50 ${f?.id===a.id?"bg-primary/10":""}`,children:[(0,F.jsx)(am,{className:"font-medium text-card-foreground",children:a.canonical_name}),(0,F.jsx)(am,{className:"text-card-foreground",children:a.mention_count}),(0,F.jsx)(am,{className:"text-card-foreground",children:t(a.first_seen)}),(0,F.jsx)(am,{className:"text-card-foreground",children:t(a.last_seen)})]},a.id))})]})}),o>1&&(0,F.jsxs)("div",{className:"flex items-center justify-between mt-3 pt-3 border-t",children:[(0,F.jsxs)("div",{className:"text-xs text-muted-foreground",children:[p+1,"-",Math.min(p+50,l)," of ",l]}),(0,F.jsxs)("div",{className:"flex items-center gap-1",children:[(0,F.jsx)(X.Button,{variant:"outline",size:"sm",onClick:()=>s(1),disabled:1===j||d,className:"h-7 w-7 p-0",children:(0,F.jsx)(aa,{className:"h-3 w-3"})}),(0,F.jsx)(X.Button,{variant:"outline",size:"sm",onClick:()=>s(j-1),disabled:1===j||d,className:"h-7 w-7 p-0",children:(0,F.jsx)(Q,{className:"h-3 w-3"})}),(0,F.jsxs)("span",{className:"text-xs px-2",children:[j," / ",o]}),(0,F.jsx)(X.Button,{variant:"outline",size:"sm",onClick:()=>s(j+1),disabled:j===o||d,className:"h-7 w-7 p-0",children:(0,F.jsx)(R,{className:"h-3 w-3"})}),(0,F.jsx)(X.Button,{variant:"outline",size:"sm",onClick:()=>s(o),disabled:j===o||d,className:"h-7 w-7 p-0",children:(0,F.jsx)(ab,{className:"h-3 w-3"})})]})]})]}):(0,F.jsx)("div",{className:"flex items-center justify-center py-20",children:(0,F.jsxs)("div",{className:"text-center",children:[(0,F.jsx)("div",{className:"text-4xl mb-2",children:"..."}),(0,F.jsx)("div",{className:"text-sm text-muted-foreground",children:"No entities found"}),(0,F.jsx)("div",{className:"text-xs text-muted-foreground mt-1",children:"Entities are extracted from facts when memories are added."})]})})}),f&&(0,F.jsx)("div",{className:"fixed right-0 top-0 h-screen w-[420px] bg-card border-l-2 border-primary shadow-2xl z-50 overflow-y-auto animate-in slide-in-from-right duration-300 ease-out",children:(0,F.jsxs)("div",{className:"p-5",children:[(0,F.jsxs)("div",{className:"flex justify-between items-center mb-6 pb-4 border-b border-border",children:[(0,F.jsxs)("div",{children:[(0,F.jsx)("h3",{className:"text-xl font-bold text-card-foreground",children:f.canonical_name}),(0,F.jsx)("p",{className:"text-sm text-muted-foreground mt-1",children:"Entity details"})]}),(0,F.jsx)(X.Button,{variant:"ghost",size:"sm",onClick:()=>g(null),className:"h-8 w-8 p-0",children:(0,F.jsx)("span",{className:"text-lg",children:"x"})})]}),(0,F.jsxs)("div",{className:"space-y-5",children:[(0,F.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,F.jsxs)("div",{className:"p-4 bg-muted/50 rounded-lg",children:[(0,F.jsx)("div",{className:"text-xs font-bold text-muted-foreground uppercase mb-2",children:"Mentions"}),(0,F.jsx)("div",{className:"text-lg font-semibold text-card-foreground",children:f.mention_count})]}),(0,F.jsxs)("div",{className:"p-4 bg-muted/50 rounded-lg",children:[(0,F.jsx)("div",{className:"text-xs font-bold text-muted-foreground uppercase mb-2",children:"First Seen"}),(0,F.jsx)("div",{className:"text-sm font-medium text-card-foreground",children:t(f.first_seen)})]})]}),(0,F.jsxs)("div",{className:"p-4 bg-muted/50 rounded-lg",children:[(0,F.jsx)("div",{className:"text-xs font-bold text-muted-foreground uppercase mb-2",children:"Entity ID"}),(0,F.jsx)("code",{className:"text-xs font-mono break-all text-muted-foreground",children:f.id})]})]})]})})]})}var mN=a.i(96743),mO=a.i(86228),mP=a.i(22297),mQ=a.i(92843),mR=a.i(4691),mS=a.i(92616),mT=Symbol("radix.slottable");function mU(a){return I.isValidElement(a)&&"function"==typeof a.type&&"__radixId"in a.type&&a.type.__radixId===mT}var mV=a.i(46872),mW=a.i(72752),mX=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),mY=I.forwardRef((a,b)=>(0,F.jsx)(aB.Primitive.span,{...a,ref:b,style:{...mX,...a.style}}));mY.displayName="VisuallyHidden";var mZ=a.i(41852),m$=a.i(52081),m_=[" ","Enter","ArrowUp","ArrowDown"],m0=[" ","Enter"],m1="Select",[m2,m3,m4]=(0,aC.createCollection)(m1),[m5,m6]=(0,aw.createContextScope)(m1,[m4,mR.createPopperScope]),m7=(0,mR.createPopperScope)(),[m8,m9]=m5(m1),[na,nb]=m5(m1),nc=a=>{let{__scopeSelect:b,children:c,open:d,defaultOpen:e,onOpenChange:f,value:g,defaultValue:h,onValueChange:i,dir:j,name:k,autoComplete:l,disabled:n,required:o,form:p}=a,q=m7(b),[r,s]=I.useState(null),[t,u]=I.useState(null),[v,w]=I.useState(!1),x=(0,ay.useDirection)(j),[y,z]=(0,ax.useControllableState)({prop:d,defaultProp:e??!1,onChange:f,caller:m1}),[A,B]=(0,ax.useControllableState)({prop:g,defaultProp:h,onChange:i,caller:m1}),C=I.useRef(null),D=!r||p||!!r.closest("form"),[E,G]=I.useState(new Set),H=Array.from(E).map(a=>a.props.value).join(";");return(0,F.jsx)(mR.Root,{...q,children:(0,F.jsxs)(m8,{required:o,scope:b,trigger:r,onTriggerChange:s,valueNode:t,onValueNodeChange:u,valueNodeHasChildren:v,onValueNodeHasChildrenChange:w,contentId:(0,mQ.useId)(),value:A,onValueChange:B,open:y,onOpenChange:z,dir:x,triggerPointerDownPosRef:C,disabled:n,children:[(0,F.jsx)(m2.Provider,{scope:b,children:(0,F.jsx)(na,{scope:a.__scopeSelect,onNativeOptionAdd:I.useCallback(a=>{G(b=>new Set(b).add(a))},[]),onNativeOptionRemove:I.useCallback(a=>{G(b=>{let c=new Set(b);return c.delete(a),c})},[]),children:c})}),D?(0,F.jsxs)(nP,{"aria-hidden":!0,required:o,tabIndex:-1,name:k,autoComplete:l,value:A,onChange:a=>B(a.target.value),disabled:n,form:p,children:[void 0===A?(0,F.jsx)("option",{value:""}):null,Array.from(E)]},H):null]})})};nc.displayName=m1;var nd="SelectTrigger",ne=I.forwardRef((a,b)=>{let{__scopeSelect:c,disabled:d=!1,...e}=a,f=m7(c),g=m9(nd,c),h=g.disabled||d,i=(0,av.useComposedRefs)(b,g.onTriggerChange),j=m3(c),k=I.useRef("touch"),[l,n,o]=nR(a=>{let b=j().filter(a=>!a.disabled),c=b.find(a=>a.value===g.value),d=nS(b,a,c);void 0!==d&&g.onValueChange(d.value)}),p=a=>{h||(g.onOpenChange(!0),o()),a&&(g.triggerPointerDownPosRef.current={x:Math.round(a.pageX),y:Math.round(a.pageY)})};return(0,F.jsx)(mR.Anchor,{asChild:!0,...f,children:(0,F.jsx)(aB.Primitive.button,{type:"button",role:"combobox","aria-controls":g.contentId,"aria-expanded":g.open,"aria-required":g.required,"aria-autocomplete":"none",dir:g.dir,"data-state":g.open?"open":"closed",disabled:h,"data-disabled":h?"":void 0,"data-placeholder":nQ(g.value)?"":void 0,...e,ref:i,onClick:(0,au.composeEventHandlers)(e.onClick,a=>{a.currentTarget.focus(),"mouse"!==k.current&&p(a)}),onPointerDown:(0,au.composeEventHandlers)(e.onPointerDown,a=>{k.current=a.pointerType;let b=a.target;b.hasPointerCapture(a.pointerId)&&b.releasePointerCapture(a.pointerId),0===a.button&&!1===a.ctrlKey&&"mouse"===a.pointerType&&(p(a),a.preventDefault())}),onKeyDown:(0,au.composeEventHandlers)(e.onKeyDown,a=>{let b=""!==l.current;a.ctrlKey||a.altKey||a.metaKey||1!==a.key.length||n(a.key),(!b||" "!==a.key)&&m_.includes(a.key)&&(p(),a.preventDefault())})})})});ne.displayName=nd;var nf="SelectValue",ng=I.forwardRef((a,b)=>{let{__scopeSelect:c,className:d,style:e,children:f,placeholder:g="",...h}=a,i=m9(nf,c),{onValueNodeHasChildrenChange:j}=i,k=void 0!==f,l=(0,av.useComposedRefs)(b,i.onValueNodeChange);return(0,mW.useLayoutEffect)(()=>{j(k)},[j,k]),(0,F.jsx)(aB.Primitive.span,{...h,ref:l,style:{pointerEvents:"none"},children:nQ(i.value)?(0,F.jsx)(F.Fragment,{children:g}):f})});ng.displayName=nf;var nh=I.forwardRef((a,b)=>{let{__scopeSelect:c,children:d,...e}=a;return(0,F.jsx)(aB.Primitive.span,{"aria-hidden":!0,...e,ref:b,children:d||"▼"})});nh.displayName="SelectIcon";var ni=a=>(0,F.jsx)(mS.Portal,{asChild:!0,...a});ni.displayName="SelectPortal";var nj="SelectContent",nk=I.forwardRef((a,b)=>{let c=m9(nj,a.__scopeSelect),[d,e]=I.useState();return((0,mW.useLayoutEffect)(()=>{e(new DocumentFragment)},[]),c.open)?(0,F.jsx)(no,{...a,ref:b}):d?an.createPortal((0,F.jsx)(nl,{scope:a.__scopeSelect,children:(0,F.jsx)(m2.Slot,{scope:a.__scopeSelect,children:(0,F.jsx)("div",{children:a.children})})}),d):null});nk.displayName=nj;var[nl,nm]=m5(nj),nn=((g=I.forwardRef((a,b)=>{let{children:c,...d}=a;if(I.isValidElement(c)){var e;let a,f,g=(e=c,(f=(a=Object.getOwnPropertyDescriptor(e.props,"ref")?.get)&&"isReactWarning"in a&&a.isReactWarning)?e.ref:(f=(a=Object.getOwnPropertyDescriptor(e,"ref")?.get)&&"isReactWarning"in a&&a.isReactWarning)?e.props.ref:e.props.ref||e.ref),h=function(a,b){let c={...b};for(let d in b){let e=a[d],f=b[d];/^on[A-Z]/.test(d)?e&&f?c[d]=(...a)=>{let b=f(...a);return e(...a),b}:e&&(c[d]=e):"style"===d?c[d]={...e,...f}:"className"===d&&(c[d]=[e,f].filter(Boolean).join(" "))}return{...a,...c}}(d,c.props);return c.type!==I.Fragment&&(h.ref=b?(0,av.composeRefs)(b,g):g),I.cloneElement(c,h)}return I.Children.count(c)>1?I.Children.only(null):null})).displayName="SelectContent.RemoveScroll.SlotClone",c=g,(d=I.forwardRef((a,b)=>{let{children:d,...e}=a,f=I.Children.toArray(d),g=f.find(mU);if(g){let a=g.props.children,d=f.map(b=>b!==g?b:I.Children.count(a)>1?I.Children.only(null):I.isValidElement(a)?a.props.children:null);return(0,F.jsx)(c,{...e,ref:b,children:I.isValidElement(a)?I.cloneElement(a,void 0,d):null})}return(0,F.jsx)(c,{...e,ref:b,children:d})})).displayName="SelectContent.RemoveScroll.Slot",d),no=I.forwardRef((a,b)=>{let{__scopeSelect:c,position:d="item-aligned",onCloseAutoFocus:e,onEscapeKeyDown:f,onPointerDownOutside:g,side:h,sideOffset:i,align:j,alignOffset:k,arrowPadding:l,collisionBoundary:n,collisionPadding:o,sticky:p,hideWhenDetached:q,avoidCollisions:r,...s}=a,t=m9(nj,c),[u,v]=I.useState(null),[w,x]=I.useState(null),y=(0,av.useComposedRefs)(b,a=>v(a)),[z,A]=I.useState(null),[B,C]=I.useState(null),D=m3(c),[E,G]=I.useState(!1),H=I.useRef(!1);I.useEffect(()=>{if(u)return(0,mZ.hideOthers)(u)},[u]),(0,mO.useFocusGuards)();let J=I.useCallback(a=>{let[b,...c]=D().map(a=>a.ref.current),[d]=c.slice(-1),e=document.activeElement;for(let c of a)if(c===e||(c?.scrollIntoView({block:"nearest"}),c===b&&w&&(w.scrollTop=0),c===d&&w&&(w.scrollTop=w.scrollHeight),c?.focus(),document.activeElement!==e))return},[D,w]),K=I.useCallback(()=>J([z,u]),[J,z,u]);I.useEffect(()=>{E&&K()},[E,K]);let{onOpenChange:L,triggerPointerDownPosRef:M}=t;I.useEffect(()=>{if(u){let a={x:0,y:0},b=b=>{a={x:Math.abs(Math.round(b.pageX)-(M.current?.x??0)),y:Math.abs(Math.round(b.pageY)-(M.current?.y??0))}},c=c=>{a.x<=10&&a.y<=10?c.preventDefault():u.contains(c.target)||L(!1),document.removeEventListener("pointermove",b),M.current=null};return null!==M.current&&(document.addEventListener("pointermove",b),document.addEventListener("pointerup",c,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",b),document.removeEventListener("pointerup",c,{capture:!0})}}},[u,L,M]),I.useEffect(()=>{let a=()=>L(!1);return window.addEventListener("blur",a),window.addEventListener("resize",a),()=>{window.removeEventListener("blur",a),window.removeEventListener("resize",a)}},[L]);let[N,O]=nR(a=>{let b=D().filter(a=>!a.disabled),c=b.find(a=>a.ref.current===document.activeElement),d=nS(b,a,c);d&&setTimeout(()=>d.ref.current.focus())}),P=I.useCallback((a,b,c)=>{let d=!H.current&&!c;(void 0!==t.value&&t.value===b||d)&&(A(a),d&&(H.current=!0))},[t.value]),Q=I.useCallback(()=>u?.focus(),[u]),R=I.useCallback((a,b,c)=>{let d=!H.current&&!c;(void 0!==t.value&&t.value===b||d)&&C(a)},[t.value]),S="popper"===d?nq:np,T=S===nq?{side:h,sideOffset:i,align:j,alignOffset:k,arrowPadding:l,collisionBoundary:n,collisionPadding:o,sticky:p,hideWhenDetached:q,avoidCollisions:r}:{};return(0,F.jsx)(nl,{scope:c,content:u,viewport:w,onViewportChange:x,itemRefCallback:P,selectedItem:z,onItemLeave:Q,itemTextRefCallback:R,focusSelectedItem:K,selectedItemText:B,position:d,isPositioned:E,searchRef:N,children:(0,F.jsx)(m$.RemoveScroll,{as:nn,allowPinchZoom:!0,children:(0,F.jsx)(mP.FocusScope,{asChild:!0,trapped:t.open,onMountAutoFocus:a=>{a.preventDefault()},onUnmountAutoFocus:(0,au.composeEventHandlers)(e,a=>{t.trigger?.focus({preventScroll:!0}),a.preventDefault()}),children:(0,F.jsx)(mN.DismissableLayer,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:f,onPointerDownOutside:g,onFocusOutside:a=>a.preventDefault(),onDismiss:()=>t.onOpenChange(!1),children:(0,F.jsx)(S,{role:"listbox",id:t.contentId,"data-state":t.open?"open":"closed",dir:t.dir,onContextMenu:a=>a.preventDefault(),...s,...T,onPlaced:()=>G(!0),ref:y,style:{display:"flex",flexDirection:"column",outline:"none",...s.style},onKeyDown:(0,au.composeEventHandlers)(s.onKeyDown,a=>{let b=a.ctrlKey||a.altKey||a.metaKey;if("Tab"===a.key&&a.preventDefault(),b||1!==a.key.length||O(a.key),["ArrowUp","ArrowDown","Home","End"].includes(a.key)){let b=D().filter(a=>!a.disabled).map(a=>a.ref.current);if(["ArrowUp","End"].includes(a.key)&&(b=b.slice().reverse()),["ArrowUp","ArrowDown"].includes(a.key)){let c=a.target,d=b.indexOf(c);b=b.slice(d+1)}setTimeout(()=>J(b)),a.preventDefault()}})})})})})})});no.displayName="SelectContentImpl";var np=I.forwardRef((a,b)=>{let{__scopeSelect:c,onPlaced:d,...e}=a,f=m9(nj,c),g=nm(nj,c),[h,i]=I.useState(null),[j,k]=I.useState(null),l=(0,av.useComposedRefs)(b,a=>k(a)),n=m3(c),o=I.useRef(!1),p=I.useRef(!0),{viewport:q,selectedItem:r,selectedItemText:s,focusSelectedItem:t}=g,u=I.useCallback(()=>{if(f.trigger&&f.valueNode&&h&&j&&q&&r&&s){let a=f.trigger.getBoundingClientRect(),b=j.getBoundingClientRect(),c=f.valueNode.getBoundingClientRect(),e=s.getBoundingClientRect();if("rtl"!==f.dir){let d=e.left-b.left,f=c.left-d,g=a.left-f,i=a.width+g,j=Math.max(i,b.width),k=at(f,[10,Math.max(10,window.innerWidth-10-j)]);h.style.minWidth=i+"px",h.style.left=k+"px"}else{let d=b.right-e.right,f=window.innerWidth-c.right-d,g=window.innerWidth-a.right-f,i=a.width+g,j=Math.max(i,b.width),k=at(f,[10,Math.max(10,window.innerWidth-10-j)]);h.style.minWidth=i+"px",h.style.right=k+"px"}let g=n(),i=window.innerHeight-20,k=q.scrollHeight,l=window.getComputedStyle(j),p=parseInt(l.borderTopWidth,10),t=parseInt(l.paddingTop,10),u=parseInt(l.borderBottomWidth,10),v=p+t+k+parseInt(l.paddingBottom,10)+u,w=Math.min(5*r.offsetHeight,v),x=window.getComputedStyle(q),y=parseInt(x.paddingTop,10),z=parseInt(x.paddingBottom,10),A=a.top+a.height/2-10,B=r.offsetHeight/2,C=p+t+(r.offsetTop+B);if(C<=A){let a=g.length>0&&r===g[g.length-1].ref.current;h.style.bottom="0px";let b=Math.max(i-A,B+(a?z:0)+(j.clientHeight-q.offsetTop-q.offsetHeight)+u);h.style.height=C+b+"px"}else{let a=g.length>0&&r===g[0].ref.current;h.style.top="0px";let b=Math.max(A,p+q.offsetTop+(a?y:0)+B);h.style.height=b+(v-C)+"px",q.scrollTop=C-A+q.offsetTop}h.style.margin="10px 0",h.style.minHeight=w+"px",h.style.maxHeight=i+"px",d?.(),requestAnimationFrame(()=>o.current=!0)}},[n,f.trigger,f.valueNode,h,j,q,r,s,f.dir,d]);(0,mW.useLayoutEffect)(()=>u(),[u]);let[v,w]=I.useState();(0,mW.useLayoutEffect)(()=>{j&&w(window.getComputedStyle(j).zIndex)},[j]);let x=I.useCallback(a=>{a&&!0===p.current&&(u(),t?.(),p.current=!1)},[u,t]);return(0,F.jsx)(nr,{scope:c,contentWrapper:h,shouldExpandOnScrollRef:o,onScrollButtonChange:x,children:(0,F.jsx)("div",{ref:i,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:v},children:(0,F.jsx)(aB.Primitive.div,{...e,ref:l,style:{boxSizing:"border-box",maxHeight:"100%",...e.style}})})})});np.displayName="SelectItemAlignedPosition";var nq=I.forwardRef((a,b)=>{let{__scopeSelect:c,align:d="start",collisionPadding:e=10,...f}=a,g=m7(c);return(0,F.jsx)(mR.Content,{...g,...f,ref:b,align:d,collisionPadding:e,style:{boxSizing:"border-box",...f.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});nq.displayName="SelectPopperPosition";var[nr,ns]=m5(nj,{}),nt="SelectViewport",nu=I.forwardRef((a,b)=>{let{__scopeSelect:c,nonce:d,...e}=a,f=nm(nt,c),g=ns(nt,c),h=(0,av.useComposedRefs)(b,f.onViewportChange),i=I.useRef(0);return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:d}),(0,F.jsx)(m2.Slot,{scope:c,children:(0,F.jsx)(aB.Primitive.div,{"data-radix-select-viewport":"",role:"presentation",...e,ref:h,style:{position:"relative",flex:1,overflow:"hidden auto",...e.style},onScroll:(0,au.composeEventHandlers)(e.onScroll,a=>{let b=a.currentTarget,{contentWrapper:c,shouldExpandOnScrollRef:d}=g;if(d?.current&&c){let a=Math.abs(i.current-b.scrollTop);if(a>0){let d=window.innerHeight-20,e=Math.max(parseFloat(c.style.minHeight),parseFloat(c.style.height));if(e<d){let f=e+a,g=Math.min(d,f),h=f-g;c.style.height=g+"px","0px"===c.style.bottom&&(b.scrollTop=h>0?h:0,c.style.justifyContent="flex-end")}}}i.current=b.scrollTop})})})]})});nu.displayName=nt;var nv="SelectGroup",[nw,nx]=m5(nv);I.forwardRef((a,b)=>{let{__scopeSelect:c,...d}=a,e=(0,mQ.useId)();return(0,F.jsx)(nw,{scope:c,id:e,children:(0,F.jsx)(aB.Primitive.div,{role:"group","aria-labelledby":e,...d,ref:b})})}).displayName=nv;var ny="SelectLabel",nz=I.forwardRef((a,b)=>{let{__scopeSelect:c,...d}=a,e=nx(ny,c);return(0,F.jsx)(aB.Primitive.div,{id:e.id,...d,ref:b})});nz.displayName=ny;var nA="SelectItem",[nB,nC]=m5(nA),nD=I.forwardRef((a,b)=>{let{__scopeSelect:c,value:d,disabled:e=!1,textValue:f,...g}=a,h=m9(nA,c),i=nm(nA,c),j=h.value===d,[k,l]=I.useState(f??""),[n,o]=I.useState(!1),p=(0,av.useComposedRefs)(b,a=>i.itemRefCallback?.(a,d,e)),q=(0,mQ.useId)(),r=I.useRef("touch"),s=()=>{e||(h.onValueChange(d),h.onOpenChange(!1))};if(""===d)throw Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return(0,F.jsx)(nB,{scope:c,value:d,disabled:e,textId:q,isSelected:j,onItemTextChange:I.useCallback(a=>{l(b=>b||(a?.textContent??"").trim())},[]),children:(0,F.jsx)(m2.ItemSlot,{scope:c,value:d,disabled:e,textValue:k,children:(0,F.jsx)(aB.Primitive.div,{role:"option","aria-labelledby":q,"data-highlighted":n?"":void 0,"aria-selected":j&&n,"data-state":j?"checked":"unchecked","aria-disabled":e||void 0,"data-disabled":e?"":void 0,tabIndex:e?void 0:-1,...g,ref:p,onFocus:(0,au.composeEventHandlers)(g.onFocus,()=>o(!0)),onBlur:(0,au.composeEventHandlers)(g.onBlur,()=>o(!1)),onClick:(0,au.composeEventHandlers)(g.onClick,()=>{"mouse"!==r.current&&s()}),onPointerUp:(0,au.composeEventHandlers)(g.onPointerUp,()=>{"mouse"===r.current&&s()}),onPointerDown:(0,au.composeEventHandlers)(g.onPointerDown,a=>{r.current=a.pointerType}),onPointerMove:(0,au.composeEventHandlers)(g.onPointerMove,a=>{r.current=a.pointerType,e?i.onItemLeave?.():"mouse"===r.current&&a.currentTarget.focus({preventScroll:!0})}),onPointerLeave:(0,au.composeEventHandlers)(g.onPointerLeave,a=>{a.currentTarget===document.activeElement&&i.onItemLeave?.()}),onKeyDown:(0,au.composeEventHandlers)(g.onKeyDown,a=>{(i.searchRef?.current===""||" "!==a.key)&&(m0.includes(a.key)&&s()," "===a.key&&a.preventDefault())})})})})});nD.displayName=nA;var nE="SelectItemText",nF=I.forwardRef((a,b)=>{let{__scopeSelect:c,className:d,style:e,...f}=a,g=m9(nE,c),h=nm(nE,c),i=nC(nE,c),j=nb(nE,c),[k,l]=I.useState(null),n=(0,av.useComposedRefs)(b,a=>l(a),i.onItemTextChange,a=>h.itemTextRefCallback?.(a,i.value,i.disabled)),o=k?.textContent,p=I.useMemo(()=>(0,F.jsx)("option",{value:i.value,disabled:i.disabled,children:o},i.value),[i.disabled,i.value,o]),{onNativeOptionAdd:q,onNativeOptionRemove:r}=j;return(0,mW.useLayoutEffect)(()=>(q(p),()=>r(p)),[q,r,p]),(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(aB.Primitive.span,{id:i.textId,...f,ref:n}),i.isSelected&&g.valueNode&&!g.valueNodeHasChildren?an.createPortal(f.children,g.valueNode):null]})});nF.displayName=nE;var nG="SelectItemIndicator",nH=I.forwardRef((a,b)=>{let{__scopeSelect:c,...d}=a;return nC(nG,c).isSelected?(0,F.jsx)(aB.Primitive.span,{"aria-hidden":!0,...d,ref:b}):null});nH.displayName=nG;var nI="SelectScrollUpButton",nJ=I.forwardRef((a,b)=>{let c=nm(nI,a.__scopeSelect),d=ns(nI,a.__scopeSelect),[e,f]=I.useState(!1),g=(0,av.useComposedRefs)(b,d.onScrollButtonChange);return(0,mW.useLayoutEffect)(()=>{if(c.viewport&&c.isPositioned){let a=function(){f(b.scrollTop>0)},b=c.viewport;return a(),b.addEventListener("scroll",a),()=>b.removeEventListener("scroll",a)}},[c.viewport,c.isPositioned]),e?(0,F.jsx)(nM,{...a,ref:g,onAutoScroll:()=>{let{viewport:a,selectedItem:b}=c;a&&b&&(a.scrollTop=a.scrollTop-b.offsetHeight)}}):null});nJ.displayName=nI;var nK="SelectScrollDownButton",nL=I.forwardRef((a,b)=>{let c=nm(nK,a.__scopeSelect),d=ns(nK,a.__scopeSelect),[e,f]=I.useState(!1),g=(0,av.useComposedRefs)(b,d.onScrollButtonChange);return(0,mW.useLayoutEffect)(()=>{if(c.viewport&&c.isPositioned){let a=function(){let a=b.scrollHeight-b.clientHeight;f(Math.ceil(b.scrollTop)<a)},b=c.viewport;return a(),b.addEventListener("scroll",a),()=>b.removeEventListener("scroll",a)}},[c.viewport,c.isPositioned]),e?(0,F.jsx)(nM,{...a,ref:g,onAutoScroll:()=>{let{viewport:a,selectedItem:b}=c;a&&b&&(a.scrollTop=a.scrollTop+b.offsetHeight)}}):null});nL.displayName=nK;var nM=I.forwardRef((a,b)=>{let{__scopeSelect:c,onAutoScroll:d,...e}=a,f=nm("SelectScrollButton",c),g=I.useRef(null),h=m3(c),i=I.useCallback(()=>{null!==g.current&&(window.clearInterval(g.current),g.current=null)},[]);return I.useEffect(()=>()=>i(),[i]),(0,mW.useLayoutEffect)(()=>{let a=h().find(a=>a.ref.current===document.activeElement);a?.ref.current?.scrollIntoView({block:"nearest"})},[h]),(0,F.jsx)(aB.Primitive.div,{"aria-hidden":!0,...e,ref:b,style:{flexShrink:0,...e.style},onPointerDown:(0,au.composeEventHandlers)(e.onPointerDown,()=>{null===g.current&&(g.current=window.setInterval(d,50))}),onPointerMove:(0,au.composeEventHandlers)(e.onPointerMove,()=>{f.onItemLeave?.(),null===g.current&&(g.current=window.setInterval(d,50))}),onPointerLeave:(0,au.composeEventHandlers)(e.onPointerLeave,()=>{i()})})}),nN=I.forwardRef((a,b)=>{let{__scopeSelect:c,...d}=a;return(0,F.jsx)(aB.Primitive.div,{"aria-hidden":!0,...d,ref:b})});nN.displayName="SelectSeparator";var nO="SelectArrow";I.forwardRef((a,b)=>{let{__scopeSelect:c,...d}=a,e=m7(c),f=m9(nO,c),g=nm(nO,c);return f.open&&"popper"===g.position?(0,F.jsx)(mR.Arrow,{...e,...d,ref:b}):null}).displayName=nO;var nP=I.forwardRef(({__scopeSelect:a,value:b,...c},d)=>{let e=I.useRef(null),f=(0,av.useComposedRefs)(d,e),g=(0,az.usePrevious)(b);return I.useEffect(()=>{let a=e.current;if(!a)return;let c=Object.getOwnPropertyDescriptor(window.HTMLSelectElement.prototype,"value").set;if(g!==b&&c){let d=new Event("change",{bubbles:!0});c.call(a,b),a.dispatchEvent(d)}},[g,b]),(0,F.jsx)(aB.Primitive.select,{...c,style:{...mX,...c.style},ref:f,defaultValue:b})});function nQ(a){return""===a||void 0===a}function nR(a){let b=(0,mV.useCallbackRef)(a),c=I.useRef(""),d=I.useRef(0),e=I.useCallback(a=>{let e=c.current+a;b(e),function a(b){c.current=b,window.clearTimeout(d.current),""!==b&&(d.current=window.setTimeout(()=>a(""),1e3))}(e)},[b]),f=I.useCallback(()=>{c.current="",window.clearTimeout(d.current)},[]);return I.useEffect(()=>()=>window.clearTimeout(d.current),[]),[c,e,f]}function nS(a,b,c){var d,e;let f=b.length>1&&Array.from(b).every(a=>a===b[0])?b[0]:b,g=c?a.indexOf(c):-1,h=(d=a,e=Math.max(g,0),d.map((a,b)=>d[(e+b)%d.length]));1===f.length&&(h=h.filter(a=>a!==c));let i=h.find(a=>a.textValue.toLowerCase().startsWith(f.toLowerCase()));return i!==c?i:void 0}nP.displayName="SelectBubbleInput";let nT=(0,L.default)("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]),nU=(0,L.default)("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]),nV=I.forwardRef(({className:a,children:b,...c},d)=>(0,F.jsxs)(ne,{ref:d,className:(0,T.cn)("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background data-[placeholder]:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",a),...c,children:[b,(0,F.jsx)(nh,{asChild:!0,children:(0,F.jsx)(nT,{className:"h-4 w-4 opacity-50"})})]}));nV.displayName=ne.displayName;let nW=I.forwardRef(({className:a,...b},c)=>(0,F.jsx)(nJ,{ref:c,className:(0,T.cn)("flex cursor-default items-center justify-center py-1",a),...b,children:(0,F.jsx)(nU,{className:"h-4 w-4"})}));nW.displayName=nJ.displayName;let nX=I.forwardRef(({className:a,...b},c)=>(0,F.jsx)(nL,{ref:c,className:(0,T.cn)("flex cursor-default items-center justify-center py-1",a),...b,children:(0,F.jsx)(nT,{className:"h-4 w-4"})}));nX.displayName=nL.displayName;let nY=I.forwardRef(({className:a,children:b,position:c="popper",...d},e)=>(0,F.jsx)(ni,{children:(0,F.jsxs)(nk,{ref:e,className:(0,T.cn)("relative z-50 max-h-[--radix-select-content-available-height] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-select-content-transform-origin]","popper"===c&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",a),position:c,...d,children:[(0,F.jsx)(nW,{}),(0,F.jsx)(nu,{className:(0,T.cn)("p-1","popper"===c&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:b}),(0,F.jsx)(nX,{})]})}));nY.displayName=nk.displayName,I.forwardRef(({className:a,...b},c)=>(0,F.jsx)(nz,{ref:c,className:(0,T.cn)("py-1.5 pl-8 pr-2 text-sm font-semibold",a),...b})).displayName=nz.displayName;let nZ=I.forwardRef(({className:a,children:b,...c},d)=>(0,F.jsxs)(nD,{ref:d,className:(0,T.cn)("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",a),...c,children:[(0,F.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,F.jsx)(nH,{children:(0,F.jsx)(bf.Check,{className:"h-4 w-4"})})}),(0,F.jsx)(nF,{children:b})]}));nZ.displayName=nD.displayName,I.forwardRef(({className:a,...b},c)=>(0,F.jsx)(nN,{ref:c,className:(0,T.cn)("-mx-1 my-1 h-px bg-muted",a),...b})).displayName=nN.displayName;var n$=a.i(4212);let n_=I.forwardRef(({className:a,...b},c)=>(0,F.jsx)("div",{ref:c,className:(0,T.cn)("rounded-lg border bg-card text-card-foreground shadow-sm",a),...b}));n_.displayName="Card";let n0=I.forwardRef(({className:a,...b},c)=>(0,F.jsx)("div",{ref:c,className:(0,T.cn)("flex flex-col space-y-1.5 p-6",a),...b}));n0.displayName="CardHeader";let n1=I.forwardRef(({className:a,...b},c)=>(0,F.jsx)("div",{ref:c,className:(0,T.cn)("text-2xl font-semibold leading-none tracking-tight",a),...b}));n1.displayName="CardTitle";let n2=I.forwardRef(({className:a,...b},c)=>(0,F.jsx)("div",{ref:c,className:(0,T.cn)("text-sm text-muted-foreground",a),...b}));n2.displayName="CardDescription";let n3=I.forwardRef(({className:a,...b},c)=>(0,F.jsx)("div",{ref:c,className:(0,T.cn)("p-6 pt-0",a),...b}));n3.displayName="CardContent",I.forwardRef(({className:a,...b},c)=>(0,F.jsx)("div",{ref:c,className:(0,T.cn)("flex items-center p-6 pt-0",a),...b})).displayName="CardFooter";let n4=(0,L.default)("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]),n5=(0,L.default)("brain",[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]]),n6=(0,L.default)("message-square",[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]]),n7=(0,L.default)("shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]),n8=(0,L.default)("play",[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]]);var n9=a.i(6219);"function"==typeof SuppressedError&&SuppressedError;var oa=function(){var a=document.getSelection();if(!a.rangeCount)return function(){};for(var b=document.activeElement,c=[],d=0;d<a.rangeCount;d++)c.push(a.getRangeAt(d));switch(b.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":b.blur();break;default:b=null}return a.removeAllRanges(),function(){"Caret"===a.type&&a.removeAllRanges(),a.rangeCount||c.forEach(function(b){a.addRange(b)}),b&&b.focus()}},ob={"text/plain":"Text","text/html":"Url",default:"Text"},oc=function(a,b){var c,d,e,f,g,h,i,j,k=!1;b||(b={}),e=b.debug||!1;try{if(g=oa(),h=document.createRange(),i=document.getSelection(),(j=document.createElement("span")).textContent=a,j.ariaHidden="true",j.style.all="unset",j.style.position="fixed",j.style.top=0,j.style.clip="rect(0, 0, 0, 0)",j.style.whiteSpace="pre",j.style.webkitUserSelect="text",j.style.MozUserSelect="text",j.style.msUserSelect="text",j.style.userSelect="text",j.addEventListener("copy",function(c){if(c.stopPropagation(),b.format)if(c.preventDefault(),void 0===c.clipboardData){e&&console.warn("unable to use e.clipboardData"),e&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var d=ob[b.format]||ob.default;window.clipboardData.setData(d,a)}else c.clipboardData.clearData(),c.clipboardData.setData(b.format,a);b.onCopy&&(c.preventDefault(),b.onCopy(c.clipboardData))}),document.body.appendChild(j),h.selectNodeContents(j),i.addRange(h),!document.execCommand("copy"))throw Error("copy command was unsuccessful");k=!0}catch(g){e&&console.error("unable to copy using execCommand: ",g),e&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(b.format||"text",a),b.onCopy&&b.onCopy(window.clipboardData),k=!0}catch(g){e&&console.error("unable to copy using clipboardData: ",g),e&&console.error("falling back to prompt"),c="message"in b?b.message:"Copy to clipboard: #{key}, Enter",d=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C",f=c.replace(/#{\s*key\s*}/g,d),window.prompt(f,a)}}finally{i&&("function"==typeof i.removeRange?i.removeRange(h):i.removeAllRanges()),j&&document.body.removeChild(j),g()}return k};function od(a){return"[object Object]"===Object.prototype.toString.call(a)}function oe(a){return Array.isArray(a)?a.length:od(a)?Object.keys(a).length:0}function of(a,b,c,d,e,f){if(f&&void 0!==f.collapsed)return!!f.collapsed;if("boolean"==typeof d)return d;if("number"==typeof d&&b>d)return!0;let g=oe(a);if("function"==typeof d){let e=oi(d,[{node:a,depth:b,indexOrName:c,size:g}]);if("boolean"==typeof e)return e}return!!(Array.isArray(a)&&g>e||od(a)&&g>e)}function og(a,b,c,d,e,f){if(f&&void 0!==f.collapsed)return!!f.collapsed;if("boolean"==typeof d)return d;if("number"==typeof d&&b>d)return!0;let g=Math.ceil(a.length/100);if("function"==typeof d){let e=oi(d,[{node:a,depth:b,indexOrName:c,size:g}]);if("boolean"==typeof e)return e}return!!(Array.isArray(a)&&g>e||od(a)&&g>e)}function oh(a,b,c){return"boolean"==typeof a?a:"number"==typeof a&&!!(b>a)||"collapsed"===a&&!!c||"expanded"===a&&!c}function oi(a,b){try{return a(...b)}catch(a){reportError(a)}}function oj(a){if(!0===a||od(a)&&!0===a.add)return!0}function ok(a){if(!0===a||od(a)&&!0===a.edit)return!0}function ol(a){if(!0===a||od(a)&&!0===a.delete)return!0}function om(a){return!a||void 0===a.add||!!a.add}function on(a){return!a||void 0===a.edit||!!a.edit}function oo(a){return!a||void 0===a.delete||!!a.delete}function op(a){return!a||void 0===a.enableClipboard||!!a.enableClipboard}function oq(){return(oq=Object.assign.bind()).apply(this,arguments)}var or=function(a){return I.createElement("svg",oq({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"none",viewBox:"0 0 16 16"},a),q||(q=I.createElement("path",{fill:"currentColor",d:"M12.473 5.806a.666.666 0 0 0-.946 0L8.473 8.86a.667.667 0 0 1-.946 0L4.473 5.806a.667.667 0 1 0-.946.94l3.06 3.06a2 2 0 0 0 2.826 0l3.06-3.06a.667.667 0 0 0 0-.94Z"})))};function os(){return(os=Object.assign.bind()).apply(this,arguments)}var ot=function(a){return I.createElement("svg",os({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24"},a),r||(r=I.createElement("path",{fill:"currentColor",d:"M17.542 2.5h-4.75a3.963 3.963 0 0 0-3.959 3.958v4.75a3.963 3.963 0 0 0 3.959 3.959h4.75a3.963 3.963 0 0 0 3.958-3.959v-4.75A3.963 3.963 0 0 0 17.542 2.5Zm2.375 8.708a2.378 2.378 0 0 1-2.375 2.375h-4.75a2.378 2.378 0 0 1-2.375-2.375v-4.75a2.378 2.378 0 0 1 2.375-2.375h4.75a2.378 2.378 0 0 1 2.375 2.375v4.75Zm-4.75 6.334a3.963 3.963 0 0 1-3.959 3.958h-4.75A3.963 3.963 0 0 1 2.5 17.542v-4.75a3.963 3.963 0 0 1 3.958-3.959.791.791 0 1 1 0 1.584 2.378 2.378 0 0 0-2.375 2.375v4.75a2.378 2.378 0 0 0 2.375 2.375h4.75a2.378 2.378 0 0 0 2.375-2.375.792.792 0 1 1 1.584 0Z"})))};function ou(){return(ou=Object.assign.bind()).apply(this,arguments)}var ov=function(a){return I.createElement("svg",ou({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24"},a),s||(s=I.createElement("path",{fill:"currentColor",d:"M17.25 3H6.75A3.755 3.755 0 0 0 3 6.75v10.5A3.754 3.754 0 0 0 6.75 21h10.5A3.754 3.754 0 0 0 21 17.25V6.75A3.755 3.755 0 0 0 17.25 3Zm2.25 14.25a2.25 2.25 0 0 1-2.25 2.25H6.75a2.25 2.25 0 0 1-2.25-2.25V6.75A2.25 2.25 0 0 1 6.75 4.5h10.5a2.25 2.25 0 0 1 2.25 2.25v10.5Z"})),t||(t=I.createElement("path",{fill:"#14C786",d:"M10.312 14.45 7.83 11.906a.625.625 0 0 0-.896 0 .659.659 0 0 0 0 .918l2.481 2.546a1.264 1.264 0 0 0 .896.381 1.237 1.237 0 0 0 .895-.38l5.858-6.011a.658.658 0 0 0 0-.919.625.625 0 0 0-.896 0l-5.857 6.01Z"})))};function ow({node:a,nodeMeta:b}){let{customizeCopy:c,CopyComponent:d,CopiedComponent:e}=(0,I.useContext)(oQ),[f,g]=(0,I.useState)(!1),h=d=>{d.stopPropagation();let e=c(a,b);"string"==typeof e&&e&&function(a){var b,c,d,e;b=this,c=void 0,d=void 0,e=function*(){try{yield navigator.clipboard.writeText(a)}catch(b){oc(a)}},new(d||(d=Promise))(function(a,f){function g(a){try{i(e.next(a))}catch(a){f(a)}}function h(a){try{i(e.throw(a))}catch(a){f(a)}}function i(b){var c;b.done?a(b.value):((c=b.value)instanceof d?c:new d(function(a){a(c)})).then(g,h)}i((e=e.apply(b,c||[])).next())})}(e),g(!0),setTimeout(()=>g(!1),3e3)};return f?"function"==typeof e?(0,F.jsx)(e,{className:"json-view--copy",style:{display:"inline-block"}}):(0,F.jsx)(ov,{className:"json-view--copy",style:{display:"inline-block"}}):"function"==typeof d?(0,F.jsx)(d,{onClick:h,className:"json-view--copy"}):(0,F.jsx)(ot,{onClick:h,className:"json-view--copy"})}function ox({indexOrName:a,value:b,depth:c,deleteHandle:d,editHandle:e,parent:f,parentPath:g}){let{displayArrayIndex:h}=(0,I.useContext)(oQ),i=Array.isArray(f);return(0,F.jsxs)("div",Object.assign({className:"json-view--pair"},{children:[!i||i&&h?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)("span",Object.assign({className:"number"==typeof a?"json-view--index":"json-view--property"},{children:a})),":"," "]}):(0,F.jsx)(F.Fragment,{}),(0,F.jsx)(oO,{node:b,depth:c+1,deleteHandle:(a,b)=>d(a,b),editHandle:(a,b,c,d)=>e(a,b,c,d),parent:f,indexOrName:a,parentPath:g})]}))}function oy(){return(oy=Object.assign.bind()).apply(this,arguments)}var oz=function(a){return I.createElement("svg",oy({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24"},a),u||(u=I.createElement("path",{fill:"currentColor",d:"M18.75 6h-2.325a3.757 3.757 0 0 0-3.675-3h-1.5a3.757 3.757 0 0 0-3.675 3H5.25a.75.75 0 0 0 0 1.5H6v9.75A3.754 3.754 0 0 0 9.75 21h4.5A3.754 3.754 0 0 0 18 17.25V7.5h.75a.75.75 0 1 0 0-1.5Zm-7.5-1.5h1.5A2.255 2.255 0 0 1 14.872 6H9.128a2.255 2.255 0 0 1 2.122-1.5Zm5.25 12.75a2.25 2.25 0 0 1-2.25 2.25h-4.5a2.25 2.25 0 0 1-2.25-2.25V7.5h9v9.75Z"})),v||(v=I.createElement("path",{fill:"#DA0000",d:"M10.5 16.5a.75.75 0 0 0 .75-.75v-4.5a.75.75 0 1 0-1.5 0v4.5a.75.75 0 0 0 .75.75ZM13.5 16.5a.75.75 0 0 0 .75-.75v-4.5a.75.75 0 1 0-1.5 0v4.5a.75.75 0 0 0 .75.75Z"})))};function oA(){return(oA=Object.assign.bind()).apply(this,arguments)}var oB=function(a){return I.createElement("svg",oA({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24"},a),w||(w=I.createElement("path",{fill:"currentColor",d:"M21 6.75v10.5A3.754 3.754 0 0 1 17.25 21H6.75A3.754 3.754 0 0 1 3 17.25V6.75A3.754 3.754 0 0 1 6.75 3h10.5A3.754 3.754 0 0 1 21 6.75Zm-1.5 0c0-1.24-1.01-2.25-2.25-2.25H6.75C5.51 4.5 4.5 5.51 4.5 6.75v10.5c0 1.24 1.01 2.25 2.25 2.25h10.5c1.24 0 2.25-1.01 2.25-2.25V6.75Z"})),x||(x=I.createElement("path",{fill:"#14C786",d:"M15 12.75a.75.75 0 1 0 0-1.5h-2.25V9a.75.75 0 1 0-1.5 0v2.25H9a.75.75 0 1 0 0 1.5h2.25V15a.75.75 0 1 0 1.5 0v-2.25H15Z"})))};function oC(){return(oC=Object.assign.bind()).apply(this,arguments)}var oD=function(a){return I.createElement("svg",oC({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24"},a),y||(y=I.createElement("path",{fill:"currentColor",d:"M12 3a9 9 0 1 0 9 9 9.01 9.01 0 0 0-9-9Zm0 16.5a7.5 7.5 0 1 1 7.5-7.5 7.509 7.509 0 0 1-7.5 7.5Z"})),z||(z=I.createElement("path",{fill:"#14C786",d:"m10.85 13.96-1.986-2.036a.5.5 0 0 0-.716 0 .527.527 0 0 0 0 .735l1.985 2.036a1.01 1.01 0 0 0 .717.305.99.99 0 0 0 .716-.305l4.686-4.808a.526.526 0 0 0 0-.735.5.5 0 0 0-.716 0l-4.687 4.809Z"})))};function oE(){return(oE=Object.assign.bind()).apply(this,arguments)}var oF=function(a){return I.createElement("svg",oE({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24"},a),A||(A=I.createElement("path",{fill:"#DA0000",d:"M15 9a.75.75 0 0 0-1.06 0L12 10.94 10.06 9A.75.75 0 0 0 9 10.06L10.94 12 9 13.94A.75.75 0 0 0 10.06 15L12 13.06 13.94 15A.75.75 0 0 0 15 13.94L13.06 12 15 10.06A.75.75 0 0 0 15 9Z"})),B||(B=I.createElement("path",{fill:"currentColor",d:"M12 3a9 9 0 1 0 9 9 9.01 9.01 0 0 0-9-9Zm0 16.5a7.5 7.5 0 1 1 7.5-7.5 7.509 7.509 0 0 1-7.5 7.5Z"})))};function oG({originNode:a,node:b,depth:c,index:d,deleteHandle:e,customOptions:f,startIndex:g,parent:h,parentPath:i}){let{enableClipboard:j,src:k,onEdit:l,onChange:n,forceUpdate:o,displaySize:p,CustomOperation:q}=(0,I.useContext)(oQ),r=[...i,String(d)],[s,t]=(0,I.useState)(!0),u=(0,I.useCallback)((b,d,e)=>{a[b]=d,l&&l({newValue:d,oldValue:e,depth:c,src:k,indexOrName:b,parentType:"array",parentPath:i}),n&&n({type:"edit",depth:c,src:k,indexOrName:b,parentType:"array",parentPath:i}),o()},[b,l,n,o]),v=b=>{a.splice(b,1),e&&e(b,i),o()},w=(0,F.jsxs)(F.Fragment,{children:[!s&&(0,F.jsxs)("span",Object.assign({onClick:()=>t(!0),className:"jv-size-chevron"},{children:[oh(p,c,s)&&(0,F.jsxs)("span",Object.assign({className:"jv-size"},{children:[oe(b)," Items"]})),(0,F.jsx)(or,{className:"jv-chevron"})]})),!s&&j&&op(f)&&(0,F.jsx)(ow,{node:b,nodeMeta:{depth:c,indexOrName:d,parent:h,parentPath:i,currentPath:r}}),"function"==typeof q?(0,F.jsx)(q,{node:b}):null]});return(0,F.jsxs)("div",{children:[(0,F.jsx)("span",{children:"["}),w,s?(0,F.jsxs)("button",Object.assign({onClick:()=>t(!1),className:"jv-button"},{children:[g," ... ",g+b.length-1]})):(0,F.jsx)("div",Object.assign({className:"jv-indent"},{children:b.map((a,e)=>(0,F.jsx)(ox,{indexOrName:e+g,value:a,depth:c,parent:b,deleteHandle:v,editHandle:u,parentPath:i},String(d)+String(e)))})),(0,F.jsx)("span",{children:"]"})]})}function oH({node:a,depth:b,deleteHandle:c,indexOrName:d,customOptions:e,parent:f,parentPath:g}){let h=void 0!==d?[...g,String(d)]:g,i=[];for(let b=0;b<a.length;b+=100)i.push(a.slice(b,b+100));let{collapsed:j,enableClipboard:k,collapseObjectsAfterLength:l,editable:n,onDelete:o,src:p,onAdd:q,CustomOperation:r,onChange:s,forceUpdate:t,displaySize:u}=(0,I.useContext)(oQ),[v,w]=(0,I.useState)(og(a,b,d,j,l,e));(0,I.useEffect)(()=>{w(og(a,b,d,j,l,e))},[j,l]);let[x,y]=(0,I.useState)(!1),[z,A]=(0,I.useState)(!1),B=()=>{a.push(null),q&&q({indexOrName:a.length-1,depth:b,src:p,parentType:"array",parentPath:g}),s&&s({type:"add",indexOrName:a.length-1,depth:b,src:p,parentType:"array",parentPath:g}),t()},C=x||z,D=(0,F.jsxs)(F.Fragment,{children:[!v&&!C&&(0,F.jsxs)("span",Object.assign({onClick:()=>w(!0),className:"jv-size-chevron"},{children:[oh(u,b,v)&&(0,F.jsxs)("span",Object.assign({className:"jv-size"},{children:[a.length," Items"]})),(0,F.jsx)(or,{className:"jv-chevron"})]})),C&&(0,F.jsx)(oD,{className:"json-view--edit",style:{display:"inline-block"},onClick:z?B:()=>{y(!1),c&&c(d,g),o&&o({value:a,depth:b,src:p,indexOrName:d,parentType:"array",parentPath:g}),s&&s({type:"delete",depth:b,src:p,indexOrName:d,parentType:"array",parentPath:g})}}),C&&(0,F.jsx)(oF,{className:"json-view--edit",style:{display:"inline-block"},onClick:()=>{y(!1),A(!1)}}),!v&&!C&&k&&op(e)&&(0,F.jsx)(ow,{node:a,nodeMeta:{depth:b,indexOrName:d,parent:f,parentPath:g,currentPath:h}}),!v&&!C&&oj(n)&&om(e)&&(0,F.jsx)(oB,{className:"json-view--edit",onClick:()=>{B()}}),!v&&!C&&ol(n)&&oo(e)&&c&&(0,F.jsx)(oz,{className:"json-view--edit",onClick:()=>y(!0)}),"function"==typeof r?(0,F.jsx)(r,{node:a}):null]});return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)("span",{children:"["}),D,v?(0,F.jsx)("button",Object.assign({onClick:()=>w(!1),className:"jv-button"},{children:"..."})):(0,F.jsx)("div",Object.assign({className:"jv-indent"},{children:i.map((f,h)=>(0,F.jsx)(oG,{originNode:a,node:f,depth:b,index:h,startIndex:100*h,deleteHandle:c,customOptions:e,parentPath:g},String(d)+String(h)))})),(0,F.jsx)("span",{children:"]"}),v&&oh(u,b,v)&&(0,F.jsxs)("span",Object.assign({onClick:()=>w(!1),className:"jv-size"},{children:[a.length," Items"]}))]})}function oI({node:a,depth:b,indexOrName:c,deleteHandle:d,customOptions:e,parent:f,parentPath:g}){let{collapsed:h,onCollapse:i,enableClipboard:j,ignoreLargeArray:k,collapseObjectsAfterLength:l,editable:n,onDelete:o,src:p,onAdd:q,onEdit:r,onChange:s,forceUpdate:t,displaySize:u,CustomOperation:v}=(0,I.useContext)(oQ),w=void 0!==c?[...g,String(c)]:g;if(!k&&Array.isArray(a)&&a.length>100)return(0,F.jsx)(oH,{node:a,depth:b,indexOrName:c,deleteHandle:d,customOptions:e,parentPath:w});let x=od(a),[y,z]=(0,I.useState)(of(a,b,c,h,l,e)),A=d=>{null==i||i({isCollapsing:!d,node:a,depth:b,indexOrName:c}),z(d)};(0,I.useEffect)(()=>{A(of(a,b,c,h,l,e))},[h,l]);let B=(0,I.useCallback)((c,d,e)=>{Array.isArray(a)?a[+c]=d:a&&(a[c]=d),r&&r({newValue:d,oldValue:e,depth:b,src:p,indexOrName:c,parentType:x?"object":"array",parentPath:w}),s&&s({type:"edit",depth:b,src:p,indexOrName:c,parentType:x?"object":"array",parentPath:w}),t()},[a,r,s,t]),C=b=>{Array.isArray(a)?a.splice(+b,1):a&&delete a[b],t()},[D,E]=(0,I.useState)(!1),[G,H]=(0,I.useState)(!1),J=(0,I.useRef)(null),K=()=>{var c;if(x){let d=null==(c=J.current)?void 0:c.value;d&&(a[d]=null,J.current&&(J.current.value=""),H(!1),q&&q({indexOrName:d,depth:b,src:p,parentType:"object",parentPath:w}),s&&s({type:"add",indexOrName:d,depth:b,src:p,parentType:"object",parentPath:w}))}else Array.isArray(a)&&(a.push(null),q&&q({indexOrName:a.length-1,depth:b,src:p,parentType:"array",parentPath:w}),s&&s({type:"add",indexOrName:a.length-1,depth:b,src:p,parentType:"array",parentPath:w}));t()},L=D||G,M=()=>{E(!1),H(!1)},N=(0,F.jsxs)(F.Fragment,{children:[!y&&!L&&(0,F.jsxs)("span",Object.assign({onClick:()=>A(!0),className:"jv-size-chevron"},{children:[oh(u,b,y)&&(0,F.jsxs)("span",Object.assign({className:"jv-size"},{children:[oe(a)," Items"]})),(0,F.jsx)(or,{className:"jv-chevron"})]})),G&&x&&(0,F.jsx)("input",{className:"json-view--input",placeholder:"property",ref:J,onKeyDown:a=>{"Enter"===a.key?(a.preventDefault(),K()):"Escape"===a.key&&M()}}),L&&(0,F.jsx)(oD,{className:"json-view--edit",style:{display:"inline-block"},onClick:G?K:()=>{E(!1),d&&d(c,w),o&&o({value:a,depth:b,src:p,indexOrName:c,parentType:x?"object":"array",parentPath:w}),s&&s({type:"delete",depth:b,src:p,indexOrName:c,parentType:x?"object":"array",parentPath:w})}}),L&&(0,F.jsx)(oF,{className:"json-view--edit",style:{display:"inline-block"},onClick:M}),!y&&!L&&j&&op(e)&&(0,F.jsx)(ow,{node:a,nodeMeta:{depth:b,indexOrName:c,parent:f,parentPath:g,currentPath:w}}),!y&&!L&&oj(n)&&om(e)&&(0,F.jsx)(oB,{className:"json-view--edit",onClick:()=>{x?(H(!0),setTimeout(()=>{var a;return null==(a=J.current)?void 0:a.focus()})):K()}}),!y&&!L&&ol(n)&&oo(e)&&d&&(0,F.jsx)(oz,{className:"json-view--edit",onClick:()=>E(!0)}),"function"==typeof v?(0,F.jsx)(v,{node:a}):null]});return Array.isArray(a)?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)("span",{children:"["}),N,y?(0,F.jsx)("button",Object.assign({onClick:()=>A(!1),className:"jv-button"},{children:"..."})):(0,F.jsx)("div",Object.assign({className:"jv-indent"},{children:a.map((d,e)=>(0,F.jsx)(ox,{indexOrName:e,value:d,depth:b,parent:a,deleteHandle:C,editHandle:B,parentPath:w},String(c)+String(e)))})),(0,F.jsx)("span",{children:"]"}),y&&oh(u,b,y)&&(0,F.jsxs)("span",Object.assign({onClick:()=>A(!1),className:"jv-size"},{children:[oe(a)," Items"]}))]}):x?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)("span",{children:"{"}),N,y?(0,F.jsx)("button",Object.assign({onClick:()=>A(!1),className:"jv-button"},{children:"..."})):(0,F.jsx)("div",Object.assign({className:"jv-indent"},{children:Object.entries(a).map(([d,e])=>(0,F.jsx)(ox,{indexOrName:d,value:e,depth:b,parent:a,deleteHandle:C,editHandle:B,parentPath:w},String(c)+String(d)))})),(0,F.jsx)("span",{children:"}"}),y&&oh(u,b,y)&&(0,F.jsxs)("span",Object.assign({onClick:()=>A(!1),className:"jv-size"},{children:[oe(a)," Items"]}))]}):(0,F.jsx)("span",{children:String(a)})}let oJ=I.default.forwardRef(({str:a,className:b,ctrlClick:c},d)=>{let{collapseStringMode:e,collapseStringsAfterLength:f,customizeCollapseStringUI:g}=(0,I.useContext)(oQ),[h,i]=(0,I.useState)(!0),j=(0,I.useRef)(null);f=f>0?f:0;let k=a.replace(/\s+/g," "),l="function"==typeof g?g(k,h):"string"==typeof g?g:"...",n=a=>{var b;if((a.ctrlKey||a.metaKey)&&c)c(a);else{let a=window.getSelection();if(a&&a.anchorOffset!==a.focusOffset&&(null==(b=a.anchorNode)?void 0:b.parentElement)===j.current)return;i(!h)}};if(a.length<=f)return(0,F.jsxs)("span",Object.assign({ref:j,className:b,onClick:c},{children:['"',a,'"']}));if("address"===e)return a.length<=10?(0,F.jsxs)("span",Object.assign({ref:j,className:b,onClick:c},{children:['"',a,'"']})):(0,F.jsxs)("span",Object.assign({ref:j,onClick:n,className:b+" cursor-pointer"},{children:['"',h?[k.slice(0,6),l,k.slice(-4)]:a,'"']}));if("directly"===e)return(0,F.jsxs)("span",Object.assign({ref:j,onClick:n,className:b+" cursor-pointer"},{children:['"',h?[k.slice(0,f),l]:a,'"']}));if("word"===e){let c=f,d=f+1,e=k,g=1;for(;;){if(/\W/.test(a[c])){e=a.slice(0,c);break}if(/\W/.test(a[d])){e=a.slice(0,d);break}if(6===g){e=a.slice(0,f);break}g++,c--,d++}return(0,F.jsxs)("span",Object.assign({ref:j,onClick:n,className:b+" cursor-pointer"},{children:['"',h?[e,l]:a,'"']}))}return(0,F.jsxs)("span",Object.assign({ref:j,className:b},{children:['"',a,'"']}))});function oK(){return(oK=Object.assign.bind()).apply(this,arguments)}var oL=function(a){return I.createElement("svg",oK({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24"},a),C||(C=I.createElement("path",{fill:"currentColor",d:"M17.25 3H6.75A3.754 3.754 0 0 0 3 6.75v10.5A3.754 3.754 0 0 0 6.75 21h10.5A3.754 3.754 0 0 0 21 17.25V6.75A3.754 3.754 0 0 0 17.25 3Zm2.25 14.25c0 1.24-1.01 2.25-2.25 2.25H6.75c-1.24 0-2.25-1.01-2.25-2.25V6.75c0-1.24 1.01-2.25 2.25-2.25h10.5c1.24 0 2.25 1.01 2.25 2.25v10.5Zm-6.09-9.466-5.031 5.03a2.981 2.981 0 0 0-.879 2.121v1.19c0 .415.336.75.75.75h1.19c.8 0 1.554-.312 2.12-.879l5.03-5.03a2.252 2.252 0 0 0 0-3.182c-.85-.85-2.331-.85-3.18 0Zm-2.91 7.151c-.28.28-.666.44-1.06.44H9v-.44c0-.4.156-.777.44-1.06l3.187-3.188 1.06 1.061-3.187 3.188Zm5.03-5.03-.782.783-1.06-1.061.782-.782a.766.766 0 0 1 1.06 0 .75.75 0 0 1 0 1.06Z"})))};function oM(){return(oM=Object.assign.bind()).apply(this,arguments)}var oN=function(a){return I.createElement("svg",oM({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24"},a),D||(D=I.createElement("path",{fill:"currentColor",d:"M6.75 3h5.5v1.5h-5.5C5.51 4.5 4.5 5.51 4.5 6.75v10.5c0 1.24 1.01 2.25 2.25 2.25h10.5c1.24 0 2.25-1.01 2.25-2.25v-5.5H21v5.5A3.754 3.754 0 0 1 17.25 21H6.75A3.754 3.754 0 0 1 3 17.25V6.75A3.754 3.754 0 0 1 6.75 3Z"})),E||(E=I.createElement("path",{fill:"currentColor",d:"M20.013 3h-3.946a.987.987 0 0 0 0 1.973h1.564l-6.342 6.342a1.004 1.004 0 0 0 0 1.396 1.004 1.004 0 0 0 1.396 0l6.342-6.342v1.564a.987.987 0 0 0 1.973 0V3.987A.987.987 0 0 0 20.013 3Z"})))};function oO({node:a,depth:b,deleteHandle:c,indexOrName:d,parent:e,editHandle:f,parentPath:g}){let h,{collapseStringsAfterLength:i,enableClipboard:j,editable:k,src:l,onDelete:n,onChange:o,customizeNode:p,matchesURL:q,urlRegExp:r,EditComponent:s,DoneComponent:t,CancelComponent:u,CustomOperation:v}=(0,I.useContext)(oQ);if("function"==typeof p&&(h=oi(p,[{node:a,depth:b,indexOrName:d}])),h){if((0,I.isValidElement)(h))return h;else if("function"==typeof h){let c=h;return(0,F.jsx)(c,{node:a,depth:b,indexOrName:d})}}if(Array.isArray(a)||od(a))return(0,F.jsx)(oI,{parent:e,node:a,depth:b,indexOrName:d,deleteHandle:c,parentPath:g,customOptions:"object"==typeof h?h:void 0});{var w;let p=typeof a,x=void 0!==d?[...g,String(d)]:g,[y,z]=(0,I.useState)(!1),[A,B]=(0,I.useState)(!1),C=(0,I.useRef)(null),D=()=>{z(!0),setTimeout(()=>{var a,b;null==(a=window.getSelection())||a.selectAllChildren(C.current),null==(b=C.current)||b.focus()})},E=(0,I.useCallback)(()=>{let b=C.current.innerText;try{let c=JSON.parse(b);f&&f(d,c,a,g)}catch(e){let c="string"===p?b.trim().replace(/^\"([\s\S]+?)\"$/,"$1"):b;f&&f(d,c,a,g)}z(!1)},[f,d,a,g,p]),G=()=>{z(!1),B(!1)},H=()=>{B(!1),c&&c(d,g),n&&n({value:a,depth:b,src:l,indexOrName:d,parentType:Array.isArray(e)?"array":"object",parentPath:g}),o&&o({depth:b,src:l,indexOrName:d,parentType:Array.isArray(e)?"array":"object",type:"delete",parentPath:g})},J=(0,I.useCallback)(a=>{"Enter"===a.key?(a.preventDefault(),E()):"Escape"===a.key&&G()},[E]),K=y||A,L=!K&&ok(k)&&on(h)&&f?a=>{(a.ctrlKey||a.metaKey)&&D()}:void 0,M=(0,F.jsxs)(F.Fragment,{children:[K&&("function"==typeof t?(0,F.jsx)(t,{className:"json-view--edit",style:{display:"inline-block"},onClick:A?H:E}):(0,F.jsx)(oD,{className:"json-view--edit",style:{display:"inline-block"},onClick:A?H:E})),K&&("function"==typeof u?(0,F.jsx)(u,{className:"json-view--edit",style:{display:"inline-block"},onClick:G}):(0,F.jsx)(oF,{className:"json-view--edit",style:{display:"inline-block"},onClick:G})),!K&&j&&op(h)&&(0,F.jsx)(ow,{node:a,nodeMeta:{depth:b,indexOrName:d,parent:e,parentPath:g,currentPath:x}}),!K&&q&&"string"===p&&r.test(a)&&(!(w=h)||void 0===w.matchesURL||!!w.matchesURL)&&(0,F.jsx)("a",Object.assign({href:a,target:"_blank",className:"json-view--link"},{children:(0,F.jsx)(oN,{})})),!K&&ok(k)&&on(h)&&f&&("function"==typeof s?(0,F.jsx)(s,{className:"json-view--edit",onClick:D}):(0,F.jsx)(oL,{className:"json-view--edit",onClick:D})),!K&&ol(k)&&oo(h)&&c&&(0,F.jsx)(oz,{className:"json-view--edit",onClick:()=>B(!0)}),"function"==typeof v?(0,F.jsx)(v,{node:a}):null]}),N="json-view--string";switch(p){case"number":case"bigint":N="json-view--number";break;case"boolean":N="json-view--boolean";break;case"object":N="json-view--null"}"string"==typeof(null==h?void 0:h.className)&&(N+=" "+h.className),A&&(N+=" json-view--deleting");let O=String(a);"bigint"===p&&(O+="n");let P=(0,I.useMemo)(()=>(0,F.jsx)("span",{contentEditable:!0,className:N,dangerouslySetInnerHTML:{__html:"string"===p?`"${O}"`:O},ref:C,onKeyDown:J}),[O,p,J]);return"string"===p?(0,F.jsxs)(F.Fragment,{children:[y?P:a.length>i?(0,F.jsx)(oJ,{str:a,ref:C,className:N,ctrlClick:L}):(0,F.jsxs)("span",Object.assign({className:N,onClick:L},{children:['"',O,'"']})),M]}):(0,F.jsxs)(F.Fragment,{children:[y?P:(0,F.jsx)("span",Object.assign({className:N,onClick:L},{children:O})),M]})}}let oP=/^(((ht|f)tps?):\/\/)?([^!@#$%^&*?.\s-]([^!@#$%^&*?.\s]{0,63}[^!@#$%^&*?.\s])?\.)+[a-z]{2,6}\/?/,oQ=(0,I.createContext)({src:void 0,collapseStringsAfterLength:99,collapseStringMode:"directly",customizeCollapseStringUI:void 0,collapseObjectsAfterLength:20,collapsed:!1,onCollapse:void 0,enableClipboard:!0,editable:!1,onEdit:void 0,onDelete:void 0,onAdd:void 0,onChange:void 0,forceUpdate:()=>{},customizeNode:void 0,customizeCopy:()=>{},displaySize:void 0,displayArrayIndex:!0,matchesURL:!1,urlRegExp:oP,ignoreLargeArray:!1,CopyComponent:void 0,CopiedComponent:void 0,EditComponent:void 0,CancelComponent:void 0,DoneComponent:void 0,CustomOperation:void 0});function oR({src:a,collapseStringsAfterLength:b=99,collapseStringMode:c="directly",customizeCollapseStringUI:d,collapseObjectsAfterLength:e=99,collapsed:f,onCollapse:g,enableClipboard:h=!0,editable:i=!1,onEdit:j,onDelete:k,onAdd:l,onChange:n,dark:o=!1,theme:p="default",customizeNode:q,customizeCopy:r=a=>(function(a,b){if("string"==typeof a)return a;try{return JSON.stringify(a,(a,b)=>{switch(typeof b){case"bigint":return String(b)+"n";case"number":case"boolean":case"object":case"string":return b;default:return String(b)}},void 0)}catch(a){return`${a.name}: ${a.message}`||"JSON.stringify failed"}})(a),displaySize:s,displayArrayIndex:t=!0,style:u,className:v,matchesURL:w=!1,urlRegExp:x=oP,ignoreLargeArray:y=!1,CopyComponent:z,CopiedComponent:A,EditComponent:B,CancelComponent:C,DoneComponent:D,CustomOperation:E}){let[G,H]=(0,I.useState)(0),J=(0,I.useCallback)(()=>H(a=>++a),[]),[K,L]=(0,I.useState)(a);return(0,I.useEffect)(()=>L(a),[a]),(0,F.jsx)(oQ.Provider,Object.assign({value:{src:K,collapseStringsAfterLength:b,collapseStringMode:c,customizeCollapseStringUI:d,collapseObjectsAfterLength:e,collapsed:f,onCollapse:g,enableClipboard:h,editable:i,onEdit:j,onDelete:k,onAdd:l,onChange:n,forceUpdate:J,customizeNode:q,customizeCopy:r,displaySize:s,displayArrayIndex:t,matchesURL:w,urlRegExp:x,ignoreLargeArray:y,CopyComponent:z,CopiedComponent:A,EditComponent:B,CancelComponent:C,DoneComponent:D,CustomOperation:E}},{children:(0,F.jsx)("code",Object.assign({className:"json-view"+(o?" dark":"")+(p&&"default"!==p?" json-view_"+p:"")+(v?" "+v:""),style:u},{children:(0,F.jsx)(oO,{node:K,depth:1,editHandle:(a,b,c,d)=>{L(b),j&&j({newValue:b,oldValue:c,depth:1,src:K,indexOrName:a,parentType:null,parentPath:d}),n&&n({type:"edit",depth:1,src:K,indexOrName:a,parentType:null,parentPath:d})},deleteHandle:(a,b)=>{L(void 0),k&&k({value:K,depth:1,src:K,indexOrName:a,parentType:null,parentPath:b}),n&&n({depth:1,src:K,indexOrName:a,parentType:null,type:"delete",parentPath:b})},parentPath:[]})}))}))}let oS=(0,L.default)("zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]);function oT(){}function oU(){}let oV=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,oW=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,oX={};function oY(a,b){return((b||oX).jsx?oW:oV).test(a)}let oZ=/[ \t\n\f\r]/g;function o$(a){return""===a.replace(oZ,"")}class o_{constructor(a,b){this.attribute=b,this.property=a}}o_.prototype.attribute="",o_.prototype.booleanish=!1,o_.prototype.boolean=!1,o_.prototype.commaOrSpaceSeparated=!1,o_.prototype.commaSeparated=!1,o_.prototype.defined=!1,o_.prototype.mustUseProperty=!1,o_.prototype.number=!1,o_.prototype.overloadedBoolean=!1,o_.prototype.property="",o_.prototype.spaceSeparated=!1,o_.prototype.space=void 0;let o0=0,o1=o8(),o2=o8(),o3=o8(),o4=o8(),o5=o8(),o6=o8(),o7=o8();function o8(){return 2**++o0}a.s(["boolean",0,o1,"booleanish",0,o2,"commaOrSpaceSeparated",0,o7,"commaSeparated",0,o6,"number",0,o4,"overloadedBoolean",0,o3,"spaceSeparated",0,o5],53427);var o9=a.i(53427);let pa=Object.keys(o9);class pb extends o_{constructor(a,b,c,d){let e=-1;if(super(a,b),function(a,b,c){c&&(a[b]=c)}(this,"space",d),"number"==typeof c)for(;++e<pa.length;){const a=pa[e];!function(a,b,c){c&&(a[b]=c)}(this,pa[e],(c&o9[a])===o9[a])}}}function pc(a){return a.toLowerCase()}pb.prototype.defined=!0;let pd=/[A-Z]/g,pe=/-[a-z]/g,pf=/^data[-\w.:]+$/i;function pg(a){return"-"+a.toLowerCase()}function ph(a){return a.charAt(1).toUpperCase()}let pi={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"};class pj{constructor(a,b,c){this.normal=b,this.property=a,c&&(this.space=c)}}function pk(a,b){let c={},d={};for(let b of a)Object.assign(c,b.property),Object.assign(d,b.normal);return new pj(c,d,b)}function pl(a){let b={},c={};for(let[d,e]of Object.entries(a.properties)){let f=new pb(d,a.transform(a.attributes||{},d),e,a.space);a.mustUseProperty&&a.mustUseProperty.includes(d)&&(f.mustUseProperty=!0),b[d]=f,c[pc(d)]=d,c[pc(f.attribute)]=d}return new pj(b,c,a.space)}pj.prototype.normal={},pj.prototype.property={},pj.prototype.space=void 0;let pm=pl({properties:{ariaActiveDescendant:null,ariaAtomic:o2,ariaAutoComplete:null,ariaBusy:o2,ariaChecked:o2,ariaColCount:o4,ariaColIndex:o4,ariaColSpan:o4,ariaControls:o5,ariaCurrent:null,ariaDescribedBy:o5,ariaDetails:null,ariaDisabled:o2,ariaDropEffect:o5,ariaErrorMessage:null,ariaExpanded:o2,ariaFlowTo:o5,ariaGrabbed:o2,ariaHasPopup:null,ariaHidden:o2,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:o5,ariaLevel:o4,ariaLive:null,ariaModal:o2,ariaMultiLine:o2,ariaMultiSelectable:o2,ariaOrientation:null,ariaOwns:o5,ariaPlaceholder:null,ariaPosInSet:o4,ariaPressed:o2,ariaReadOnly:o2,ariaRelevant:null,ariaRequired:o2,ariaRoleDescription:o5,ariaRowCount:o4,ariaRowIndex:o4,ariaRowSpan:o4,ariaSelected:o2,ariaSetSize:o4,ariaSort:null,ariaValueMax:o4,ariaValueMin:o4,ariaValueNow:o4,ariaValueText:null,role:null},transform:(a,b)=>"role"===b?b:"aria-"+b.slice(4).toLowerCase()});function pn(a,b){return b in a?a[b]:b}function po(a,b){return pn(a,b.toLowerCase())}let pp=pl({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:o6,acceptCharset:o5,accessKey:o5,action:null,allow:null,allowFullScreen:o1,allowPaymentRequest:o1,allowUserMedia:o1,alt:null,as:null,async:o1,autoCapitalize:null,autoComplete:o5,autoFocus:o1,autoPlay:o1,blocking:o5,capture:null,charSet:null,checked:o1,cite:null,className:o5,cols:o4,colSpan:null,content:null,contentEditable:o2,controls:o1,controlsList:o5,coords:o4|o6,crossOrigin:null,data:null,dateTime:null,decoding:null,default:o1,defer:o1,dir:null,dirName:null,disabled:o1,download:o3,draggable:o2,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:o1,formTarget:null,headers:o5,height:o4,hidden:o3,high:o4,href:null,hrefLang:null,htmlFor:o5,httpEquiv:o5,id:null,imageSizes:null,imageSrcSet:null,inert:o1,inputMode:null,integrity:null,is:null,isMap:o1,itemId:null,itemProp:o5,itemRef:o5,itemScope:o1,itemType:o5,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:o1,low:o4,manifest:null,max:null,maxLength:o4,media:null,method:null,min:null,minLength:o4,multiple:o1,muted:o1,name:null,nonce:null,noModule:o1,noValidate:o1,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:o1,optimum:o4,pattern:null,ping:o5,placeholder:null,playsInline:o1,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:o1,referrerPolicy:null,rel:o5,required:o1,reversed:o1,rows:o4,rowSpan:o4,sandbox:o5,scope:null,scoped:o1,seamless:o1,selected:o1,shadowRootClonable:o1,shadowRootDelegatesFocus:o1,shadowRootMode:null,shape:null,size:o4,sizes:null,slot:null,span:o4,spellCheck:o2,src:null,srcDoc:null,srcLang:null,srcSet:null,start:o4,step:null,style:null,tabIndex:o4,target:null,title:null,translate:null,type:null,typeMustMatch:o1,useMap:null,value:o2,width:o4,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:o5,axis:null,background:null,bgColor:null,border:o4,borderColor:null,bottomMargin:o4,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:o1,declare:o1,event:null,face:null,frame:null,frameBorder:null,hSpace:o4,leftMargin:o4,link:null,longDesc:null,lowSrc:null,marginHeight:o4,marginWidth:o4,noResize:o1,noHref:o1,noShade:o1,noWrap:o1,object:null,profile:null,prompt:null,rev:null,rightMargin:o4,rules:null,scheme:null,scrolling:o2,standby:null,summary:null,text:null,topMargin:o4,valueType:null,version:null,vAlign:null,vLink:null,vSpace:o4,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:o1,disableRemotePlayback:o1,prefix:null,property:null,results:o4,security:null,unselectable:null},space:"html",transform:po}),pq=pl({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:o7,accentHeight:o4,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:o4,amplitude:o4,arabicForm:null,ascent:o4,attributeName:null,attributeType:null,azimuth:o4,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:o4,by:null,calcMode:null,capHeight:o4,className:o5,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:o4,diffuseConstant:o4,direction:null,display:null,dur:null,divisor:o4,dominantBaseline:null,download:o1,dx:null,dy:null,edgeMode:null,editable:null,elevation:o4,enableBackground:null,end:null,event:null,exponent:o4,externalResourcesRequired:null,fill:null,fillOpacity:o4,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:o6,g2:o6,glyphName:o6,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:o4,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:o4,horizOriginX:o4,horizOriginY:o4,id:null,ideographic:o4,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:o4,k:o4,k1:o4,k2:o4,k3:o4,k4:o4,kernelMatrix:o7,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:o4,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:o4,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:o4,overlineThickness:o4,paintOrder:null,panose1:null,path:null,pathLength:o4,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:o5,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:o4,pointsAtY:o4,pointsAtZ:o4,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:o7,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:o7,rev:o7,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:o7,requiredFeatures:o7,requiredFonts:o7,requiredFormats:o7,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:o4,specularExponent:o4,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:o4,strikethroughThickness:o4,string:null,stroke:null,strokeDashArray:o7,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:o4,strokeOpacity:o4,strokeWidth:null,style:null,surfaceScale:o4,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:o7,tabIndex:o4,tableValues:null,target:null,targetX:o4,targetY:o4,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:o7,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:o4,underlineThickness:o4,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:o4,values:null,vAlphabetic:o4,vMathematical:o4,vectorEffect:null,vHanging:o4,vIdeographic:o4,version:null,vertAdvY:o4,vertOriginX:o4,vertOriginY:o4,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:o4,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:pn}),pr=pl({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform:(a,b)=>"xlink:"+b.slice(5).toLowerCase()}),ps=pl({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:po}),pt=pl({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform:(a,b)=>"xml:"+b.slice(3).toLowerCase()}),pu=pk([pm,pp,pr,ps,pt],"html"),pv=pk([pm,pq,pr,ps,pt],"svg");var pw=a.i(52540);let px=pz("end"),py=pz("start");function pz(a){return function(b){let c=b&&b.position&&b.position[a]||{};if("number"==typeof c.line&&c.line>0&&"number"==typeof c.column&&c.column>0)return{line:c.line,column:c.column,offset:"number"==typeof c.offset&&c.offset>-1?c.offset:void 0}}}function pA(a){return a&&"object"==typeof a?"position"in a||"type"in a?pC(a.position):"start"in a||"end"in a?pC(a):"line"in a||"column"in a?pB(a):"":""}function pB(a){return pD(a&&a.line)+":"+pD(a&&a.column)}function pC(a){return pB(a&&a.start)+"-"+pB(a&&a.end)}function pD(a){return a&&"number"==typeof a?a:1}class pE extends Error{constructor(a,b,c){super(),"string"==typeof b&&(c=b,b=void 0);let d="",e={},f=!1;if(b&&(e="line"in b&&"column"in b||"start"in b&&"end"in b?{place:b}:"type"in b?{ancestors:[b],place:b.position}:{...b}),"string"==typeof a?d=a:!e.cause&&a&&(f=!0,d=a.message,e.cause=a),!e.ruleId&&!e.source&&"string"==typeof c){const a=c.indexOf(":");-1===a?e.ruleId=c:(e.source=c.slice(0,a),e.ruleId=c.slice(a+1))}if(!e.place&&e.ancestors&&e.ancestors){const a=e.ancestors[e.ancestors.length-1];a&&(e.place=a.position)}const g=e.place&&"start"in e.place?e.place.start:e.place;this.ancestors=e.ancestors||void 0,this.cause=e.cause||void 0,this.column=g?g.column:void 0,this.fatal=void 0,this.file="",this.message=d,this.line=g?g.line:void 0,this.name=pA(e.place)||"1:1",this.place=e.place||void 0,this.reason=this.message,this.ruleId=e.ruleId||void 0,this.source=e.source||void 0,this.stack=f&&e.cause&&"string"==typeof e.cause.stack?e.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}pE.prototype.file="",pE.prototype.name="",pE.prototype.reason="",pE.prototype.message="",pE.prototype.stack="",pE.prototype.column=void 0,pE.prototype.line=void 0,pE.prototype.ancestors=void 0,pE.prototype.cause=void 0,pE.prototype.fatal=void 0,pE.prototype.place=void 0,pE.prototype.ruleId=void 0,pE.prototype.source=void 0;let pF={}.hasOwnProperty,pG=new Map,pH=/[A-Z]/g,pI=new Set(["table","tbody","thead","tfoot","tr"]),pJ=new Set(["td","th"]),pK="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function pL(a,b,c){var d,e,f,g,h,i,j,k,l;let n,o,p,q,r,s,t,u,v,w,x;return"element"===b.type?(d=a,e=b,f=c,o=n=d.schema,"svg"===e.tagName.toLowerCase()&&"html"===n.space&&(d.schema=pv),d.ancestors.push(e),p=pP(d,e.tagName,!1),q=function(a,b){let c,d,e={};for(d in b.properties)if("children"!==d&&pF.call(b.properties,d)){let f=function(a,b,c){let d=function(a,b){let c=pc(b),d=b,e=o_;if(c in a.normal)return a.property[a.normal[c]];if(c.length>4&&"data"===c.slice(0,4)&&pf.test(b)){if("-"===b.charAt(4)){let a=b.slice(5).replace(pe,ph);d="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{let a=b.slice(4);if(!pe.test(a)){let c=a.replace(pd,pg);"-"!==c.charAt(0)&&(c="-"+c),b="data"+c}}e=pb}return new e(d,b)}(a.schema,b);if(!(null==c||"number"==typeof c&&Number.isNaN(c))){var e;let b;if(Array.isArray(c)&&(c=d.commaSeparated?(b={},(""===(e=c)[e.length-1]?[...e,""]:e).join((b.padRight?" ":"")+","+(!1===b.padLeft?"":" ")).trim()):c.join(" ").trim()),"style"===d.property){let b="object"==typeof c?c:function(a,b){try{return(0,pw.default)(b,{reactCompat:!0})}catch(c){if(a.ignoreInvalidStyle)return{};let b=new pE("Cannot parse `style` attribute",{ancestors:a.ancestors,cause:c,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw b.file=a.filePath||void 0,b.url=pK+"#cannot-parse-style-attribute",b}}(a,String(c));return"css"===a.stylePropertyNameCase&&(b=function(a){let b,c={};for(b in a)pF.call(a,b)&&(c[function(a){let b=a.replace(pH,pR);return"ms-"===b.slice(0,3)&&(b="-"+b),b}(b)]=a[b]);return c}(b)),["style",b]}return["react"===a.elementAttributeNameCase&&d.space?pi[d.property]||d.property:d.attribute,c]}}(a,d,b.properties[d]);if(f){let[d,g]=f;a.tableCellAlignToStyle&&"align"===d&&"string"==typeof g&&pJ.has(b.tagName)?c=g:e[d]=g}}return c&&((e.style||(e.style={}))["css"===a.stylePropertyNameCase?"text-align":"textAlign"]=c),e}(d,e),r=pO(d,e),pI.has(e.tagName)&&(r=r.filter(function(a){return"string"!=typeof a||!("object"==typeof a?"text"===a.type&&o$(a.value):o$(a))})),pM(d,q,p,e),pN(q,r),d.ancestors.pop(),d.schema=n,d.create(e,p,q,f)):"mdxFlowExpression"===b.type||"mdxTextExpression"===b.type?function(a,b){if(b.data&&b.data.estree&&a.evaluater){let c=b.data.estree.body[0];return oT("ExpressionStatement"===c.type),a.evaluater.evaluateExpression(c.expression)}pQ(a,b.position)}(a,b):"mdxJsxFlowElement"===b.type||"mdxJsxTextElement"===b.type?(g=a,h=b,i=c,t=s=g.schema,"svg"===h.name&&"html"===s.space&&(g.schema=pv),g.ancestors.push(h),u=null===h.name?g.Fragment:pP(g,h.name,!0),v=function(a,b){let c={};for(let d of b.attributes)if("mdxJsxExpressionAttribute"===d.type)if(d.data&&d.data.estree&&a.evaluater){let b=d.data.estree.body[0];oT("ExpressionStatement"===b.type);let e=b.expression;oT("ObjectExpression"===e.type);let f=e.properties[0];oT("SpreadElement"===f.type),Object.assign(c,a.evaluater.evaluateExpression(f.argument))}else pQ(a,b.position);else{let e,f=d.name;if(d.value&&"object"==typeof d.value)if(d.value.data&&d.value.data.estree&&a.evaluater){let b=d.value.data.estree.body[0];oT("ExpressionStatement"===b.type),e=a.evaluater.evaluateExpression(b.expression)}else pQ(a,b.position);else e=null===d.value||d.value;c[f]=e}return c}(g,h),w=pO(g,h),pM(g,v,u,h),pN(v,w),g.ancestors.pop(),g.schema=s,g.create(h,u,v,i)):"mdxjsEsm"===b.type?function(a,b){if(b.data&&b.data.estree&&a.evaluater)return a.evaluater.evaluateProgram(b.data.estree);pQ(a,b.position)}(a,b):"root"===b.type?(j=a,k=b,l=c,pN(x={},pO(j,k)),j.create(k,j.Fragment,x,l)):"text"===b.type?b.value:void 0}function pM(a,b,c,d){"string"!=typeof c&&c!==a.Fragment&&a.passNode&&(b.node=d)}function pN(a,b){if(b.length>0){let c=b.length>1?b:b[0];c&&(a.children=c)}}function pO(a,b){let c=[],d=-1,e=a.passKeys?new Map:pG;for(;++d<b.children.length;){let f,g=b.children[d];if(a.passKeys){let a="element"===g.type?g.tagName:"mdxJsxFlowElement"===g.type||"mdxJsxTextElement"===g.type?g.name:void 0;if(a){let b=e.get(a)||0;f=a+"-"+b,e.set(a,b+1)}}let h=pL(a,g,f);void 0!==h&&c.push(h)}return c}function pP(a,b,c){let d;if(c)if(b.includes(".")){let a,c=b.split("."),e=-1;for(;++e<c.length;){let b=oY(c[e])?{type:"Identifier",name:c[e]}:{type:"Literal",value:c[e]};a=a?{type:"MemberExpression",object:a,property:b,computed:!!(e&&"Literal"===b.type),optional:!1}:b}oT(a,"always a result"),d=a}else d=oY(b)&&!/^[a-z]/.test(b)?{type:"Identifier",name:b}:{type:"Literal",value:b};else d={type:"Literal",value:b};if("Literal"===d.type){let b=d.value;return pF.call(a.components,b)?a.components[b]:b}if(a.evaluater)return a.evaluater.evaluateExpression(d);pQ(a)}function pQ(a,b){let c=new pE("Cannot handle MDX estrees without `createEvaluater`",{ancestors:a.ancestors,place:b,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw c.file=a.filePath||void 0,c.url=pK+"#cannot-handle-mdx-estrees-without-createevaluater",c}function pR(a){return"-"+a.toLowerCase()}let pS={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},pT={};function pU(a,b,c){var d;if((d=a)&&"object"==typeof d){if("value"in a)return"html"!==a.type||c?a.value:"";if(b&&"alt"in a&&a.alt)return a.alt;if("children"in a)return pV(a.children,b,c)}return Array.isArray(a)?pV(a,b,c):""}function pV(a,b,c){let d=[],e=-1;for(;++e<a.length;)d[e]=pU(a[e],b,c);return d.join("")}function pW(a,b,c,d){let e,f=a.length,g=0;if(b=b<0?-b>f?0:f+b:b>f?f:b,c=c>0?c:0,d.length<1e4)(e=Array.from(d)).unshift(b,c),a.splice(...e);else for(c&&a.splice(b,c);g<d.length;)(e=d.slice(g,g+1e4)).unshift(b,0),a.splice(...e),g+=1e4,b+=1e4}function pX(a,b){return a.length>0?(pW(a,a.length,0,b),a):b}let pY={}.hasOwnProperty;function pZ(a){return null!==a&&a<-2}function p$(a){return -2===a||-1===a||32===a}function p_(a){return function(b){return null!==b&&b>-1&&a.test(String.fromCharCode(b))}}function p0(a,b,c,d){let e=d?d-1:1/0,f=0;return function(d){return p$(d)?(a.enter(c),function d(g){return p$(g)&&f++<e?(a.consume(g),d):(a.exit(c),b(g))}(d)):b(d)}}p_(/[A-Za-z]/),p_(/[\dA-Za-z]/),p_(/[#-'*+\--9=?A-Z^-~]/),p_(/\d/),p_(/[\dA-Fa-f]/),p_(/[!-/:-@[-`{-~]/),p_(/\p{P}|\p{S}/u),p_(/\s/);let p1={tokenize:function(a){let b,c=a.attempt(this.parser.constructs.contentInitial,function(b){return null===b?void a.consume(b):(a.enter("lineEnding"),a.consume(b),a.exit("lineEnding"),p0(a,c,"linePrefix"))},function(c){return a.enter("paragraph"),function c(d){let e=a.enter("chunkText",{contentType:"text",previous:b});return b&&(b.next=e),b=e,function b(d){if(null===d){a.exit("chunkText"),a.exit("paragraph"),a.consume(d);return}return pZ(d)?(a.consume(d),a.exit("chunkText"),c):(a.consume(d),b)}(d)}(c)});return c}},p2={tokenize:function(a){let b,c,d,e=this,f=[],g=0;return h;function h(b){if(g<f.length){let c=f[g];return e.containerState=c[1],a.attempt(c[0].continuation,i,j)(b)}return j(b)}function i(a){if(g++,e.containerState._closeFlow){let c;e.containerState._closeFlow=void 0,b&&s();let d=e.events.length,f=d;for(;f--;)if("exit"===e.events[f][0]&&"chunkFlow"===e.events[f][1].type){c=e.events[f][1].end;break}r(g);let h=d;for(;h<e.events.length;)e.events[h][1].end={...c},h++;return pW(e.events,f+1,0,e.events.slice(d)),e.events.length=h,j(a)}return h(a)}function j(c){if(g===f.length){if(!b)return n(c);if(b.currentConstruct&&b.currentConstruct.concrete)return p(c);e.interrupt=!!(b.currentConstruct&&!b._gfmTableDynamicInterruptHack)}return e.containerState={},a.check(p3,k,l)(c)}function k(a){return b&&s(),r(g),n(a)}function l(a){return e.parser.lazy[e.now().line]=g!==f.length,d=e.now().offset,p(a)}function n(b){return e.containerState={},a.attempt(p3,o,p)(b)}function o(a){return g++,f.push([e.currentConstruct,e.containerState]),n(a)}function p(d){if(null===d){b&&s(),r(0),a.consume(d);return}return b=b||e.parser.flow(e.now()),a.enter("chunkFlow",{_tokenizer:b,contentType:"flow",previous:c}),function b(c){if(null===c){q(a.exit("chunkFlow"),!0),r(0),a.consume(c);return}return pZ(c)?(a.consume(c),q(a.exit("chunkFlow")),g=0,e.interrupt=void 0,h):(a.consume(c),b)}(d)}function q(a,f){let h=e.sliceStream(a);if(f&&h.push(null),a.previous=c,c&&(c.next=a),c=a,b.defineSkip(a.start),b.write(h),e.parser.lazy[a.start.line]){let a,c,f=b.events.length;for(;f--;)if(b.events[f][1].start.offset<d&&(!b.events[f][1].end||b.events[f][1].end.offset>d))return;let h=e.events.length,i=h;for(;i--;)if("exit"===e.events[i][0]&&"chunkFlow"===e.events[i][1].type){if(a){c=e.events[i][1].end;break}a=!0}for(r(g),f=h;f<e.events.length;)e.events[f][1].end={...c},f++;pW(e.events,i+1,0,e.events.slice(h)),e.events.length=f}}function r(b){let c=f.length;for(;c-- >b;){let b=f[c];e.containerState=b[1],b[0].exit.call(e,a)}f.length=b}function s(){b.write([null]),c=void 0,b=void 0,e.containerState._closeFlow=void 0}}},p3={tokenize:function(a,b,c){return p0(a,a.attempt(this.parser.constructs.document,b,c),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}},p4=qd(/[A-Za-z]/),p5=qd(/[\dA-Za-z]/),p6=qd(/[#-'*+\--9=?A-Z^-~]/),p7=qd(/\d/),p8=qd(/[\dA-Fa-f]/),p9=qd(/[!-/:-@[-`{-~]/);function qa(a){return null!==a&&a<-2}function qb(a){return null!==a&&(a<0||32===a)}function qc(a){return -2===a||-1===a||32===a}function qd(a){return function(b){return null!==b&&b>-1&&a.test(String.fromCharCode(b))}}function qe(a,b,c,d){let e=d?d-1:1/0,f=0;return function(d){return qc(d)?(a.enter(c),function d(g){return qc(g)&&f++<e?(a.consume(g),d):(a.exit(c),b(g))}(d)):b(d)}}qd(/\p{P}|\p{S}/u),qd(/\s/);let qf={partial:!0,tokenize:function(a,b,c){return function(b){return qc(b)?qe(a,d,"linePrefix")(b):d(b)};function d(a){return null===a||qa(a)?b(a):c(a)}}};class qg{constructor(a){this.left=a?[...a]:[],this.right=[]}get(a){if(a<0||a>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+a+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return a<this.left.length?this.left[a]:this.right[this.right.length-a+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(a,b){let c=null==b?1/0:b;return c<this.left.length?this.left.slice(a,c):a>this.left.length?this.right.slice(this.right.length-c+this.left.length,this.right.length-a+this.left.length).reverse():this.left.slice(a).concat(this.right.slice(this.right.length-c+this.left.length).reverse())}splice(a,b,c){this.setCursor(Math.trunc(a));let d=this.right.splice(this.right.length-(b||0),1/0);return c&&qh(this.left,c),d.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(a){this.setCursor(1/0),this.left.push(a)}pushMany(a){this.setCursor(1/0),qh(this.left,a)}unshift(a){this.setCursor(0),this.right.push(a)}unshiftMany(a){this.setCursor(0),qh(this.right,a.reverse())}setCursor(a){if(a!==this.left.length&&(!(a>this.left.length)||0!==this.right.length)&&(!(a<0)||0!==this.left.length))if(a<this.left.length){let b=this.left.splice(a,1/0);qh(this.right,b.reverse())}else{let b=this.right.splice(this.left.length+this.right.length-a,1/0);qh(this.left,b.reverse())}}}function qh(a,b){let c=0;if(b.length<1e4)a.push(...b);else for(;c<b.length;)a.push(...b.slice(c,c+1e4)),c+=1e4}function qi(a){let b,c,d,e,f,g,h,i={},j=-1,k=new qg(a);for(;++j<k.length;){for(;j in i;)j=i[j];if(b=k.get(j),j&&"chunkFlow"===b[1].type&&"listItemPrefix"===k.get(j-1)[1].type&&((d=0)<(g=b[1]._tokenizer.events).length&&"lineEndingBlank"===g[d][1].type&&(d+=2),d<g.length&&"content"===g[d][1].type))for(;++d<g.length&&"content"!==g[d][1].type;)"chunkText"===g[d][1].type&&(g[d][1]._isInFirstContentOfListItem=!0,d++);if("enter"===b[0])b[1].contentType&&(Object.assign(i,function(a,b){let c,d,e=a.get(b)[1],f=a.get(b)[2],g=b-1,h=[],i=e._tokenizer;!i&&(i=f.parser[e.contentType](e.start),e._contentTypeTextTrailing&&(i._contentTypeTextTrailing=!0));let j=i.events,k=[],l={},n=-1,o=e,p=0,q=0,r=[0];for(;o;){for(;a.get(++g)[1]!==o;);h.push(g),!o._tokenizer&&(c=f.sliceStream(o),o.next||c.push(null),d&&i.defineSkip(o.start),o._isInFirstContentOfListItem&&(i._gfmTasklistFirstContentOfListItem=!0),i.write(c),o._isInFirstContentOfListItem&&(i._gfmTasklistFirstContentOfListItem=void 0)),d=o,o=o.next}for(o=e;++n<j.length;)"exit"===j[n][0]&&"enter"===j[n-1][0]&&j[n][1].type===j[n-1][1].type&&j[n][1].start.line!==j[n][1].end.line&&(q=n+1,r.push(q),o._tokenizer=void 0,o.previous=void 0,o=o.next);for(i.events=[],o?(o._tokenizer=void 0,o.previous=void 0):r.pop(),n=r.length;n--;){let b=j.slice(r[n],r[n+1]),c=h.pop();k.push([c,c+b.length-1]),a.splice(c,2,b)}for(k.reverse(),n=-1;++n<k.length;)l[p+k[n][0]]=p+k[n][1],p+=k[n][1]-k[n][0]-1;return l}(k,j)),j=i[j],h=!0);else if(b[1]._container){for(d=j,c=void 0;d--;)if("lineEnding"===(e=k.get(d))[1].type||"lineEndingBlank"===e[1].type)"enter"===e[0]&&(c&&(k.get(c)[1].type="lineEndingBlank"),e[1].type="lineEnding",c=d);else if("linePrefix"===e[1].type||"listItemIndent"===e[1].type);else break;c&&(b[1].end={...k.get(c)[1].start},(f=k.slice(c,j)).unshift(b),k.splice(c,j-c+1,f))}}return pW(a,0,1/0,k.slice(0)),!h}let qj={resolve:function(a){return qi(a),a},tokenize:function(a,b){let c;return function(b){return a.enter("content"),c=a.enter("chunkContent",{contentType:"content"}),d(b)};function d(b){return null===b?e(b):qa(b)?a.check(qk,f,e)(b):(a.consume(b),d)}function e(c){return a.exit("chunkContent"),a.exit("content"),b(c)}function f(b){return a.consume(b),a.exit("chunkContent"),c.next=a.enter("chunkContent",{contentType:"content",previous:c}),c=c.next,d}}},qk={partial:!0,tokenize:function(a,b,c){let d=this;return function(b){return a.exit("chunkContent"),a.enter("lineEnding"),a.consume(b),a.exit("lineEnding"),qe(a,e,"linePrefix")};function e(e){if(null===e||qa(e))return c(e);let f=d.events[d.events.length-1];return!d.parser.constructs.disable.null.includes("codeIndented")&&f&&"linePrefix"===f[1].type&&f[2].sliceSerialize(f[1],!0).length>=4?b(e):a.interrupt(d.parser.constructs.flow,c,b)(e)}}},ql={tokenize:function(a){let b=this,c=a.attempt(qf,function(d){return null===d?void a.consume(d):(a.enter("lineEndingBlank"),a.consume(d),a.exit("lineEndingBlank"),b.currentConstruct=void 0,c)},a.attempt(this.parser.constructs.flowInitial,d,p0(a,a.attempt(this.parser.constructs.flow,d,a.attempt(qj,d)),"linePrefix")));return c;function d(d){return null===d?void a.consume(d):(a.enter("lineEnding"),a.consume(d),a.exit("lineEnding"),b.currentConstruct=void 0,c)}}},qm={resolveAll:qq()},qn=qp("string"),qo=qp("text");function qp(a){return{resolveAll:qq("text"===a?qr:void 0),tokenize:function(b){let c=this,d=this.parser.constructs[a],e=b.attempt(d,f,g);return f;function f(a){return i(a)?e(a):g(a)}function g(a){return null===a?void b.consume(a):(b.enter("data"),b.consume(a),h)}function h(a){return i(a)?(b.exit("data"),e(a)):(b.consume(a),h)}function i(a){if(null===a)return!0;let b=d[a],e=-1;if(b)for(;++e<b.length;){let a=b[e];if(!a.previous||a.previous.call(c,c.previous))return!0}return!1}}}}function qq(a){return function(b,c){let d,e=-1;for(;++e<=b.length;)void 0===d?b[e]&&"data"===b[e][1].type&&(d=e,e++):b[e]&&"data"===b[e][1].type||(e!==d+2&&(b[d][1].end=b[e-1][1].end,b.splice(d+2,e-d-2),e=d+2),d=void 0);return a?a(b,c):b}}function qr(a,b){let c=0;for(;++c<=a.length;)if((c===a.length||"lineEnding"===a[c][1].type)&&"data"===a[c-1][1].type){let d,e=a[c-1][1],f=b.sliceStream(e),g=f.length,h=-1,i=0;for(;g--;){let a=f[g];if("string"==typeof a){for(h=a.length;32===a.charCodeAt(h-1);)i++,h--;if(h)break;h=-1}else if(-2===a)d=!0,i++;else if(-1===a);else{g++;break}}if(b._contentTypeTextTrailing&&c===a.length&&(i=0),i){let f={type:c===a.length||d||i<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:g?h:e.start._bufferIndex+h,_index:e.start._index+g,line:e.end.line,column:e.end.column-i,offset:e.end.offset-i},end:{...e.end}};e.end={...f.start},e.start.offset===e.end.offset?Object.assign(e,f):(a.splice(c,0,["enter",f,b],["exit",f,b]),c+=2)}c++}return a}qu(/[A-Za-z]/),qu(/[\dA-Za-z]/),qu(/[#-'*+\--9=?A-Z^-~]/),qu(/\d/),qu(/[\dA-Fa-f]/),qu(/[!-/:-@[-`{-~]/);let qs=qu(/\p{P}|\p{S}/u),qt=qu(/\s/);function qu(a){return function(b){return null!==b&&b>-1&&a.test(String.fromCharCode(b))}}function qv(a){return null===a||null!==a&&(a<0||32===a)||qt(a)?1:qs(a)?2:void 0}function qw(a,b,c){let d=[],e=-1;for(;++e<a.length;){let f=a[e].resolveAll;f&&!d.includes(f)&&(b=f(b,c),d.push(f))}return b}let qx={name:"attention",resolveAll:function(a,b){let c,d,e,f,g,h,i,j,k=-1;for(;++k<a.length;)if("enter"===a[k][0]&&"attentionSequence"===a[k][1].type&&a[k][1]._close){for(c=k;c--;)if("exit"===a[c][0]&&"attentionSequence"===a[c][1].type&&a[c][1]._open&&b.sliceSerialize(a[c][1]).charCodeAt(0)===b.sliceSerialize(a[k][1]).charCodeAt(0)){if((a[c][1]._close||a[k][1]._open)&&(a[k][1].end.offset-a[k][1].start.offset)%3&&!((a[c][1].end.offset-a[c][1].start.offset+a[k][1].end.offset-a[k][1].start.offset)%3))continue;h=a[c][1].end.offset-a[c][1].start.offset>1&&a[k][1].end.offset-a[k][1].start.offset>1?2:1;let l={...a[c][1].end},n={...a[k][1].start};qy(l,-h),qy(n,h),f={type:h>1?"strongSequence":"emphasisSequence",start:l,end:{...a[c][1].end}},g={type:h>1?"strongSequence":"emphasisSequence",start:{...a[k][1].start},end:n},e={type:h>1?"strongText":"emphasisText",start:{...a[c][1].end},end:{...a[k][1].start}},d={type:h>1?"strong":"emphasis",start:{...f.start},end:{...g.end}},a[c][1].end={...f.start},a[k][1].start={...g.end},i=[],a[c][1].end.offset-a[c][1].start.offset&&(i=pX(i,[["enter",a[c][1],b],["exit",a[c][1],b]])),i=pX(i,[["enter",d,b],["enter",f,b],["exit",f,b],["enter",e,b]]),i=pX(i,qw(b.parser.constructs.insideSpan.null,a.slice(c+1,k),b)),i=pX(i,[["exit",e,b],["enter",g,b],["exit",g,b],["exit",d,b]]),a[k][1].end.offset-a[k][1].start.offset?(j=2,i=pX(i,[["enter",a[k][1],b],["exit",a[k][1],b]])):j=0,pW(a,c-1,k-c+3,i),k=c+i.length-j-2;break}}for(k=-1;++k<a.length;)"attentionSequence"===a[k][1].type&&(a[k][1].type="data");return a},tokenize:function(a,b){let c,d=this.parser.constructs.attentionMarkers.null,e=this.previous,f=qv(e);return function(g){return c=g,a.enter("attentionSequence"),function g(h){if(h===c)return a.consume(h),g;let i=a.exit("attentionSequence"),j=qv(h),k=!j||2===j&&f||d.includes(h),l=!f||2===f&&j||d.includes(e);return i._open=!!(42===c?k:k&&(f||!l)),i._close=!!(42===c?l:l&&(j||!k)),b(h)}(g)}}};function qy(a,b){a.column+=b,a.offset+=b,a._bufferIndex+=b}let qz={continuation:{tokenize:function(a,b,c){let d=this;return function(b){return qc(b)?qe(a,e,"linePrefix",d.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(b):e(b)};function e(d){return a.attempt(qz,b,c)(d)}}},exit:function(a){a.exit("blockQuote")},name:"blockQuote",tokenize:function(a,b,c){let d=this;return function(b){if(62===b){let c=d.containerState;return c.open||(a.enter("blockQuote",{_container:!0}),c.open=!0),a.enter("blockQuotePrefix"),a.enter("blockQuoteMarker"),a.consume(b),a.exit("blockQuoteMarker"),e}return c(b)};function e(c){return qc(c)?(a.enter("blockQuotePrefixWhitespace"),a.consume(c),a.exit("blockQuotePrefixWhitespace"),a.exit("blockQuotePrefix"),b):(a.exit("blockQuotePrefix"),b(c))}}},qA={name:"characterEscape",tokenize:function(a,b,c){return function(b){return a.enter("characterEscape"),a.enter("escapeMarker"),a.consume(b),a.exit("escapeMarker"),d};function d(d){return p9(d)?(a.enter("characterEscapeValue"),a.consume(d),a.exit("characterEscapeValue"),a.exit("characterEscape"),b):c(d)}}},qB={AElig:"Æ",AMP:"&",Aacute:"Á",Abreve:"Ă",Acirc:"Â",Acy:"А",Afr:"𝔄",Agrave:"À",Alpha:"Α",Amacr:"Ā",And:"⩓",Aogon:"Ą",Aopf:"𝔸",ApplyFunction:"",Aring:"Å",Ascr:"𝒜",Assign:"≔",Atilde:"Ã",Auml:"Ä",Backslash:"∖",Barv:"⫧",Barwed:"⌆",Bcy:"Б",Because:"∵",Bernoullis:"ℬ",Beta:"Β",Bfr:"𝔅",Bopf:"𝔹",Breve:"˘",Bscr:"ℬ",Bumpeq:"≎",CHcy:"Ч",COPY:"©",Cacute:"Ć",Cap:"⋒",CapitalDifferentialD:"ⅅ",Cayleys:"ℭ",Ccaron:"Č",Ccedil:"Ç",Ccirc:"Ĉ",Cconint:"∰",Cdot:"Ċ",Cedilla:"¸",CenterDot:"·",Cfr:"ℭ",Chi:"Χ",CircleDot:"⊙",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",Colon:"∷",Colone:"⩴",Congruent:"≡",Conint:"∯",ContourIntegral:"∮",Copf:"ℂ",Coproduct:"∐",CounterClockwiseContourIntegral:"∳",Cross:"⨯",Cscr:"𝒞",Cup:"⋓",CupCap:"≍",DD:"ⅅ",DDotrahd:"⤑",DJcy:"Ђ",DScy:"Ѕ",DZcy:"Џ",Dagger:"‡",Darr:"↡",Dashv:"⫤",Dcaron:"Ď",Dcy:"Д",Del:"∇",Delta:"Δ",Dfr:"𝔇",DiacriticalAcute:"´",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",Diamond:"⋄",DifferentialD:"ⅆ",Dopf:"𝔻",Dot:"¨",DotDot:"⃜",DotEqual:"≐",DoubleContourIntegral:"∯",DoubleDot:"¨",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",DownArrow:"↓",DownArrowBar:"⤓",DownArrowUpArrow:"⇵",DownBreve:"̑",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVector:"↽",DownLeftVectorBar:"⥖",DownRightTeeVector:"⥟",DownRightVector:"⇁",DownRightVectorBar:"⥗",DownTee:"⊤",DownTeeArrow:"↧",Downarrow:"⇓",Dscr:"𝒟",Dstrok:"Đ",ENG:"Ŋ",ETH:"Ð",Eacute:"É",Ecaron:"Ě",Ecirc:"Ê",Ecy:"Э",Edot:"Ė",Efr:"𝔈",Egrave:"È",Element:"∈",Emacr:"Ē",EmptySmallSquare:"◻",EmptyVerySmallSquare:"▫",Eogon:"Ę",Eopf:"𝔼",Epsilon:"Ε",Equal:"⩵",EqualTilde:"≂",Equilibrium:"⇌",Escr:"ℰ",Esim:"⩳",Eta:"Η",Euml:"Ë",Exists:"∃",ExponentialE:"ⅇ",Fcy:"Ф",Ffr:"𝔉",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",Fopf:"𝔽",ForAll:"∀",Fouriertrf:"ℱ",Fscr:"ℱ",GJcy:"Ѓ",GT:">",Gamma:"Γ",Gammad:"Ϝ",Gbreve:"Ğ",Gcedil:"Ģ",Gcirc:"Ĝ",Gcy:"Г",Gdot:"Ġ",Gfr:"𝔊",Gg:"⋙",Gopf:"𝔾",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",Gscr:"𝒢",Gt:"≫",HARDcy:"Ъ",Hacek:"ˇ",Hat:"^",Hcirc:"Ĥ",Hfr:"ℌ",HilbertSpace:"ℋ",Hopf:"ℍ",HorizontalLine:"─",Hscr:"ℋ",Hstrok:"Ħ",HumpDownHump:"≎",HumpEqual:"≏",IEcy:"Е",IJlig:"IJ",IOcy:"Ё",Iacute:"Í",Icirc:"Î",Icy:"И",Idot:"İ",Ifr:"ℑ",Igrave:"Ì",Im:"ℑ",Imacr:"Ī",ImaginaryI:"ⅈ",Implies:"⇒",Int:"∬",Integral:"∫",Intersection:"⋂",InvisibleComma:"",InvisibleTimes:"",Iogon:"Į",Iopf:"𝕀",Iota:"Ι",Iscr:"ℐ",Itilde:"Ĩ",Iukcy:"І",Iuml:"Ï",Jcirc:"Ĵ",Jcy:"Й",Jfr:"𝔍",Jopf:"𝕁",Jscr:"𝒥",Jsercy:"Ј",Jukcy:"Є",KHcy:"Х",KJcy:"Ќ",Kappa:"Κ",Kcedil:"Ķ",Kcy:"К",Kfr:"𝔎",Kopf:"𝕂",Kscr:"𝒦",LJcy:"Љ",LT:"<",Lacute:"Ĺ",Lambda:"Λ",Lang:"⟪",Laplacetrf:"ℒ",Larr:"↞",Lcaron:"Ľ",Lcedil:"Ļ",Lcy:"Л",LeftAngleBracket:"⟨",LeftArrow:"←",LeftArrowBar:"⇤",LeftArrowRightArrow:"⇆",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVector:"⇃",LeftDownVectorBar:"⥙",LeftFloor:"⌊",LeftRightArrow:"↔",LeftRightVector:"⥎",LeftTee:"⊣",LeftTeeArrow:"↤",LeftTeeVector:"⥚",LeftTriangle:"⊲",LeftTriangleBar:"⧏",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVector:"↿",LeftUpVectorBar:"⥘",LeftVector:"↼",LeftVectorBar:"⥒",Leftarrow:"⇐",Leftrightarrow:"⇔",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",LessLess:"⪡",LessSlantEqual:"⩽",LessTilde:"≲",Lfr:"𝔏",Ll:"⋘",Lleftarrow:"⇚",Lmidot:"Ŀ",LongLeftArrow:"⟵",LongLeftRightArrow:"⟷",LongRightArrow:"⟶",Longleftarrow:"⟸",Longleftrightarrow:"⟺",Longrightarrow:"⟹",Lopf:"𝕃",LowerLeftArrow:"↙",LowerRightArrow:"↘",Lscr:"ℒ",Lsh:"↰",Lstrok:"Ł",Lt:"≪",Map:"⤅",Mcy:"М",MediumSpace:" ",Mellintrf:"ℳ",Mfr:"𝔐",MinusPlus:"∓",Mopf:"𝕄",Mscr:"ℳ",Mu:"Μ",NJcy:"Њ",Nacute:"Ń",Ncaron:"Ň",Ncedil:"Ņ",Ncy:"Н",NegativeMediumSpace:"",NegativeThickSpace:"",NegativeThinSpace:"",NegativeVeryThinSpace:"",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:"\n",Nfr:"𝔑",NoBreak:"",NonBreakingSpace:" ",Nopf:"ℕ",Not:"⫬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",NotLeftTriangle:"⋪",NotLeftTriangleBar:"⧏̸",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangle:"⋫",NotRightTriangleBar:"⧐̸",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",Nscr:"𝒩",Ntilde:"Ñ",Nu:"Ν",OElig:"Œ",Oacute:"Ó",Ocirc:"Ô",Ocy:"О",Odblac:"Ő",Ofr:"𝔒",Ograve:"Ò",Omacr:"Ō",Omega:"Ω",Omicron:"Ο",Oopf:"𝕆",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",Or:"⩔",Oscr:"𝒪",Oslash:"Ø",Otilde:"Õ",Otimes:"⨷",Ouml:"Ö",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",PartialD:"∂",Pcy:"П",Pfr:"𝔓",Phi:"Φ",Pi:"Π",PlusMinus:"±",Poincareplane:"ℌ",Popf:"ℙ",Pr:"⪻",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",Prime:"″",Product:"∏",Proportion:"∷",Proportional:"∝",Pscr:"𝒫",Psi:"Ψ",QUOT:'"',Qfr:"𝔔",Qopf:"ℚ",Qscr:"𝒬",RBarr:"⤐",REG:"®",Racute:"Ŕ",Rang:"⟫",Rarr:"↠",Rarrtl:"⤖",Rcaron:"Ř",Rcedil:"Ŗ",Rcy:"Р",Re:"ℜ",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",Rfr:"ℜ",Rho:"Ρ",RightAngleBracket:"⟩",RightArrow:"→",RightArrowBar:"⇥",RightArrowLeftArrow:"⇄",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVector:"⇂",RightDownVectorBar:"⥕",RightFloor:"⌋",RightTee:"⊢",RightTeeArrow:"↦",RightTeeVector:"⥛",RightTriangle:"⊳",RightTriangleBar:"⧐",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVector:"↾",RightUpVectorBar:"⥔",RightVector:"⇀",RightVectorBar:"⥓",Rightarrow:"⇒",Ropf:"ℝ",RoundImplies:"⥰",Rrightarrow:"⇛",Rscr:"ℛ",Rsh:"↱",RuleDelayed:"⧴",SHCHcy:"Щ",SHcy:"Ш",SOFTcy:"Ь",Sacute:"Ś",Sc:"⪼",Scaron:"Š",Scedil:"Ş",Scirc:"Ŝ",Scy:"С",Sfr:"𝔖",ShortDownArrow:"↓",ShortLeftArrow:"←",ShortRightArrow:"→",ShortUpArrow:"↑",Sigma:"Σ",SmallCircle:"∘",Sopf:"𝕊",Sqrt:"√",Square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",Sscr:"𝒮",Star:"⋆",Sub:"⋐",Subset:"⋐",SubsetEqual:"⊆",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",SuchThat:"∋",Sum:"∑",Sup:"⋑",Superset:"⊃",SupersetEqual:"⊇",Supset:"⋑",THORN:"Þ",TRADE:"™",TSHcy:"Ћ",TScy:"Ц",Tab:" ",Tau:"Τ",Tcaron:"Ť",Tcedil:"Ţ",Tcy:"Т",Tfr:"𝔗",Therefore:"∴",Theta:"Θ",ThickSpace:" ",ThinSpace:" ",Tilde:"∼",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",Topf:"𝕋",TripleDot:"⃛",Tscr:"𝒯",Tstrok:"Ŧ",Uacute:"Ú",Uarr:"↟",Uarrocir:"⥉",Ubrcy:"Ў",Ubreve:"Ŭ",Ucirc:"Û",Ucy:"У",Udblac:"Ű",Ufr:"𝔘",Ugrave:"Ù",Umacr:"Ū",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",Uogon:"Ų",Uopf:"𝕌",UpArrow:"↑",UpArrowBar:"⤒",UpArrowDownArrow:"⇅",UpDownArrow:"↕",UpEquilibrium:"⥮",UpTee:"⊥",UpTeeArrow:"↥",Uparrow:"⇑",Updownarrow:"⇕",UpperLeftArrow:"↖",UpperRightArrow:"↗",Upsi:"ϒ",Upsilon:"Υ",Uring:"Ů",Uscr:"𝒰",Utilde:"Ũ",Uuml:"Ü",VDash:"⊫",Vbar:"⫫",Vcy:"В",Vdash:"⊩",Vdashl:"⫦",Vee:"⋁",Verbar:"‖",Vert:"‖",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",Vfr:"𝔙",Vopf:"𝕍",Vscr:"𝒱",Vvdash:"⊪",Wcirc:"Ŵ",Wedge:"⋀",Wfr:"𝔚",Wopf:"𝕎",Wscr:"𝒲",Xfr:"𝔛",Xi:"Ξ",Xopf:"𝕏",Xscr:"𝒳",YAcy:"Я",YIcy:"Ї",YUcy:"Ю",Yacute:"Ý",Ycirc:"Ŷ",Ycy:"Ы",Yfr:"𝔜",Yopf:"𝕐",Yscr:"𝒴",Yuml:"Ÿ",ZHcy:"Ж",Zacute:"Ź",Zcaron:"Ž",Zcy:"З",Zdot:"Ż",ZeroWidthSpace:"",Zeta:"Ζ",Zfr:"ℨ",Zopf:"ℤ",Zscr:"𝒵",aacute:"á",abreve:"ă",ac:"∾",acE:"∾̳",acd:"∿",acirc:"â",acute:"´",acy:"а",aelig:"æ",af:"",afr:"𝔞",agrave:"à",alefsym:"ℵ",aleph:"ℵ",alpha:"α",amacr:"ā",amalg:"⨿",amp:"&",and:"∧",andand:"⩕",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsd:"∡",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",aogon:"ą",aopf:"𝕒",ap:"≈",apE:"⩰",apacir:"⩯",ape:"≊",apid:"≋",apos:"'",approx:"≈",approxeq:"≊",aring:"å",ascr:"𝒶",ast:"*",asymp:"≈",asympeq:"≍",atilde:"ã",auml:"ä",awconint:"∳",awint:"⨑",bNot:"⫭",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",barvee:"⊽",barwed:"⌅",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",bcy:"б",bdquo:"„",becaus:"∵",because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",beta:"β",beth:"ℶ",between:"≬",bfr:"𝔟",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bnot:"⌐",bopf:"𝕓",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxDL:"╗",boxDR:"╔",boxDl:"╖",boxDr:"╓",boxH:"═",boxHD:"╦",boxHU:"╩",boxHd:"╤",boxHu:"╧",boxUL:"╝",boxUR:"╚",boxUl:"╜",boxUr:"╙",boxV:"║",boxVH:"╬",boxVL:"╣",boxVR:"╠",boxVh:"╫",boxVl:"╢",boxVr:"╟",boxbox:"⧉",boxdL:"╕",boxdR:"╒",boxdl:"┐",boxdr:"┌",boxh:"─",boxhD:"╥",boxhU:"╨",boxhd:"┬",boxhu:"┴",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxuL:"╛",boxuR:"╘",boxul:"┘",boxur:"└",boxv:"│",boxvH:"╪",boxvL:"╡",boxvR:"╞",boxvh:"┼",boxvl:"┤",boxvr:"├",bprime:"‵",breve:"˘",brvbar:"¦",bscr:"𝒷",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsol:"\\",bsolb:"⧅",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpE:"⪮",bumpe:"≏",bumpeq:"≏",cacute:"ć",cap:"∩",capand:"⩄",capbrcup:"⩉",capcap:"⩋",capcup:"⩇",capdot:"⩀",caps:"∩︀",caret:"⁁",caron:"ˇ",ccaps:"⩍",ccaron:"č",ccedil:"ç",ccirc:"ĉ",ccups:"⩌",ccupssm:"⩐",cdot:"ċ",cedil:"¸",cemptyv:"⦲",cent:"¢",centerdot:"·",cfr:"𝔠",chcy:"ч",check:"✓",checkmark:"✓",chi:"χ",cir:"○",cirE:"⧃",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledR:"®",circledS:"Ⓢ",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",cire:"≗",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",clubs:"♣",clubsuit:"♣",colon:":",colone:"≔",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",conint:"∮",copf:"𝕔",coprod:"∐",copy:"©",copysr:"℗",crarr:"↵",cross:"✗",cscr:"𝒸",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",cup:"∪",cupbrcap:"⩈",cupcap:"⩆",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"¤",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",dArr:"⇓",dHar:"⥥",dagger:"†",daleth:"ℸ",darr:"↓",dash:"‐",dashv:"⊣",dbkarow:"⤏",dblac:"˝",dcaron:"ď",dcy:"д",dd:"ⅆ",ddagger:"‡",ddarr:"⇊",ddotseq:"⩷",deg:"°",delta:"δ",demptyv:"⦱",dfisht:"⥿",dfr:"𝔡",dharl:"⇃",dharr:"⇂",diam:"⋄",diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"¨",digamma:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",djcy:"ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",dopf:"𝕕",dot:"˙",doteq:"≐",doteqdot:"≑",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",downarrow:"↓",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",dscr:"𝒹",dscy:"ѕ",dsol:"⧶",dstrok:"đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",dzcy:"џ",dzigrarr:"⟿",eDDot:"⩷",eDot:"≑",eacute:"é",easter:"⩮",ecaron:"ě",ecir:"≖",ecirc:"ê",ecolon:"≕",ecy:"э",edot:"ė",ee:"ⅇ",efDot:"≒",efr:"𝔢",eg:"⪚",egrave:"è",egs:"⪖",egsdot:"⪘",el:"⪙",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",emacr:"ē",empty:"∅",emptyset:"∅",emptyv:"∅",emsp13:" ",emsp14:" ",emsp:" ",eng:"ŋ",ensp:" ",eogon:"ę",eopf:"𝕖",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",epsilon:"ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",equals:"=",equest:"≟",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erDot:"≓",erarr:"⥱",escr:"ℯ",esdot:"≐",esim:"≂",eta:"η",eth:"ð",euml:"ë",euro:"€",excl:"!",exist:"∃",expectation:"ℰ",exponentiale:"ⅇ",fallingdotseq:"≒",fcy:"ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",ffr:"𝔣",filig:"fi",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",fopf:"𝕗",forall:"∀",fork:"⋔",forkv:"⫙",fpartint:"⨍",frac12:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",fscr:"𝒻",gE:"≧",gEl:"⪌",gacute:"ǵ",gamma:"γ",gammad:"ϝ",gap:"⪆",gbreve:"ğ",gcirc:"ĝ",gcy:"г",gdot:"ġ",ge:"≥",gel:"⋛",geq:"≥",geqq:"≧",geqslant:"⩾",ges:"⩾",gescc:"⪩",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",gfr:"𝔤",gg:"≫",ggg:"⋙",gimel:"ℷ",gjcy:"ѓ",gl:"≷",glE:"⪒",gla:"⪥",glj:"⪤",gnE:"≩",gnap:"⪊",gnapprox:"⪊",gne:"⪈",gneq:"⪈",gneqq:"≩",gnsim:"⋧",gopf:"𝕘",grave:"`",gscr:"ℊ",gsim:"≳",gsime:"⪎",gsiml:"⪐",gt:">",gtcc:"⪧",gtcir:"⩺",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",hArr:"⇔",hairsp:" ",half:"½",hamilt:"ℋ",hardcy:"ъ",harr:"↔",harrcir:"⥈",harrw:"↭",hbar:"ℏ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",hfr:"𝔥",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",hopf:"𝕙",horbar:"―",hscr:"𝒽",hslash:"ℏ",hstrok:"ħ",hybull:"⁃",hyphen:"‐",iacute:"í",ic:"",icirc:"î",icy:"и",iecy:"е",iexcl:"¡",iff:"⇔",ifr:"𝔦",igrave:"ì",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",ijlig:"ij",imacr:"ī",image:"ℑ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",imof:"⊷",imped:"Ƶ",in:"∈",incare:"℅",infin:"∞",infintie:"⧝",inodot:"ı",int:"∫",intcal:"⊺",integers:"ℤ",intercal:"⊺",intlarhk:"⨗",intprod:"⨼",iocy:"ё",iogon:"į",iopf:"𝕚",iota:"ι",iprod:"⨼",iquest:"¿",iscr:"𝒾",isin:"∈",isinE:"⋹",isindot:"⋵",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"",itilde:"ĩ",iukcy:"і",iuml:"ï",jcirc:"ĵ",jcy:"й",jfr:"𝔧",jmath:"ȷ",jopf:"𝕛",jscr:"𝒿",jsercy:"ј",jukcy:"є",kappa:"κ",kappav:"ϰ",kcedil:"ķ",kcy:"к",kfr:"𝔨",kgreen:"ĸ",khcy:"х",kjcy:"ќ",kopf:"𝕜",kscr:"𝓀",lAarr:"⇚",lArr:"⇐",lAtail:"⤛",lBarr:"⤎",lE:"≦",lEg:"⪋",lHar:"⥢",lacute:"ĺ",laemptyv:"⦴",lagran:"ℒ",lambda:"λ",lang:"⟨",langd:"⦑",langle:"⟨",lap:"⪅",laquo:"«",larr:"←",larrb:"⇤",larrbfs:"⤟",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",lat:"⪫",latail:"⤙",late:"⪭",lates:"⪭︀",lbarr:"⤌",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",lcaron:"ľ",lcedil:"ļ",lceil:"⌈",lcub:"{",lcy:"л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",le:"≤",leftarrow:"←",leftarrowtail:"↢",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",leftrightarrow:"↔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",leftthreetimes:"⋋",leg:"⋚",leq:"≤",leqq:"≦",leqslant:"⩽",les:"⩽",lescc:"⪨",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",lessgtr:"≶",lesssim:"≲",lfisht:"⥼",lfloor:"⌊",lfr:"𝔩",lg:"≶",lgE:"⪑",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",ljcy:"љ",ll:"≪",llarr:"⇇",llcorner:"⌞",llhard:"⥫",lltri:"◺",lmidot:"ŀ",lmoust:"⎰",lmoustache:"⎰",lnE:"≨",lnap:"⪉",lnapprox:"⪉",lne:"⪇",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",longleftarrow:"⟵",longleftrightarrow:"⟷",longmapsto:"⟼",longrightarrow:"⟶",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",lopf:"𝕝",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"",lrtri:"⊿",lsaquo:"‹",lscr:"𝓁",lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",lstrok:"ł",lt:"<",ltcc:"⪦",ltcir:"⩹",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltrPar:"⦖",ltri:"◃",ltrie:"⊴",ltrif:"◂",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",mDDot:"∺",macr:"¯",male:"♂",malt:"✠",maltese:"✠",map:"↦",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",mcy:"м",mdash:"—",measuredangle:"∡",mfr:"𝔪",mho:"℧",micro:"µ",mid:"∣",midast:"*",midcir:"⫰",middot:"·",minus:"−",minusb:"⊟",minusd:"∸",minusdu:"⨪",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",mopf:"𝕞",mp:"∓",mscr:"𝓂",mstpos:"∾",mu:"μ",multimap:"⊸",mumap:"⊸",nGg:"⋙̸",nGt:"≫⃒",nGtv:"≫̸",nLeftarrow:"⇍",nLeftrightarrow:"⇎",nLl:"⋘̸",nLt:"≪⃒",nLtv:"≪̸",nRightarrow:"⇏",nVDash:"⊯",nVdash:"⊮",nabla:"∇",nacute:"ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natur:"♮",natural:"♮",naturals:"ℕ",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",ncaron:"ň",ncedil:"ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",ncy:"н",ndash:"–",ne:"≠",neArr:"⇗",nearhk:"⤤",nearr:"↗",nearrow:"↗",nedot:"≐̸",nequiv:"≢",nesear:"⤨",nesim:"≂̸",nexist:"∄",nexists:"∄",nfr:"𝔫",ngE:"≧̸",nge:"≱",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",ngsim:"≵",ngt:"≯",ngtr:"≯",nhArr:"⇎",nharr:"↮",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",njcy:"њ",nlArr:"⇍",nlE:"≦̸",nlarr:"↚",nldr:"‥",nle:"≰",nleftarrow:"↚",nleftrightarrow:"↮",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nlsim:"≴",nlt:"≮",nltri:"⋪",nltrie:"⋬",nmid:"∤",nopf:"𝕟",not:"¬",notin:"∉",notinE:"⋹̸",notindot:"⋵̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",npar:"∦",nparallel:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",npre:"⪯̸",nprec:"⊀",npreceq:"⪯̸",nrArr:"⇏",nrarr:"↛",nrarrc:"⤳̸",nrarrw:"↝̸",nrightarrow:"↛",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",nscr:"𝓃",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsubE:"⫅̸",nsube:"⊈",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupE:"⫆̸",nsupe:"⊉",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",ntilde:"ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",nu:"ν",num:"#",numero:"№",numsp:" ",nvDash:"⊭",nvHarr:"⤄",nvap:"≍⃒",nvdash:"⊬",nvge:"≥⃒",nvgt:">⃒",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwArr:"⇖",nwarhk:"⤣",nwarr:"↖",nwarrow:"↖",nwnear:"⤧",oS:"Ⓢ",oacute:"ó",oast:"⊛",ocir:"⊚",ocirc:"ô",ocy:"о",odash:"⊝",odblac:"ő",odiv:"⨸",odot:"⊙",odsold:"⦼",oelig:"œ",ofcir:"⦿",ofr:"𝔬",ogon:"˛",ograve:"ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",omacr:"ō",omega:"ω",omicron:"ο",omid:"⦶",ominus:"⊖",oopf:"𝕠",opar:"⦷",operp:"⦹",oplus:"⊕",or:"∨",orarr:"↻",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oscr:"ℴ",oslash:"ø",osol:"⊘",otilde:"õ",otimes:"⊗",otimesas:"⨶",ouml:"ö",ovbar:"⌽",par:"∥",para:"¶",parallel:"∥",parsim:"⫳",parsl:"⫽",part:"∂",pcy:"п",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",pfr:"𝔭",phi:"φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",pi:"π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plus:"+",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plusdo:"∔",plusdu:"⨥",pluse:"⩲",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",pointint:"⨕",popf:"𝕡",pound:"£",pr:"≺",prE:"⪳",prap:"⪷",prcue:"≼",pre:"⪯",prec:"≺",precapprox:"⪷",preccurlyeq:"≼",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",precsim:"≾",prime:"′",primes:"ℙ",prnE:"⪵",prnap:"⪹",prnsim:"⋨",prod:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",propto:"∝",prsim:"≾",prurel:"⊰",pscr:"𝓅",psi:"ψ",puncsp:" ",qfr:"𝔮",qint:"⨌",qopf:"𝕢",qprime:"⁗",qscr:"𝓆",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",quot:'"',rAarr:"⇛",rArr:"⇒",rAtail:"⤜",rBarr:"⤏",rHar:"⥤",race:"∽̱",racute:"ŕ",radic:"√",raemptyv:"⦳",rang:"⟩",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",rarr:"→",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",rarrtl:"↣",rarrw:"↝",ratail:"⤚",ratio:"∶",rationals:"ℚ",rbarr:"⤍",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",rcaron:"ř",rcedil:"ŗ",rceil:"⌉",rcub:"}",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",rect:"▭",reg:"®",rfisht:"⥽",rfloor:"⌋",rfr:"𝔯",rhard:"⇁",rharu:"⇀",rharul:"⥬",rho:"ρ",rhov:"ϱ",rightarrow:"→",rightarrowtail:"↣",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",rightthreetimes:"⋌",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"",rmoust:"⎱",rmoustache:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",ropf:"𝕣",roplus:"⨮",rotimes:"⨵",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",rsaquo:"›",rscr:"𝓇",rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",ruluhar:"⥨",rx:"℞",sacute:"ś",sbquo:"‚",sc:"≻",scE:"⪴",scap:"⪸",scaron:"š",sccue:"≽",sce:"⪰",scedil:"ş",scirc:"ŝ",scnE:"⪶",scnap:"⪺",scnsim:"⋩",scpolint:"⨓",scsim:"≿",scy:"с",sdot:"⋅",sdotb:"⊡",sdote:"⩦",seArr:"⇘",searhk:"⤥",searr:"↘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",sfr:"𝔰",sfrown:"⌢",sharp:"♯",shchcy:"щ",shcy:"ш",shortmid:"∣",shortparallel:"∥",shy:"",sigma:"σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",softcy:"ь",sol:"/",solb:"⧄",solbar:"⌿",sopf:"𝕤",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",squ:"□",square:"□",squarf:"▪",squf:"▪",srarr:"→",sscr:"𝓈",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",star:"☆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",sub:"⊂",subE:"⫅",subdot:"⪽",sube:"⊆",subedot:"⫃",submult:"⫁",subnE:"⫋",subne:"⊊",subplus:"⪿",subrarr:"⥹",subset:"⊂",subseteq:"⊆",subseteqq:"⫅",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succ:"≻",succapprox:"⪸",succcurlyeq:"≽",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",sum:"∑",sung:"♪",sup1:"¹",sup2:"²",sup3:"³",sup:"⊃",supE:"⫆",supdot:"⪾",supdsub:"⫘",supe:"⊇",supedot:"⫄",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supne:"⊋",supplus:"⫀",supset:"⊃",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swArr:"⇙",swarhk:"⤦",swarr:"↙",swarrow:"↙",swnwar:"⤪",szlig:"ß",target:"⌖",tau:"τ",tbrk:"⎴",tcaron:"ť",tcedil:"ţ",tcy:"т",tdot:"⃛",telrec:"⌕",tfr:"𝔱",there4:"∴",therefore:"∴",theta:"θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",thinsp:" ",thkap:"≈",thksim:"∼",thorn:"þ",tilde:"˜",times:"×",timesb:"⊠",timesbar:"⨱",timesd:"⨰",tint:"∭",toea:"⤨",top:"⊤",topbot:"⌶",topcir:"⫱",topf:"𝕥",topfork:"⫚",tosa:"⤩",tprime:"‴",trade:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",tscr:"𝓉",tscy:"ц",tshcy:"ћ",tstrok:"ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",uArr:"⇑",uHar:"⥣",uacute:"ú",uarr:"↑",ubrcy:"ў",ubreve:"ŭ",ucirc:"û",ucy:"у",udarr:"⇅",udblac:"ű",udhar:"⥮",ufisht:"⥾",ufr:"𝔲",ugrave:"ù",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",umacr:"ū",uml:"¨",uogon:"ų",uopf:"𝕦",uparrow:"↑",updownarrow:"↕",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",upsi:"υ",upsih:"ϒ",upsilon:"υ",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",uring:"ů",urtri:"◹",uscr:"𝓊",utdot:"⋰",utilde:"ũ",utri:"▵",utrif:"▴",uuarr:"⇈",uuml:"ü",uwangle:"⦧",vArr:"⇕",vBar:"⫨",vBarv:"⫩",vDash:"⊨",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",varr:"↕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",vcy:"в",vdash:"⊢",vee:"∨",veebar:"⊻",veeeq:"≚",vellip:"⋮",verbar:"|",vert:"|",vfr:"𝔳",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",vopf:"𝕧",vprop:"∝",vrtri:"⊳",vscr:"𝓋",vsubnE:"⫋︀",vsubne:"⊊︀",vsupnE:"⫌︀",vsupne:"⊋︀",vzigzag:"⦚",wcirc:"ŵ",wedbar:"⩟",wedge:"∧",wedgeq:"≙",weierp:"℘",wfr:"𝔴",wopf:"𝕨",wp:"℘",wr:"≀",wreath:"≀",wscr:"𝓌",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",xfr:"𝔵",xhArr:"⟺",xharr:"⟷",xi:"ξ",xlArr:"⟸",xlarr:"⟵",xmap:"⟼",xnis:"⋻",xodot:"⨀",xopf:"𝕩",xoplus:"⨁",xotime:"⨂",xrArr:"⟹",xrarr:"⟶",xscr:"𝓍",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",yacute:"ý",yacy:"я",ycirc:"ŷ",ycy:"ы",yen:"¥",yfr:"𝔶",yicy:"ї",yopf:"𝕪",yscr:"𝓎",yucy:"ю",yuml:"ÿ",zacute:"ź",zcaron:"ž",zcy:"з",zdot:"ż",zeetrf:"ℨ",zeta:"ζ",zfr:"𝔷",zhcy:"ж",zigrarr:"⇝",zopf:"𝕫",zscr:"𝓏",zwj:"",zwnj:""},qC={}.hasOwnProperty;function qD(a){return!!qC.call(qB,a)&&qB[a]}let qE={name:"characterReference",tokenize:function(a,b,c){let d,e,f=this,g=0;return function(b){return a.enter("characterReference"),a.enter("characterReferenceMarker"),a.consume(b),a.exit("characterReferenceMarker"),h};function h(b){return 35===b?(a.enter("characterReferenceMarkerNumeric"),a.consume(b),a.exit("characterReferenceMarkerNumeric"),i):(a.enter("characterReferenceValue"),d=31,e=p5,j(b))}function i(b){return 88===b||120===b?(a.enter("characterReferenceMarkerHexadecimal"),a.consume(b),a.exit("characterReferenceMarkerHexadecimal"),a.enter("characterReferenceValue"),d=6,e=p8,j):(a.enter("characterReferenceValue"),d=7,e=p7,j(b))}function j(h){if(59===h&&g){let d=a.exit("characterReferenceValue");return e!==p5||qD(f.sliceSerialize(d))?(a.enter("characterReferenceMarker"),a.consume(h),a.exit("characterReferenceMarker"),a.exit("characterReference"),b):c(h)}return e(h)&&g++<d?(a.consume(h),j):c(h)}}},qF={partial:!0,tokenize:function(a,b,c){let d=this;return function(b){return null===b?c(b):(a.enter("lineEnding"),a.consume(b),a.exit("lineEnding"),e)};function e(a){return d.parser.lazy[d.now().line]?c(a):b(a)}}},qG={concrete:!0,name:"codeFenced",tokenize:function(a,b,c){let d,e=this,f={partial:!0,tokenize:function(a,b,c){let f=0;return function(b){return a.enter("lineEnding"),a.consume(b),a.exit("lineEnding"),g};function g(b){return a.enter("codeFencedFence"),qc(b)?qe(a,i,"linePrefix",e.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(b):i(b)}function i(b){return b===d?(a.enter("codeFencedFenceSequence"),function b(e){return e===d?(f++,a.consume(e),b):f>=h?(a.exit("codeFencedFenceSequence"),qc(e)?qe(a,j,"whitespace")(e):j(e)):c(e)}(b)):c(b)}function j(d){return null===d||qa(d)?(a.exit("codeFencedFence"),b(d)):c(d)}}},g=0,h=0;return function(b){var f;let j;return f=b,g=(j=e.events[e.events.length-1])&&"linePrefix"===j[1].type?j[2].sliceSerialize(j[1],!0).length:0,d=f,a.enter("codeFenced"),a.enter("codeFencedFence"),a.enter("codeFencedFenceSequence"),function b(e){return e===d?(h++,a.consume(e),b):h<3?c(e):(a.exit("codeFencedFenceSequence"),qc(e)?qe(a,i,"whitespace")(e):i(e))}(f)};function i(f){return null===f||qa(f)?(a.exit("codeFencedFence"),e.interrupt?b(f):a.check(qF,k,p)(f)):(a.enter("codeFencedFenceInfo"),a.enter("chunkString",{contentType:"string"}),function b(e){return null===e||qa(e)?(a.exit("chunkString"),a.exit("codeFencedFenceInfo"),i(e)):qc(e)?(a.exit("chunkString"),a.exit("codeFencedFenceInfo"),qe(a,j,"whitespace")(e)):96===e&&e===d?c(e):(a.consume(e),b)}(f))}function j(b){return null===b||qa(b)?i(b):(a.enter("codeFencedFenceMeta"),a.enter("chunkString",{contentType:"string"}),function b(e){return null===e||qa(e)?(a.exit("chunkString"),a.exit("codeFencedFenceMeta"),i(e)):96===e&&e===d?c(e):(a.consume(e),b)}(b))}function k(b){return a.attempt(f,p,l)(b)}function l(b){return a.enter("lineEnding"),a.consume(b),a.exit("lineEnding"),n}function n(b){return g>0&&qc(b)?qe(a,o,"linePrefix",g+1)(b):o(b)}function o(b){return null===b||qa(b)?a.check(qF,k,p)(b):(a.enter("codeFlowValue"),function b(c){return null===c||qa(c)?(a.exit("codeFlowValue"),o(c)):(a.consume(c),b)}(b))}function p(c){return a.exit("codeFenced"),b(c)}}},qH={name:"codeIndented",tokenize:function(a,b,c){let d=this;return function(b){return a.enter("codeIndented"),qe(a,e,"linePrefix",5)(b)};function e(b){let e=d.events[d.events.length-1];return e&&"linePrefix"===e[1].type&&e[2].sliceSerialize(e[1],!0).length>=4?function b(c){return null===c?f(c):qa(c)?a.attempt(qI,b,f)(c):(a.enter("codeFlowValue"),function c(d){return null===d||qa(d)?(a.exit("codeFlowValue"),b(d)):(a.consume(d),c)}(c))}(b):c(b)}function f(c){return a.exit("codeIndented"),b(c)}}},qI={partial:!0,tokenize:function(a,b,c){let d=this;return e;function e(b){return d.parser.lazy[d.now().line]?c(b):qa(b)?(a.enter("lineEnding"),a.consume(b),a.exit("lineEnding"),e):qe(a,f,"linePrefix",5)(b)}function f(a){let f=d.events[d.events.length-1];return f&&"linePrefix"===f[1].type&&f[2].sliceSerialize(f[1],!0).length>=4?b(a):qa(a)?e(a):c(a)}}};function qJ(a){return null!==a&&(a<32||127===a)}function qK(a){return function(b){return null!==b&&b>-1&&a.test(String.fromCharCode(b))}}function qL(a,b,c,d,e,f,g,h,i){let j=i||1/0,k=0;return function(b){return 60===b?(a.enter(d),a.enter(e),a.enter(f),a.consume(b),a.exit(f),l):null===b||32===b||41===b||qJ(b)?c(b):(a.enter(d),a.enter(g),a.enter(h),a.enter("chunkString",{contentType:"string"}),p(b))};function l(c){return 62===c?(a.enter(f),a.consume(c),a.exit(f),a.exit(e),a.exit(d),b):(a.enter(h),a.enter("chunkString",{contentType:"string"}),n(c))}function n(b){return 62===b?(a.exit("chunkString"),a.exit(h),l(b)):null===b||60===b||null!==b&&b<-2?c(b):(a.consume(b),92===b?o:n)}function o(b){return 60===b||62===b||92===b?(a.consume(b),n):n(b)}function p(e){return!k&&(null===e||41===e||null!==e&&(e<0||32===e))?(a.exit("chunkString"),a.exit(h),a.exit(g),a.exit(d),b(e)):k<j&&40===e?(a.consume(e),k++,p):41===e?(a.consume(e),k--,p):null===e||32===e||40===e||qJ(e)?c(e):(a.consume(e),92===e?q:p)}function q(b){return 40===b||41===b||92===b?(a.consume(b),p):p(b)}}function qM(a){return null!==a&&a<-2}function qN(a){return function(b){return null!==b&&b>-1&&a.test(String.fromCharCode(b))}}function qO(a,b,c,d,e,f){let g,h=this,i=0;return function(b){return a.enter(d),a.enter(e),a.consume(b),a.exit(e),a.enter(f),j};function j(l){return i>999||null===l||91===l||93===l&&!g||94===l&&!i&&"_hiddenFootnoteSupport"in h.parser.constructs?c(l):93===l?(a.exit(f),a.enter(e),a.consume(l),a.exit(e),a.exit(d),b):qM(l)?(a.enter("lineEnding"),a.consume(l),a.exit("lineEnding"),j):(a.enter("chunkString",{contentType:"string"}),k(l))}function k(b){return null===b||91===b||93===b||qM(b)||i++>999?(a.exit("chunkString"),j(b)):(a.consume(b),g||(g=-2!==b&&-1!==b&&32!==b),92===b?l:k)}function l(b){return 91===b||92===b||93===b?(a.consume(b),i++,k):k(b)}}function qP(a){return null!==a&&a<-2}function qQ(a){return -2===a||-1===a||32===a}function qR(a){return function(b){return null!==b&&b>-1&&a.test(String.fromCharCode(b))}}function qS(a,b,c,d,e,f){let g;return function(b){return 34===b||39===b||40===b?(a.enter(d),a.enter(e),a.consume(b),a.exit(e),g=40===b?41:b,h):c(b)};function h(c){return c===g?(a.enter(e),a.consume(c),a.exit(e),a.exit(d),b):(a.enter(f),i(c))}function i(b){if(b===g)return a.exit(f),h(g);if(null===b)return c(b);if(qP(b)){var d,e;let c,f;return a.enter("lineEnding"),a.consume(b),a.exit("lineEnding"),d=i,e="linePrefix",c=1/0,f=0,function(b){return qQ(b)?(a.enter(e),function b(g){return qQ(g)&&f++<c?(a.consume(g),b):(a.exit(e),d(g))}(b)):d(b)}}return a.enter("chunkString",{contentType:"string"}),j(b)}function j(b){return b===g||null===b||qP(b)?(a.exit("chunkString"),i(b)):(a.consume(b),92===b?k:j)}function k(b){return b===g||92===b?(a.consume(b),j):j(b)}}function qT(a){return -2===a||-1===a||32===a}function qU(a){return function(b){return null!==b&&b>-1&&a.test(String.fromCharCode(b))}}function qV(a,b){let c;return function d(e){var f,g;if(null!==e&&e<-2)return a.enter("lineEnding"),a.consume(e),a.exit("lineEnding"),c=!0,d;if(qT(e)){let b,h;return(f=d,g=c?"linePrefix":"lineSuffix",b=1/0,h=0,function(c){return qT(c)?(a.enter(g),function c(d){return qT(d)&&h++<b?(a.consume(d),c):(a.exit(g),f(d))}(c)):f(c)})(e)}return b(e)}}function qW(a){return a.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}qK(/[A-Za-z]/),qK(/[\dA-Za-z]/),qK(/[#-'*+\--9=?A-Z^-~]/),qK(/\d/),qK(/[\dA-Fa-f]/),qK(/[!-/:-@[-`{-~]/),qK(/\p{P}|\p{S}/u),qK(/\s/),qN(/[A-Za-z]/),qN(/[\dA-Za-z]/),qN(/[#-'*+\--9=?A-Z^-~]/),qN(/\d/),qN(/[\dA-Fa-f]/),qN(/[!-/:-@[-`{-~]/),qN(/\p{P}|\p{S}/u),qN(/\s/),qR(/[A-Za-z]/),qR(/[\dA-Za-z]/),qR(/[#-'*+\--9=?A-Z^-~]/),qR(/\d/),qR(/[\dA-Fa-f]/),qR(/[!-/:-@[-`{-~]/),qR(/\p{P}|\p{S}/u),qR(/\s/),qU(/[A-Za-z]/),qU(/[\dA-Za-z]/),qU(/[#-'*+\--9=?A-Z^-~]/),qU(/\d/),qU(/[\dA-Fa-f]/),qU(/[!-/:-@[-`{-~]/),qU(/\p{P}|\p{S}/u),qU(/\s/);let qX={partial:!0,tokenize:function(a,b,c){return function(b){return qb(b)?qV(a,d)(b):c(b)};function d(b){return qS(a,e,c,"definitionTitle","definitionTitleMarker","definitionTitleString")(b)}function e(b){return qc(b)?qe(a,f,"whitespace")(b):f(b)}function f(a){return null===a||qa(a)?b(a):c(a)}}},qY=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],qZ=["pre","script","style","textarea"],q$={partial:!0,tokenize:function(a,b,c){return function(d){return a.enter("lineEnding"),a.consume(d),a.exit("lineEnding"),a.attempt(qf,b,c)}}},q_={partial:!0,tokenize:function(a,b,c){let d=this;return function(b){return qa(b)?(a.enter("lineEnding"),a.consume(b),a.exit("lineEnding"),e):c(b)};function e(a){return d.parser.lazy[d.now().line]?c(a):b(a)}}},q0={name:"labelEnd",resolveAll:function(a){let b=-1,c=[];for(;++b<a.length;){let d=a[b][1];if(c.push(a[b]),"labelImage"===d.type||"labelLink"===d.type||"labelEnd"===d.type){let a="labelImage"===d.type?4:2;d.type="data",b+=a}}return a.length!==c.length&&pW(a,0,a.length,c),a},resolveTo:function(a,b){let c,d,e,f,g=a.length,h=0;for(;g--;)if(c=a[g][1],d){if("link"===c.type||"labelLink"===c.type&&c._inactive)break;"enter"===a[g][0]&&"labelLink"===c.type&&(c._inactive=!0)}else if(e){if("enter"===a[g][0]&&("labelImage"===c.type||"labelLink"===c.type)&&!c._balanced&&(d=g,"labelLink"!==c.type)){h=2;break}}else"labelEnd"===c.type&&(e=g);let i={type:"labelLink"===a[d][1].type?"link":"image",start:{...a[d][1].start},end:{...a[a.length-1][1].end}},j={type:"label",start:{...a[d][1].start},end:{...a[e][1].end}},k={type:"labelText",start:{...a[d+h+2][1].end},end:{...a[e-2][1].start}};return f=pX(f=[["enter",i,b],["enter",j,b]],a.slice(d+1,d+h+3)),f=pX(f,[["enter",k,b]]),f=pX(f,qw(b.parser.constructs.insideSpan.null,a.slice(d+h+4,e-3),b)),f=pX(f,[["exit",k,b],a[e-2],a[e-1],["exit",j,b]]),f=pX(f,a.slice(e+1)),f=pX(f,[["exit",i,b]]),pW(a,d,a.length,f),a},tokenize:function(a,b,c){let d,e,f=this,g=f.events.length;for(;g--;)if(("labelImage"===f.events[g][1].type||"labelLink"===f.events[g][1].type)&&!f.events[g][1]._balanced){d=f.events[g][1];break}return function(b){return d?d._inactive?k(b):(e=f.parser.defined.includes(qW(f.sliceSerialize({start:d.end,end:f.now()}))),a.enter("labelEnd"),a.enter("labelMarker"),a.consume(b),a.exit("labelMarker"),a.exit("labelEnd"),h):c(b)};function h(b){return 40===b?a.attempt(q1,j,e?j:k)(b):91===b?a.attempt(q2,j,e?i:k)(b):e?j(b):k(b)}function i(b){return a.attempt(q3,j,k)(b)}function j(a){return b(a)}function k(a){return d._balanced=!0,c(a)}}},q1={tokenize:function(a,b,c){return function(b){return a.enter("resource"),a.enter("resourceMarker"),a.consume(b),a.exit("resourceMarker"),d};function d(b){return qb(b)?qV(a,e)(b):e(b)}function e(b){return 41===b?j(b):qL(a,f,g,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(b)}function f(b){return qb(b)?qV(a,h)(b):j(b)}function g(a){return c(a)}function h(b){return 34===b||39===b||40===b?qS(a,i,c,"resourceTitle","resourceTitleMarker","resourceTitleString")(b):j(b)}function i(b){return qb(b)?qV(a,j)(b):j(b)}function j(d){return 41===d?(a.enter("resourceMarker"),a.consume(d),a.exit("resourceMarker"),a.exit("resource"),b):c(d)}}},q2={tokenize:function(a,b,c){let d=this;return function(b){return qO.call(d,a,e,f,"reference","referenceMarker","referenceString")(b)};function e(a){return d.parser.defined.includes(qW(d.sliceSerialize(d.events[d.events.length-1][1]).slice(1,-1)))?b(a):c(a)}function f(a){return c(a)}}},q3={tokenize:function(a,b,c){return function(b){return a.enter("reference"),a.enter("referenceMarker"),a.consume(b),a.exit("referenceMarker"),d};function d(d){return 93===d?(a.enter("referenceMarker"),a.consume(d),a.exit("referenceMarker"),a.exit("reference"),b):c(d)}}},q4={name:"labelStartImage",resolveAll:q0.resolveAll,tokenize:function(a,b,c){let d=this;return function(b){return a.enter("labelImage"),a.enter("labelImageMarker"),a.consume(b),a.exit("labelImageMarker"),e};function e(b){return 91===b?(a.enter("labelMarker"),a.consume(b),a.exit("labelMarker"),a.exit("labelImage"),f):c(b)}function f(a){return 94===a&&"_hiddenFootnoteSupport"in d.parser.constructs?c(a):b(a)}}},q5={name:"labelStartLink",resolveAll:q0.resolveAll,tokenize:function(a,b,c){let d=this;return function(b){return a.enter("labelLink"),a.enter("labelMarker"),a.consume(b),a.exit("labelMarker"),a.exit("labelLink"),e};function e(a){return 94===a&&"_hiddenFootnoteSupport"in d.parser.constructs?c(a):b(a)}}},q6={name:"lineEnding",tokenize:function(a,b){return function(c){return a.enter("lineEnding"),a.consume(c),a.exit("lineEnding"),qe(a,b,"linePrefix")}}},q7={name:"thematicBreak",tokenize:function(a,b,c){let d,e=0;return function(f){var g;return a.enter("thematicBreak"),d=g=f,function f(g){return g===d?(a.enter("thematicBreakSequence"),function b(c){return c===d?(a.consume(c),e++,b):(a.exit("thematicBreakSequence"),qc(c)?qe(a,f,"whitespace")(c):f(c))}(g)):e>=3&&(null===g||qa(g))?(a.exit("thematicBreak"),b(g)):c(g)}(g)}}},q8={continuation:{tokenize:function(a,b,c){let d=this;return d.containerState._closeFlow=void 0,a.check(qf,function(c){return d.containerState.furtherBlankLines=d.containerState.furtherBlankLines||d.containerState.initialBlankLine,qe(a,b,"listItemIndent",d.containerState.size+1)(c)},function(c){return d.containerState.furtherBlankLines||!qc(c)?(d.containerState.furtherBlankLines=void 0,d.containerState.initialBlankLine=void 0,e(c)):(d.containerState.furtherBlankLines=void 0,d.containerState.initialBlankLine=void 0,a.attempt(ra,b,e)(c))});function e(e){return d.containerState._closeFlow=!0,d.interrupt=void 0,qe(a,a.attempt(q8,b,c),"linePrefix",d.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(e)}}},exit:function(a){a.exit(this.containerState.type)},name:"list",tokenize:function(a,b,c){let d=this,e=d.events[d.events.length-1],f=e&&"linePrefix"===e[1].type?e[2].sliceSerialize(e[1],!0).length:0,g=0;return function(b){let e=d.containerState.type||(42===b||43===b||45===b?"listUnordered":"listOrdered");if("listUnordered"===e?!d.containerState.marker||b===d.containerState.marker:p7(b)){if(d.containerState.type||(d.containerState.type=e,a.enter(e,{_container:!0})),"listUnordered"===e)return a.enter("listItemPrefix"),42===b||45===b?a.check(q7,c,h)(b):h(b);if(!d.interrupt||49===b)return a.enter("listItemPrefix"),a.enter("listItemValue"),function b(e){return p7(e)&&++g<10?(a.consume(e),b):(!d.interrupt||g<2)&&(d.containerState.marker?e===d.containerState.marker:41===e||46===e)?(a.exit("listItemValue"),h(e)):c(e)}(b)}return c(b)};function h(b){return a.enter("listItemMarker"),a.consume(b),a.exit("listItemMarker"),d.containerState.marker=d.containerState.marker||b,a.check(qf,d.interrupt?c:i,a.attempt(q9,k,j))}function i(a){return d.containerState.initialBlankLine=!0,f++,k(a)}function j(b){return qc(b)?(a.enter("listItemPrefixWhitespace"),a.consume(b),a.exit("listItemPrefixWhitespace"),k):c(b)}function k(c){return d.containerState.size=f+d.sliceSerialize(a.exit("listItemPrefix"),!0).length,b(c)}}},q9={partial:!0,tokenize:function(a,b,c){let d=this;return qe(a,function(a){let e=d.events[d.events.length-1];return!qc(a)&&e&&"listItemPrefixWhitespace"===e[1].type?b(a):c(a)},"listItemPrefixWhitespace",d.parser.constructs.disable.null.includes("codeIndented")?void 0:5)}},ra={partial:!0,tokenize:function(a,b,c){let d=this;return qe(a,function(a){let e=d.events[d.events.length-1];return e&&"listItemIndent"===e[1].type&&e[2].sliceSerialize(e[1],!0).length===d.containerState.size?b(a):c(a)},"listItemIndent",d.containerState.size+1)}},rb={name:"setextUnderline",resolveTo:function(a,b){let c,d,e,f=a.length;for(;f--;)if("enter"===a[f][0]){if("content"===a[f][1].type){c=f;break}"paragraph"===a[f][1].type&&(d=f)}else"content"===a[f][1].type&&a.splice(f,1),e||"definition"!==a[f][1].type||(e=f);let g={type:"setextHeading",start:{...a[c][1].start},end:{...a[a.length-1][1].end}};return a[d][1].type="setextHeadingText",e?(a.splice(d,0,["enter",g,b]),a.splice(e+1,0,["exit",a[c][1],b]),a[c][1].end={...a[e][1].end}):a[c][1]=g,a.push(["exit",g,b]),a},tokenize:function(a,b,c){let d,e=this;return function(b){var g;let h,i=e.events.length;for(;i--;)if("lineEnding"!==e.events[i][1].type&&"linePrefix"!==e.events[i][1].type&&"content"!==e.events[i][1].type){h="paragraph"===e.events[i][1].type;break}return!e.parser.lazy[e.now().line]&&(e.interrupt||h)?(a.enter("setextHeadingLine"),d=b,g=b,a.enter("setextHeadingLineSequence"),function b(c){return c===d?(a.consume(c),b):(a.exit("setextHeadingLineSequence"),qc(c)?qe(a,f,"lineSuffix")(c):f(c))}(g)):c(b)};function f(d){return null===d||qa(d)?(a.exit("setextHeadingLine"),b(d)):c(d)}}};a.s(["attentionMarkers",0,{null:[42,95]},"contentInitial",0,{91:{name:"definition",tokenize:function(a,b,c){let d,e=this;return function(b){var d;return a.enter("definition"),d=b,qO.call(e,a,f,c,"definitionLabel","definitionLabelMarker","definitionLabelString")(d)};function f(b){return(d=qW(e.sliceSerialize(e.events[e.events.length-1][1]).slice(1,-1)),58===b)?(a.enter("definitionMarker"),a.consume(b),a.exit("definitionMarker"),g):c(b)}function g(b){return qb(b)?qV(a,h)(b):h(b)}function h(b){return qL(a,i,c,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(b)}function i(b){return a.attempt(qX,j,j)(b)}function j(b){return qc(b)?qe(a,k,"whitespace")(b):k(b)}function k(f){return null===f||qa(f)?(a.exit("definition"),e.parser.defined.push(d),b(f)):c(f)}}}},"disable",0,{null:[]},"document",0,{42:q8,43:q8,45:q8,48:q8,49:q8,50:q8,51:q8,52:q8,53:q8,54:q8,55:q8,56:q8,57:q8,62:qz},"flow",0,{35:{name:"headingAtx",resolve:function(a,b){let c,d,e=a.length-2,f=3;return"whitespace"===a[3][1].type&&(f+=2),e-2>f&&"whitespace"===a[e][1].type&&(e-=2),"atxHeadingSequence"===a[e][1].type&&(f===e-1||e-4>f&&"whitespace"===a[e-2][1].type)&&(e-=f+1===e?2:4),e>f&&(c={type:"atxHeadingText",start:a[f][1].start,end:a[e][1].end},d={type:"chunkText",start:a[f][1].start,end:a[e][1].end,contentType:"text"},pW(a,f,e-f+1,[["enter",c,b],["enter",d,b],["exit",d,b],["exit",c,b]])),a},tokenize:function(a,b,c){let d=0;return function(e){var f;return a.enter("atxHeading"),f=e,a.enter("atxHeadingSequence"),function e(f){return 35===f&&d++<6?(a.consume(f),e):null===f||qb(f)?(a.exit("atxHeadingSequence"),function c(d){return 35===d?(a.enter("atxHeadingSequence"),function b(d){return 35===d?(a.consume(d),b):(a.exit("atxHeadingSequence"),c(d))}(d)):null===d||qa(d)?(a.exit("atxHeading"),b(d)):qc(d)?qe(a,c,"whitespace")(d):(a.enter("atxHeadingText"),function b(d){return null===d||35===d||qb(d)?(a.exit("atxHeadingText"),c(d)):(a.consume(d),b)}(d))}(f)):c(f)}(f)}}},42:q7,45:[rb,q7],60:{concrete:!0,name:"htmlFlow",resolveTo:function(a){let b=a.length;for(;b--&&("enter"!==a[b][0]||"htmlFlow"!==a[b][1].type););return b>1&&"linePrefix"===a[b-2][1].type&&(a[b][1].start=a[b-2][1].start,a[b+1][1].start=a[b-2][1].start,a.splice(b-2,2)),a},tokenize:function(a,b,c){let d,e,f,g,h,i=this;return function(b){var c;return c=b,a.enter("htmlFlow"),a.enter("htmlFlowData"),a.consume(c),j};function j(g){return 33===g?(a.consume(g),k):47===g?(a.consume(g),e=!0,o):63===g?(a.consume(g),d=3,i.interrupt?b:H):p4(g)?(a.consume(g),f=String.fromCharCode(g),p):c(g)}function k(e){return 45===e?(a.consume(e),d=2,l):91===e?(a.consume(e),d=5,g=0,n):p4(e)?(a.consume(e),d=4,i.interrupt?b:H):c(e)}function l(d){return 45===d?(a.consume(d),i.interrupt?b:H):c(d)}function n(d){let e="CDATA[";return d===e.charCodeAt(g++)?(a.consume(d),g===e.length)?i.interrupt?b:z:n:c(d)}function o(b){return p4(b)?(a.consume(b),f=String.fromCharCode(b),p):c(b)}function p(g){if(null===g||47===g||62===g||qb(g)){let h=47===g,j=f.toLowerCase();return!h&&!e&&qZ.includes(j)?(d=1,i.interrupt?b(g):z(g)):qY.includes(f.toLowerCase())?(d=6,h)?(a.consume(g),q):i.interrupt?b(g):z(g):(d=7,i.interrupt&&!i.parser.lazy[i.now().line]?c(g):e?function b(c){return qc(c)?(a.consume(c),b):x(c)}(g):r(g))}return 45===g||p5(g)?(a.consume(g),f+=String.fromCharCode(g),p):c(g)}function q(d){return 62===d?(a.consume(d),i.interrupt?b:z):c(d)}function r(b){return 47===b?(a.consume(b),x):58===b||95===b||p4(b)?(a.consume(b),s):qc(b)?(a.consume(b),r):x(b)}function s(b){return 45===b||46===b||58===b||95===b||p5(b)?(a.consume(b),s):t(b)}function t(b){return 61===b?(a.consume(b),u):qc(b)?(a.consume(b),t):r(b)}function u(b){return null===b||60===b||61===b||62===b||96===b?c(b):34===b||39===b?(a.consume(b),h=b,v):qc(b)?(a.consume(b),u):function b(c){return null===c||34===c||39===c||47===c||60===c||61===c||62===c||96===c||qb(c)?t(c):(a.consume(c),b)}(b)}function v(b){return b===h?(a.consume(b),h=null,w):null===b||qa(b)?c(b):(a.consume(b),v)}function w(a){return 47===a||62===a||qc(a)?r(a):c(a)}function x(b){return 62===b?(a.consume(b),y):c(b)}function y(b){return null===b||qa(b)?z(b):qc(b)?(a.consume(b),y):c(b)}function z(b){return 45===b&&2===d?(a.consume(b),D):60===b&&1===d?(a.consume(b),E):62===b&&4===d?(a.consume(b),I):63===b&&3===d?(a.consume(b),H):93===b&&5===d?(a.consume(b),G):qa(b)&&(6===d||7===d)?(a.exit("htmlFlowData"),a.check(q$,J,A)(b)):null===b||qa(b)?(a.exit("htmlFlowData"),A(b)):(a.consume(b),z)}function A(b){return a.check(q_,B,J)(b)}function B(b){return a.enter("lineEnding"),a.consume(b),a.exit("lineEnding"),C}function C(b){return null===b||qa(b)?A(b):(a.enter("htmlFlowData"),z(b))}function D(b){return 45===b?(a.consume(b),H):z(b)}function E(b){return 47===b?(a.consume(b),f="",F):z(b)}function F(b){if(62===b){let c=f.toLowerCase();return qZ.includes(c)?(a.consume(b),I):z(b)}return p4(b)&&f.length<8?(a.consume(b),f+=String.fromCharCode(b),F):z(b)}function G(b){return 93===b?(a.consume(b),H):z(b)}function H(b){return 62===b?(a.consume(b),I):45===b&&2===d?(a.consume(b),H):z(b)}function I(b){return null===b||qa(b)?(a.exit("htmlFlowData"),J(b)):(a.consume(b),I)}function J(c){return a.exit("htmlFlow"),b(c)}}},61:rb,95:q7,96:qG,126:qG},"flowInitial",0,{[-2]:qH,[-1]:qH,32:qH},"insideSpan",0,{null:[qx,qm]},"string",0,{38:qE,92:qA},"text",0,{[-5]:q6,[-4]:q6,[-3]:q6,33:q4,38:qE,42:qx,60:[{name:"autolink",tokenize:function(a,b,c){let d=0;return function(b){return a.enter("autolink"),a.enter("autolinkMarker"),a.consume(b),a.exit("autolinkMarker"),a.enter("autolinkProtocol"),e};function e(b){return p4(b)?(a.consume(b),f):64===b?c(b):h(b)}function f(b){return 43===b||45===b||46===b||p5(b)?(d=1,function b(c){return 58===c?(a.consume(c),d=0,g):(43===c||45===c||46===c||p5(c))&&d++<32?(a.consume(c),b):(d=0,h(c))}(b)):h(b)}function g(d){return 62===d?(a.exit("autolinkProtocol"),a.enter("autolinkMarker"),a.consume(d),a.exit("autolinkMarker"),a.exit("autolink"),b):null===d||32===d||60===d||null!==d&&(d<32||127===d)?c(d):(a.consume(d),g)}function h(b){return 64===b?(a.consume(b),i):p6(b)?(a.consume(b),h):c(b)}function i(e){return p5(e)?function e(f){return 46===f?(a.consume(f),d=0,i):62===f?(a.exit("autolinkProtocol").type="autolinkEmail",a.enter("autolinkMarker"),a.consume(f),a.exit("autolinkMarker"),a.exit("autolink"),b):function b(f){if((45===f||p5(f))&&d++<63){let c=45===f?b:e;return a.consume(f),c}return c(f)}(f)}(e):c(e)}}},{name:"htmlText",tokenize:function(a,b,c){let d,e,f,g=this;return function(b){return a.enter("htmlText"),a.enter("htmlTextData"),a.consume(b),h};function h(b){return 33===b?(a.consume(b),i):47===b?(a.consume(b),v):63===b?(a.consume(b),t):p4(b)?(a.consume(b),x):c(b)}function i(b){return 45===b?(a.consume(b),j):91===b?(a.consume(b),e=0,o):p4(b)?(a.consume(b),s):c(b)}function j(b){return 45===b?(a.consume(b),n):c(b)}function k(b){return null===b?c(b):45===b?(a.consume(b),l):qa(b)?(f=k,F(b)):(a.consume(b),k)}function l(b){return 45===b?(a.consume(b),n):k(b)}function n(a){return 62===a?E(a):45===a?l(a):k(a)}function o(b){let d="CDATA[";return b===d.charCodeAt(e++)?(a.consume(b),e===d.length?p:o):c(b)}function p(b){return null===b?c(b):93===b?(a.consume(b),q):qa(b)?(f=p,F(b)):(a.consume(b),p)}function q(b){return 93===b?(a.consume(b),r):p(b)}function r(b){return 62===b?E(b):93===b?(a.consume(b),r):p(b)}function s(b){return null===b||62===b?E(b):qa(b)?(f=s,F(b)):(a.consume(b),s)}function t(b){return null===b?c(b):63===b?(a.consume(b),u):qa(b)?(f=t,F(b)):(a.consume(b),t)}function u(a){return 62===a?E(a):t(a)}function v(b){return p4(b)?(a.consume(b),w):c(b)}function w(b){return 45===b||p5(b)?(a.consume(b),w):function b(c){return qa(c)?(f=b,F(c)):qc(c)?(a.consume(c),b):E(c)}(b)}function x(b){return 45===b||p5(b)?(a.consume(b),x):47===b||62===b||qb(b)?y(b):c(b)}function y(b){return 47===b?(a.consume(b),E):58===b||95===b||p4(b)?(a.consume(b),z):qa(b)?(f=y,F(b)):qc(b)?(a.consume(b),y):E(b)}function z(b){return 45===b||46===b||58===b||95===b||p5(b)?(a.consume(b),z):function b(c){return 61===c?(a.consume(c),A):qa(c)?(f=b,F(c)):qc(c)?(a.consume(c),b):y(c)}(b)}function A(b){return null===b||60===b||61===b||62===b||96===b?c(b):34===b||39===b?(a.consume(b),d=b,B):qa(b)?(f=A,F(b)):qc(b)?(a.consume(b),A):(a.consume(b),C)}function B(b){return b===d?(a.consume(b),d=void 0,D):null===b?c(b):qa(b)?(f=B,F(b)):(a.consume(b),B)}function C(b){return null===b||34===b||39===b||60===b||61===b||96===b?c(b):47===b||62===b||qb(b)?y(b):(a.consume(b),C)}function D(a){return 47===a||62===a||qb(a)?y(a):c(a)}function E(d){return 62===d?(a.consume(d),a.exit("htmlTextData"),a.exit("htmlText"),b):c(d)}function F(b){return a.exit("htmlTextData"),a.enter("lineEnding"),a.consume(b),a.exit("lineEnding"),G}function G(b){return qc(b)?qe(a,H,"linePrefix",g.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(b):H(b)}function H(b){return a.enter("htmlTextData"),f(b)}}}],91:q5,92:[{name:"hardBreakEscape",tokenize:function(a,b,c){return function(b){return a.enter("hardBreakEscape"),a.consume(b),d};function d(d){return qa(d)?(a.exit("hardBreakEscape"),b(d)):c(d)}}},qA],93:q0,95:qx,96:{name:"codeText",previous:function(a){return 96!==a||"characterEscape"===this.events[this.events.length-1][1].type},resolve:function(a){let b,c,d=a.length-4,e=3;if(("lineEnding"===a[3][1].type||"space"===a[e][1].type)&&("lineEnding"===a[d][1].type||"space"===a[d][1].type)){for(b=e;++b<d;)if("codeTextData"===a[b][1].type){a[e][1].type="codeTextPadding",a[d][1].type="codeTextPadding",e+=2,d-=2;break}}for(b=e-1,d++;++b<=d;)void 0===c?b!==d&&"lineEnding"!==a[b][1].type&&(c=b):(b===d||"lineEnding"===a[b][1].type)&&(a[c][1].type="codeTextData",b!==c+2&&(a[c][1].end=a[b-1][1].end,a.splice(c+2,b-c-2),d-=b-c-2,b=c+2),c=void 0);return a},tokenize:function(a,b,c){let d,e,f=0;return function(b){return a.enter("codeText"),a.enter("codeTextSequence"),function b(c){return 96===c?(a.consume(c),f++,b):(a.exit("codeTextSequence"),g(c))}(b)};function g(i){return null===i?c(i):32===i?(a.enter("space"),a.consume(i),a.exit("space"),g):96===i?(e=a.enter("codeTextSequence"),d=0,function c(g){return 96===g?(a.consume(g),d++,c):d===f?(a.exit("codeTextSequence"),a.exit("codeText"),b(g)):(e.type="codeTextData",h(g))}(i)):qa(i)?(a.enter("lineEnding"),a.consume(i),a.exit("lineEnding"),g):(a.enter("codeTextData"),h(i))}function h(b){return null===b||32===b||96===b||qa(b)?(a.exit("codeTextData"),g(b)):(a.consume(b),h)}}}}],48293);var rc=a.i(48293);let rd=/[\0\t\n\r]/g;function re(a,b){let c=Number.parseInt(a,b);return c<9||11===c||c>13&&c<32||c>126&&c<160||c>55295&&c<57344||c>64975&&c<65008||(65535&c)==65535||(65535&c)==65534||c>1114111?"�":String.fromCodePoint(c)}let rf=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function rg(a,b,c){if(b)return b;if(35===c.charCodeAt(0)){let a=c.charCodeAt(1),b=120===a||88===a;return re(c.slice(b?2:1),b?16:10)}return qD(c)||a}let rh={}.hasOwnProperty;function ri(a){return{line:a.line,column:a.column,offset:a.offset}}function rj(a,b){if(a)throw Error("Cannot close `"+a.type+"` ("+pA({start:a.start,end:a.end})+"): a different token (`"+b.type+"`, "+pA({start:b.start,end:b.end})+") is open");throw Error("Cannot close document, a token (`"+b.type+"`, "+pA({start:b.start,end:b.end})+") is still open")}function rk(a){let b=this;b.parser=function(c){var d,e;let f,g,h,i;return"string"!=typeof(d={...b.data("settings"),...a,extensions:b.data("micromarkExtensions")||[],mdastExtensions:b.data("fromMarkdownExtensions")||[]})&&(e=d,d=void 0),(function(a){let b={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:d(s),autolinkProtocol:j,autolinkEmail:j,atxHeading:d(p),blockQuote:d(function(){return{type:"blockquote",children:[]}}),characterEscape:j,characterReference:j,codeFenced:d(o),codeFencedFenceInfo:e,codeFencedFenceMeta:e,codeIndented:d(o,e),codeText:d(function(){return{type:"inlineCode",value:""}},e),codeTextData:j,data:j,codeFlowValue:j,definition:d(function(){return{type:"definition",identifier:"",label:null,title:null,url:""}}),definitionDestinationString:e,definitionLabelString:e,definitionTitleString:e,emphasis:d(function(){return{type:"emphasis",children:[]}}),hardBreakEscape:d(q),hardBreakTrailing:d(q),htmlFlow:d(r,e),htmlFlowData:j,htmlText:d(r,e),htmlTextData:j,image:d(function(){return{type:"image",title:null,url:"",alt:null}}),label:e,link:d(s),listItem:d(function(a){return{type:"listItem",spread:a._spread,checked:null,children:[]}}),listItemValue:function(a){this.data.expectingFirstListItemValue&&(this.stack[this.stack.length-2].start=Number.parseInt(this.sliceSerialize(a),10),this.data.expectingFirstListItemValue=void 0)},listOrdered:d(t,function(){this.data.expectingFirstListItemValue=!0}),listUnordered:d(t),paragraph:d(function(){return{type:"paragraph",children:[]}}),reference:function(){this.data.referenceType="collapsed"},referenceString:e,resourceDestinationString:e,resourceTitleString:e,setextHeading:d(p),strong:d(function(){return{type:"strong",children:[]}}),thematicBreak:d(function(){return{type:"thematicBreak"}})},exit:{atxHeading:g(),atxHeadingSequence:function(a){let b=this.stack[this.stack.length-1];b.depth||(b.depth=this.sliceSerialize(a).length)},autolink:g(),autolinkEmail:function(a){k.call(this,a),this.stack[this.stack.length-1].url="mailto:"+this.sliceSerialize(a)},autolinkProtocol:function(a){k.call(this,a),this.stack[this.stack.length-1].url=this.sliceSerialize(a)},blockQuote:g(),characterEscapeValue:k,characterReferenceMarkerHexadecimal:n,characterReferenceMarkerNumeric:n,characterReferenceValue:function(a){let b,c=this.sliceSerialize(a),d=this.data.characterReferenceType;d?(b=re(c,"characterReferenceMarkerNumeric"===d?10:16),this.data.characterReferenceType=void 0):b=qD(c);let e=this.stack[this.stack.length-1];e.value+=b},characterReference:function(a){this.stack.pop().position.end=ri(a.end)},codeFenced:g(function(){let a=this.resume();this.stack[this.stack.length-1].value=a.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}),codeFencedFence:function(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)},codeFencedFenceInfo:function(){let a=this.resume();this.stack[this.stack.length-1].lang=a},codeFencedFenceMeta:function(){let a=this.resume();this.stack[this.stack.length-1].meta=a},codeFlowValue:k,codeIndented:g(function(){let a=this.resume();this.stack[this.stack.length-1].value=a.replace(/(\r?\n|\r)$/g,"")}),codeText:g(function(){let a=this.resume();this.stack[this.stack.length-1].value=a}),codeTextData:k,data:k,definition:g(),definitionDestinationString:function(){let a=this.resume();this.stack[this.stack.length-1].url=a},definitionLabelString:function(a){let b=this.resume(),c=this.stack[this.stack.length-1];c.label=b,c.identifier=qW(this.sliceSerialize(a)).toLowerCase()},definitionTitleString:function(){let a=this.resume();this.stack[this.stack.length-1].title=a},emphasis:g(),hardBreakEscape:g(l),hardBreakTrailing:g(l),htmlFlow:g(function(){let a=this.resume();this.stack[this.stack.length-1].value=a}),htmlFlowData:k,htmlText:g(function(){let a=this.resume();this.stack[this.stack.length-1].value=a}),htmlTextData:k,image:g(function(){let a=this.stack[this.stack.length-1];if(this.data.inReference){let b=this.data.referenceType||"shortcut";a.type+="Reference",a.referenceType=b,delete a.url,delete a.title}else delete a.identifier,delete a.label;this.data.referenceType=void 0}),label:function(){let a=this.stack[this.stack.length-1],b=this.resume(),c=this.stack[this.stack.length-1];this.data.inReference=!0,"link"===c.type?c.children=a.children:c.alt=b},labelText:function(a){let b=this.sliceSerialize(a),c=this.stack[this.stack.length-2];c.label=b.replace(rf,rg),c.identifier=qW(b).toLowerCase()},lineEnding:function(a){let c=this.stack[this.stack.length-1];if(this.data.atHardBreak){c.children[c.children.length-1].position.end=ri(a.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&b.canContainEols.includes(c.type)&&(j.call(this,a),k.call(this,a))},link:g(function(){let a=this.stack[this.stack.length-1];if(this.data.inReference){let b=this.data.referenceType||"shortcut";a.type+="Reference",a.referenceType=b,delete a.url,delete a.title}else delete a.identifier,delete a.label;this.data.referenceType=void 0}),listItem:g(),listOrdered:g(),listUnordered:g(),paragraph:g(),referenceString:function(a){let b=this.resume(),c=this.stack[this.stack.length-1];c.label=b,c.identifier=qW(this.sliceSerialize(a)).toLowerCase(),this.data.referenceType="full"},resourceDestinationString:function(){let a=this.resume();this.stack[this.stack.length-1].url=a},resourceTitleString:function(){let a=this.resume();this.stack[this.stack.length-1].title=a},resource:function(){this.data.inReference=void 0},setextHeading:g(function(){this.data.setextHeadingSlurpLineEnding=void 0}),setextHeadingLineSequence:function(a){this.stack[this.stack.length-1].depth=61===this.sliceSerialize(a).codePointAt(0)?1:2},setextHeadingText:function(){this.data.setextHeadingSlurpLineEnding=!0},strong:g(),thematicBreak:g()}};!function a(b,c){let d=-1;for(;++d<c.length;){let e=c[d];Array.isArray(e)?a(b,e):function(a,b){let c;for(c in b)if(rh.call(b,c))switch(c){case"canContainEols":{let d=b[c];d&&a[c].push(...d);break}case"transforms":{let d=b[c];d&&a[c].push(...d);break}case"enter":case"exit":{let d=b[c];d&&Object.assign(a[c],d)}}}(b,e)}}(b,(a||{}).mdastExtensions||[]);let c={};return function(a){let d={type:"root",children:[]},g={stack:[d],tokenStack:[],config:b,enter:f,exit:h,buffer:e,resume:i,data:c},j=[],k=-1;for(;++k<a.length;)("listOrdered"===a[k][1].type||"listUnordered"===a[k][1].type)&&("enter"===a[k][0]?j.push(k):k=function(a,b,c){let d,e,f,g,h=b-1,i=-1,j=!1;for(;++h<=c;){let b=a[h];switch(b[1].type){case"listUnordered":case"listOrdered":case"blockQuote":"enter"===b[0]?i++:i--,g=void 0;break;case"lineEndingBlank":"enter"===b[0]&&(!d||g||i||f||(f=h),g=void 0);break;case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:g=void 0}if(!i&&"enter"===b[0]&&"listItemPrefix"===b[1].type||-1===i&&"exit"===b[0]&&("listUnordered"===b[1].type||"listOrdered"===b[1].type)){if(d){let g=h;for(e=void 0;g--;){let b=a[g];if("lineEnding"===b[1].type||"lineEndingBlank"===b[1].type){if("exit"===b[0])continue;e&&(a[e][1].type="lineEndingBlank",j=!0),b[1].type="lineEnding",e=g}else if("linePrefix"===b[1].type||"blockQuotePrefix"===b[1].type||"blockQuotePrefixWhitespace"===b[1].type||"blockQuoteMarker"===b[1].type||"listItemIndent"===b[1].type);else break}f&&(!e||f<e)&&(d._spread=!0),d.end=Object.assign({},e?a[e][1].start:b[1].end),a.splice(e||h,0,["exit",d,b[2]]),h++,c++}if("listItemPrefix"===b[1].type){let e={type:"listItem",_spread:!1,start:Object.assign({},b[1].start),end:void 0};d=e,a.splice(h,0,["enter",e,b[2]]),h++,c++,f=void 0,g=!0}}}return a[b][1]._spread=j,c}(a,j.pop(),k));for(k=-1;++k<a.length;){let c=b[a[k][0]];rh.call(c,a[k][1].type)&&c[a[k][1].type].call(Object.assign({sliceSerialize:a[k][2].sliceSerialize},g),a[k][1])}if(g.tokenStack.length>0){let a=g.tokenStack[g.tokenStack.length-1];(a[1]||rj).call(g,void 0,a[0])}for(d.position={start:ri(a.length>0?a[0][1].start:{line:1,column:1,offset:0}),end:ri(a.length>0?a[a.length-2][1].end:{line:1,column:1,offset:0})},k=-1;++k<b.transforms.length;)d=b.transforms[k](d)||d;return d};function d(a,b){return function(c){f.call(this,a(c),c),b&&b.call(this,c)}}function e(){this.stack.push({type:"fragment",children:[]})}function f(a,b,c){this.stack[this.stack.length-1].children.push(a),this.stack.push(a),this.tokenStack.push([b,c||void 0]),a.position={start:ri(b.start),end:void 0}}function g(a){return function(b){a&&a.call(this,b),h.call(this,b)}}function h(a,b){let c=this.stack.pop(),d=this.tokenStack.pop();if(d)d[0].type!==a.type&&(b?b.call(this,a,d[0]):(d[1]||rj).call(this,a,d[0]));else throw Error("Cannot close `"+a.type+"` ("+pA({start:a.start,end:a.end})+"): it’s not open");c.position.end=ri(a.end)}function i(){var a;return a=this.stack.pop(),pU(a,"boolean"!=typeof pT.includeImageAlt||pT.includeImageAlt,"boolean"!=typeof pT.includeHtml||pT.includeHtml)}function j(a){let b=this.stack[this.stack.length-1].children,c=b[b.length-1];c&&"text"===c.type||((c={type:"text",value:""}).position={start:ri(a.start),end:void 0},b.push(c)),this.stack.push(c)}function k(a){let b=this.stack.pop();b.value+=this.sliceSerialize(a),b.position.end=ri(a.end)}function l(){this.data.atHardBreak=!0}function n(a){this.data.characterReferenceType=a.type}function o(){return{type:"code",lang:null,meta:null,value:""}}function p(){return{type:"heading",depth:0,children:[]}}function q(){return{type:"break"}}function r(){return{type:"html",value:""}}function s(){return{type:"link",title:null,url:"",children:[]}}function t(a){return{type:"list",ordered:"listOrdered"===a.type,start:null,spread:a._spread,children:[]}}})(e)(function(a){for(;!qi(a););return a}((function(a){let b={constructs:function(a){let b={},c=-1;for(;++c<a.length;)!function(a,b){let c;for(c in b){let d,e=(pY.call(a,c)?a[c]:void 0)||(a[c]={}),f=b[c];if(f)for(d in f){pY.call(e,d)||(e[d]=[]);let a=f[d];!function(a,b){let c=-1,d=[];for(;++c<b.length;)("after"===b[c].add?a:d).push(b[c]);pW(a,0,0,d)}(e[d],Array.isArray(a)?a:a?[a]:[])}}}(b,a[c]);return b}([rc,...(a||{}).extensions||[]]),content:c(p1),defined:[],document:c(p2),flow:c(ql),lazy:{},string:c(qn),text:c(qo)};return b;function c(a){return function(c){return function(a,b,c){let d={_bufferIndex:-1,_index:0,line:c&&c.line||1,column:c&&c.column||1,offset:c&&c.offset||0},e={},f=[],g=[],h=[],i={attempt:p(function(a,b){q(a,b.from)}),check:p(o),consume:function(a){pZ(a)?(d.line++,d.column=1,d.offset+=-3===a?2:1,r()):-1!==a&&(d.column++,d.offset++),d._bufferIndex<0?d._index++:(d._bufferIndex++,d._bufferIndex===g[d._index].length&&(d._bufferIndex=-1,d._index++)),j.previous=a},enter:function(a,b){let c=b||{};return c.type=a,c.start=n(),j.events.push(["enter",c,j]),h.push(c),c},exit:function(a){let b=h.pop();return b.end=n(),j.events.push(["exit",b,j]),b},interrupt:p(o,{interrupt:!0})},j={code:null,containerState:{},defineSkip:function(a){e[a.line]=a.column,r()},events:[],now:n,parser:a,previous:null,sliceSerialize:function(a,b){return function(a,b){let c,d=-1,e=[];for(;++d<a.length;){let f,g=a[d];if("string"==typeof g)f=g;else switch(g){case -5:f="\r";break;case -4:f="\n";break;case -3:f="\r\n";break;case -2:f=b?" ":" ";break;case -1:if(!b&&c)continue;f=" ";break;default:f=String.fromCharCode(g)}c=-2===g,e.push(f)}return e.join("")}(l(a),b)},sliceStream:l,write:function(a){return(g=pX(g,a),function(){let a;for(;d._index<g.length;){let c=g[d._index];if("string"==typeof c)for(a=d._index,d._bufferIndex<0&&(d._bufferIndex=0);d._index===a&&d._bufferIndex<c.length;){var b;b=c.charCodeAt(d._bufferIndex),k=k(b)}else k=k(c)}}(),null!==g[g.length-1])?[]:(q(b,0),j.events=qw(f,j.events,j),j.events)}},k=b.tokenize.call(j,i);return b.resolveAll&&f.push(b),j;function l(a){return function(a,b){let c,d=b.start._index,e=b.start._bufferIndex,f=b.end._index,g=b.end._bufferIndex;if(d===f)c=[a[d].slice(e,g)];else{if(c=a.slice(d,f),e>-1){let a=c[0];"string"==typeof a?c[0]=a.slice(e):c.shift()}g>0&&c.push(a[f].slice(0,g))}return c}(g,a)}function n(){let{_bufferIndex:a,_index:b,line:c,column:e,offset:f}=d;return{_bufferIndex:a,_index:b,line:c,column:e,offset:f}}function o(a,b){b.restore()}function p(a,b){return function(c,e,f){var g;let k,l,o,p;return Array.isArray(c)?q(c):"tokenize"in c?q([c]):(g=c,function(a){let b=null!==a&&g[a],c=null!==a&&g.null;return q([...Array.isArray(b)?b:b?[b]:[],...Array.isArray(c)?c:c?[c]:[]])(a)});function q(a){return(k=a,l=0,0===a.length)?f:s(a[l])}function s(a){return function(c){let e,f,g,k,l;return(e=n(),f=j.previous,g=j.currentConstruct,k=j.events.length,l=Array.from(h),p={from:k,restore:function(){d=e,j.previous=f,j.currentConstruct=g,j.events.length=k,h=l,r()}},o=a,a.partial||(j.currentConstruct=a),a.name&&j.parser.constructs.disable.null.includes(a.name))?u(c):a.tokenize.call(b?Object.assign(Object.create(j),b):j,i,t,u)(c)}}function t(b){return a(o,p),e}function u(a){return(p.restore(),++l<k.length)?s(k[l]):f}}}function q(a,b){a.resolveAll&&!f.includes(a)&&f.push(a),a.resolve&&pW(j.events,b,j.events.length-b,a.resolve(j.events.slice(b),j)),a.resolveTo&&(j.events=a.resolveTo(j.events,j))}function r(){d.line in e&&d.column<2&&(d.column=e[d.line],d.offset+=e[d.line]-1)}}(b,a,c)}}})(e).document().write((g=1,h="",i=!0,function(a,b,c){let d,e,j,k,l,n=[];for(a=h+("string"==typeof a?a.toString():new TextDecoder(b||void 0).decode(a)),j=0,h="",i&&(65279===a.charCodeAt(0)&&j++,i=void 0);j<a.length;){if(rd.lastIndex=j,k=(d=rd.exec(a))&&void 0!==d.index?d.index:a.length,l=a.charCodeAt(k),!d){h=a.slice(j);break}if(10===l&&j===k&&f)n.push(-3),f=void 0;else switch(f&&(n.push(-5),f=void 0),j<k&&(n.push(a.slice(j,k)),g+=k-j),l){case 0:n.push(65533),g++;break;case 9:for(e=4*Math.ceil(g/4),n.push(-2);g++<e;)n.push(-1);break;case 10:n.push(-4),g=1;break;default:f=!0,g=1}j=k+1}return c&&(f&&n.push(-5),h&&n.push(h),n.push(null)),n})(c,d,!0))))}}let rl="object"==typeof self?self:globalThis,rm=a=>{var b;let c,d;return(b=new Map,c=(a,c)=>(b.set(c,a),a),d=e=>{if(b.has(e))return b.get(e);let[f,g]=a[e];switch(f){case 0:case -1:return c(g,e);case 1:{let a=c([],e);for(let b of g)a.push(d(b));return a}case 2:{let a=c({},e);for(let[b,c]of g)a[d(b)]=d(c);return a}case 3:return c(new Date(g),e);case 4:{let{source:a,flags:b}=g;return c(new RegExp(a,b),e)}case 5:{let a=c(new Map,e);for(let[b,c]of g)a.set(d(b),d(c));return a}case 6:{let a=c(new Set,e);for(let b of g)a.add(d(b));return a}case 7:{let{name:a,message:b}=g;return c(new rl[a](b),e)}case 8:return c(BigInt(g),e);case"BigInt":return c(Object(BigInt(g)),e);case"ArrayBuffer":return c(new Uint8Array(g).buffer,g);case"DataView":{let{buffer:a}=new Uint8Array(g);return c(new DataView(a),g)}}return c(new rl[f](g),e)})(0)},{toString:rn}={},{keys:ro}=Object,rp=a=>{let b=typeof a;if("object"!==b||!a)return[0,b];let c=rn.call(a).slice(8,-1);switch(c){case"Array":return[1,""];case"Object":return[2,""];case"Date":return[3,""];case"RegExp":return[4,""];case"Map":return[5,""];case"Set":return[6,""];case"DataView":return[1,c]}return c.includes("Array")?[1,c]:c.includes("Error")?[7,c]:[2,c]},rq=([a,b])=>0===a&&("function"===b||"symbol"===b),rr=(a,{json:b,lossy:c}={})=>{var d,e,f;let g,h,i=[];return(d=!(b||c),e=!!b,f=new Map,g=(a,b)=>{let c=i.push(a)-1;return f.set(b,c),c},h=a=>{if(f.has(a))return f.get(a);let[b,c]=rp(a);switch(b){case 0:{let e=a;switch(c){case"bigint":b=8,e=a.toString();break;case"function":case"symbol":if(d)throw TypeError("unable to serialize "+c);e=null;break;case"undefined":return g([-1],a)}return g([b,e],a)}case 1:{if(c){let b=a;return"DataView"===c?b=new Uint8Array(a.buffer):"ArrayBuffer"===c&&(b=new Uint8Array(a)),g([c,[...b]],a)}let d=[],e=g([b,d],a);for(let b of a)d.push(h(b));return e}case 2:{if(c)switch(c){case"BigInt":return g([c,a.toString()],a);case"Boolean":case"Number":case"String":return g([c,a.valueOf()],a)}if(e&&"toJSON"in a)return h(a.toJSON());let f=[],i=g([b,f],a);for(let b of ro(a))(d||!rq(rp(a[b])))&&f.push([h(b),h(a[b])]);return i}case 3:return g([b,a.toISOString()],a);case 4:{let{source:c,flags:d}=a;return g([b,{source:c,flags:d}],a)}case 5:{let c=[],e=g([b,c],a);for(let[b,e]of a)(d||!(rq(rp(b))||rq(rp(e))))&&c.push([h(b),h(e)]);return e}case 6:{let c=[],e=g([b,c],a);for(let b of a)(d||!rq(rp(b)))&&c.push(h(b));return e}}let{message:i}=a;return g([b,{name:c,message:i}],a)})(a),i},rs="function"==typeof structuredClone?(a,b)=>b&&("json"in b||"lossy"in b)?rm(rr(a,b)):structuredClone(a):(a,b)=>rm(rr(a,b));ru(/[A-Za-z]/);let rt=ru(/[\dA-Za-z]/);function ru(a){return function(b){return null!==b&&b>-1&&a.test(String.fromCharCode(b))}}function rv(a){let b=[],c=-1,d=0,e=0;for(;++c<a.length;){let f=a.charCodeAt(c),g="";if(37===f&&rt(a.charCodeAt(c+1))&&rt(a.charCodeAt(c+2)))e=2;else if(f<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(f))||(g=String.fromCharCode(f));else if(f>55295&&f<57344){let b=a.charCodeAt(c+1);f<56320&&b>56319&&b<57344?(g=String.fromCharCode(f,b),e=1):g="�"}else g=String.fromCharCode(f);g&&(b.push(a.slice(d,c),encodeURIComponent(g)),d=c+e+1,g=""),e&&(c+=e,e=0)}return b.join("")+a.slice(d)}function rw(a,b){let c=[{type:"text",value:"↩"}];return b>1&&c.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(b)}]}),c}function rx(a,b){return"Back to reference "+(a+1)+(b>1?"-"+b:"")}ru(/[#-'*+\--9=?A-Z^-~]/),ru(/\d/),ru(/[\dA-Fa-f]/),ru(/[!-/:-@[-`{-~]/),ru(/\p{P}|\p{S}/u),ru(/\s/);let ry=function(a){var b,c;if(null==a)return rA;if("function"==typeof a)return rz(a);if("object"==typeof a){return Array.isArray(a)?function(a){let b=[],c=-1;for(;++c<a.length;)b[c]=ry(a[c]);return rz(function(...a){let c=-1;for(;++c<b.length;)if(b[c].apply(this,a))return!0;return!1})}(a):(b=a,rz(function(a){let c;for(c in b)if(a[c]!==b[c])return!1;return!0}))}if("string"==typeof a){return c=a,rz(function(a){return a&&a.type===c})}throw Error("Expected function, string, or object as test")};function rz(a){return function(b,c,d){return!!(function(a){return null!==a&&"object"==typeof a&&"type"in a}(b)&&a.call(this,b,"number"==typeof c?c:void 0,d||void 0))}}function rA(){return!0}let rB=[];function rC(a,b,c,d){var e,f,g;let h,i,j,k,l,n;"function"==typeof b&&"function"!=typeof c?(i=void 0,j=b,h=c):(i=b,j=c,h=d),e=i,f=function(a,b){let c=b[b.length-1],d=c?c.children.indexOf(a):void 0;return j(a,d,c)},g=h,"function"==typeof e&&"function"!=typeof f?(g=f,f=e):k=e,l=ry(k),n=g?-1:1,(function a(b,c,d){let h=b&&"object"==typeof b?b:{};if("string"==typeof h.type){let a="string"==typeof h.tagName?h.tagName:"string"==typeof h.name?h.name:void 0;Object.defineProperty(i,"name",{value:"node (\x1b[33m"+b.type+(a?"<"+a+">":"")+"\x1b[39m)"})}return i;function i(){var h;let i,j,k,o=rB;if((!e||l(b,c,d[d.length-1]||void 0))&&!1===(o=Array.isArray(h=f(b,d))?h:"number"==typeof h?[!0,h]:null==h?rB:[h])[0])return o;if("children"in b&&b.children&&b.children&&"skip"!==o[0])for(j=(g?b.children.length:-1)+n,k=d.concat(b);j>-1&&j<b.children.length;){if(!1===(i=a(b.children[j],j,k)())[0])return i;j="number"==typeof i[1]?i[1]:j+n}return o}})(a,void 0,[])()}function rD(a,b){let c=b.referenceType,d="]";if("collapsed"===c?d+="[]":"full"===c&&(d+="["+(b.label||b.identifier)+"]"),"imageReference"===b.type)return[{type:"text",value:"!["+b.alt+d}];let e=a.all(b),f=e[0];f&&"text"===f.type?f.value="["+f.value:e.unshift({type:"text",value:"["});let g=e[e.length-1];return g&&"text"===g.type?g.value+=d:e.push({type:"text",value:d}),e}function rE(a){let b=a.spread;return null==b?a.children.length>1:b}function rF(a,b,c){let d=0,e=a.length;if(b){let b=a.codePointAt(d);for(;9===b||32===b;)d++,b=a.codePointAt(d)}if(c){let b=a.codePointAt(e-1);for(;9===b||32===b;)e--,b=a.codePointAt(e-1)}return e>d?a.slice(d,e):""}let rG={blockquote:function(a,b){let c={type:"element",tagName:"blockquote",properties:{},children:a.wrap(a.all(b),!0)};return a.patch(b,c),a.applyData(b,c)},break:function(a,b){let c={type:"element",tagName:"br",properties:{},children:[]};return a.patch(b,c),[a.applyData(b,c),{type:"text",value:"\n"}]},code:function(a,b){let c=b.value?b.value+"\n":"",d={},e=b.lang?b.lang.split(/\s+/):[];e.length>0&&(d.className=["language-"+e[0]]);let f={type:"element",tagName:"code",properties:d,children:[{type:"text",value:c}]};return b.meta&&(f.data={meta:b.meta}),a.patch(b,f),f={type:"element",tagName:"pre",properties:{},children:[f=a.applyData(b,f)]},a.patch(b,f),f},delete:function(a,b){let c={type:"element",tagName:"del",properties:{},children:a.all(b)};return a.patch(b,c),a.applyData(b,c)},emphasis:function(a,b){let c={type:"element",tagName:"em",properties:{},children:a.all(b)};return a.patch(b,c),a.applyData(b,c)},footnoteReference:function(a,b){let c,d="string"==typeof a.options.clobberPrefix?a.options.clobberPrefix:"user-content-",e=String(b.identifier).toUpperCase(),f=rv(e.toLowerCase()),g=a.footnoteOrder.indexOf(e),h=a.footnoteCounts.get(e);void 0===h?(h=0,a.footnoteOrder.push(e),c=a.footnoteOrder.length):c=g+1,h+=1,a.footnoteCounts.set(e,h);let i={type:"element",tagName:"a",properties:{href:"#"+d+"fn-"+f,id:d+"fnref-"+f+(h>1?"-"+h:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(c)}]};a.patch(b,i);let j={type:"element",tagName:"sup",properties:{},children:[i]};return a.patch(b,j),a.applyData(b,j)},heading:function(a,b){let c={type:"element",tagName:"h"+b.depth,properties:{},children:a.all(b)};return a.patch(b,c),a.applyData(b,c)},html:function(a,b){if(a.options.allowDangerousHtml){let c={type:"raw",value:b.value};return a.patch(b,c),a.applyData(b,c)}},imageReference:function(a,b){let c=String(b.identifier).toUpperCase(),d=a.definitionById.get(c);if(!d)return rD(a,b);let e={src:rv(d.url||""),alt:b.alt};null!==d.title&&void 0!==d.title&&(e.title=d.title);let f={type:"element",tagName:"img",properties:e,children:[]};return a.patch(b,f),a.applyData(b,f)},image:function(a,b){let c={src:rv(b.url)};null!==b.alt&&void 0!==b.alt&&(c.alt=b.alt),null!==b.title&&void 0!==b.title&&(c.title=b.title);let d={type:"element",tagName:"img",properties:c,children:[]};return a.patch(b,d),a.applyData(b,d)},inlineCode:function(a,b){let c={type:"text",value:b.value.replace(/\r?\n|\r/g," ")};a.patch(b,c);let d={type:"element",tagName:"code",properties:{},children:[c]};return a.patch(b,d),a.applyData(b,d)},linkReference:function(a,b){let c=String(b.identifier).toUpperCase(),d=a.definitionById.get(c);if(!d)return rD(a,b);let e={href:rv(d.url||"")};null!==d.title&&void 0!==d.title&&(e.title=d.title);let f={type:"element",tagName:"a",properties:e,children:a.all(b)};return a.patch(b,f),a.applyData(b,f)},link:function(a,b){let c={href:rv(b.url)};null!==b.title&&void 0!==b.title&&(c.title=b.title);let d={type:"element",tagName:"a",properties:c,children:a.all(b)};return a.patch(b,d),a.applyData(b,d)},listItem:function(a,b,c){let d=a.all(b),e=c?function(a){let b=!1;if("list"===a.type){b=a.spread||!1;let c=a.children,d=-1;for(;!b&&++d<c.length;)b=rE(c[d])}return b}(c):rE(b),f={},g=[];if("boolean"==typeof b.checked){let a,c=d[0];c&&"element"===c.type&&"p"===c.tagName?a=c:(a={type:"element",tagName:"p",properties:{},children:[]},d.unshift(a)),a.children.length>0&&a.children.unshift({type:"text",value:" "}),a.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:b.checked,disabled:!0},children:[]}),f.className=["task-list-item"]}let h=-1;for(;++h<d.length;){let a=d[h];(e||0!==h||"element"!==a.type||"p"!==a.tagName)&&g.push({type:"text",value:"\n"}),"element"!==a.type||"p"!==a.tagName||e?g.push(a):g.push(...a.children)}let i=d[d.length-1];i&&(e||"element"!==i.type||"p"!==i.tagName)&&g.push({type:"text",value:"\n"});let j={type:"element",tagName:"li",properties:f,children:g};return a.patch(b,j),a.applyData(b,j)},list:function(a,b){let c={},d=a.all(b),e=-1;for("number"==typeof b.start&&1!==b.start&&(c.start=b.start);++e<d.length;){let a=d[e];if("element"===a.type&&"li"===a.tagName&&a.properties&&Array.isArray(a.properties.className)&&a.properties.className.includes("task-list-item")){c.className=["contains-task-list"];break}}let f={type:"element",tagName:b.ordered?"ol":"ul",properties:c,children:a.wrap(d,!0)};return a.patch(b,f),a.applyData(b,f)},paragraph:function(a,b){let c={type:"element",tagName:"p",properties:{},children:a.all(b)};return a.patch(b,c),a.applyData(b,c)},root:function(a,b){let c={type:"root",children:a.wrap(a.all(b))};return a.patch(b,c),a.applyData(b,c)},strong:function(a,b){let c={type:"element",tagName:"strong",properties:{},children:a.all(b)};return a.patch(b,c),a.applyData(b,c)},table:function(a,b){let c=a.all(b),d=c.shift(),e=[];if(d){let c={type:"element",tagName:"thead",properties:{},children:a.wrap([d],!0)};a.patch(b.children[0],c),e.push(c)}if(c.length>0){let d={type:"element",tagName:"tbody",properties:{},children:a.wrap(c,!0)},f=py(b.children[1]),g=px(b.children[b.children.length-1]);f&&g&&(d.position={start:f,end:g}),e.push(d)}let f={type:"element",tagName:"table",properties:{},children:a.wrap(e,!0)};return a.patch(b,f),a.applyData(b,f)},tableCell:function(a,b){let c={type:"element",tagName:"td",properties:{},children:a.all(b)};return a.patch(b,c),a.applyData(b,c)},tableRow:function(a,b,c){let d=c?c.children:void 0,e=0===(d?d.indexOf(b):1)?"th":"td",f=c&&"table"===c.type?c.align:void 0,g=f?f.length:b.children.length,h=-1,i=[];for(;++h<g;){let c=b.children[h],d={},g=f?f[h]:void 0;g&&(d.align=g);let j={type:"element",tagName:e,properties:d,children:[]};c&&(j.children=a.all(c),a.patch(c,j),j=a.applyData(c,j)),i.push(j)}let j={type:"element",tagName:"tr",properties:{},children:a.wrap(i,!0)};return a.patch(b,j),a.applyData(b,j)},text:function(a,b){let c={type:"text",value:function(a){let b=String(a),c=/\r?\n|\r/g,d=c.exec(b),e=0,f=[];for(;d;)f.push(rF(b.slice(e,d.index),e>0,!0),d[0]),e=d.index+d[0].length,d=c.exec(b);return f.push(rF(b.slice(e),e>0,!1)),f.join("")}(String(b.value))};return a.patch(b,c),a.applyData(b,c)},thematicBreak:function(a,b){let c={type:"element",tagName:"hr",properties:{},children:[]};return a.patch(b,c),a.applyData(b,c)},toml:rH,yaml:rH,definition:rH,footnoteDefinition:rH};function rH(){}let rI={}.hasOwnProperty,rJ={};function rK(a,b){a.position&&(b.position=function(a){let b=py(a),c=px(a);if(b&&c)return{start:b,end:c}}(a))}function rL(a,b){let c=b;if(a&&a.data){let b=a.data.hName,d=a.data.hChildren,e=a.data.hProperties;"string"==typeof b&&("element"===c.type?c.tagName=b:c={type:"element",tagName:b,properties:{},children:"children"in c?c.children:[c]}),"element"===c.type&&e&&Object.assign(c.properties,rs(e)),"children"in c&&c.children&&null!=d&&(c.children=d)}return c}function rM(a,b){let c=[],d=-1;for(b&&c.push({type:"text",value:"\n"});++d<a.length;)d&&c.push({type:"text",value:"\n"}),c.push(a[d]);return b&&a.length>0&&c.push({type:"text",value:"\n"}),c}function rN(a){let b=0,c=a.charCodeAt(b);for(;9===c||32===c;)b++,c=a.charCodeAt(b);return a.slice(b)}function rO(a,b){let c,d,e,f,g=(c=b||rJ,d=new Map,e=new Map,f={all:function(a){let b=[];if("children"in a){let c=a.children,d=-1;for(;++d<c.length;){let e=f.one(c[d],a);if(e){if(d&&"break"===c[d-1].type&&(Array.isArray(e)||"text"!==e.type||(e.value=rN(e.value)),!Array.isArray(e)&&"element"===e.type)){let a=e.children[0];a&&"text"===a.type&&(a.value=rN(a.value))}Array.isArray(e)?b.push(...e):b.push(e)}}}return b},applyData:rL,definitionById:d,footnoteById:e,footnoteCounts:new Map,footnoteOrder:[],handlers:{...rG,...c.handlers},one:function(a,b){let c=a.type,d=f.handlers[c];if(rI.call(f.handlers,c)&&d)return d(f,a,b);if(f.options.passThrough&&f.options.passThrough.includes(c)){if("children"in a){let{children:b,...c}=a,d=rs(c);return d.children=f.all(a),d}return rs(a)}return(f.options.unknownHandler||function(a,b){let c=b.data||{},d="value"in b&&!(rI.call(c,"hProperties")||rI.call(c,"hChildren"))?{type:"text",value:b.value}:{type:"element",tagName:"div",properties:{},children:a.all(b)};return a.patch(b,d),a.applyData(b,d)})(f,a,b)},options:c,patch:rK,wrap:rM},rC(a,function(a){if("definition"===a.type||"footnoteDefinition"===a.type){let b="definition"===a.type?d:e,c=String(a.identifier).toUpperCase();b.has(c)||b.set(c,a)}}),f),h=g.one(a,void 0),i=function(a){let b="string"==typeof a.options.clobberPrefix?a.options.clobberPrefix:"user-content-",c=a.options.footnoteBackContent||rw,d=a.options.footnoteBackLabel||rx,e=a.options.footnoteLabel||"Footnotes",f=a.options.footnoteLabelTagName||"h2",g=a.options.footnoteLabelProperties||{className:["sr-only"]},h=[],i=-1;for(;++i<a.footnoteOrder.length;){let e=a.footnoteById.get(a.footnoteOrder[i]);if(!e)continue;let f=a.all(e),g=String(e.identifier).toUpperCase(),j=rv(g.toLowerCase()),k=0,l=[],n=a.footnoteCounts.get(g);for(;void 0!==n&&++k<=n;){l.length>0&&l.push({type:"text",value:" "});let a="string"==typeof c?c:c(i,k);"string"==typeof a&&(a={type:"text",value:a}),l.push({type:"element",tagName:"a",properties:{href:"#"+b+"fnref-"+j+(k>1?"-"+k:""),dataFootnoteBackref:"",ariaLabel:"string"==typeof d?d:d(i,k),className:["data-footnote-backref"]},children:Array.isArray(a)?a:[a]})}let o=f[f.length-1];if(o&&"element"===o.type&&"p"===o.tagName){let a=o.children[o.children.length-1];a&&"text"===a.type?a.value+=" ":o.children.push({type:"text",value:" "}),o.children.push(...l)}else f.push(...l);let p={type:"element",tagName:"li",properties:{id:b+"fn-"+j},children:a.wrap(f,!0)};a.patch(e,p),h.push(p)}if(0!==h.length)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:f,properties:{...rs(g),id:"footnote-label"},children:[{type:"text",value:e}]},{type:"text",value:"\n"},{type:"element",tagName:"ol",properties:{},children:a.wrap(h,!0)},{type:"text",value:"\n"}]}}(g),j=Array.isArray(h)?{type:"root",children:h}:h||{type:"root",children:[]};return i&&(oT("children"in j),j.children.push({type:"text",value:"\n"},i)),j}function rP(a,b){return a&&"run"in a?async function(c,d){let e=rO(c,{file:d,...b});await a.run(e,d)}:function(c,d){return rO(c,{file:d,...a||b})}}function rQ(a){if(a)throw a}var rR=a.i(97599);function rS(a){if("object"!=typeof a||null===a)return!1;let b=Object.getPrototypeOf(a);return(null===b||b===Object.prototype||null===Object.getPrototypeOf(b))&&!(Symbol.toStringTag in a)&&!(Symbol.iterator in a)}var rT=a.i(50227),rT=rT,rU=a.i(59639),rU=rU,rV=a.i(57764),rV=rV;function rW(a){return!!(null!==a&&"object"==typeof a&&"href"in a&&a.href&&"protocol"in a&&a.protocol&&void 0===a.auth)}let rX=["history","path","basename","stem","extname","dirname"];class rY{constructor(a){let b,c;b=a?rW(a)?{path:a}:"string"==typeof a||function(a){return!!(a&&"object"==typeof a&&"byteLength"in a&&"byteOffset"in a)}(a)?{value:a}:a:{},this.cwd="cwd"in b?"":rU.default.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let d=-1;for(;++d<rX.length;){const a=rX[d];a in b&&void 0!==b[a]&&null!==b[a]&&(this[a]="history"===a?[...b[a]]:b[a])}for(c in b)rX.includes(c)||(this[c]=b[c])}get basename(){return"string"==typeof this.path?rT.default.basename(this.path):void 0}set basename(a){r$(a,"basename"),rZ(a,"basename"),this.path=rT.default.join(this.dirname||"",a)}get dirname(){return"string"==typeof this.path?rT.default.dirname(this.path):void 0}set dirname(a){r_(this.basename,"dirname"),this.path=rT.default.join(a||"",this.basename)}get extname(){return"string"==typeof this.path?rT.default.extname(this.path):void 0}set extname(a){if(rZ(a,"extname"),r_(this.dirname,"extname"),a){if(46!==a.codePointAt(0))throw Error("`extname` must start with `.`");if(a.includes(".",1))throw Error("`extname` cannot contain multiple dots")}this.path=rT.default.join(this.dirname,this.stem+(a||""))}get path(){return this.history[this.history.length-1]}set path(a){rW(a)&&(a=(0,rV.fileURLToPath)(a)),r$(a,"path"),this.path!==a&&this.history.push(a)}get stem(){return"string"==typeof this.path?rT.default.basename(this.path,this.extname):void 0}set stem(a){r$(a,"stem"),rZ(a,"stem"),this.path=rT.default.join(this.dirname||"",a+(this.extname||""))}fail(a,b,c){let d=this.message(a,b,c);throw d.fatal=!0,d}info(a,b,c){let d=this.message(a,b,c);return d.fatal=void 0,d}message(a,b,c){let d=new pE(a,b,c);return this.path&&(d.name=this.path+":"+d.name,d.file=this.path),d.fatal=!1,this.messages.push(d),d}toString(a){return void 0===this.value?"":"string"==typeof this.value?this.value:new TextDecoder(a||void 0).decode(this.value)}}function rZ(a,b){if(a&&a.includes(rT.default.sep))throw Error("`"+b+"` cannot be a path: did not expect `"+rT.default.sep+"`")}function r$(a,b){if(!a)throw Error("`"+b+"` cannot be empty")}function r_(a,b){if(!a)throw Error("Setting `"+b+"` requires `path` to be set too")}let r0=function(a){let b=this.constructor.prototype,c=b[a],d=function(){return c.apply(d,arguments)};return Object.setPrototypeOf(d,b),d},r1={}.hasOwnProperty;class r2 extends r0{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=function(){let a=[],b={run:function(...b){let c=-1,d=b.pop();if("function"!=typeof d)throw TypeError("Expected function as last argument, not "+d);!function e(f,...g){let h=a[++c],i=-1;if(f)return void d(f);for(;++i<b.length;)(null===g[i]||void 0===g[i])&&(g[i]=b[i]);b=g,h?(function(a,b){let c;return function(...b){let f,g=a.length>b.length;g&&b.push(d);try{f=a.apply(this,b)}catch(a){if(g&&c)throw a;return d(a)}g||(f&&f.then&&"function"==typeof f.then?f.then(e,d):f instanceof Error?d(f):e(f))};function d(a,...e){c||(c=!0,b(a,...e))}function e(a){d(null,a)}})(h,e)(...g):d(null,...g)}(null,...b)},use:function(c){if("function"!=typeof c)throw TypeError("Expected `middelware` to be a function, not "+c);return a.push(c),b}};return b}()}copy(){let a=new r2,b=-1;for(;++b<this.attachers.length;){let c=this.attachers[b];a.use(...c)}return a.data((0,rR.default)(!0,{},this.namespace)),a}data(a,b){return"string"==typeof a?2==arguments.length?(r6("data",this.frozen),this.namespace[a]=b,this):r1.call(this.namespace,a)&&this.namespace[a]||void 0:a?(r6("data",this.frozen),this.namespace=a,this):this.namespace}freeze(){if(this.frozen)return this;for(;++this.freezeIndex<this.attachers.length;){let[a,...b]=this.attachers[this.freezeIndex];if(!1===b[0])continue;!0===b[0]&&(b[0]=void 0);let c=a.call(this,...b);"function"==typeof c&&this.transformers.use(c)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(a){this.freeze();let b=r9(a),c=this.parser||this.Parser;return r4("parse",c),c(String(b),b)}process(a,b){let c=this;return this.freeze(),r4("process",this.parser||this.Parser),r5("process",this.compiler||this.Compiler),b?d(void 0,b):new Promise(d);function d(d,e){let f=r9(a),g=c.parse(f);function h(a,c){a||!c?e(a):d?d(c):(oT(b,"`done` is defined if `resolve` is not"),b(void 0,c))}c.run(g,f,function(a,b,d){var e,f;if(a||!b||!d)return h(a);let g=c.stringify(b,d);"string"==typeof(e=g)||(f=e)&&"object"==typeof f&&"byteLength"in f&&"byteOffset"in f?d.value=g:d.result=g,h(a,d)})}}processSync(a){let b,c=!1;return this.freeze(),r4("processSync",this.parser||this.Parser),r5("processSync",this.compiler||this.Compiler),this.process(a,function(a,d){c=!0,rQ(a),b=d}),r8("processSync","process",c),oT(b,"we either bailed on an error or have a tree"),b}run(a,b,c){r7(a),this.freeze();let d=this.transformers;return c||"function"!=typeof b||(c=b,b=void 0),c?e(void 0,c):new Promise(e);function e(e,f){oT("function"!=typeof b,"`file` can’t be a `done` anymore, we checked");let g=r9(b);d.run(a,g,function(b,d,g){let h=d||a;b?f(b):e?e(h):(oT(c,"`done` is defined if `resolve` is not"),c(void 0,h,g))})}}runSync(a,b){let c,d=!1;return this.run(a,b,function(a,b){rQ(a),c=b,d=!0}),r8("runSync","run",d),oT(c,"we either bailed on an error or have a tree"),c}stringify(a,b){this.freeze();let c=r9(b),d=this.compiler||this.Compiler;return r5("stringify",d),r7(a),d(a,c)}use(a,...b){let c=this.attachers,d=this.namespace;if(r6("use",this.frozen),null==a);else if("function"==typeof a)g(a,b);else if("object"==typeof a)Array.isArray(a)?f(a):e(a);else throw TypeError("Expected usable value, not `"+a+"`");return this;function e(a){if(!("plugins"in a)&&!("settings"in a))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");f(a.plugins),a.settings&&(d.settings=(0,rR.default)(!0,d.settings,a.settings))}function f(a){let b=-1;if(null==a);else if(Array.isArray(a))for(;++b<a.length;)!function(a){if("function"==typeof a)g(a,[]);else if("object"==typeof a)if(Array.isArray(a)){let[b,...c]=a;g(b,c)}else e(a);else throw TypeError("Expected usable value, not `"+a+"`")}(a[b]);else throw TypeError("Expected a list of plugins, not `"+a+"`")}function g(a,b){let d=-1,e=-1;for(;++d<c.length;)if(c[d][0]===a){e=d;break}if(-1===e)c.push([a,...b]);else if(b.length>0){let[d,...f]=b,g=c[e][1];rS(g)&&rS(d)&&(d=(0,rR.default)(!0,g,d)),c[e]=[a,d,...f]}}}}let r3=new r2().freeze();function r4(a,b){if("function"!=typeof b)throw TypeError("Cannot `"+a+"` without `parser`")}function r5(a,b){if("function"!=typeof b)throw TypeError("Cannot `"+a+"` without `compiler`")}function r6(a,b){if(b)throw Error("Cannot call `"+a+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function r7(a){if(!rS(a)||"string"!=typeof a.type)throw TypeError("Expected node, got `"+a+"`")}function r8(a,b,c){if(!c)throw Error("`"+a+"` finished async. Use `"+b+"` instead")}function r9(a){var b;return(b=a)&&"object"==typeof b&&"message"in b&&"messages"in b?a:new rY(a)}let sa=[],sb={allowDangerousHtml:!0},sc=/^(https?|ircs?|mailto|xmpp)$/i,sd=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function se(a){var b;let c,d,e,f,g,h=(c=(b=a).rehypePlugins||sa,d=b.remarkPlugins||sa,e=b.remarkRehypeOptions?{...b.remarkRehypeOptions,...sb}:sb,r3().use(rk).use(d).use(rP,e).use(c)),i=(f=a.children||"",g=new rY,"string"==typeof f?g.value=f:oU("Unexpected value `"+f+"` for `children` prop, expected `string`"),g);return function(a,b){let c=b.allowedElements,d=b.allowElement,e=b.components,f=b.disallowedElements,g=b.skipHtml,h=b.unwrapDisallowed,i=b.urlTransform||sf;for(let a of sd)Object.hasOwn(b,a.from)&&oU("Unexpected `"+a.from+"` prop, "+(a.to?"use `"+a.to+"` instead":"remove it")+" (see <https://github.com/remarkjs/react-markdown/blob/main/changelog.md#"+a.id+"> for more info)");return c&&f&&oU("Unexpected combined `allowedElements` and `disallowedElements`, expected one or the other"),rC(a,function(a,b,e){if("raw"===a.type&&e&&"number"==typeof b)return g?e.children.splice(b,1):e.children[b]={type:"text",value:a.value},b;if("element"===a.type){let b;for(b in pS)if(Object.hasOwn(pS,b)&&Object.hasOwn(a.properties,b)){let c=a.properties[b],d=pS[b];(null===d||d.includes(a.tagName))&&(a.properties[b]=i(String(c||""),b,a))}}if("element"===a.type){let g=c?!c.includes(a.tagName):!!f&&f.includes(a.tagName);if(!g&&d&&"number"==typeof b&&(g=!d(a,b,e)),g&&e&&"number"==typeof b)return h&&a.children?e.children.splice(b,1,...a.children):e.children.splice(b,1),b}}),function(a,b){var c,d,e,f;let g;if(!b||void 0===b.Fragment)throw TypeError("Expected `Fragment` in options");let h=b.filePath||void 0;if(b.development){if("function"!=typeof b.jsxDEV)throw TypeError("Expected `jsxDEV` in options when `development: true`");c=h,d=b.jsxDEV,g=function(a,b,e,f){let g=Array.isArray(e.children),h=py(a);return d(b,e,f,g,{columnNumber:h?h.column-1:void 0,fileName:c,lineNumber:h?h.line:void 0},void 0)}}else{if("function"!=typeof b.jsx)throw TypeError("Expected `jsx` in production options");if("function"!=typeof b.jsxs)throw TypeError("Expected `jsxs` in production options");e=b.jsx,f=b.jsxs,g=function(a,b,c,d){let g=Array.isArray(c.children)?f:e;return d?g(b,c,d):g(b,c)}}let i={Fragment:b.Fragment,ancestors:[],components:b.components||{},create:g,elementAttributeNameCase:b.elementAttributeNameCase||"react",evaluater:b.createEvaluater?b.createEvaluater():void 0,filePath:h,ignoreInvalidStyle:b.ignoreInvalidStyle||!1,passKeys:!1!==b.passKeys,passNode:b.passNode||!1,schema:"svg"===b.space?pv:pu,stylePropertyNameCase:b.stylePropertyNameCase||"dom",tableCellAlignToStyle:!1!==b.tableCellAlignToStyle},j=pL(i,a,void 0);return j&&"string"!=typeof j?j:i.create(a,i.Fragment,{children:j||void 0},void 0)}(a,{Fragment:F.Fragment,components:e,ignoreInvalidStyle:!0,jsx:F.jsx,jsxs:F.jsxs,passKeys:!0,passNode:!0})}(h.runSync(h.parse(i),i),a)}function sf(a){let b=a.indexOf(":"),c=a.indexOf("?"),d=a.indexOf("#"),e=a.indexOf("/");return -1===b||-1!==e&&b>e||-1!==c&&b>c||-1!==d&&b>d||sc.test(a.slice(0,b))?a:""}let sg=a=>{let b=new Date(a);return`${b.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})} at ${b.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",hour12:!1})}`};function sh({mentalModel:a}){return(0,F.jsxs)("div",{className:"space-y-6",children:[(0,F.jsxs)("div",{className:"pb-5 border-b border-border",children:[(0,F.jsxs)("div",{className:"flex items-center gap-2",children:[(0,F.jsx)("h3",{className:"text-xl font-bold text-foreground",children:a.name}),a.trigger?.refresh_after_consolidation&&(0,F.jsxs)("span",{className:"flex items-center gap-1 px-2 py-0.5 rounded-full bg-amber-500/10 text-amber-600 dark:text-amber-400 text-xs font-medium",children:[(0,F.jsx)(oS,{className:"w-3 h-3"}),"Auto refresh"]})]}),(0,F.jsx)("code",{className:"text-xs font-mono text-muted-foreground/70",children:a.id}),a.source_query&&(0,F.jsx)("p",{className:"text-sm text-muted-foreground mt-1",children:a.source_query})]}),(0,F.jsxs)("div",{className:"flex gap-8",children:[(0,F.jsxs)("div",{children:[(0,F.jsx)("div",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide mb-1",children:"Created"}),(0,F.jsx)("div",{className:"text-sm text-foreground",children:sg(a.created_at)})]}),(0,F.jsxs)("div",{children:[(0,F.jsx)("div",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide mb-1",children:"Last Refreshed"}),(0,F.jsx)("div",{className:"text-sm text-foreground",children:sg(a.last_refreshed_at)})]})]}),(0,F.jsxs)("div",{children:[(0,F.jsx)("div",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide mb-3",children:"Content"}),(0,F.jsx)("div",{className:"prose prose-base dark:prose-invert max-w-none",children:(0,F.jsx)(se,{children:a.content})})]}),a.tags&&a.tags.length>0&&(0,F.jsxs)("div",{children:[(0,F.jsx)("div",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide mb-3",children:"Tags"}),(0,F.jsx)("div",{className:"flex flex-wrap gap-1.5",children:a.tags.map((a,b)=>(0,F.jsx)("span",{className:"px-2 py-0.5 bg-amber-500/10 text-amber-600 dark:text-amber-400 rounded text-xs",children:a},b))})]})]})}function si({mentalModelId:a,onClose:b}){let{currentBank:c}=(0,J.useBank)(),[d,e]=(0,I.useState)(null),[f,g]=(0,I.useState)(!1),[h,i]=(0,I.useState)(null);(0,I.useEffect)(()=>{a&&c&&(async()=>{g(!0),i(null),e(null);try{let b=await W.client.getMentalModel(c,a);e(b)}catch(a){console.error("Error loading mental model:",a),i(a.message)}finally{g(!1)}})()},[a,c]);let j=null!==a;return(0,F.jsx)(bi.Dialog,{open:j,onOpenChange:a=>!a&&b(),children:(0,F.jsxs)(bi.DialogContent,{className:"max-w-2xl max-h-[80vh] overflow-hidden flex flex-col p-6",children:[(0,F.jsx)(mY,{children:(0,F.jsx)(bi.DialogTitle,{children:"Mental Model Details"})}),f?(0,F.jsx)("div",{className:"flex items-center justify-center py-20",children:(0,F.jsx)(bh,{className:"w-8 h-8 animate-spin text-muted-foreground"})}):h?(0,F.jsx)("div",{className:"flex items-center justify-center py-20",children:(0,F.jsx)("div",{className:"text-center text-destructive",children:(0,F.jsxs)("div",{className:"text-sm",children:["Error: ",h]})})}):d?(0,F.jsx)("div",{className:"flex-1 overflow-y-auto",children:(0,F.jsx)(sh,{mentalModel:d})}):null]})})}function sj(){let a,b,c,d,e,f,g,h,i,j,k,{currentBank:l}=(0,J.useBank)(),[n,o]=(0,I.useState)(""),[p,q]=(0,I.useState)("mid"),[r,s]=(0,I.useState)(4096),[t,u]=(0,I.useState)(!0),[v,w]=(0,I.useState)(!0),[x,y]=(0,I.useState)("answer"),[z,A]=(0,I.useState)(null),[B,C]=(0,I.useState)(!1),[D,E]=(0,I.useState)(""),[G,H]=(0,I.useState)("any"),[K,L]=(0,I.useState)(""),[O,P]=(0,I.useState)(!1),[Q,R]=(0,I.useState)(!1),[S,T]=(0,I.useState)(null),[U,V]=(0,I.useState)(null),[Z,$]=(0,I.useState)(null),[_,aa]=(0,I.useState)(!1),[ab,ac]=(0,I.useState)(null),[ad,af]=(0,I.useState)(null),[ag,ah]=(0,I.useState)(!1),[ai,aj]=(0,I.useState)(null),[ak,al]=(0,I.useState)("world"),am="General Feedback",an=async a=>{if(ac(a),af(null),l&&a?.id){ah(!0);try{let b=await W.client.listObservations(l),c=b.items?.find(b=>b.id===a.id);af(c||a)}catch(b){console.error("Failed to load observation:",b),af(a)}finally{ah(!1)}}},ao=async()=>{if(l&&K.trim()){P(!0);try{let a=await W.client.listDirectives(l),b=a.items?.find(a=>a.name===am);if(b){let a=b.content?`${b.content}
|
|
8
|
-
${K.trim()}`:K.trim();await W.client.updateDirective(l,b.id,{content:a})}else await W.client.createDirective(l,{name:am,content:K.trim()});L(""),R(!0),setTimeout(()=>R(!1),3e3)}catch(a){console.error("Error submitting feedback:",a),alert("Error submitting feedback: "+a.message)}finally{P(!1)}}},ap=async()=>{if(l&&n){C(!0),y("answer");try{let a=D.split(",").map(a=>a.trim()).filter(a=>a.length>0),b=await W.client.reflect({bank_id:l,query:n,budget:p,max_tokens:r,include_facts:t,include_tool_calls:v,...a.length>0&&{tags:a,tags_match:G}});A(b)}catch(a){console.error("Error running reflect:",a),alert("Error running reflect: "+a.message)}finally{C(!1)}}};return l?(0,F.jsxs)("div",{className:"space-y-6",children:[(0,F.jsx)(n_,{children:(0,F.jsxs)(n3,{className:"pt-6",children:[(0,F.jsxs)("div",{className:"flex gap-3",children:[(0,F.jsxs)("div",{className:"flex-1 relative",children:[(0,F.jsx)(M,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),(0,F.jsx)(Y.Input,{type:"text",value:n,onChange:a=>o(a.target.value),placeholder:"What would you like to reflect on?",className:"pl-10 h-12 text-lg",onKeyDown:a=>"Enter"===a.key&&ap()})]}),(0,F.jsx)(X.Button,{onClick:ap,disabled:B||!n,className:"h-12 px-8",children:B?"Reflecting...":"Reflect"})]}),(0,F.jsxs)("div",{className:"flex flex-wrap items-center gap-6 mt-4 pt-4 border-t",children:[(0,F.jsxs)("div",{className:"flex items-center gap-2",children:[(0,F.jsx)("span",{className:"text-sm font-medium text-muted-foreground",children:"Budget:"}),(0,F.jsxs)(nc,{value:p,onValueChange:a=>q(a),children:[(0,F.jsx)(nV,{className:"w-24 h-8",children:(0,F.jsx)(ng,{})}),(0,F.jsxs)(nY,{children:[(0,F.jsx)(nZ,{value:"low",children:"Low"}),(0,F.jsx)(nZ,{value:"mid",children:"Mid"}),(0,F.jsx)(nZ,{value:"high",children:"High"})]})]})]}),(0,F.jsxs)("div",{className:"flex items-center gap-2",children:[(0,F.jsx)("span",{className:"text-sm text-muted-foreground",children:"Tokens:"}),(0,F.jsx)(Y.Input,{type:"number",value:r,onChange:a=>s(parseInt(a.target.value)||4096),className:"w-24 h-8"})]}),(0,F.jsx)("div",{className:"h-6 w-px bg-border"}),(0,F.jsxs)("div",{className:"flex items-center gap-4",children:[(0,F.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer",children:[(0,F.jsx)(n$.Checkbox,{checked:t,onCheckedChange:a=>u(a)}),(0,F.jsx)("span",{className:"text-sm",children:"Include Source"})]}),(0,F.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer",children:[(0,F.jsx)(n$.Checkbox,{checked:v,onCheckedChange:a=>w(a)}),(0,F.jsx)("span",{className:"text-sm",children:"Include Tools"})]})]})]}),(0,F.jsxs)("div",{className:"flex items-center gap-4 mt-4 pt-4 border-t",children:[(0,F.jsx)(bl.Tag,{className:"h-4 w-4 text-muted-foreground"}),(0,F.jsx)("div",{className:"flex-1 max-w-md",children:(0,F.jsx)(Y.Input,{type:"text",value:D,onChange:a=>E(a.target.value),placeholder:"Filter by tags (comma-separated)",className:"h-8"})}),(0,F.jsxs)(nc,{value:G,onValueChange:a=>H(a),children:[(0,F.jsx)(nV,{className:"w-40 h-8",children:(0,F.jsx)(ng,{})}),(0,F.jsxs)(nY,{children:[(0,F.jsx)(nZ,{value:"any",children:"Any (incl. untagged)"}),(0,F.jsx)(nZ,{value:"all",children:"All (incl. untagged)"}),(0,F.jsx)(nZ,{value:"any_strict",children:"Any (strict)"}),(0,F.jsx)(nZ,{value:"all_strict",children:"All (strict)"})]})]})]})]})}),B&&(0,F.jsx)(n_,{children:(0,F.jsxs)(n3,{className:"flex flex-col items-center justify-center py-16",children:[(0,F.jsx)("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary mb-4"}),(0,F.jsx)("p",{className:"text-muted-foreground",children:"Reflecting on memories..."})]})}),!B&&z&&(0,F.jsxs)("div",{className:"space-y-4",children:[(0,F.jsxs)("div",{className:"flex items-center gap-6 text-sm",children:[z.usage&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)("div",{className:"flex items-center gap-2",children:[(0,F.jsx)("span",{className:"text-muted-foreground",children:"Input tokens:"}),(0,F.jsx)("span",{className:"font-semibold",children:z.usage.input_tokens?.toLocaleString()})]}),(0,F.jsxs)("div",{className:"flex items-center gap-2",children:[(0,F.jsx)("span",{className:"text-muted-foreground",children:"Output tokens:"}),(0,F.jsx)("span",{className:"font-semibold",children:z.usage.output_tokens?.toLocaleString()})]})]}),z.trace?.tool_calls&&(0,F.jsxs)("div",{className:"flex items-center gap-2",children:[(0,F.jsx)("span",{className:"text-muted-foreground",children:"Tool calls:"}),(0,F.jsx)("span",{className:"font-semibold",children:z.trace.tool_calls.length}),(0,F.jsxs)("span",{className:"text-muted-foreground",children:["(",z.trace.tool_calls.reduce((a,b)=>a+b.duration_ms,0),"ms)"]})]}),z.trace?.llm_calls&&(0,F.jsxs)("div",{className:"flex items-center gap-2",children:[(0,F.jsx)("span",{className:"text-muted-foreground",children:"LLM calls:"}),(0,F.jsx)("span",{className:"font-semibold",children:z.trace.llm_calls.length}),(0,F.jsxs)("span",{className:"text-muted-foreground",children:["(",z.trace.llm_calls.reduce((a,b)=>a+b.duration_ms,0),"ms)"]})]}),(0,F.jsx)("div",{className:"flex-1"}),(0,F.jsx)("div",{className:"flex gap-1 bg-muted p-1 rounded-lg",children:["answer","trace","json"].map(a=>(0,F.jsx)("button",{onClick:()=>y(a),className:`px-3 py-1.5 text-sm font-medium rounded-md transition-colors ${x===a?"bg-background shadow-sm":"text-muted-foreground hover:text-foreground"}`,children:"answer"===a?"Answer":"trace"===a?"Trace":"JSON"},a))})]}),"answer"===x&&(0,F.jsxs)("div",{className:"space-y-6",children:[(0,F.jsxs)(n_,{children:[(0,F.jsx)(n0,{children:(0,F.jsx)(n1,{children:"Answer"})}),(0,F.jsx)(n3,{children:(0,F.jsx)("div",{className:"text-base leading-relaxed whitespace-pre-wrap",children:z.text})})]}),z.new_opinions&&z.new_opinions.length>0&&(0,F.jsxs)(n_,{className:"border-green-200 dark:border-green-800",children:[(0,F.jsxs)(n0,{className:"bg-green-50 dark:bg-green-950",children:[(0,F.jsxs)(n1,{className:"flex items-center gap-2",children:[(0,F.jsx)(M,{className:"w-5 h-5"}),"New Opinions Formed"]}),(0,F.jsx)(n2,{children:"New beliefs generated from this interaction"})]}),(0,F.jsx)(n3,{className:"pt-6",children:(0,F.jsx)("div",{className:"space-y-3",children:z.new_opinions.map((a,b)=>(0,F.jsxs)("div",{className:"p-3 bg-muted rounded-lg border border-border",children:[(0,F.jsx)("div",{className:"font-semibold text-foreground",children:a.text}),(0,F.jsxs)("div",{className:"text-sm text-muted-foreground mt-1",children:["Confidence: ",a.confidence?.toFixed(2)]})]},b))})})]}),(0,F.jsxs)(n_,{className:"border-blue-200 dark:border-blue-800",children:[(0,F.jsxs)(n0,{className:"py-4",children:[(0,F.jsxs)(n1,{className:"flex items-center gap-2 text-base",children:[(0,F.jsx)(n6,{className:"w-4 h-4"}),"Add Directive"]}),(0,F.jsx)(n2,{className:"text-xs",children:"Hard rules injected into prompts that the agent must follow"})]}),(0,F.jsx)(n3,{className:"pt-0",children:Q?(0,F.jsxs)("div",{className:"flex items-center gap-2 text-green-600 dark:text-green-400",children:[(0,F.jsx)("span",{className:"text-lg",children:"✓"}),(0,F.jsxs)("span",{className:"text-sm font-medium",children:["Directive saved to ",am]})]}):(0,F.jsxs)("div",{className:"flex gap-3",children:[(0,F.jsx)(n9.Textarea,{value:K,onChange:a=>L(a.target.value),placeholder:"e.g., Always respond in formal English...",className:"flex-1 min-h-[60px] resize-none",onKeyDown:a=>{"Enter"===a.key&&(a.metaKey||a.ctrlKey)&&ao()}}),(0,F.jsx)(X.Button,{onClick:ao,disabled:O||!K.trim(),className:"self-end",children:O?"Saving...":"Save"})]})})]})]}),"trace"===x&&(0,F.jsxs)("div",{className:"space-y-4",children:[z.observations_created&&z.observations_created.length>0&&(0,F.jsxs)(n_,{className:"border-emerald-200 dark:border-emerald-800",children:[(0,F.jsxs)(n0,{className:"bg-emerald-50 dark:bg-emerald-950 py-3",children:[(0,F.jsxs)(n1,{className:"flex items-center gap-2 text-base",children:[(0,F.jsx)(n5,{className:"w-4 h-4 text-emerald-600"}),"Observations Created (",z.observations_created.length,")"]}),(0,F.jsx)(n2,{className:"text-xs",children:"New observations learned during this reflection"})]}),(0,F.jsx)(n3,{className:"pt-4",children:(0,F.jsx)("div",{className:"space-y-2",children:z.observations_created.map((a,b)=>(0,F.jsxs)("div",{className:"p-3 bg-emerald-50 dark:bg-emerald-950/50 rounded-lg border border-emerald-200 dark:border-emerald-800",children:[(0,F.jsx)("div",{className:"font-medium text-sm text-emerald-900 dark:text-emerald-100",children:a.name}),(0,F.jsx)("div",{className:"text-xs text-emerald-700 dark:text-emerald-300 mt-1",children:a.description}),(0,F.jsxs)("div",{className:"text-[10px] text-muted-foreground mt-2 font-mono",children:["ID: ",a.id]})]},b))})})]}),(0,F.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:[(0,F.jsxs)(n_,{className:"h-fit",children:[(0,F.jsxs)(n0,{className:"pb-3",children:[(0,F.jsx)(n1,{className:"text-base",children:"Execution Trace"}),(0,F.jsxs)(n2,{className:"text-xs",children:[z.iterations||0," iteration",1!==(z.iterations||0)?"s":""," •"," ",(z.trace?.llm_calls?.reduce((a,b)=>a+b.duration_ms,0)||0)+(z.trace?.tool_calls?.reduce((a,b)=>a+b.duration_ms,0)||0),"ms total"]})]}),(0,F.jsx)(n3,{children:v?z.trace?.llm_calls&&z.trace.llm_calls.length>0||z.trace?.tool_calls&&z.trace.tool_calls.length>0?(0,F.jsx)("div",{className:"max-h-[500px] overflow-y-auto pr-2",children:(a=z.trace?.llm_calls||[],b=z.trace?.tool_calls||[],c=[],a.forEach((d,e)=>{let f=b.filter(a=>a.iteration===e+1),g=e===a.length-1,h=d.scope.includes("final")||g&&0===f.length,i=h?a.length:e+1;c.push({type:"llm",llm:d,iteration:i,isFinal:h}),f.length>0&&c.push({type:"tools",tools:f,iteration:e+1})}),c.map((a,b)=>(0,F.jsxs)("div",{className:"relative",children:[b<c.length-1&&(0,F.jsx)("div",{className:"absolute left-3 top-6 bottom-0 w-0.5 bg-border"}),"llm"===a.type?(0,F.jsxs)("div",{className:"flex items-start gap-3 pb-3",children:[(0,F.jsx)("div",{className:`w-6 h-6 rounded-full flex items-center justify-center flex-shrink-0 ${a.isFinal?"bg-emerald-500/15 text-emerald-600 dark:text-emerald-400":"bg-primary/10 text-primary"}`,children:a.isFinal?(0,F.jsx)(bf.Check,{className:"w-3.5 h-3.5",strokeWidth:2.5}):(0,F.jsx)("span",{className:"text-[10px] font-semibold",children:a.iteration})}),(0,F.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,F.jsxs)("div",{className:"flex items-center justify-between",children:[(0,F.jsx)("span",{className:"font-medium text-sm",children:a.isFinal?"Response generated":"Agent decided"}),(0,F.jsxs)("span",{className:"text-xs text-muted-foreground flex items-center gap-1",children:[(0,F.jsx)(ae,{className:"w-3 h-3"}),a.llm.duration_ms,"ms"]})]}),(0,F.jsx)("span",{className:"text-xs text-muted-foreground",children:a.isFinal?"Final answer":"Called tools below"})]})]}):(0,F.jsxs)("div",{className:"flex items-start gap-3 pb-3",children:[(0,F.jsx)("div",{className:"w-6 h-6 rounded-full flex items-center justify-center bg-blue-500/15 text-blue-600 dark:text-blue-400 flex-shrink-0",children:(0,F.jsx)(n8,{className:"w-3 h-3",fill:"currentColor"})}),(0,F.jsxs)("div",{className:"flex-1 min-w-0 space-y-2",children:[(0,F.jsxs)("div",{className:"text-xs text-muted-foreground",children:["Executing ",a.tools?.length," tool",a.tools?.length!==1?"s":""]}),a.tools?.map((a,b)=>(0,F.jsxs)("div",{className:"border border-border rounded-lg overflow-hidden",children:[(0,F.jsxs)("div",{className:"flex items-center justify-between px-3 py-1.5 bg-muted/50",children:[(0,F.jsx)("span",{className:"font-medium text-sm text-foreground",children:a.tool}),(0,F.jsxs)("span",{className:"text-xs text-muted-foreground flex items-center gap-1",children:[(0,F.jsx)(ae,{className:"w-3 h-3"}),a.duration_ms,"ms"]})]}),(0,F.jsxs)("div",{className:"p-2 space-y-2",children:[(0,F.jsxs)("div",{children:[(0,F.jsx)("p",{className:"text-[10px] font-semibold text-muted-foreground mb-1",children:"Input:"}),(0,F.jsx)("div",{className:"bg-muted p-1.5 rounded text-xs overflow-auto max-h-32",children:(0,F.jsx)(oR,{src:a.input,collapsed:1,theme:"default"})})]}),a.output&&(0,F.jsxs)("div",{children:[(0,F.jsx)("p",{className:"text-[10px] font-semibold text-muted-foreground mb-1",children:"Output:"}),(0,F.jsx)("div",{className:"bg-muted p-1.5 rounded text-xs overflow-auto max-h-32",children:(0,F.jsx)(oR,{src:a.output,collapsed:1,theme:"default"})})]})]})]},b))]})]})]},b)))}):(0,F.jsxs)("div",{className:"flex items-start gap-3 p-3 bg-muted border border-border rounded-lg",children:[(0,F.jsx)(n4,{className:"w-4 h-4 text-muted-foreground mt-0.5 flex-shrink-0"}),(0,F.jsxs)("div",{children:[(0,F.jsx)("p",{className:"font-medium text-sm text-foreground",children:"No operations"}),(0,F.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5",children:"No LLM or tool calls were made during this reflection."})]})]}):(0,F.jsxs)("div",{className:"flex items-start gap-3 p-3 bg-muted border border-border rounded-lg",children:[(0,F.jsx)(n4,{className:"w-4 h-4 text-muted-foreground mt-0.5 flex-shrink-0"}),(0,F.jsxs)("div",{children:[(0,F.jsx)("p",{className:"font-medium text-sm text-foreground",children:"Not included"}),(0,F.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5",children:'Enable "Include Tool Calls" to see trace.'})]})]})})]}),(0,F.jsxs)(n_,{className:"h-fit",children:[(0,F.jsxs)(n0,{className:"pb-3",children:[(0,F.jsx)(n1,{className:"text-base",children:"Based On"}),(0,F.jsxs)(n2,{className:"text-xs",children:[(z.based_on?.memories?.length||0)+(z.based_on?.observations?.filter(a=>"directive"!==a.subtype)?.length||0)+(z.based_on?.directives?.length||0)," ","items used"]})]}),(0,F.jsx)(n3,{children:t?z.based_on?.memories&&z.based_on.memories.length>0||z.based_on?.mental_models&&z.based_on.mental_models.length>0||z.based_on?.directives&&z.based_on.directives.length>0||z.based_on?.observations&&z.based_on.observations.length>0?(e=(d=z.based_on?.memories||[]).filter(a=>"world"===a.type),f=d.filter(a=>"experience"===a.type),g=z.based_on?.mental_models||[],h=(z.based_on?.observations||[]).filter(a=>"directive"!==a.subtype),j=[{id:"directives",label:"Directives",count:(i=z.based_on?.directives||[]).length},{id:"mental_models",label:"Mental Models",count:g.length},{id:"observations",label:"Observations",count:h.length},{id:"world",label:"World",count:e.length},{id:"experience",label:"Experience",count:f.length}],k=(()=>{switch(ak){case"directives":return i;case"mental_models":return g;case"observations":return h;case"world":return e;case"experience":return f;default:return[]}})(),(0,F.jsxs)("div",{children:[(0,F.jsx)("div",{className:"flex items-center gap-1 bg-muted rounded-lg p-1 mb-4",children:j.map(a=>(0,F.jsxs)("button",{onClick:()=>al(a.id),className:`flex-1 px-3 py-1.5 rounded-md text-sm font-medium transition-all ${ak===a.id?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,children:[a.label," (",a.count,")"]},a.id))}),k.length>0?(0,F.jsx)("div",{className:"max-h-[400px] overflow-y-auto pr-2 space-y-3",children:k.map((a,b)=>{let c,d;return(0,F.jsx)("div",{className:`p-4 bg-muted/50 rounded-lg border border-border/50 ${"directives"!==ak?"cursor-pointer hover:bg-muted/80 transition-colors":""}`,onClick:()=>{"directives"!==ak&&("observations"===ak?an(a):"mental_models"===ak?aj(a.id):T(a.id))},children:"directives"===ak?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)("div",{className:"font-medium text-sm",children:a.name}),a.content&&(0,F.jsx)("p",{className:"mt-1 text-xs text-muted-foreground line-clamp-2",children:a.content})]}):"observations"===ak?(0,F.jsx)("div",{className:"font-medium text-sm",children:a.name}):"mental_models"===ak?(d=(c=a.text?.indexOf(": ")??-1)>0?a.text.slice(0,c):a.id,(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)("div",{className:"font-medium text-sm",children:d}),(0,F.jsx)("code",{className:"text-xs font-mono text-muted-foreground",children:a.id})]})):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)("p",{className:"text-sm text-foreground leading-relaxed",children:a.text}),a.context&&(0,F.jsx)("div",{className:"text-xs text-muted-foreground mt-2",children:a.context})]})},a.id||b)})}):(0,F.jsxs)("p",{className:"text-sm text-muted-foreground text-center py-4",children:["No ",ak," items"]})]})):(0,F.jsxs)("div",{className:"flex items-start gap-3 p-3 bg-amber-50 dark:bg-amber-950 border border-amber-200 dark:border-amber-800 rounded-lg",children:[(0,F.jsx)(n4,{className:"w-4 h-4 text-amber-600 dark:text-amber-400 mt-0.5 flex-shrink-0"}),(0,F.jsxs)("div",{children:[(0,F.jsx)("p",{className:"font-medium text-sm text-amber-900 dark:text-amber-100",children:"No facts found"}),(0,F.jsx)("p",{className:"text-xs text-amber-700 dark:text-amber-300 mt-0.5",children:"No memories were used to generate this answer."})]})]}):(0,F.jsxs)("div",{className:"flex items-start gap-3 p-3 bg-muted border border-border rounded-lg",children:[(0,F.jsx)(n4,{className:"w-4 h-4 text-muted-foreground mt-0.5 flex-shrink-0"}),(0,F.jsxs)("div",{children:[(0,F.jsx)("p",{className:"font-medium text-sm text-foreground",children:"Not included"}),(0,F.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5",children:'Enable "Include Source" to see memories.'})]})]})})]})]})]}),"json"===x&&(0,F.jsxs)(n_,{children:[(0,F.jsx)(n0,{children:(0,F.jsx)(n1,{className:"text-lg",children:"Raw Response"})}),(0,F.jsx)(n3,{children:(0,F.jsx)("div",{className:"bg-muted p-4 rounded-lg overflow-auto max-h-[600px]",children:(0,F.jsx)(oR,{src:z,collapsed:2,theme:"default"})})})]})]}),!B&&!z&&(0,F.jsx)(n_,{className:"border-dashed",children:(0,F.jsxs)(n3,{className:"flex flex-col items-center justify-center py-16",children:[(0,F.jsx)(M,{className:"h-12 w-12 text-muted-foreground mb-4"}),(0,F.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Ready to Reflect"}),(0,F.jsx)("p",{className:"text-muted-foreground text-center max-w-md",children:"Enter a question above to query the memory bank and generate a disposition-aware response."})]})}),(0,F.jsx)(bn,{memoryId:S,onClose:()=>T(null)}),U&&(0,F.jsx)("div",{className:"fixed right-0 top-0 h-screen w-[420px] bg-card border-l shadow-2xl z-50 overflow-y-auto",children:(0,F.jsxs)("div",{className:"p-6",children:[(0,F.jsxs)("div",{className:"flex items-center justify-between mb-6",children:[(0,F.jsxs)("div",{className:"flex items-center gap-2",children:[(0,F.jsx)(n7,{className:"w-5 h-5"}),(0,F.jsx)("h2",{className:"text-lg font-semibold",children:"Directive"})]}),(0,F.jsx)(X.Button,{variant:"ghost",size:"icon",onClick:()=>{V(null),$(null)},children:(0,F.jsx)(bg.X,{className:"w-4 h-4"})})]}),_?(0,F.jsx)("div",{className:"flex items-center justify-center py-8",children:(0,F.jsx)("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary"})}):(0,F.jsxs)("div",{className:"space-y-4",children:[(0,F.jsxs)("div",{children:[(0,F.jsx)("h3",{className:"text-sm font-medium text-muted-foreground",children:"Name"}),(0,F.jsx)("p",{className:"mt-1 font-medium",children:Z?.name||U.name})]}),Z?.description&&(0,F.jsxs)("div",{children:[(0,F.jsx)("h3",{className:"text-sm font-medium text-muted-foreground",children:"Description"}),(0,F.jsx)("p",{className:"mt-1 text-sm",children:Z.description})]}),Z?.tags&&Z.tags.length>0&&(0,F.jsxs)("div",{children:[(0,F.jsx)("h3",{className:"text-sm font-medium text-muted-foreground mb-1",children:"Tags"}),(0,F.jsx)("div",{className:"flex flex-wrap gap-1",children:Z.tags.map(a=>(0,F.jsxs)("span",{className:"text-xs px-2 py-0.5 rounded bg-muted text-muted-foreground flex items-center gap-1",children:[(0,F.jsx)(bl.Tag,{className:"w-2.5 h-2.5"}),a]},a))})]}),(Z?.content||U.content)&&(0,F.jsxs)("div",{children:[(0,F.jsx)("h3",{className:"text-sm font-medium text-muted-foreground mb-2",children:"Content"}),(0,F.jsx)("div",{className:"p-3 bg-muted rounded-lg",children:(0,F.jsx)("div",{className:"text-sm text-muted-foreground whitespace-pre-wrap",children:Z?.content||U.content})})]}),(0,F.jsxs)("div",{className:"pt-2 border-t",children:[(0,F.jsx)("h3",{className:"text-sm font-medium text-muted-foreground",children:"ID"}),(0,F.jsx)("p",{className:"mt-1 font-mono text-xs text-muted-foreground",children:U.id})]})]})]})}),ab&&(0,F.jsx)("div",{className:"fixed right-0 top-0 h-screen w-[420px] bg-card border-l shadow-2xl z-50 overflow-y-auto",children:(0,F.jsxs)("div",{className:"p-6",children:[(0,F.jsxs)("div",{className:"flex items-center justify-between mb-6",children:[(0,F.jsxs)("div",{className:"flex items-center gap-2",children:[(0,F.jsx)(n5,{className:"w-5 h-5"}),(0,F.jsx)("h2",{className:"text-lg font-semibold",children:"Observation"})]}),(0,F.jsx)(X.Button,{variant:"ghost",size:"icon",onClick:()=>{ac(null),af(null)},children:(0,F.jsx)(bg.X,{className:"w-4 h-4"})})]}),ag?(0,F.jsx)("div",{className:"flex items-center justify-center py-8",children:(0,F.jsx)("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary"})}):(0,F.jsxs)("div",{className:"space-y-4",children:[(0,F.jsxs)("div",{children:[(0,F.jsx)("h3",{className:"text-sm font-medium text-muted-foreground",children:"Text"}),(0,F.jsx)("p",{className:"mt-1 font-medium",children:ad?.text||ab.text})]}),ad?.tags&&ad.tags.length>0&&(0,F.jsxs)("div",{children:[(0,F.jsx)("h3",{className:"text-sm font-medium text-muted-foreground mb-1",children:"Tags"}),(0,F.jsx)("div",{className:"flex flex-wrap gap-1",children:ad.tags.map(a=>(0,F.jsxs)("span",{className:"text-xs px-2 py-0.5 rounded bg-muted text-muted-foreground flex items-center gap-1",children:[(0,F.jsx)(bl.Tag,{className:"w-2.5 h-2.5"}),a]},a))})]}),ad?.source_memories&&ad.source_memories.length>0&&(0,F.jsxs)("div",{children:[(0,F.jsxs)("h3",{className:"text-sm font-medium text-muted-foreground mb-2",children:["Source Memories (",ad.source_memories.length,")"]}),(0,F.jsx)("div",{className:"space-y-2",children:ad.source_memories.map((a,b)=>(0,F.jsx)("div",{className:"p-3 bg-muted rounded-lg",children:(0,F.jsx)("div",{className:"text-sm text-muted-foreground whitespace-pre-wrap",children:a.text||("string"==typeof a?a:"")})},b))})]}),(0,F.jsxs)("div",{className:"pt-2 border-t",children:[(0,F.jsx)("h3",{className:"text-sm font-medium text-muted-foreground",children:"ID"}),(0,F.jsx)("p",{className:"mt-1 font-mono text-xs text-muted-foreground",children:ab.id})]})]})]})}),(0,F.jsx)(si,{mentalModelId:ai,onClose:()=>aj(null)})]}):(0,F.jsx)(n_,{className:"border-dashed",children:(0,F.jsxs)(n3,{className:"flex flex-col items-center justify-center py-16",children:[(0,F.jsx)(N,{className:"h-12 w-12 text-muted-foreground mb-4"}),(0,F.jsx)("h3",{className:"text-xl font-semibold mb-2",children:"No Bank Selected"}),(0,F.jsx)("p",{className:"text-muted-foreground",children:"Select a memory bank to start reflecting."})]})})}let sk=(0,L.default)("arrow-down",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);function sl(){let a,b,c,d,e,f,g,h,i,j,k,l,n,o,{currentBank:p}=(0,J.useBank)(),[q,r]=(0,I.useState)(""),[s,t]=(0,I.useState)(["world"]),[u,v]=(0,I.useState)("mid"),[w,x]=(0,I.useState)(4096),[y,z]=(0,I.useState)(""),[A,B]=(0,I.useState)(!1),[C,D]=(0,I.useState)(!1),[E,G]=(0,I.useState)(""),[H,L]=(0,I.useState)("any"),[M,Q]=(0,I.useState)(null),[S,T]=(0,I.useState)(null),[U,V]=(0,I.useState)(null),[$,_]=(0,I.useState)(null),[aa,ab]=(0,I.useState)(null),[ac,ad]=(0,I.useState)(!1),[af,ag]=(0,I.useState)("results"),[ah,ai]=(0,I.useState)(null),[aj,ak]=(0,I.useState)(new Set),[al,am]=(0,I.useState)(new Set),an=a=>{ak(b=>{let c=new Set(b);return c.has(a)?c.delete(a):c.add(a),c})},ao=a=>{am(b=>{let c=new Set(b);return c.has(a)?c.delete(a):c.add(a),c})},ap=a=>{let b=a.id||a.node_id;ai(M?.find(a=>a.id===b||a.node_id===b)||a)},aq=async()=>{if(!p)return void alert("Please select a memory bank first");if(q){if(0===s.length)return void alert("Please select at least one type (World, Experience, or Observations)");ad(!0);try{let a=E.split(",").map(a=>a.trim()).filter(a=>a.length>0),b={bank_id:p,query:q,types:s,budget:u,max_tokens:w,trace:!0,include:{entities:C?{max_tokens:500}:null,chunks:A?{max_tokens:8192}:null},...y&&{query_timestamp:y},...a.length>0&&{tags:a,tags_match:H}},c=await W.client.recall(b);Q(c.results||[]),T(c.entities||null),V(c.chunks||null),_(c.observations||null),ab(c.trace||null),ag("results")}catch(a){console.error("Error running search:",a),alert("Error running search: "+a.message)}finally{ad(!1)}}},ar=a=>{t(b=>b.includes(a)?b.filter(b=>b!==a):[...b,a])};return p?(0,F.jsxs)("div",{className:"space-y-6",children:[(0,F.jsx)(n_,{children:(0,F.jsxs)(n3,{className:"pt-6",children:[(0,F.jsxs)("div",{className:"flex gap-3",children:[(0,F.jsxs)("div",{className:"flex-1 relative",children:[(0,F.jsx)(K.Search,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),(0,F.jsx)(Y.Input,{type:"text",value:q,onChange:a=>r(a.target.value),placeholder:"What would you like to recall?",className:"pl-10 h-12 text-lg",onKeyDown:a=>"Enter"===a.key&&aq()})]}),(0,F.jsx)(X.Button,{onClick:aq,disabled:ac||!q,className:"h-12 px-8",children:ac?"Searching...":"Recall"})]}),(0,F.jsxs)("div",{className:"flex flex-wrap items-center gap-6 mt-4 pt-4 border-t",children:[(0,F.jsxs)("div",{className:"flex items-center gap-4",children:[(0,F.jsx)("span",{className:"text-sm font-medium text-muted-foreground",children:"Types:"}),(0,F.jsxs)("div",{className:"flex gap-3",children:[["world","experience"].map(a=>(0,F.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer",children:[(0,F.jsx)(n$.Checkbox,{checked:s.includes(a),onCheckedChange:()=>ar(a)}),(0,F.jsx)("span",{className:"text-sm capitalize",children:a})]},a)),(0,F.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer",children:[(0,F.jsx)(n$.Checkbox,{checked:s.includes("observation"),onCheckedChange:()=>ar("observation")}),(0,F.jsx)("span",{className:"text-sm",children:"Observations"})]})]})]}),(0,F.jsx)("div",{className:"h-6 w-px bg-border"}),(0,F.jsxs)("div",{className:"flex items-center gap-2",children:[(0,F.jsx)(oS,{className:"h-4 w-4 text-muted-foreground"}),(0,F.jsxs)(nc,{value:u,onValueChange:a=>v(a),children:[(0,F.jsx)(nV,{className:"w-24 h-8",children:(0,F.jsx)(ng,{})}),(0,F.jsxs)(nY,{children:[(0,F.jsx)(nZ,{value:"low",children:"Low"}),(0,F.jsx)(nZ,{value:"mid",children:"Mid"}),(0,F.jsx)(nZ,{value:"high",children:"High"})]})]})]}),(0,F.jsxs)("div",{className:"flex items-center gap-2",children:[(0,F.jsx)("span",{className:"text-sm text-muted-foreground",children:"Tokens:"}),(0,F.jsx)(Y.Input,{type:"number",value:w,onChange:a=>x(parseInt(a.target.value)),className:"w-24 h-8"})]}),(0,F.jsxs)("div",{className:"flex items-center gap-2",children:[(0,F.jsx)(ae,{className:"h-4 w-4 text-muted-foreground"}),(0,F.jsx)(Y.Input,{type:"datetime-local",value:y,onChange:a=>z(a.target.value),className:"h-8",placeholder:"Query date"})]}),(0,F.jsx)("div",{className:"h-6 w-px bg-border"}),(0,F.jsxs)("div",{className:"flex items-center gap-4",children:[(0,F.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer",children:[(0,F.jsx)(n$.Checkbox,{checked:A,onCheckedChange:a=>B(a)}),(0,F.jsx)(O.FileText,{className:"h-4 w-4 text-muted-foreground"}),(0,F.jsx)("span",{className:"text-sm",children:"Chunks"})]}),(0,F.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer",children:[(0,F.jsx)(n$.Checkbox,{checked:C,onCheckedChange:a=>D(a)}),(0,F.jsx)(P,{className:"h-4 w-4 text-muted-foreground"}),(0,F.jsx)("span",{className:"text-sm",children:"Entities"})]})]})]}),(0,F.jsxs)("div",{className:"flex items-center gap-4 mt-4 pt-4 border-t",children:[(0,F.jsx)(bl.Tag,{className:"h-4 w-4 text-muted-foreground"}),(0,F.jsx)("div",{className:"flex-1 max-w-md",children:(0,F.jsx)(Y.Input,{type:"text",value:E,onChange:a=>G(a.target.value),placeholder:"Filter by tags (comma-separated)",className:"h-8"})}),(0,F.jsxs)(nc,{value:H,onValueChange:a=>L(a),children:[(0,F.jsx)(nV,{className:"w-40 h-8",children:(0,F.jsx)(ng,{})}),(0,F.jsxs)(nY,{children:[(0,F.jsx)(nZ,{value:"any",children:"Any (incl. untagged)"}),(0,F.jsx)(nZ,{value:"all",children:"All (incl. untagged)"}),(0,F.jsx)(nZ,{value:"any_strict",children:"Any (strict)"}),(0,F.jsx)(nZ,{value:"all_strict",children:"All (strict)"})]})]})]})]})}),ac&&(0,F.jsx)(n_,{children:(0,F.jsxs)(n3,{className:"flex flex-col items-center justify-center py-16",children:[(0,F.jsx)("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary mb-4"}),(0,F.jsx)("p",{className:"text-muted-foreground",children:"Searching memories..."})]})}),!ac&&M&&(0,F.jsxs)("div",{className:"space-y-4",children:[aa?.summary&&(0,F.jsxs)("div",{className:"flex items-center gap-6 text-sm",children:[(0,F.jsxs)("div",{className:"flex items-center gap-2",children:[(0,F.jsx)("span",{className:"text-muted-foreground",children:"Results:"}),(0,F.jsx)("span",{className:"font-semibold",children:M.length})]}),(0,F.jsxs)("div",{className:"flex items-center gap-2",children:[(0,F.jsx)("span",{className:"text-muted-foreground",children:"Duration:"}),(0,F.jsxs)("span",{className:"font-semibold",children:[aa.summary.total_duration_seconds?.toFixed(2),"s"]})]}),(0,F.jsxs)("div",{className:"flex items-center gap-2",children:[(0,F.jsx)("span",{className:"text-muted-foreground",children:"Nodes visited:"}),(0,F.jsx)("span",{className:"font-semibold",children:aa.summary.total_nodes_visited})]}),(0,F.jsx)("div",{className:"flex-1"}),(0,F.jsx)("div",{className:"flex gap-1 bg-muted p-1 rounded-lg",children:["results","trace","json"].map(a=>(0,F.jsx)("button",{onClick:()=>ag(a),className:`px-3 py-1.5 text-sm font-medium rounded-md transition-colors ${af===a?"bg-background shadow-sm":"text-muted-foreground hover:text-foreground"}`,children:"results"===a?"Results":"trace"===a?"Trace":"JSON"},a))})]}),"results"===af&&(0,F.jsxs)("div",{className:"space-y-4",children:[$&&$.length>0&&(0,F.jsxs)(n_,{className:"border-orange-500/30 bg-orange-500/5",children:[(0,F.jsx)(n0,{className:"py-3",children:(0,F.jsxs)(n1,{className:"text-base flex items-center gap-2",children:[(0,F.jsx)(N,{className:"h-4 w-4 text-orange-500"}),(0,F.jsx)("span",{children:"Observations"}),(0,F.jsxs)("span",{className:"text-xs text-muted-foreground",children:["(",$.length,")"]})]})}),(0,F.jsx)(n3,{className:"pt-0 space-y-2",children:$.map((a,b)=>(0,F.jsxs)("div",{className:"p-3 bg-background rounded-lg border border-orange-500/20",children:[(0,F.jsx)("p",{className:"text-sm text-foreground",children:a.text}),(0,F.jsxs)("div",{className:"flex items-center gap-3 mt-2 text-xs text-muted-foreground",children:[(0,F.jsx)("span",{className:"px-2 py-0.5 rounded bg-orange-500/10 text-orange-600",children:"Observation"}),(0,F.jsxs)("span",{children:["Proof count: ",a.proof_count||1]}),(0,F.jsxs)("span",{children:["Relevance: ",(a.relevance||0).toFixed(3)]})]})]},a.id||b))})]}),(0,F.jsx)("div",{className:"space-y-3",children:0!==M.length||$&&0!==$.length?M.map((a,b)=>{let c=aa?.visits?.find(b=>b.node_id===a.id),d=c?c.weights.final_weight:a.score||0;return(0,F.jsx)(n_,{className:"cursor-pointer hover:border-primary/50 transition-colors",onClick:()=>ai(a),children:(0,F.jsx)(n3,{className:"py-4",children:(0,F.jsxs)("div",{className:"flex items-start gap-4",children:[(0,F.jsx)("div",{className:"flex-shrink-0 w-8 h-8 rounded-full bg-primary/10 flex items-center justify-center",children:(0,F.jsx)("span",{className:"text-sm font-semibold text-primary",children:b+1})}),(0,F.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,F.jsx)("p",{className:"text-foreground",children:a.text}),(0,F.jsxs)("div",{className:"flex items-center gap-4 mt-2 text-xs text-muted-foreground",children:[(0,F.jsx)("span",{className:"px-2 py-0.5 rounded bg-muted capitalize",children:a.type||"world"}),a.context&&(0,F.jsx)("span",{className:"truncate max-w-xs",children:a.context}),a.occurred_start&&(0,F.jsx)("span",{children:new Date(a.occurred_start).toLocaleDateString()})]})]}),(0,F.jsxs)("div",{className:"flex-shrink-0 text-right",children:[(0,F.jsx)("div",{className:"text-sm font-semibold",children:d.toFixed(3)}),(0,F.jsx)("div",{className:"text-xs text-muted-foreground",children:"score"})]}),(0,F.jsx)(R,{className:"h-5 w-5 text-muted-foreground flex-shrink-0"})]})})},b)}):(0,F.jsx)(n_,{children:(0,F.jsxs)(n3,{className:"flex flex-col items-center justify-center py-12",children:[(0,F.jsx)(K.Search,{className:"h-12 w-12 text-muted-foreground mb-4"}),(0,F.jsx)("p",{className:"text-muted-foreground",children:"No memories found for this query."})]})})})]}),"trace"===af&&aa&&(0,F.jsxs)("div",{className:"space-y-4",children:[aa.retrieval_results&&aa.retrieval_results.length>0&&(a={},aa.retrieval_results.forEach(b=>{let c=b.fact_type||"all";a[c]||(a[c]=[]),a[c].push(b)}),b=Object.keys(a),(0,F.jsxs)("div",{children:[(0,F.jsxs)("div",{className:"text-xs font-medium text-muted-foreground mb-3 flex items-center gap-2",children:[(0,F.jsx)("div",{className:"flex-1 h-px bg-border"}),(0,F.jsx)("span",{children:"PARALLEL RETRIEVAL"}),(0,F.jsx)("div",{className:"flex-1 h-px bg-border"})]}),(0,F.jsx)("div",{className:"space-y-2",children:b.map((b,c)=>{let d=a[b],e=`lane-${b}`,f=aj.has(e),g=d.reduce((a,b)=>a+(b.results?.length||0),0),h=Math.max(...d.map(a=>a.duration_seconds||0)),i={world:{bg:"bg-blue-500/10",text:"text-blue-500",border:"border-blue-500/30"},experience:{bg:"bg-green-500/10",text:"text-green-500",border:"border-green-500/30"},opinion:{bg:"bg-purple-500/10",text:"text-purple-500",border:"border-purple-500/30"},all:{bg:"bg-gray-500/10",text:"text-gray-500",border:"border-gray-500/30"}},j=i[b]||i.all;return(0,F.jsx)(n_,{className:`transition-colors ${f?"border-primary":j.border}`,children:(0,F.jsxs)(n3,{className:"py-3 px-4",children:[(0,F.jsxs)("div",{className:"flex items-center gap-3 cursor-pointer",onClick:()=>an(e),children:[(0,F.jsx)("div",{className:`w-8 h-8 rounded-lg ${j.bg} flex items-center justify-center`,children:(0,F.jsx)("span",{className:`text-sm font-bold ${j.text} capitalize`,children:b.charAt(0).toUpperCase()})}),(0,F.jsxs)("div",{className:"flex-1",children:[(0,F.jsxs)("div",{className:"flex items-center gap-2",children:[(0,F.jsx)("span",{className:"font-semibold text-foreground capitalize",children:b}),(0,F.jsxs)("span",{className:"text-xs text-muted-foreground",children:[d.length," methods"]})]}),(0,F.jsx)("div",{className:"flex gap-1.5 mt-1",children:d.map((a,b)=>(0,F.jsxs)("span",{className:"text-[10px] px-2 py-0.5 rounded-full bg-muted text-muted-foreground capitalize",children:[a.method_name,": ",a.results?.length||0]},b))})]}),(0,F.jsxs)("div",{className:"text-right",children:[(0,F.jsx)("div",{className:"text-2xl font-bold text-foreground",children:g}),(0,F.jsxs)("div",{className:"text-[10px] text-muted-foreground",children:[h.toFixed(2),"s"]})]}),f?(0,F.jsx)(nT,{className:"h-5 w-5 text-muted-foreground"}):(0,F.jsx)(R,{className:"h-5 w-5 text-muted-foreground"})]}),f&&(0,F.jsx)("div",{className:"mt-4 pt-4 border-t border-border",children:(0,F.jsx)("div",{className:`grid gap-3 ${1===d.length?"grid-cols-1":2===d.length?"grid-cols-2":3===d.length?"grid-cols-3":"grid-cols-4"}`,children:d.map((a,b)=>{let c,d,f,g,h=`${e}-method-${b}`,i=aj.has(h),j=a.results||[];return(0,F.jsxs)("div",{className:"flex flex-col",children:[(0,F.jsxs)("div",{className:`p-3 rounded-lg cursor-pointer transition-colors ${i?"bg-primary/10 border border-primary":"bg-muted/50 hover:bg-muted"}`,onClick:a=>{a.stopPropagation(),an(h)},children:[(0,F.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,F.jsxs)("div",{className:"flex items-center gap-2",children:[(0,F.jsx)("span",{className:"font-medium text-sm text-foreground capitalize",children:a.method_name}),"temporal"===a.method_name&&a.metadata?.constraint&&(0,F.jsxs)("span",{className:"flex items-center gap-1 text-[10px] text-muted-foreground",children:[(0,F.jsx)(Z,{className:"h-3 w-3"}),a.metadata.constraint.start?new Date(a.metadata.constraint.start).toLocaleDateString():"any"," → ",a.metadata.constraint.end?new Date(a.metadata.constraint.end).toLocaleDateString():"any"]})]}),i?(0,F.jsx)(nT,{className:"h-3 w-3 text-muted-foreground"}):(0,F.jsx)(R,{className:"h-3 w-3 text-muted-foreground"})]}),(0,F.jsxs)("div",{className:"flex items-end justify-between",children:[(0,F.jsx)("div",{className:"text-2xl font-bold text-foreground",children:j.length}),(0,F.jsxs)("div",{className:"text-[10px] text-muted-foreground",children:[a.duration_seconds?.toFixed(2),"s"]})]})]}),i&&j.length>0&&(c=`results-${h}`,f=(d=al.has(c))?j:j.slice(0,5),g=j.length>5,(0,F.jsxs)("div",{className:"mt-2 space-y-1.5 max-h-[300px] overflow-y-auto",children:[f.map((a,b)=>(0,F.jsx)("div",{className:"p-2 bg-background rounded cursor-pointer hover:bg-muted/50 transition-colors border border-border",onClick:b=>{b.stopPropagation(),ap(a)},children:(0,F.jsxs)("div",{className:"flex items-start gap-2",children:[(0,F.jsx)("span",{className:"text-[10px] font-mono text-muted-foreground mt-0.5",children:b+1}),(0,F.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,F.jsx)("p",{className:"text-xs text-foreground line-clamp-2",children:a.text}),(0,F.jsx)("div",{className:"flex items-center gap-2 mt-1",children:(0,F.jsx)("span",{className:"text-[10px] text-muted-foreground",children:(a.score||a.similarity||0).toFixed(4)})})]})]})},b)),g&&(0,F.jsx)("button",{className:"w-full text-[10px] text-primary hover:text-primary/80 py-1.5 hover:bg-muted/50 rounded transition-colors",onClick:a=>{a.stopPropagation(),ao(c)},children:d?"Show less":`View all ${j.length} results`})]}))]},h)})})})]})},e)})}),(0,F.jsx)("div",{className:"flex justify-center py-2",children:(0,F.jsx)("div",{className:"flex items-center gap-2",children:b.map((a,b)=>{let c={world:"bg-blue-500",experience:"bg-green-500",opinion:"bg-purple-500",all:"bg-gray-500"};return(0,F.jsx)("div",{className:"flex flex-col items-center",children:(0,F.jsx)("div",{className:`w-1 h-4 ${c[a]||c.all} rounded-full opacity-50`})},b)})})}),(0,F.jsx)("div",{className:"flex justify-center",children:(0,F.jsx)(sk,{className:"h-5 w-5 text-muted-foreground/50"})})]})),aa.rrf_merged&&(c="rrf-merge",d=aj.has(c),(0,F.jsxs)("div",{children:[(0,F.jsx)(n_,{className:`cursor-pointer transition-colors ${d?"border-primary":"hover:border-primary/50"}`,onClick:()=>an(c),children:(0,F.jsx)(n3,{className:"py-4",children:(0,F.jsxs)("div",{className:"flex items-center gap-4",children:[(0,F.jsx)("div",{className:"flex-shrink-0 w-10 h-10 rounded-full bg-purple-500/10 flex items-center justify-center",children:(0,F.jsx)("span",{className:"text-sm font-bold text-purple-500",children:"∪"})}),(0,F.jsxs)("div",{className:"flex-1",children:[(0,F.jsxs)("div",{className:"flex items-center gap-2",children:[(0,F.jsx)("span",{className:"font-semibold text-foreground",children:"RRF Fusion"}),(0,F.jsx)("span",{className:"text-xs px-2 py-0.5 rounded bg-muted text-muted-foreground",children:"merge"})]}),(0,F.jsx)("div",{className:"text-sm text-muted-foreground mt-0.5",children:"Reciprocal Rank Fusion of all retrieval results"})]}),(0,F.jsx)("div",{className:"text-2xl font-bold text-foreground",children:aa.rrf_merged.length}),d?(0,F.jsx)(nT,{className:"h-5 w-5 text-muted-foreground"}):(0,F.jsx)(R,{className:"h-5 w-5 text-muted-foreground"})]})})}),d&&aa.rrf_merged.length>0&&(e="results-rrf",g=(f=al.has(e))?aa.rrf_merged:aa.rrf_merged.slice(0,5),h=aa.rrf_merged.length>5,(0,F.jsxs)("div",{className:"ml-6 mt-2 space-y-2 border-l-2 border-muted pl-4 max-h-[400px] overflow-y-auto",children:[g.map((a,b)=>(0,F.jsx)("div",{className:"p-3 bg-muted/30 rounded-lg cursor-pointer hover:bg-muted/50 transition-colors",onClick:b=>{b.stopPropagation(),ap(a)},children:(0,F.jsxs)("div",{className:"flex items-start gap-3",children:[(0,F.jsx)("span",{className:"text-xs font-mono text-muted-foreground",children:b+1}),(0,F.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,F.jsx)("p",{className:"text-sm text-foreground line-clamp-2",children:a.text}),(0,F.jsxs)("div",{className:"text-xs text-muted-foreground mt-1",children:["RRF Score: ",(a.rrf_score||a.score||0).toFixed(4)]})]})]})},b)),h&&(0,F.jsx)("button",{className:"w-full text-xs text-primary hover:text-primary/80 py-2 hover:bg-muted/50 rounded transition-colors",onClick:a=>{a.stopPropagation(),ao(e)},children:f?"Show less":`View all ${aa.rrf_merged.length} results`})]})),(0,F.jsx)("div",{className:"flex justify-center py-2",children:(0,F.jsx)(sk,{className:"h-4 w-4 text-muted-foreground/50"})})]})),aa.reranked&&(i="reranking",j=aj.has(i),(0,F.jsxs)("div",{children:[(0,F.jsx)(n_,{className:`cursor-pointer transition-colors ${j?"border-primary":"hover:border-primary/50"}`,onClick:()=>an(i),children:(0,F.jsx)(n3,{className:"py-4",children:(0,F.jsxs)("div",{className:"flex items-center gap-4",children:[(0,F.jsx)("div",{className:"flex-shrink-0 w-10 h-10 rounded-full bg-amber-500/10 flex items-center justify-center",children:(0,F.jsx)("span",{className:"text-sm font-bold text-amber-500",children:"⚡"})}),(0,F.jsxs)("div",{className:"flex-1",children:[(0,F.jsxs)("div",{className:"flex items-center gap-2",children:[(0,F.jsx)("span",{className:"font-semibold text-foreground",children:"Combined Scoring"}),(0,F.jsx)("span",{className:"text-xs px-2 py-0.5 rounded bg-muted text-muted-foreground",children:"rerank"})]}),(0,F.jsx)("div",{className:"text-sm text-muted-foreground mt-0.5",children:(0,F.jsx)("span",{className:"font-mono text-xs",children:"0.6×cross_encoder + 0.2×rrf + 0.1×temporal + 0.1×recency"})})]}),(0,F.jsx)("div",{className:"text-2xl font-bold text-foreground",children:aa.reranked.length}),j?(0,F.jsx)(nT,{className:"h-5 w-5 text-muted-foreground"}):(0,F.jsx)(R,{className:"h-5 w-5 text-muted-foreground"})]})})}),j&&aa.reranked.length>0&&(k="results-rerank",n=(l=al.has(k))?aa.reranked:aa.reranked.slice(0,5),o=aa.reranked.length>5,(0,F.jsxs)("div",{className:"ml-6 mt-2 space-y-2 border-l-2 border-muted pl-4 max-h-[400px] overflow-y-auto",children:[n.map((a,b)=>{let c=a.score_components||{};return(0,F.jsx)("div",{className:"p-3 bg-muted/30 rounded-lg cursor-pointer hover:bg-muted/50 transition-colors",onClick:b=>{b.stopPropagation(),ap(a)},children:(0,F.jsxs)("div",{className:"flex items-start gap-3",children:[(0,F.jsx)("span",{className:"text-xs font-mono text-muted-foreground",children:b+1}),(0,F.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,F.jsx)("p",{className:"text-sm text-foreground line-clamp-2",children:a.text}),(0,F.jsxs)("div",{className:"flex flex-wrap gap-x-3 gap-y-1 mt-2 text-[10px] text-muted-foreground font-mono",children:[(0,F.jsxs)("span",{className:"font-semibold text-foreground",children:["= ",(a.rerank_score||a.score||0).toFixed(4)]}),void 0!==c.cross_encoder_score_normalized&&(0,F.jsxs)("span",{title:"Cross-encoder (60%)",children:["CE: ",c.cross_encoder_score_normalized.toFixed(3)]}),void 0!==c.rrf_normalized&&(0,F.jsxs)("span",{title:`RRF normalized (20%) - raw: ${c.rrf_score?.toFixed(4)||"N/A"}`,children:["RRF: ",c.rrf_normalized.toFixed(3)]}),void 0!==c.temporal&&(0,F.jsxs)("span",{title:"Temporal proximity (10%)",children:["Tmp: ",c.temporal.toFixed(3)]}),void 0!==c.recency&&(0,F.jsxs)("span",{title:"Recency (10%)",children:["Rec: ",c.recency.toFixed(3)]})]})]})]})},b)}),o&&(0,F.jsx)("button",{className:"w-full text-xs text-primary hover:text-primary/80 py-2 hover:bg-muted/50 rounded transition-colors",onClick:a=>{a.stopPropagation(),ao(k)},children:l?"Show less":`View all ${aa.reranked.length} results`})]})),(0,F.jsx)("div",{className:"flex justify-center py-2",children:(0,F.jsx)(sk,{className:"h-4 w-4 text-muted-foreground/50"})})]})),(0,F.jsx)(n_,{className:"border-primary bg-primary/5",children:(0,F.jsx)(n3,{className:"py-4",children:(0,F.jsxs)("div",{className:"flex items-center gap-4",children:[(0,F.jsx)("div",{className:"flex-shrink-0 w-10 h-10 rounded-full bg-primary/20 flex items-center justify-center",children:(0,F.jsx)("span",{className:"text-sm font-bold text-primary",children:"✓"})}),(0,F.jsxs)("div",{className:"flex-1",children:[(0,F.jsxs)("div",{className:"flex items-center gap-2",children:[(0,F.jsx)("span",{className:"font-semibold text-foreground",children:"Final Results"}),(0,F.jsx)("span",{className:"text-xs px-2 py-0.5 rounded bg-primary/20 text-primary",children:"output"})]}),(0,F.jsx)("div",{className:"text-sm text-muted-foreground mt-0.5",children:"Top results after all processing steps"})]}),(0,F.jsx)("div",{className:"text-2xl font-bold text-primary",children:M?.length||0})]})})})]}),"json"===af&&(0,F.jsxs)(n_,{children:[(0,F.jsx)(n0,{children:(0,F.jsx)(n1,{className:"text-lg",children:"Raw Response"})}),(0,F.jsx)(n3,{children:(0,F.jsx)("div",{className:"bg-muted p-4 rounded-lg overflow-auto max-h-[600px]",children:(0,F.jsx)(oR,{src:{results:M,...S&&{entities:S},...U&&{chunks:U},...$&&{observations:$},trace:aa},collapsed:2,theme:"default"})})})]})]}),!ac&&!M&&(0,F.jsx)(n_,{className:"border-dashed",children:(0,F.jsxs)(n3,{className:"flex flex-col items-center justify-center py-16",children:[(0,F.jsx)(K.Search,{className:"h-12 w-12 text-muted-foreground mb-4"}),(0,F.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Ready to Recall"}),(0,F.jsx)("p",{className:"text-muted-foreground text-center max-w-md",children:"Enter a query above to search through your memories. Use filters to narrow down by fact type, budget, and more."})]})}),ah&&(0,F.jsx)("div",{className:"fixed right-0 top-0 h-screen w-[420px] bg-card border-l shadow-2xl z-50 overflow-y-auto",children:(0,F.jsx)(bo,{memory:ah,onClose:()=>ai(null),inPanel:!0,bankId:p||void 0})})]}):(0,F.jsx)(n_,{className:"border-dashed",children:(0,F.jsxs)(n3,{className:"flex flex-col items-center justify-center py-16",children:[(0,F.jsx)(N,{className:"h-12 w-12 text-muted-foreground mb-4"}),(0,F.jsx)("h3",{className:"text-xl font-semibold mb-2",children:"No Bank Selected"}),(0,F.jsx)("p",{className:"text-muted-foreground",children:"Select a memory bank to start recalling."})]})})}var sm=a.i(74206),sn=a.i(77192),so=a.i(24050),sp=Symbol("radix.slottable");function sq(a){return I.isValidElement(a)&&"function"==typeof a.type&&"__radixId"in a.type&&a.type.__radixId===sp}var sr=["Enter"," "],ss=["ArrowUp","PageDown","End"],st=["ArrowDown","PageUp","Home",...ss],su={ltr:[...sr,"ArrowRight"],rtl:[...sr,"ArrowLeft"]},sv={ltr:["ArrowLeft"],rtl:["ArrowRight"]},sw="Menu",[sx,sy,sz]=(0,aC.createCollection)(sw),[sA,sB]=(0,aw.createContextScope)(sw,[sz,mR.createPopperScope,so.createRovingFocusGroupScope]),sC=(0,mR.createPopperScope)(),sD=(0,so.createRovingFocusGroupScope)(),[sE,sF]=sA(sw),[sG,sH]=sA(sw),sI=a=>{let{__scopeMenu:b,open:c=!1,children:d,dir:e,onOpenChange:f,modal:g=!0}=a,h=sC(b),[i,j]=I.useState(null),k=I.useRef(!1),l=(0,mV.useCallbackRef)(f),n=(0,ay.useDirection)(e);return I.useEffect(()=>{let a=()=>{k.current=!0,document.addEventListener("pointerdown",b,{capture:!0,once:!0}),document.addEventListener("pointermove",b,{capture:!0,once:!0})},b=()=>k.current=!1;return document.addEventListener("keydown",a,{capture:!0}),()=>{document.removeEventListener("keydown",a,{capture:!0}),document.removeEventListener("pointerdown",b,{capture:!0}),document.removeEventListener("pointermove",b,{capture:!0})}},[]),(0,F.jsx)(mR.Root,{...h,children:(0,F.jsx)(sE,{scope:b,open:c,onOpenChange:l,content:i,onContentChange:j,children:(0,F.jsx)(sG,{scope:b,onClose:I.useCallback(()=>l(!1),[l]),isUsingKeyboardRef:k,dir:n,modal:g,children:d})})})};sI.displayName=sw;var sJ=I.forwardRef((a,b)=>{let{__scopeMenu:c,...d}=a,e=sC(c);return(0,F.jsx)(mR.Anchor,{...e,...d,ref:b})});sJ.displayName="MenuAnchor";var sK="MenuPortal",[sL,sM]=sA(sK,{forceMount:void 0}),sN=a=>{let{__scopeMenu:b,forceMount:c,children:d,container:e}=a,f=sF(sK,b);return(0,F.jsx)(sL,{scope:b,forceMount:c,children:(0,F.jsx)(sn.Presence,{present:c||f.open,children:(0,F.jsx)(mS.Portal,{asChild:!0,container:e,children:d})})})};sN.displayName=sK;var sO="MenuContent",[sP,sQ]=sA(sO),sR=I.forwardRef((a,b)=>{let c=sM(sO,a.__scopeMenu),{forceMount:d=c.forceMount,...e}=a,f=sF(sO,a.__scopeMenu),g=sH(sO,a.__scopeMenu);return(0,F.jsx)(sx.Provider,{scope:a.__scopeMenu,children:(0,F.jsx)(sn.Presence,{present:d||f.open,children:(0,F.jsx)(sx.Slot,{scope:a.__scopeMenu,children:g.modal?(0,F.jsx)(sS,{...e,ref:b}):(0,F.jsx)(sT,{...e,ref:b})})})})}),sS=I.forwardRef((a,b)=>{let c=sF(sO,a.__scopeMenu),d=I.useRef(null),e=(0,av.useComposedRefs)(b,d);return I.useEffect(()=>{let a=d.current;if(a)return(0,mZ.hideOthers)(a)},[]),(0,F.jsx)(sV,{...a,ref:e,trapFocus:c.open,disableOutsidePointerEvents:c.open,disableOutsideScroll:!0,onFocusOutside:(0,au.composeEventHandlers)(a.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>c.onOpenChange(!1)})}),sT=I.forwardRef((a,b)=>{let c=sF(sO,a.__scopeMenu);return(0,F.jsx)(sV,{...a,ref:b,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>c.onOpenChange(!1)})}),sU=((h=I.forwardRef((a,b)=>{let{children:c,...d}=a;if(I.isValidElement(c)){var e;let a,f,g=(e=c,(f=(a=Object.getOwnPropertyDescriptor(e.props,"ref")?.get)&&"isReactWarning"in a&&a.isReactWarning)?e.ref:(f=(a=Object.getOwnPropertyDescriptor(e,"ref")?.get)&&"isReactWarning"in a&&a.isReactWarning)?e.props.ref:e.props.ref||e.ref),h=function(a,b){let c={...b};for(let d in b){let e=a[d],f=b[d];/^on[A-Z]/.test(d)?e&&f?c[d]=(...a)=>{let b=f(...a);return e(...a),b}:e&&(c[d]=e):"style"===d?c[d]={...e,...f}:"className"===d&&(c[d]=[e,f].filter(Boolean).join(" "))}return{...a,...c}}(d,c.props);return c.type!==I.Fragment&&(h.ref=b?(0,av.composeRefs)(b,g):g),I.cloneElement(c,h)}return I.Children.count(c)>1?I.Children.only(null):null})).displayName="MenuContent.ScrollLock.SlotClone",e=h,(f=I.forwardRef((a,b)=>{let{children:c,...d}=a,f=I.Children.toArray(c),g=f.find(sq);if(g){let a=g.props.children,c=f.map(b=>b!==g?b:I.Children.count(a)>1?I.Children.only(null):I.isValidElement(a)?a.props.children:null);return(0,F.jsx)(e,{...d,ref:b,children:I.isValidElement(a)?I.cloneElement(a,void 0,c):null})}return(0,F.jsx)(e,{...d,ref:b,children:c})})).displayName="MenuContent.ScrollLock.Slot",f),sV=I.forwardRef((a,b)=>{let{__scopeMenu:c,loop:d=!1,trapFocus:e,onOpenAutoFocus:f,onCloseAutoFocus:g,disableOutsidePointerEvents:h,onEntryFocus:i,onEscapeKeyDown:j,onPointerDownOutside:k,onFocusOutside:l,onInteractOutside:n,onDismiss:o,disableOutsideScroll:p,...q}=a,r=sF(sO,c),s=sH(sO,c),t=sC(c),u=sD(c),v=sy(c),[w,x]=I.useState(null),y=I.useRef(null),z=(0,av.useComposedRefs)(b,y,r.onContentChange),A=I.useRef(0),B=I.useRef(""),C=I.useRef(0),D=I.useRef(null),E=I.useRef("right"),G=I.useRef(0),H=p?m$.RemoveScroll:I.Fragment;I.useEffect(()=>()=>window.clearTimeout(A.current),[]),(0,mO.useFocusGuards)();let J=I.useCallback(a=>{var b,c;return E.current===D.current?.side&&(b=a,!!(c=D.current?.area)&&function(a,b){let{x:c,y:d}=a,e=!1;for(let a=0,f=b.length-1;a<b.length;f=a++){let g=b[a],h=b[f],i=g.x,j=g.y,k=h.x,l=h.y;j>d!=l>d&&c<(k-i)*(d-j)/(l-j)+i&&(e=!e)}return e}({x:b.clientX,y:b.clientY},c))},[]);return(0,F.jsx)(sP,{scope:c,searchRef:B,onItemEnter:I.useCallback(a=>{J(a)&&a.preventDefault()},[J]),onItemLeave:I.useCallback(a=>{J(a)||(y.current?.focus(),x(null))},[J]),onTriggerLeave:I.useCallback(a=>{J(a)&&a.preventDefault()},[J]),pointerGraceTimerRef:C,onPointerGraceIntentChange:I.useCallback(a=>{D.current=a},[]),children:(0,F.jsx)(H,{...p?{as:sU,allowPinchZoom:!0}:void 0,children:(0,F.jsx)(mP.FocusScope,{asChild:!0,trapped:e,onMountAutoFocus:(0,au.composeEventHandlers)(f,a=>{a.preventDefault(),y.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:g,children:(0,F.jsx)(mN.DismissableLayer,{asChild:!0,disableOutsidePointerEvents:h,onEscapeKeyDown:j,onPointerDownOutside:k,onFocusOutside:l,onInteractOutside:n,onDismiss:o,children:(0,F.jsx)(so.Root,{asChild:!0,...u,dir:s.dir,orientation:"vertical",loop:d,currentTabStopId:w,onCurrentTabStopIdChange:x,onEntryFocus:(0,au.composeEventHandlers)(i,a=>{s.isUsingKeyboardRef.current||a.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,F.jsx)(mR.Content,{role:"menu","aria-orientation":"vertical","data-state":tj(r.open),"data-radix-menu-content":"",dir:s.dir,...t,...q,ref:z,style:{outline:"none",...q.style},onKeyDown:(0,au.composeEventHandlers)(q.onKeyDown,a=>{let b=a.target.closest("[data-radix-menu-content]")===a.currentTarget,c=a.ctrlKey||a.altKey||a.metaKey,d=1===a.key.length;if(b){var e;let b,f,g,h,i,j;"Tab"===a.key&&a.preventDefault(),!c&&d&&(e=a.key,b=B.current+e,f=v().filter(a=>!a.disabled),g=document.activeElement,h=f.find(a=>a.ref.current===g)?.textValue,i=function(a,b,c){var d;let e=b.length>1&&Array.from(b).every(a=>a===b[0])?b[0]:b,f=c?a.indexOf(c):-1,g=(d=Math.max(f,0),a.map((b,c)=>a[(d+c)%a.length]));1===e.length&&(g=g.filter(a=>a!==c));let h=g.find(a=>a.toLowerCase().startsWith(e.toLowerCase()));return h!==c?h:void 0}(f.map(a=>a.textValue),b,h),j=f.find(a=>a.textValue===i)?.ref.current,function a(b){B.current=b,window.clearTimeout(A.current),""!==b&&(A.current=window.setTimeout(()=>a(""),1e3))}(b),j&&setTimeout(()=>j.focus()))}let f=y.current;if(a.target!==f||!st.includes(a.key))return;a.preventDefault();let g=v().filter(a=>!a.disabled).map(a=>a.ref.current);ss.includes(a.key)&&g.reverse(),function(a){let b=document.activeElement;for(let c of a)if(c===b||(c.focus(),document.activeElement!==b))return}(g)}),onBlur:(0,au.composeEventHandlers)(a.onBlur,a=>{a.currentTarget.contains(a.target)||(window.clearTimeout(A.current),B.current="")}),onPointerMove:(0,au.composeEventHandlers)(a.onPointerMove,tm(a=>{let b=a.target,c=G.current!==a.clientX;a.currentTarget.contains(b)&&c&&(E.current=a.clientX>G.current?"right":"left",G.current=a.clientX)}))})})})})})})});sR.displayName=sO;var sW=I.forwardRef((a,b)=>{let{__scopeMenu:c,...d}=a;return(0,F.jsx)(aB.Primitive.div,{role:"group",...d,ref:b})});sW.displayName="MenuGroup";var sX=I.forwardRef((a,b)=>{let{__scopeMenu:c,...d}=a;return(0,F.jsx)(aB.Primitive.div,{...d,ref:b})});sX.displayName="MenuLabel";var sY="MenuItem",sZ="menu.itemSelect",s$=I.forwardRef((a,b)=>{let{disabled:c=!1,onSelect:d,...e}=a,f=I.useRef(null),g=sH(sY,a.__scopeMenu),h=sQ(sY,a.__scopeMenu),i=(0,av.useComposedRefs)(b,f),j=I.useRef(!1);return(0,F.jsx)(s_,{...e,ref:i,disabled:c,onClick:(0,au.composeEventHandlers)(a.onClick,()=>{let a=f.current;if(!c&&a){let b=new CustomEvent(sZ,{bubbles:!0,cancelable:!0});a.addEventListener(sZ,a=>d?.(a),{once:!0}),(0,aB.dispatchDiscreteCustomEvent)(a,b),b.defaultPrevented?j.current=!1:g.onClose()}}),onPointerDown:b=>{a.onPointerDown?.(b),j.current=!0},onPointerUp:(0,au.composeEventHandlers)(a.onPointerUp,a=>{j.current||a.currentTarget?.click()}),onKeyDown:(0,au.composeEventHandlers)(a.onKeyDown,a=>{let b=""!==h.searchRef.current;c||b&&" "===a.key||sr.includes(a.key)&&(a.currentTarget.click(),a.preventDefault())})})});s$.displayName=sY;var s_=I.forwardRef((a,b)=>{let{__scopeMenu:c,disabled:d=!1,textValue:e,...f}=a,g=sQ(sY,c),h=sD(c),i=I.useRef(null),j=(0,av.useComposedRefs)(b,i),[k,l]=I.useState(!1),[n,o]=I.useState("");return I.useEffect(()=>{let a=i.current;a&&o((a.textContent??"").trim())},[f.children]),(0,F.jsx)(sx.ItemSlot,{scope:c,disabled:d,textValue:e??n,children:(0,F.jsx)(so.Item,{asChild:!0,...h,focusable:!d,children:(0,F.jsx)(aB.Primitive.div,{role:"menuitem","data-highlighted":k?"":void 0,"aria-disabled":d||void 0,"data-disabled":d?"":void 0,...f,ref:j,onPointerMove:(0,au.composeEventHandlers)(a.onPointerMove,tm(a=>{d?g.onItemLeave(a):(g.onItemEnter(a),a.defaultPrevented||a.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:(0,au.composeEventHandlers)(a.onPointerLeave,tm(a=>g.onItemLeave(a))),onFocus:(0,au.composeEventHandlers)(a.onFocus,()=>l(!0)),onBlur:(0,au.composeEventHandlers)(a.onBlur,()=>l(!1))})})})}),s0=I.forwardRef((a,b)=>{let{checked:c=!1,onCheckedChange:d,...e}=a;return(0,F.jsx)(s8,{scope:a.__scopeMenu,checked:c,children:(0,F.jsx)(s$,{role:"menuitemcheckbox","aria-checked":tk(c)?"mixed":c,...e,ref:b,"data-state":tl(c),onSelect:(0,au.composeEventHandlers)(e.onSelect,()=>d?.(!!tk(c)||!c),{checkForDefaultPrevented:!1})})})});s0.displayName="MenuCheckboxItem";var s1="MenuRadioGroup",[s2,s3]=sA(s1,{value:void 0,onValueChange:()=>{}}),s4=I.forwardRef((a,b)=>{let{value:c,onValueChange:d,...e}=a,f=(0,mV.useCallbackRef)(d);return(0,F.jsx)(s2,{scope:a.__scopeMenu,value:c,onValueChange:f,children:(0,F.jsx)(sW,{...e,ref:b})})});s4.displayName=s1;var s5="MenuRadioItem",s6=I.forwardRef((a,b)=>{let{value:c,...d}=a,e=s3(s5,a.__scopeMenu),f=c===e.value;return(0,F.jsx)(s8,{scope:a.__scopeMenu,checked:f,children:(0,F.jsx)(s$,{role:"menuitemradio","aria-checked":f,...d,ref:b,"data-state":tl(f),onSelect:(0,au.composeEventHandlers)(d.onSelect,()=>e.onValueChange?.(c),{checkForDefaultPrevented:!1})})})});s6.displayName=s5;var s7="MenuItemIndicator",[s8,s9]=sA(s7,{checked:!1}),ta=I.forwardRef((a,b)=>{let{__scopeMenu:c,forceMount:d,...e}=a,f=s9(s7,c);return(0,F.jsx)(sn.Presence,{present:d||tk(f.checked)||!0===f.checked,children:(0,F.jsx)(aB.Primitive.span,{...e,ref:b,"data-state":tl(f.checked)})})});ta.displayName=s7;var tb=I.forwardRef((a,b)=>{let{__scopeMenu:c,...d}=a;return(0,F.jsx)(aB.Primitive.div,{role:"separator","aria-orientation":"horizontal",...d,ref:b})});tb.displayName="MenuSeparator";var tc=I.forwardRef((a,b)=>{let{__scopeMenu:c,...d}=a,e=sC(c);return(0,F.jsx)(mR.Arrow,{...e,...d,ref:b})});tc.displayName="MenuArrow";var[td,te]=sA("MenuSub"),tf="MenuSubTrigger",tg=I.forwardRef((a,b)=>{let c=sF(tf,a.__scopeMenu),d=sH(tf,a.__scopeMenu),e=te(tf,a.__scopeMenu),f=sQ(tf,a.__scopeMenu),g=I.useRef(null),{pointerGraceTimerRef:h,onPointerGraceIntentChange:i}=f,j={__scopeMenu:a.__scopeMenu},k=I.useCallback(()=>{g.current&&window.clearTimeout(g.current),g.current=null},[]);return I.useEffect(()=>k,[k]),I.useEffect(()=>{let a=h.current;return()=>{window.clearTimeout(a),i(null)}},[h,i]),(0,F.jsx)(sJ,{asChild:!0,...j,children:(0,F.jsx)(s_,{id:e.triggerId,"aria-haspopup":"menu","aria-expanded":c.open,"aria-controls":e.contentId,"data-state":tj(c.open),...a,ref:(0,av.composeRefs)(b,e.onTriggerChange),onClick:b=>{a.onClick?.(b),a.disabled||b.defaultPrevented||(b.currentTarget.focus(),c.open||c.onOpenChange(!0))},onPointerMove:(0,au.composeEventHandlers)(a.onPointerMove,tm(b=>{f.onItemEnter(b),!b.defaultPrevented&&(a.disabled||c.open||g.current||(f.onPointerGraceIntentChange(null),g.current=window.setTimeout(()=>{c.onOpenChange(!0),k()},100)))})),onPointerLeave:(0,au.composeEventHandlers)(a.onPointerLeave,tm(a=>{k();let b=c.content?.getBoundingClientRect();if(b){let d=c.content?.dataset.side,e="right"===d,g=b[e?"left":"right"],i=b[e?"right":"left"];f.onPointerGraceIntentChange({area:[{x:a.clientX+(e?-5:5),y:a.clientY},{x:g,y:b.top},{x:i,y:b.top},{x:i,y:b.bottom},{x:g,y:b.bottom}],side:d}),window.clearTimeout(h.current),h.current=window.setTimeout(()=>f.onPointerGraceIntentChange(null),300)}else{if(f.onTriggerLeave(a),a.defaultPrevented)return;f.onPointerGraceIntentChange(null)}})),onKeyDown:(0,au.composeEventHandlers)(a.onKeyDown,b=>{let e=""!==f.searchRef.current;a.disabled||e&&" "===b.key||su[d.dir].includes(b.key)&&(c.onOpenChange(!0),c.content?.focus(),b.preventDefault())})})})});tg.displayName=tf;var th="MenuSubContent",ti=I.forwardRef((a,b)=>{let c=sM(sO,a.__scopeMenu),{forceMount:d=c.forceMount,...e}=a,f=sF(sO,a.__scopeMenu),g=sH(sO,a.__scopeMenu),h=te(th,a.__scopeMenu),i=I.useRef(null),j=(0,av.useComposedRefs)(b,i);return(0,F.jsx)(sx.Provider,{scope:a.__scopeMenu,children:(0,F.jsx)(sn.Presence,{present:d||f.open,children:(0,F.jsx)(sx.Slot,{scope:a.__scopeMenu,children:(0,F.jsx)(sV,{id:h.contentId,"aria-labelledby":h.triggerId,...e,ref:j,align:"start",side:"rtl"===g.dir?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:a=>{g.isUsingKeyboardRef.current&&i.current?.focus(),a.preventDefault()},onCloseAutoFocus:a=>a.preventDefault(),onFocusOutside:(0,au.composeEventHandlers)(a.onFocusOutside,a=>{a.target!==h.trigger&&f.onOpenChange(!1)}),onEscapeKeyDown:(0,au.composeEventHandlers)(a.onEscapeKeyDown,a=>{g.onClose(),a.preventDefault()}),onKeyDown:(0,au.composeEventHandlers)(a.onKeyDown,a=>{let b=a.currentTarget.contains(a.target),c=sv[g.dir].includes(a.key);b&&c&&(f.onOpenChange(!1),h.trigger?.focus(),a.preventDefault())})})})})})});function tj(a){return a?"open":"closed"}function tk(a){return"indeterminate"===a}function tl(a){return tk(a)?"indeterminate":a?"checked":"unchecked"}function tm(a){return b=>"mouse"===b.pointerType?a(b):void 0}ti.displayName=th;var tn="DropdownMenu",[to,tp]=(0,aw.createContextScope)(tn,[sB]),tq=sB(),[tr,ts]=to(tn),tt=a=>{let{__scopeDropdownMenu:b,children:c,dir:d,open:e,defaultOpen:f,onOpenChange:g,modal:h=!0}=a,i=tq(b),j=I.useRef(null),[k,l]=(0,ax.useControllableState)({prop:e,defaultProp:f??!1,onChange:g,caller:tn});return(0,F.jsx)(tr,{scope:b,triggerId:(0,mQ.useId)(),triggerRef:j,contentId:(0,mQ.useId)(),open:k,onOpenChange:l,onOpenToggle:I.useCallback(()=>l(a=>!a),[l]),modal:h,children:(0,F.jsx)(sI,{...i,open:k,onOpenChange:l,dir:d,modal:h,children:c})})};tt.displayName=tn;var tu="DropdownMenuTrigger",tv=I.forwardRef((a,b)=>{let{__scopeDropdownMenu:c,disabled:d=!1,...e}=a,f=ts(tu,c),g=tq(c);return(0,F.jsx)(sJ,{asChild:!0,...g,children:(0,F.jsx)(aB.Primitive.button,{type:"button",id:f.triggerId,"aria-haspopup":"menu","aria-expanded":f.open,"aria-controls":f.open?f.contentId:void 0,"data-state":f.open?"open":"closed","data-disabled":d?"":void 0,disabled:d,...e,ref:(0,av.composeRefs)(b,f.triggerRef),onPointerDown:(0,au.composeEventHandlers)(a.onPointerDown,a=>{!d&&0===a.button&&!1===a.ctrlKey&&(f.onOpenToggle(),f.open||a.preventDefault())}),onKeyDown:(0,au.composeEventHandlers)(a.onKeyDown,a=>{!d&&(["Enter"," "].includes(a.key)&&f.onOpenToggle(),"ArrowDown"===a.key&&f.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});tv.displayName=tu;var tw=a=>{let{__scopeDropdownMenu:b,...c}=a,d=tq(b);return(0,F.jsx)(sN,{...d,...c})};tw.displayName="DropdownMenuPortal";var tx="DropdownMenuContent",ty=I.forwardRef((a,b)=>{let{__scopeDropdownMenu:c,...d}=a,e=ts(tx,c),f=tq(c),g=I.useRef(!1);return(0,F.jsx)(sR,{id:e.contentId,"aria-labelledby":e.triggerId,...f,...d,ref:b,onCloseAutoFocus:(0,au.composeEventHandlers)(a.onCloseAutoFocus,a=>{g.current||e.triggerRef.current?.focus(),g.current=!1,a.preventDefault()}),onInteractOutside:(0,au.composeEventHandlers)(a.onInteractOutside,a=>{let b=a.detail.originalEvent,c=0===b.button&&!0===b.ctrlKey,d=2===b.button||c;(!e.modal||d)&&(g.current=!0)}),style:{...a.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});ty.displayName=tx,I.forwardRef((a,b)=>{let{__scopeDropdownMenu:c,...d}=a,e=tq(c);return(0,F.jsx)(sW,{...e,...d,ref:b})}).displayName="DropdownMenuGroup";var tz=I.forwardRef((a,b)=>{let{__scopeDropdownMenu:c,...d}=a,e=tq(c);return(0,F.jsx)(sX,{...e,...d,ref:b})});tz.displayName="DropdownMenuLabel";var tA=I.forwardRef((a,b)=>{let{__scopeDropdownMenu:c,...d}=a,e=tq(c);return(0,F.jsx)(s$,{...e,...d,ref:b})});tA.displayName="DropdownMenuItem";var tB=I.forwardRef((a,b)=>{let{__scopeDropdownMenu:c,...d}=a,e=tq(c);return(0,F.jsx)(s0,{...e,...d,ref:b})});tB.displayName="DropdownMenuCheckboxItem",I.forwardRef((a,b)=>{let{__scopeDropdownMenu:c,...d}=a,e=tq(c);return(0,F.jsx)(s4,{...e,...d,ref:b})}).displayName="DropdownMenuRadioGroup";var tC=I.forwardRef((a,b)=>{let{__scopeDropdownMenu:c,...d}=a,e=tq(c);return(0,F.jsx)(s6,{...e,...d,ref:b})});tC.displayName="DropdownMenuRadioItem";var tD=I.forwardRef((a,b)=>{let{__scopeDropdownMenu:c,...d}=a,e=tq(c);return(0,F.jsx)(ta,{...e,...d,ref:b})});tD.displayName="DropdownMenuItemIndicator";var tE=I.forwardRef((a,b)=>{let{__scopeDropdownMenu:c,...d}=a,e=tq(c);return(0,F.jsx)(tb,{...e,...d,ref:b})});tE.displayName="DropdownMenuSeparator",I.forwardRef((a,b)=>{let{__scopeDropdownMenu:c,...d}=a,e=tq(c);return(0,F.jsx)(tc,{...e,...d,ref:b})}).displayName="DropdownMenuArrow";var tF=I.forwardRef((a,b)=>{let{__scopeDropdownMenu:c,...d}=a,e=tq(c);return(0,F.jsx)(tg,{...e,...d,ref:b})});tF.displayName="DropdownMenuSubTrigger";var tG=I.forwardRef((a,b)=>{let{__scopeDropdownMenu:c,...d}=a,e=tq(c);return(0,F.jsx)(ti,{...e,...d,ref:b,style:{...a.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});tG.displayName="DropdownMenuSubContent";let tH=(0,L.default)("circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);I.forwardRef(({className:a,inset:b,children:c,...d},e)=>(0,F.jsxs)(tF,{ref:e,className:(0,T.cn)("flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",b&&"pl-8",a),...d,children:[c,(0,F.jsx)(R,{className:"ml-auto"})]})).displayName=tF.displayName,I.forwardRef(({className:a,...b},c)=>(0,F.jsx)(tG,{ref:c,className:(0,T.cn)("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]",a),...b})).displayName=tG.displayName;let tI=I.forwardRef(({className:a,sideOffset:b=4,...c},d)=>(0,F.jsx)(tw,{children:(0,F.jsx)(ty,{ref:d,sideOffset:b,className:(0,T.cn)("z-50 max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]",a),...c})}));tI.displayName=ty.displayName;let tJ=I.forwardRef(({className:a,inset:b,...c},d)=>(0,F.jsx)(tA,{ref:d,className:(0,T.cn)("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",b&&"pl-8",a),...c}));tJ.displayName=tA.displayName,I.forwardRef(({className:a,children:b,checked:c,...d},e)=>(0,F.jsxs)(tB,{ref:e,className:(0,T.cn)("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",a),checked:c,...d,children:[(0,F.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,F.jsx)(tD,{children:(0,F.jsx)(bf.Check,{className:"h-4 w-4"})})}),b]})).displayName=tB.displayName,I.forwardRef(({className:a,children:b,...c},d)=>(0,F.jsxs)(tC,{ref:d,className:(0,T.cn)("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",a),...c,children:[(0,F.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,F.jsx)(tD,{children:(0,F.jsx)(tH,{className:"h-2 w-2 fill-current"})})}),b]})).displayName=tC.displayName,I.forwardRef(({className:a,inset:b,...c},d)=>(0,F.jsx)(tz,{ref:d,className:(0,T.cn)("px-2 py-1.5 text-sm font-semibold",b&&"pl-8",a),...c})).displayName=tz.displayName;let tK=I.forwardRef(({className:a,...b},c)=>(0,F.jsx)(tE,{ref:c,className:(0,T.cn)("-mx-1 my-1 h-px bg-muted",a),...b}));tK.displayName=tE.displayName;let tL=(0,L.default)("save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]),tM=(0,L.default)("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]),tN=(0,L.default)("link-2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]),tO=(0,L.default)("folder-open",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]),tP=(0,L.default)("activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]),tQ=(0,L.default)("target",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]),tR=(0,L.default)("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);var tS=a.i(15618);let tT=(0,L.default)("ellipsis-vertical",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]]),tU=(0,L.default)("pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]),tV={skepticism:{label:"Skepticism",shortLabel:"S",description:"How skeptical vs trusting when forming opinions",lowLabel:"Trusting",highLabel:"Skeptical"},literalism:{label:"Literalism",shortLabel:"L",description:"How literally to interpret information when forming opinions",lowLabel:"Flexible",highLabel:"Literal"},empathy:{label:"Empathy",shortLabel:"E",description:"How much to consider emotional context when forming opinions",lowLabel:"Detached",highLabel:"Empathetic"}};function tW({disposition:a,editMode:b,editDisposition:c,onEditChange:d}){let e=b?c:a;return(0,F.jsx)("div",{className:"space-y-4",children:Object.keys(tV).map(a=>(0,F.jsxs)("div",{className:"space-y-2",children:[(0,F.jsxs)("div",{className:"flex justify-between items-center",children:[(0,F.jsxs)("div",{children:[(0,F.jsx)("label",{className:"text-sm font-medium text-foreground",children:tV[a].label}),(0,F.jsx)("p",{className:"text-xs text-muted-foreground",children:tV[a].description})]}),(0,F.jsxs)("span",{className:"text-sm font-bold text-primary",children:[e[a],"/5"]})]}),b?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)("div",{className:"flex justify-between text-[10px] text-muted-foreground",children:[(0,F.jsx)("span",{children:tV[a].lowLabel}),(0,F.jsx)("span",{children:tV[a].highLabel})]}),(0,F.jsx)("input",{type:"range",min:"1",max:"5",step:"1",value:c[a],onChange:b=>d(a,parseInt(b.target.value)),className:"w-full h-2 bg-muted rounded-lg appearance-none cursor-pointer accent-primary"})]}):(0,F.jsxs)("div",{className:"flex items-center gap-2",children:[(0,F.jsx)("span",{className:"text-xs text-muted-foreground",children:tV[a].lowLabel}),(0,F.jsx)("div",{className:"flex-1 h-2 bg-muted rounded-full overflow-hidden",children:(0,F.jsx)("div",{className:"h-full bg-primary rounded-full transition-all",style:{width:`${(e[a]-1)/4*100}%`}})}),(0,F.jsx)("span",{className:"text-xs text-muted-foreground",children:tV[a].highLabel})]})]},a))})}function tX(){let a=(0,G.useRouter)(),{currentBank:b,setCurrentBank:c,loadBanks:d}=(0,J.useBank)(),{features:e}=(0,sm.useFeatures)(),f=e?.observations??!1,[g,h]=(0,I.useState)(null),[i,j]=(0,I.useState)(null),[k,l]=(0,I.useState)([]),[n,o]=(0,I.useState)(0),[p,q]=(0,I.useState)([]),[r,s]=(0,I.useState)(0),[t,u]=(0,I.useState)(!1),[v,w]=(0,I.useState)(!1),[x,y]=(0,I.useState)(!1),[z,A]=(0,I.useState)(!1),[B,C]=(0,I.useState)(null),[D,E]=(0,I.useState)(null),[H,K]=(0,I.useState)(!1),L=(0,I.useRef)(x);(0,I.useEffect)(()=>{L.current=x},[x]);let[M,O]=(0,I.useState)(!1),[P,Q]=(0,I.useState)(!1),[R,S]=(0,I.useState)(!1),[T,U]=(0,I.useState)(!1),[V,Y]=(0,I.useState)(!1),[Z,$]=(0,I.useState)(null),[_]=(0,I.useState)(10),[aa,ab]=(0,I.useState)(0),[af,ag]=(0,I.useState)(null),[an,ao]=(0,I.useState)(""),[ap,aq]=(0,I.useState)({skepticism:3,literalism:3,empathy:3}),ar=async(a=Z,c=aa)=>{if(b)try{let d=await W.client.listOperations(b,{status:a||void 0,limit:_,offset:c});l(d.operations||[]),o(d.total||0)}catch(a){console.error("Error loading operations:",a)}},as=async(a=!1)=>{if(b){if(a){try{let[a,c,d]=await Promise.all([W.client.getBankStats(b),W.client.listDirectives(b),W.client.listMentalModels(b)]);j(a),q(c.items||[]),s(d.items?.length||0)}catch(a){console.error("Error refreshing stats:",a)}return}u(!0);try{let[a,c,d,e]=await Promise.all([W.client.getBankProfile(b),W.client.getBankStats(b),W.client.listDirectives(b),W.client.listMentalModels(b)]);h(a),j(c),q(d.items||[]),s(e.items?.length||0),await ar(),L.current||(ao(a.mission||""),aq(a.disposition))}catch(a){console.error("Error loading bank profile:",a),alert("Error loading bank profile: "+a.message)}finally{u(!1)}}},at=async()=>{if(b){w(!0);try{await W.client.updateBankProfile(b,{mission:an,disposition:ap}),await as(),y(!1)}catch(a){console.error("Error saving bank profile:",a),alert("Error saving bank profile: "+a.message)}finally{w(!1)}}},au=async()=>{if(b){Q(!0);try{await W.client.deleteBank(b),O(!1),c(null),await d(),a.push("/")}catch(a){console.error("Error deleting bank:",a),alert("Error deleting bank: "+a.message)}finally{Q(!1)}}},av=async()=>{if(b){U(!0);try{let a=await W.client.clearObservations(b);S(!1),await as(),alert(a.message||"Observations cleared successfully")}catch(a){console.error("Error clearing observations:",a),alert("Error clearing observations: "+a.message)}finally{U(!1)}}},aw=async()=>{if(b){Y(!0);try{await W.client.triggerConsolidation(b),await as(),await ar()}catch(a){console.error("Error triggering consolidation:",a),alert("Error triggering consolidation: "+a.message)}finally{Y(!1)}}},ax=a=>{ab(a),ar(Z,a)},ay=async a=>{if(b){ag(a);try{await W.client.cancelOperation(b,a),await ar()}catch(a){console.error("Error cancelling operation:",a),alert("Error cancelling operation: "+a.message)}finally{ag(null)}}},az=async()=>{if(b&&D){K(!0);try{await W.client.deleteDirective(b,D.id),q(a=>a.filter(a=>a.id!==D.id)),B?.id===D.id&&C(null),E(null)}catch(a){console.error("Error deleting directive:",a),alert("Error deleting: "+a.message)}finally{K(!1)}}};return((0,I.useEffect)(()=>{if(b){as();let a=setInterval(()=>as(!0),5e3);return()=>clearInterval(a)}},[b]),(0,I.useEffect)(()=>{let a=a=>{"Escape"===a.key&&C(null)};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[]),b)?t&&!g?(0,F.jsx)(n_,{children:(0,F.jsxs)(n3,{className:"text-center py-10",children:[(0,F.jsx)(ae,{className:"w-12 h-12 mx-auto mb-3 text-muted-foreground animate-pulse"}),(0,F.jsx)("div",{className:"text-lg text-muted-foreground",children:"Loading profile..."})]})}):(0,F.jsxs)("div",{className:"space-y-6",children:[(0,F.jsxs)("div",{className:"flex justify-between items-center",children:[(0,F.jsxs)("div",{children:[(0,F.jsx)("h2",{className:"text-2xl font-bold text-foreground",children:g?.name||b}),(0,F.jsx)("p",{className:"text-sm text-muted-foreground font-mono",children:b})]}),(0,F.jsx)("div",{className:"flex gap-2",children:x?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(X.Button,{onClick:()=>{g&&(ao(g.mission||""),aq(g.disposition)),y(!1)},variant:"secondary",disabled:v,children:"Cancel"}),(0,F.jsx)(X.Button,{onClick:at,disabled:v,children:v?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(ac,{className:"w-4 h-4 mr-2 animate-spin"}),"Saving..."]}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(tL,{className:"w-4 h-4 mr-2"}),"Save Changes"]})})]}):(0,F.jsxs)(tt,{children:[(0,F.jsx)(tv,{asChild:!0,children:(0,F.jsxs)(X.Button,{variant:"outline",size:"sm",children:["Actions",(0,F.jsx)(tT,{className:"w-4 h-4 ml-2"})]})}),(0,F.jsxs)(tI,{align:"end",className:"w-48",children:[(0,F.jsxs)(tJ,{onClick:()=>y(!0),children:[(0,F.jsx)(tU,{className:"w-4 h-4 mr-2"}),"Edit Profile"]}),(0,F.jsx)(tK,{}),(0,F.jsxs)(tJ,{onClick:aw,disabled:V||!f,title:f?void 0:"Observations feature is not enabled",children:[V?(0,F.jsx)(bh,{className:"w-4 h-4 mr-2 animate-spin"}):(0,F.jsx)(n5,{className:"w-4 h-4 mr-2"}),V?"Consolidating...":"Run Consolidation",!f&&(0,F.jsx)("span",{className:"ml-auto text-xs text-muted-foreground",children:"Off"})]}),(0,F.jsxs)(tJ,{onClick:()=>S(!0),disabled:!f,className:"text-amber-600 dark:text-amber-400 focus:text-amber-700 dark:focus:text-amber-300",title:f?void 0:"Observations feature is not enabled",children:[(0,F.jsx)(mK,{className:"w-4 h-4 mr-2"}),"Clear Observations",!f&&(0,F.jsx)("span",{className:"ml-auto text-xs text-muted-foreground",children:"Off"})]}),(0,F.jsx)(tK,{}),(0,F.jsxs)(tJ,{onClick:()=>O(!0),className:"text-red-600 dark:text-red-400 focus:text-red-700 dark:focus:text-red-300",children:[(0,F.jsx)(mK,{className:"w-4 h-4 mr-2"}),"Delete Bank"]})]})]})})]}),i&&(0,F.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[(0,F.jsx)(n_,{className:"bg-gradient-to-br from-blue-500/10 to-blue-600/5 border-blue-500/20",children:(0,F.jsx)(n3,{className:"p-4",children:(0,F.jsxs)("div",{className:"flex items-center gap-3",children:[(0,F.jsx)("div",{className:"p-2 rounded-lg bg-blue-500/20",children:(0,F.jsx)(N,{className:"w-5 h-5 text-blue-500"})}),(0,F.jsxs)("div",{children:[(0,F.jsx)("p",{className:"text-xs text-muted-foreground font-medium",children:"Memories"}),(0,F.jsx)("p",{className:"text-2xl font-bold text-foreground",children:i.total_nodes})]})]})})}),(0,F.jsx)(n_,{className:"bg-gradient-to-br from-purple-500/10 to-purple-600/5 border-purple-500/20",children:(0,F.jsx)(n3,{className:"p-4",children:(0,F.jsxs)("div",{className:"flex items-center gap-3",children:[(0,F.jsx)("div",{className:"p-2 rounded-lg bg-purple-500/20",children:(0,F.jsx)(tN,{className:"w-5 h-5 text-purple-500"})}),(0,F.jsxs)("div",{children:[(0,F.jsx)("p",{className:"text-xs text-muted-foreground font-medium",children:"Links"}),(0,F.jsx)("p",{className:"text-2xl font-bold text-foreground",children:i.total_links})]})]})})}),(0,F.jsx)(n_,{className:"bg-gradient-to-br from-emerald-500/10 to-emerald-600/5 border-emerald-500/20",children:(0,F.jsx)(n3,{className:"p-4",children:(0,F.jsxs)("div",{className:"flex items-center gap-3",children:[(0,F.jsx)("div",{className:"p-2 rounded-lg bg-emerald-500/20",children:(0,F.jsx)(tO,{className:"w-5 h-5 text-emerald-500"})}),(0,F.jsxs)("div",{children:[(0,F.jsx)("p",{className:"text-xs text-muted-foreground font-medium",children:"Documents"}),(0,F.jsx)("p",{className:"text-2xl font-bold text-foreground",children:i.total_documents})]})]})})}),(0,F.jsx)(n_,{className:`bg-gradient-to-br ${i.pending_operations>0?"from-amber-500/10 to-amber-600/5 border-amber-500/20":"from-slate-500/10 to-slate-600/5 border-slate-500/20"}`,children:(0,F.jsx)(n3,{className:"p-4",children:(0,F.jsxs)("div",{className:"flex items-center gap-3",children:[(0,F.jsx)("div",{className:`p-2 rounded-lg ${i.pending_operations>0?"bg-amber-500/20":"bg-slate-500/20"}`,children:(0,F.jsx)(tP,{className:`w-5 h-5 ${i.pending_operations>0?"text-amber-500 animate-pulse":"text-slate-500"}`})}),(0,F.jsxs)("div",{children:[(0,F.jsx)("p",{className:"text-xs text-muted-foreground font-medium",children:"Pending"}),(0,F.jsx)("p",{className:"text-2xl font-bold text-foreground",children:i.pending_operations})]})]})})})]}),i&&(0,F.jsxs)("div",{className:"grid grid-cols-5 gap-3",children:[(0,F.jsxs)("div",{className:"bg-blue-500/10 border border-blue-500/20 rounded-xl p-4 text-center",children:[(0,F.jsx)("p",{className:"text-xs text-blue-600 dark:text-blue-400 font-semibold uppercase tracking-wide",children:"World Facts"}),(0,F.jsx)("p",{className:"text-2xl font-bold text-blue-600 dark:text-blue-400 mt-1",children:i.nodes_by_fact_type?.world||0})]}),(0,F.jsxs)("div",{className:"bg-purple-500/10 border border-purple-500/20 rounded-xl p-4 text-center",children:[(0,F.jsx)("p",{className:"text-xs text-purple-600 dark:text-purple-400 font-semibold uppercase tracking-wide",children:"Experience"}),(0,F.jsx)("p",{className:"text-2xl font-bold text-purple-600 dark:text-purple-400 mt-1",children:i.nodes_by_fact_type?.experience||0})]}),(0,F.jsxs)("div",{className:`rounded-xl p-4 text-center ${f?"bg-amber-500/10 border border-amber-500/20":"bg-muted/50 border border-muted"}`,title:f?void 0:"Observations feature is not enabled",children:[(0,F.jsxs)("p",{className:`text-xs font-semibold uppercase tracking-wide ${f?"text-amber-600 dark:text-amber-400":"text-muted-foreground"}`,children:["Observations",!f&&(0,F.jsx)("span",{className:"ml-1 normal-case",children:"(Off)"})]}),(0,F.jsx)("p",{className:`text-2xl font-bold mt-1 ${f?"text-amber-600 dark:text-amber-400":"text-muted-foreground"}`,children:f?i.total_mental_models||0:"—"})]}),(0,F.jsxs)("div",{className:"bg-cyan-500/10 border border-cyan-500/20 rounded-xl p-4 text-center",children:[(0,F.jsx)("p",{className:"text-xs text-cyan-600 dark:text-cyan-400 font-semibold uppercase tracking-wide",children:"Mental Models"}),(0,F.jsx)("p",{className:"text-2xl font-bold text-cyan-600 dark:text-cyan-400 mt-1",children:r})]}),(0,F.jsxs)("div",{className:"bg-rose-500/10 border border-rose-500/20 rounded-xl p-4 text-center",children:[(0,F.jsx)("p",{className:"text-xs text-rose-600 dark:text-rose-400 font-semibold uppercase tracking-wide",children:"Directives"}),(0,F.jsx)("p",{className:"text-2xl font-bold text-rose-600 dark:text-rose-400 mt-1",children:p.length})]})]}),(0,F.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[(0,F.jsxs)(n_,{children:[(0,F.jsxs)(n0,{className:"pb-2",children:[(0,F.jsxs)(n1,{className:"flex items-center gap-2 text-lg",children:[(0,F.jsx)(n5,{className:"w-5 h-5 text-primary"}),"Disposition Profile"]}),(0,F.jsx)(n2,{children:"Traits that shape how opinions are formed via Reflect"})]}),(0,F.jsx)(n3,{children:g&&(0,F.jsx)(tW,{disposition:g.disposition,editMode:x,editDisposition:ap,onEditChange:(a,b)=>aq(c=>({...c,[a]:b}))})})]}),(0,F.jsxs)(n_,{children:[(0,F.jsxs)(n0,{className:"pb-2",children:[(0,F.jsxs)(n1,{className:"flex items-center gap-2 text-lg",children:[(0,F.jsx)(tQ,{className:"w-5 h-5 text-primary"}),"Mission"]}),(0,F.jsx)(n2,{children:"Who the agent is and what they're trying to accomplish. Used for mental models and reflect."})]}),(0,F.jsx)(n3,{children:x?(0,F.jsx)(n9.Textarea,{value:an,onChange:a=>ao(a.target.value),placeholder:"e.g., I am a PM for the engineering team. I help coordinate sprints and track project progress...",rows:6,className:"resize-none"}):(0,F.jsx)("p",{className:"text-sm text-foreground whitespace-pre-wrap leading-relaxed",children:g?.mission||"No mission set. Set a mission to derive structural mental models and personalize reflect responses."})})]})]}),(0,F.jsxs)(n_,{children:[(0,F.jsx)(n0,{className:"pb-2",children:(0,F.jsxs)("div",{className:"flex items-center justify-between",children:[(0,F.jsxs)("div",{children:[(0,F.jsxs)(n1,{className:"flex items-center gap-2 text-lg",children:[(0,F.jsx)(tR,{className:"w-5 h-5 text-rose-500"}),"Directives"]}),(0,F.jsx)(n2,{children:"Hard rules that must be followed during reflect"})]}),(0,F.jsxs)(X.Button,{onClick:()=>A(!0),variant:"outline",size:"sm",className:"h-8",children:[(0,F.jsx)(tS.Plus,{className:"w-4 h-4 mr-1"}),"Add"]})]})}),(0,F.jsx)(n3,{children:p.length>0?(0,F.jsx)("div",{className:"grid grid-cols-2 gap-3",children:p.map(a=>(0,F.jsx)(n_,{className:`cursor-pointer transition-colors border-rose-500/30 ${B?.id===a.id?"bg-rose-500/10 border-rose-500":"hover:bg-rose-500/5"}`,onClick:()=>C(a),children:(0,F.jsx)(n3,{className:"p-3",children:(0,F.jsxs)("div",{className:"flex items-start gap-2",children:[(0,F.jsx)(tR,{className:"w-4 h-4 text-rose-500 shrink-0 mt-0.5"}),(0,F.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,F.jsx)("span",{className:"font-medium text-sm text-foreground",children:a.name}),(0,F.jsx)("p",{className:"text-xs text-muted-foreground line-clamp-2 mt-1",children:a.content}),a.tags&&a.tags.length>0&&(0,F.jsxs)("div",{className:"flex items-center gap-1 mt-2 flex-wrap",children:[(0,F.jsx)(bl.Tag,{className:"w-3 h-3 text-muted-foreground"}),a.tags.map(a=>(0,F.jsx)("span",{className:"text-xs px-1.5 py-0.5 rounded bg-muted text-muted-foreground",children:a},a))]})]})]})})},a.id))}):(0,F.jsxs)("div",{className:"p-6 border border-dashed border-rose-500/30 rounded-lg text-center",children:[(0,F.jsx)(tR,{className:"w-6 h-6 mx-auto mb-2 text-rose-500/50"}),(0,F.jsx)("p",{className:"text-sm text-muted-foreground",children:"No directives yet. Directives are hard rules that must be followed during reflect."})]})})]}),(0,F.jsxs)(n_,{children:[(0,F.jsx)(n0,{className:"pb-2",children:(0,F.jsxs)("div",{className:"flex items-center justify-between",children:[(0,F.jsxs)("div",{children:[(0,F.jsxs)(n1,{className:"flex items-center gap-2 text-lg",children:[(0,F.jsx)(tP,{className:"w-5 h-5 text-primary"}),"Background Operations",(0,F.jsx)("button",{onClick:()=>ar(),className:"p-1 rounded hover:bg-muted transition-colors",title:"Refresh operations",children:(0,F.jsx)(ac,{className:"w-4 h-4 text-muted-foreground hover:text-foreground"})})]}),(0,F.jsxs)(n2,{children:[n," operation",1!==n?"s":"",Z?` (${Z})`:""]})]}),(0,F.jsx)("div",{className:"flex gap-1 bg-muted p-1 rounded-lg",children:[{value:null,label:"All"},{value:"pending",label:"Pending"},{value:"completed",label:"Completed"},{value:"failed",label:"Failed"}].map(a=>(0,F.jsx)("button",{onClick:()=>{var b;$(b=a.value),ab(0),ar(b,0)},className:`px-3 py-1.5 text-sm font-medium rounded-md transition-colors ${Z===a.value?"bg-background shadow-sm":"text-muted-foreground hover:text-foreground"}`,children:a.label},a.value??"all"))})]})}),(0,F.jsx)(n3,{children:k.length>0?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)("div",{className:"overflow-x-auto",children:(0,F.jsxs)(ah,{children:[(0,F.jsx)(ai,{children:(0,F.jsxs)(ak,{children:[(0,F.jsx)(al,{className:"w-[100px]",children:"ID"}),(0,F.jsx)(al,{children:"Type"}),(0,F.jsx)(al,{children:"Created"}),(0,F.jsx)(al,{children:"Status"}),(0,F.jsx)(al,{className:"w-[80px]"})]})}),(0,F.jsx)(aj,{children:k.map(a=>(0,F.jsxs)(ak,{className:"failed"===a.status?"bg-red-500/5":"",children:[(0,F.jsx)(am,{className:"font-mono text-xs text-muted-foreground",children:a.id.substring(0,8)}),(0,F.jsx)(am,{className:"font-medium",children:a.task_type}),(0,F.jsx)(am,{className:"text-sm text-muted-foreground",children:new Date(a.created_at).toLocaleString()}),(0,F.jsxs)(am,{children:["pending"===a.status&&(0,F.jsxs)("span",{className:"inline-flex items-center gap-1.5 px-2 py-0.5 rounded-full text-xs font-medium bg-amber-500/10 text-amber-600 dark:text-amber-400 border border-amber-500/20",children:[(0,F.jsx)(ae,{className:"w-3 h-3"}),"pending"]}),"failed"===a.status&&(0,F.jsxs)("span",{className:"inline-flex items-center gap-1.5 px-2 py-0.5 rounded-full text-xs font-medium bg-red-500/10 text-red-600 dark:text-red-400 border border-red-500/20",title:a.error_message??void 0,children:[(0,F.jsx)(tM,{className:"w-3 h-3"}),"failed"]}),"completed"===a.status&&(0,F.jsxs)("span",{className:"inline-flex items-center gap-1.5 px-2 py-0.5 rounded-full text-xs font-medium bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 border border-emerald-500/20",children:[(0,F.jsx)(ad,{className:"w-3 h-3"}),"completed"]})]}),(0,F.jsx)(am,{children:"pending"===a.status&&(0,F.jsxs)(X.Button,{variant:"ghost",size:"sm",className:"h-7 text-xs text-muted-foreground hover:text-red-600 dark:hover:text-red-400",onClick:()=>ay(a.id),disabled:af===a.id,children:[af===a.id?(0,F.jsx)(bh,{className:"w-3 h-3 animate-spin"}):(0,F.jsx)(bg.X,{className:"w-3 h-3 mr-1"}),af===a.id?"":"Cancel"]})})]},a.id))})]})}),n>_&&(0,F.jsxs)("div",{className:"flex items-center justify-between mt-4 pt-4 border-t",children:[(0,F.jsxs)("p",{className:"text-sm text-muted-foreground",children:["Showing ",aa+1,"-",Math.min(aa+_,n)," of"," ",n]}),(0,F.jsxs)("div",{className:"flex gap-2",children:[(0,F.jsx)(X.Button,{variant:"outline",size:"sm",onClick:()=>ax(Math.max(0,aa-_)),disabled:0===aa,children:"Previous"}),(0,F.jsx)(X.Button,{variant:"outline",size:"sm",onClick:()=>ax(aa+_),disabled:aa+_>=n,children:"Next"})]})]})]}):(0,F.jsxs)("p",{className:"text-muted-foreground text-center py-8 text-sm",children:["No ",Z?`${Z} `:"","operations"]})})]}),(0,F.jsx)(mm,{open:M,onOpenChange:O,children:(0,F.jsxs)(mD,{children:[(0,F.jsxs)(mE,{children:[(0,F.jsx)(mG,{children:"Delete Memory Bank"}),(0,F.jsx)(mH,{asChild:!0,children:(0,F.jsxs)("div",{className:"space-y-2 text-sm text-muted-foreground",children:[(0,F.jsxs)("p",{children:["Are you sure you want to delete the memory bank"," ",(0,F.jsx)("span",{className:"font-semibold text-foreground",children:b}),"?"]}),(0,F.jsx)("p",{className:"text-red-600 dark:text-red-400 font-medium",children:"This action cannot be undone. All memories, entities, documents, and the bank profile will be permanently deleted."}),i&&(0,F.jsxs)("p",{children:["This will delete ",i.total_nodes," memories, ",i.total_documents," ","documents, and ",i.total_links," links."]})]})})]}),(0,F.jsxs)(mF,{children:[(0,F.jsx)(mJ,{disabled:P,children:"Cancel"}),(0,F.jsx)(mI,{onClick:au,disabled:P,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:P?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(ac,{className:"w-4 h-4 mr-2 animate-spin"}),"Deleting..."]}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(mK,{className:"w-4 h-4 mr-2"}),"Delete Bank"]})})]})]})}),(0,F.jsx)(mm,{open:R,onOpenChange:S,children:(0,F.jsxs)(mD,{children:[(0,F.jsxs)(mE,{children:[(0,F.jsx)(mG,{children:"Clear Observations"}),(0,F.jsx)(mH,{asChild:!0,children:(0,F.jsxs)("div",{className:"space-y-2 text-sm text-muted-foreground",children:[(0,F.jsxs)("p",{children:["Are you sure you want to clear all observations for"," ",(0,F.jsx)("span",{className:"font-semibold text-foreground",children:b}),"?"]}),(0,F.jsx)("p",{className:"text-amber-600 dark:text-amber-400 font-medium",children:"This will delete all consolidated knowledge. Observations will be regenerated the next time consolidation runs."}),i&&i.total_mental_models>0&&(0,F.jsxs)("p",{children:["This will delete ",i.total_mental_models," observations."]})]})})]}),(0,F.jsxs)(mF,{children:[(0,F.jsx)(mJ,{disabled:T,children:"Cancel"}),(0,F.jsx)(mI,{onClick:av,disabled:T,className:"bg-amber-500 text-white hover:bg-amber-600",children:T?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(bh,{className:"w-4 h-4 mr-2 animate-spin"}),"Clearing..."]}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(mK,{className:"w-4 h-4 mr-2"}),"Clear Observations"]})})]})]})}),(0,F.jsx)(tY,{open:z,mode:"create",onClose:()=>A(!1),onCreated:a=>{q(b=>[a,...b]),A(!1)}}),(0,F.jsx)(mm,{open:!!D,onOpenChange:a=>!a&&E(null),children:(0,F.jsxs)(mD,{children:[(0,F.jsxs)(mE,{children:[(0,F.jsx)(mG,{children:"Delete Directive"}),(0,F.jsxs)(mH,{children:["Are you sure you want to delete"," ",(0,F.jsxs)("span",{className:"font-semibold",children:['"',D?.name,'"']}),"?",(0,F.jsx)("br",{}),(0,F.jsx)("br",{}),(0,F.jsx)("span",{className:"text-destructive font-semibold",children:"This action cannot be undone."})]})]}),(0,F.jsxs)(mF,{className:"flex-row justify-end space-x-2",children:[(0,F.jsx)(mJ,{className:"mt-0",children:"Cancel"}),(0,F.jsxs)(mI,{onClick:az,disabled:H,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:[H?(0,F.jsx)(bh,{className:"w-4 h-4 animate-spin mr-1"}):null,"Delete"]})]})]})}),B&&(0,F.jsx)(tZ,{directive:B,onClose:()=>C(null),onDelete:()=>E({id:B.id,name:B.name}),onUpdated:a=>{q(b=>b.map(b=>b.id===a.id?a:b)),C(a)}})]}):(0,F.jsx)(n_,{children:(0,F.jsxs)(n3,{className:"p-10 text-center",children:[(0,F.jsx)("h3",{className:"text-xl font-semibold mb-2 text-card-foreground",children:"No Bank Selected"}),(0,F.jsx)("p",{className:"text-muted-foreground",children:"Please select a memory bank from the dropdown above to view its profile."})]})})}function tY({open:a,mode:b,directive:c,onClose:d,onCreated:e,onSaved:f}){let{currentBank:g}=(0,J.useBank)(),[h,i]=(0,I.useState)(!1),[j,k]=(0,I.useState)({name:"",content:"",tags:""});(0,I.useEffect)(()=>{"edit"===b&&c?k({name:c.name,content:c.content,tags:(c.tags||[]).join(", ")}):"create"===b&&k({name:"",content:"",tags:""})},[a,b,c]);let l=async()=>{if(g&&j.name.trim()&&j.content.trim()){i(!0);try{let a=j.tags.split(",").map(a=>a.trim()).filter(a=>a.length>0);if("create"===b){let b=await W.client.createDirective(g,{name:j.name.trim(),content:j.content.trim(),tags:a.length>0?a:void 0});k({name:"",content:"",tags:""}),e?.(b)}else if(c){let b=await W.client.updateDirective(g,c.id,{name:j.name.trim(),content:j.content.trim(),tags:a});f?.(b),d()}}catch(a){console.error(`Error ${"create"===b?"creating":"updating"} directive:`,a),alert(`Error ${"create"===b?"creating":"updating"}: `+a.message)}finally{i(!1)}}},n=()=>{"create"===b&&k({name:"",content:"",tags:""}),d()};return(0,F.jsx)(bi.Dialog,{open:a,onOpenChange:a=>!a&&n(),children:(0,F.jsxs)(bi.DialogContent,{className:"sm:max-w-lg",children:[(0,F.jsxs)(bi.DialogHeader,{children:[(0,F.jsxs)(bi.DialogTitle,{className:"flex items-center gap-2",children:[(0,F.jsx)(tR,{className:"w-5 h-5 text-rose-500"}),"create"===b?"Create":"Edit"," Directive"]}),(0,F.jsx)(bi.DialogDescription,{children:"Directives are hard rules that must be followed during reflect."})]}),(0,F.jsxs)("div",{className:"space-y-4 py-4",children:[(0,F.jsxs)("div",{className:"space-y-2",children:[(0,F.jsx)("label",{className:"text-sm font-medium text-foreground",children:"Name *"}),(0,F.jsx)(Y.Input,{value:j.name,onChange:a=>k({...j,name:a.target.value}),placeholder:"e.g., Competitor Policy"})]}),(0,F.jsxs)("div",{className:"space-y-2",children:[(0,F.jsx)("label",{className:"text-sm font-medium text-foreground",children:"Rule *"}),(0,F.jsx)(n9.Textarea,{value:j.content,onChange:a=>k({...j,content:a.target.value}),placeholder:"e.g., Never mention competitor products directly.",className:"min-h-[120px]"})]}),(0,F.jsxs)("div",{className:"space-y-2",children:[(0,F.jsxs)("label",{className:"text-sm font-medium text-foreground",children:["Tags ",(0,F.jsx)("span",{className:"text-muted-foreground font-normal",children:"(optional)"})]}),(0,F.jsx)(Y.Input,{value:j.tags,onChange:a=>k({...j,tags:a.target.value}),placeholder:"e.g., project-x, team-alpha (comma-separated)"})]})]}),(0,F.jsxs)(bi.DialogFooter,{children:[(0,F.jsx)(X.Button,{variant:"outline",onClick:n,disabled:h,children:"Cancel"}),(0,F.jsxs)(X.Button,{onClick:l,disabled:h||!j.name.trim()||!j.content.trim(),className:"bg-rose-500 hover:bg-rose-600",children:[h?(0,F.jsx)(bh,{className:"w-4 h-4 animate-spin mr-1"}):null,"create"===b?"Create":"Save"]})]})]})})}function tZ({directive:a,onClose:b,onDelete:c,onUpdated:d}){let[e,f]=(0,I.useState)(!1);return(0,F.jsxs)("div",{className:"fixed right-0 top-0 h-screen w-1/2 bg-card border-l-2 border-rose-500 shadow-2xl z-50 overflow-y-auto animate-in slide-in-from-right duration-300 ease-out",children:[(0,F.jsxs)("div",{className:"p-6",children:[(0,F.jsxs)("div",{className:"flex justify-between items-start mb-8 pb-5 border-b border-border",children:[(0,F.jsxs)("div",{className:"flex items-start gap-3",children:[(0,F.jsx)(tR,{className:"w-5 h-5 text-rose-500"}),(0,F.jsxs)("div",{children:[(0,F.jsxs)("div",{className:"flex items-center gap-2",children:[(0,F.jsx)("h3",{className:"text-xl font-bold text-foreground",children:a.name}),(0,F.jsx)(X.Button,{variant:"ghost",size:"sm",onClick:()=>f(!0),className:"h-7 w-7 p-0",children:(0,F.jsx)(tU,{className:"h-3.5 w-3.5"})})]}),(0,F.jsx)("span",{className:"text-xs px-1.5 py-0.5 rounded bg-rose-500/10 text-rose-600 dark:text-rose-400",children:"directive"})]})]}),(0,F.jsxs)("div",{className:"flex items-center gap-2",children:[(0,F.jsx)(X.Button,{variant:"ghost",size:"sm",onClick:c,className:"h-8 w-8 p-0 text-muted-foreground hover:text-rose-500",children:(0,F.jsx)(mK,{className:"h-4 w-4"})}),(0,F.jsx)(X.Button,{variant:"ghost",size:"sm",onClick:b,className:"h-8 w-8 p-0",children:(0,F.jsx)(bg.X,{className:"h-4 w-4"})})]})]}),(0,F.jsxs)("div",{className:"space-y-6",children:[(0,F.jsxs)("div",{children:[(0,F.jsx)("div",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide mb-3",children:"Rule"}),(0,F.jsx)("div",{className:"prose prose-base dark:prose-invert max-w-none",children:(0,F.jsx)(se,{children:a.content})})]}),a.tags&&a.tags.length>0&&(0,F.jsxs)("div",{children:[(0,F.jsx)("div",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide mb-3",children:"Tags"}),(0,F.jsx)("div",{className:"flex flex-wrap gap-2",children:a.tags.map(a=>(0,F.jsx)("span",{className:"px-2 py-1 rounded bg-muted text-muted-foreground text-sm",children:a},a))})]}),(0,F.jsxs)("div",{children:[(0,F.jsx)("div",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide mb-2",children:"ID"}),(0,F.jsx)("code",{className:"text-sm font-mono break-all text-muted-foreground",children:a.id})]})]})]}),(0,F.jsx)(tY,{open:e,mode:"edit",directive:a,onClose:()=>f(!1),onSaved:d})]})}function t$(){let{currentBank:a}=(0,J.useBank)(),[b,c]=(0,I.useState)([]),[d,e]=(0,I.useState)(!1),[f,g]=(0,I.useState)(""),[h,i]=(0,I.useState)(1),[j,k]=(0,I.useState)(!1),[l,n]=(0,I.useState)(null),[o,p]=(0,I.useState)(null),[q,r]=(0,I.useState)(!1),s=b.filter(a=>{if(!f)return!0;let b=f.toLowerCase();return a.id.toLowerCase().includes(b)||a.name.toLowerCase().includes(b)||a.source_query.toLowerCase().includes(b)||a.content.toLowerCase().includes(b)}),t=async()=>{if(a){e(!0);try{let b=await W.client.listMentalModels(a);c(b.items||[])}catch(a){console.error("Error loading mental models:",a)}finally{e(!1)}}},u=async()=>{if(a&&o){r(!0);try{await W.client.deleteMentalModel(a,o.id),c(a=>a.filter(a=>a.id!==o.id)),l?.id===o.id&&n(null),p(null)}catch(a){console.error("Error deleting mental model:",a),alert("Error deleting: "+a.message)}finally{r(!1)}}};if((0,I.useEffect)(()=>{a&&t()},[a]),(0,I.useEffect)(()=>{let a=a=>{"Escape"===a.key&&n(null)};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[]),(0,I.useEffect)(()=>{i(1)},[f]),!a)return(0,F.jsx)(n_,{children:(0,F.jsx)(n3,{className:"p-10 text-center",children:(0,F.jsx)("p",{className:"text-muted-foreground",children:"Select a memory bank to view mental models."})})});let v=Math.ceil(s.length/100),w=(h-1)*100,x=w+100,y=s.slice(w,x);return(0,F.jsxs)("div",{children:[d?(0,F.jsxs)("div",{className:"text-center py-12",children:[(0,F.jsx)(ac,{className:"w-8 h-8 mx-auto mb-3 text-muted-foreground animate-spin"}),(0,F.jsx)("p",{className:"text-muted-foreground",children:"Loading..."})]}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)("div",{className:"mb-4",children:(0,F.jsx)(Y.Input,{type:"text",value:f,onChange:a=>g(a.target.value),placeholder:"Filter mental models by name, query, or content...",className:"max-w-md"})}),(0,F.jsxs)("div",{className:"flex items-center justify-between mb-6",children:[(0,F.jsx)("div",{className:"text-sm text-muted-foreground",children:f?`${s.length} of ${b.length} mental models`:`${b.length} mental model${1!==b.length?"s":""}`}),(0,F.jsxs)(X.Button,{onClick:()=>k(!0),variant:"outline",size:"sm",children:[(0,F.jsx)(tS.Plus,{className:"w-4 h-4 mr-2"}),"Add Mental Model"]})]}),s.length>0?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)("div",{className:"border rounded-lg overflow-hidden",children:(0,F.jsxs)(ah,{className:"table-fixed",children:[(0,F.jsx)(ai,{children:(0,F.jsxs)(ak,{className:"bg-muted/50",children:[(0,F.jsx)(al,{className:"w-[20%]",children:"ID"}),(0,F.jsx)(al,{className:"w-[20%]",children:"Name"}),(0,F.jsx)(al,{className:"w-[35%]",children:"Source Query"}),(0,F.jsx)(al,{className:"w-[15%]",children:"Last Refreshed"}),(0,F.jsx)(al,{className:"w-[10%]"})]})}),(0,F.jsx)(aj,{children:y.map(a=>{let b=new Date(a.last_refreshed_at),c=b.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}),d=b.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",hour12:!1});return(0,F.jsxs)(ak,{className:`cursor-pointer hover:bg-muted/50 ${l?.id===a.id?"bg-primary/10":""}`,onClick:()=>n(a),children:[(0,F.jsx)(am,{className:"py-2",children:(0,F.jsx)("code",{className:"text-xs font-mono text-muted-foreground truncate block",children:a.id})}),(0,F.jsx)(am,{className:"py-2",children:(0,F.jsx)("div",{className:"font-medium text-foreground",children:a.name})}),(0,F.jsx)(am,{className:"py-2",children:(0,F.jsx)("div",{className:"text-sm text-muted-foreground truncate",children:a.source_query})}),(0,F.jsxs)(am,{className:"py-2 text-sm text-foreground",children:[(0,F.jsx)("div",{children:c}),(0,F.jsx)("div",{className:"text-xs text-muted-foreground",children:d})]}),(0,F.jsx)(am,{className:"py-2",children:(0,F.jsx)(X.Button,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0 text-muted-foreground hover:text-destructive",onClick:b=>{b.stopPropagation(),p({id:a.id,name:a.name})},children:(0,F.jsx)(mK,{className:"h-4 w-4"})})})]},a.id)})})]})}),v>1&&(0,F.jsxs)("div",{className:"flex items-center justify-between mt-3 pt-3 border-t",children:[(0,F.jsxs)("div",{className:"text-xs text-muted-foreground",children:[w+1,"-",Math.min(x,s.length)," of"," ",s.length]}),(0,F.jsxs)("div",{className:"flex items-center gap-1",children:[(0,F.jsx)(X.Button,{variant:"outline",size:"sm",onClick:()=>i(1),disabled:1===h,className:"h-7 w-7 p-0",children:(0,F.jsx)(aa,{className:"h-3 w-3"})}),(0,F.jsx)(X.Button,{variant:"outline",size:"sm",onClick:()=>i(a=>Math.max(1,a-1)),disabled:1===h,className:"h-7 w-7 p-0",children:(0,F.jsx)(Q,{className:"h-3 w-3"})}),(0,F.jsxs)("span",{className:"text-xs px-2",children:[h," / ",v]}),(0,F.jsx)(X.Button,{variant:"outline",size:"sm",onClick:()=>i(a=>Math.min(v,a+1)),disabled:h===v,className:"h-7 w-7 p-0",children:(0,F.jsx)(R,{className:"h-3 w-3"})}),(0,F.jsx)(X.Button,{variant:"outline",size:"sm",onClick:()=>i(v),disabled:h===v,className:"h-7 w-7 p-0",children:(0,F.jsx)(ab,{className:"h-3 w-3"})})]})]})]}):(0,F.jsxs)("div",{className:"p-6 border border-dashed border-border rounded-lg text-center",children:[(0,F.jsx)(M,{className:"w-6 h-6 mx-auto mb-2 text-muted-foreground"}),(0,F.jsx)("p",{className:"text-sm text-muted-foreground",children:f?"No mental models match your filter":"No mental models yet. Create a mental model to generate and save a summary from your memories."})]})]}),(0,F.jsx)(t_,{open:j,onClose:()=>k(!1),onCreated:()=>{k(!1),t()}}),(0,F.jsx)(mm,{open:!!o,onOpenChange:a=>!a&&p(null),children:(0,F.jsxs)(mD,{children:[(0,F.jsxs)(mE,{children:[(0,F.jsx)(mG,{children:"Delete Mental Model"}),(0,F.jsxs)(mH,{children:["Are you sure you want to delete"," ",(0,F.jsxs)("span",{className:"font-semibold",children:['"',o?.name,'"']}),"?",(0,F.jsx)("br",{}),(0,F.jsx)("br",{}),(0,F.jsx)("span",{className:"text-destructive font-semibold",children:"This action cannot be undone."})]})]}),(0,F.jsxs)(mF,{className:"flex-row justify-end space-x-2",children:[(0,F.jsx)(mJ,{className:"mt-0",children:"Cancel"}),(0,F.jsxs)(mI,{onClick:u,disabled:q,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:[q?(0,F.jsx)(bh,{className:"w-4 h-4 animate-spin mr-1"}):null,"Delete"]})]})]})}),l&&(0,F.jsx)(t0,{mentalModel:l,onClose:()=>n(null),onDelete:()=>p({id:l.id,name:l.name}),onRefreshed:a=>{c(b=>b.map(b=>b.id===a.id?a:b)),n(a)}})]})}function t_({open:a,onClose:b,onCreated:c}){let{currentBank:d}=(0,J.useBank)(),[e,f]=(0,I.useState)(!1),[g,h]=(0,I.useState)({name:"",sourceQuery:"",maxTokens:"2048",tags:""}),i=async()=>{if(d&&g.name.trim()&&g.sourceQuery.trim()){f(!0);try{let a=g.tags.split(",").map(a=>a.trim()).filter(a=>a.length>0),b=parseInt(g.maxTokens)||2048;await W.client.createMentalModel(d,{name:g.name.trim(),source_query:g.sourceQuery.trim(),tags:a.length>0?a:void 0,max_tokens:b}),h({name:"",sourceQuery:"",maxTokens:"2048",tags:""}),c()}catch(a){console.error("Error creating mental model:",a),alert("Error creating mental model: "+a.message)}finally{f(!1)}}};return(0,F.jsx)(bi.Dialog,{open:a,onOpenChange:a=>{a||(h({name:"",sourceQuery:"",maxTokens:"2048",tags:""}),b())},children:(0,F.jsxs)(bi.DialogContent,{className:"sm:max-w-lg",children:[(0,F.jsxs)(bi.DialogHeader,{children:[(0,F.jsx)(bi.DialogTitle,{children:"Create Mental Model"}),(0,F.jsx)(bi.DialogDescription,{children:"Create a mental model by running a query. The content will be auto-generated and can be refreshed later."})]}),(0,F.jsxs)("div",{className:"space-y-4 py-4",children:[(0,F.jsxs)("div",{className:"space-y-2",children:[(0,F.jsx)("label",{className:"text-sm font-medium text-foreground",children:"Name *"}),(0,F.jsx)(Y.Input,{value:g.name,onChange:a=>h({...g,name:a.target.value}),placeholder:"e.g., Team Communication Preferences"})]}),(0,F.jsxs)("div",{className:"space-y-2",children:[(0,F.jsx)("label",{className:"text-sm font-medium text-foreground",children:"Source Query *"}),(0,F.jsx)(Y.Input,{value:g.sourceQuery,onChange:a=>h({...g,sourceQuery:a.target.value}),placeholder:"e.g., How does the team prefer to communicate?"}),(0,F.jsx)("p",{className:"text-xs text-muted-foreground",children:"This query will be run to generate the initial content, and re-run when you refresh."})]}),(0,F.jsxs)("div",{className:"space-y-2",children:[(0,F.jsx)("label",{className:"text-sm font-medium text-foreground",children:"Max Tokens"}),(0,F.jsx)(Y.Input,{type:"number",value:g.maxTokens,onChange:a=>h({...g,maxTokens:a.target.value}),placeholder:"2048",min:"256",max:"8192"}),(0,F.jsx)("p",{className:"text-xs text-muted-foreground",children:"Maximum tokens for the generated response (256-8192)."})]}),(0,F.jsxs)("div",{className:"space-y-2",children:[(0,F.jsxs)("label",{className:"text-sm font-medium text-foreground",children:["Tags ",(0,F.jsx)("span",{className:"text-muted-foreground font-normal",children:"(optional)"})]}),(0,F.jsx)(Y.Input,{value:g.tags,onChange:a=>h({...g,tags:a.target.value}),placeholder:"e.g., project-x, team-alpha (comma-separated)"})]})]}),(0,F.jsxs)(bi.DialogFooter,{children:[(0,F.jsx)(X.Button,{variant:"outline",onClick:b,disabled:e,children:"Cancel"}),(0,F.jsx)(X.Button,{onClick:i,disabled:e||!g.name.trim()||!g.sourceQuery.trim(),children:e?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(bh,{className:"w-4 h-4 animate-spin mr-1"}),"Generating..."]}):"Create"})]})]})})}function t0({mentalModel:a,onClose:b,onDelete:c,onRefreshed:d}){let{currentBank:e}=(0,J.useBank)(),[f,g]=(0,I.useState)(!1),[h,i]=(0,I.useState)(null),[j,k]=(0,I.useState)(!1),[l,n]=(0,I.useState)(a.name),[o,p]=(0,I.useState)(!1);(0,I.useEffect)(()=>{n(a.name),k(!1)},[a.id,a.name]);let q=async()=>{if(!e)return;g(!0);let b=a.last_refreshed_at;try{await W.client.refreshMentalModel(e,a.id);let c=0,f=async()=>{c++;try{let h=await W.client.getMentalModel(e,a.id);if(h.last_refreshed_at!==b){d(h),g(!1);return}if(c>=120){g(!1),alert("Refresh is taking longer than expected. Check the operations list for status.");return}setTimeout(f,1e3)}catch(a){console.error("Error polling mental model:",a),g(!1)}};setTimeout(f,1e3)}catch(a){console.error("Error refreshing mental model:",a),alert("Error refreshing: "+a.message),g(!1)}},r=async()=>{if(e&&l.trim()){p(!0);try{let b=await W.client.updateMentalModel(e,a.id,{name:l.trim()});d(b),k(!1)}catch(a){console.error("Error updating mental model:",a),alert("Error updating: "+a.message)}finally{p(!1)}}},s=a=>{let b=new Date(a);return`${b.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})} at ${b.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",hour12:!1})}`},t=a.reflect_response?.based_on?Object.entries(a.reflect_response.based_on).filter(([a])=>"observation"!==a).flatMap(([a,b])=>b.map(b=>({...b,factType:a}))):[],u=a.reflect_response?.based_on?.observation||[];return(0,F.jsxs)("div",{className:"fixed right-0 top-0 h-screen w-1/2 bg-card border-l shadow-2xl z-50 overflow-y-auto animate-in slide-in-from-right duration-300 ease-out",children:[(0,F.jsxs)("div",{className:"p-6",children:[(0,F.jsxs)("div",{className:"flex justify-between items-start mb-8 pb-5 border-b border-border",children:[(0,F.jsx)("div",{className:"flex-1 mr-4",children:j?(0,F.jsxs)("div",{className:"space-y-2",children:[(0,F.jsx)(Y.Input,{value:l,onChange:a=>n(a.target.value),className:"text-lg font-bold",autoFocus:!0}),(0,F.jsxs)("div",{className:"flex gap-2",children:[(0,F.jsxs)(X.Button,{size:"sm",onClick:r,disabled:o||!l.trim(),children:[o?(0,F.jsx)(bh,{className:"w-3 h-3 animate-spin mr-1"}):null,"Save"]}),(0,F.jsx)(X.Button,{size:"sm",variant:"outline",onClick:()=>{n(a.name),k(!1)},children:"Cancel"})]})]}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)("div",{className:"flex items-center gap-2",children:[(0,F.jsx)("h3",{className:"text-xl font-bold text-foreground",children:a.name}),(0,F.jsx)(X.Button,{variant:"ghost",size:"sm",onClick:()=>k(!0),className:"h-7 w-7 p-0",children:(0,F.jsx)(tU,{className:"h-3.5 w-3.5"})})]}),(0,F.jsx)("p",{className:"text-sm text-muted-foreground mt-1",children:a.source_query})]})}),(0,F.jsxs)("div",{className:"flex items-center gap-2",children:[(0,F.jsxs)(X.Button,{variant:"outline",size:"sm",onClick:q,disabled:f,className:"h-8",children:[f?(0,F.jsx)(bh,{className:"w-4 h-4 animate-spin mr-1"}):(0,F.jsx)(ac,{className:"w-4 h-4 mr-1"}),"Refresh"]}),(0,F.jsx)(X.Button,{variant:"ghost",size:"sm",onClick:b,className:"h-8 w-8 p-0",children:(0,F.jsx)(bg.X,{className:"h-4 w-4"})})]})]}),(0,F.jsxs)("div",{className:"space-y-6",children:[(0,F.jsxs)("div",{children:[(0,F.jsx)("div",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide mb-3",children:"Content"}),(0,F.jsx)("div",{className:"prose prose-base dark:prose-invert max-w-none",children:(0,F.jsx)(se,{children:a.content})})]}),t.length>0&&(0,F.jsxs)("div",{className:"border-t border-border pt-5",children:[(0,F.jsxs)("div",{className:"text-xs font-bold text-muted-foreground uppercase mb-3",children:["Based On (",t.length," ",1===t.length?"fact":"facts",")"]}),(0,F.jsx)("div",{className:"space-y-3",children:t.map((a,b)=>(0,F.jsxs)("div",{className:"p-4 bg-muted/50 rounded-lg border border-border/50",children:[(0,F.jsxs)("div",{className:"flex items-start justify-between gap-2 mb-2",children:[(0,F.jsx)("span",{className:`px-2 py-0.5 rounded text-xs font-medium ${"world"===a.factType?"bg-blue-500/10 text-blue-600 dark:text-blue-400":"experience"===a.factType?"bg-green-500/10 text-green-600 dark:text-green-400":"bg-purple-500/10 text-purple-600 dark:text-purple-400"}`,children:a.factType}),(0,F.jsx)(X.Button,{variant:"outline",size:"sm",className:"h-6 text-xs",onClick:()=>i(a.id),children:"View"})]}),(0,F.jsx)("p",{className:"text-sm text-foreground leading-relaxed",children:a.text})]},a.id||b))})]}),u.length>0&&(0,F.jsxs)("div",{className:"border-t border-border pt-5",children:[(0,F.jsxs)("div",{className:"text-xs font-bold text-muted-foreground uppercase mb-3",children:["Observations Used (",u.length,")"]}),(0,F.jsx)("div",{className:"space-y-3",children:u.map((a,b)=>(0,F.jsxs)("div",{className:"p-4 bg-muted/50 rounded-lg border border-border/50",children:[(0,F.jsxs)("div",{className:"flex items-start justify-between gap-2 mb-2",children:[(0,F.jsx)("span",{className:"px-2 py-0.5 rounded text-xs font-medium bg-amber-500/10 text-amber-600 dark:text-amber-400",children:"observation"}),(0,F.jsx)(X.Button,{variant:"outline",size:"sm",className:"h-6 text-xs",onClick:()=>i(a.id),children:"View"})]}),(0,F.jsx)("p",{className:"text-sm text-foreground leading-relaxed",children:a.text})]},a.id||b))})]}),!a.reflect_response&&(0,F.jsxs)("div",{className:"border-t border-border pt-5",children:[(0,F.jsx)("div",{className:"text-xs font-bold text-muted-foreground uppercase mb-3",children:"Based On"}),(0,F.jsx)("p",{className:"text-sm text-muted-foreground",children:'No source data available. Click "Refresh" to regenerate with source tracking.'})]}),a.tags&&a.tags.length>0&&(0,F.jsxs)("div",{children:[(0,F.jsx)("div",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide mb-3",children:"Tags"}),(0,F.jsx)("div",{className:"flex flex-wrap gap-2",children:a.tags.map(a=>(0,F.jsx)("span",{className:"px-2 py-1 rounded bg-muted text-muted-foreground text-sm",children:a},a))})]}),(0,F.jsxs)("div",{className:"flex gap-6 text-sm text-muted-foreground",children:[(0,F.jsxs)("span",{children:["Created: ",s(a.created_at)]}),(0,F.jsxs)("span",{children:["Refreshed: ",s(a.last_refreshed_at)]})]}),(0,F.jsxs)("div",{className:"p-4 bg-muted/50 rounded-lg",children:[(0,F.jsx)("div",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide mb-2",children:"ID"}),(0,F.jsx)("code",{className:"text-sm font-mono break-all text-muted-foreground",children:a.id})]}),(0,F.jsx)("div",{className:"pt-4 border-t border-border",children:(0,F.jsxs)(X.Button,{variant:"outline",size:"sm",onClick:c,className:"text-muted-foreground hover:text-destructive hover:border-destructive",children:[(0,F.jsx)(mK,{className:"h-4 w-4 mr-2"}),"Delete"]})})]})]}),h&&e&&(0,F.jsx)(bn,{memoryId:h,onClose:()=>i(null)})]})}function t1(){let a=(0,G.useParams)(),b=(0,G.useRouter)(),c=(0,G.useSearchParams)(),{features:d}=(0,sm.useFeatures)(),e=a.bankId,f=c.get("view")||"profile",g=c.get("subTab")||"world",h=d?.observations??!1,i=a=>{b.push(`/banks/${e}?view=data&subTab=${a}`)};return(0,F.jsxs)("div",{className:"min-h-screen bg-background flex flex-col",children:[(0,F.jsx)(H.BankSelector,{}),(0,F.jsxs)("div",{className:"flex flex-1 overflow-hidden",children:[(0,F.jsx)(V,{currentTab:f,onTabChange:a=>{b.push(`/banks/${e}?view=${a}`)}}),(0,F.jsx)("main",{className:"flex-1 overflow-y-auto",children:(0,F.jsxs)("div",{className:"p-6",children:["profile"===f&&(0,F.jsxs)("div",{children:[(0,F.jsx)("h1",{className:"text-3xl font-bold mb-2 text-foreground",children:"Bank Profile"}),(0,F.jsx)("p",{className:"text-muted-foreground mb-6",children:"View and edit the memory bank profile, disposition traits, and background information."}),(0,F.jsx)(tX,{})]}),"recall"===f&&(0,F.jsxs)("div",{children:[(0,F.jsx)("h1",{className:"text-3xl font-bold mb-2 text-foreground",children:"Recall"}),(0,F.jsx)("p",{className:"text-muted-foreground mb-6",children:"Analyze memory recall with detailed trace information and retrieval methods."}),(0,F.jsx)(sl,{})]}),"reflect"===f&&(0,F.jsxs)("div",{children:[(0,F.jsx)("h1",{className:"text-3xl font-bold mb-2 text-foreground",children:"Reflect"}),(0,F.jsx)("p",{className:"text-muted-foreground mb-6",children:"Run an agentic loop that autonomously gathers evidence and reasons through the lens of the bank's disposition to generate contextual responses."}),(0,F.jsx)(sj,{})]}),"data"===f&&(0,F.jsxs)("div",{children:[(0,F.jsx)("h1",{className:"text-3xl font-bold mb-2 text-foreground",children:"Memories"}),(0,F.jsx)("p",{className:"text-muted-foreground mb-6",children:"View and explore different types of memories stored in this memory bank."}),(0,F.jsx)("div",{className:"mb-6 border-b border-border",children:(0,F.jsxs)("div",{className:"flex gap-1",children:[(0,F.jsxs)("button",{onClick:()=>i("world"),className:`px-6 py-3 font-semibold text-sm transition-all relative ${"world"===g?"text-primary":"text-muted-foreground hover:text-foreground"}`,children:["World Facts","world"===g&&(0,F.jsx)("div",{className:"absolute bottom-0 left-0 right-0 h-0.5 bg-primary"})]}),(0,F.jsxs)("button",{onClick:()=>i("experience"),className:`px-6 py-3 font-semibold text-sm transition-all relative ${"experience"===g?"text-primary":"text-muted-foreground hover:text-foreground"}`,children:["Experience","experience"===g&&(0,F.jsx)("div",{className:"absolute bottom-0 left-0 right-0 h-0.5 bg-primary"})]}),(0,F.jsxs)("button",{onClick:()=>i("observations"),className:`px-6 py-3 font-semibold text-sm transition-all relative ${"observations"===g?"text-primary":"text-muted-foreground hover:text-foreground"}`,children:["Observations",!h&&(0,F.jsx)("span",{className:"ml-2 text-xs px-1.5 py-0.5 rounded bg-muted text-muted-foreground",children:"Off"}),"observations"===g&&(0,F.jsx)("div",{className:"absolute bottom-0 left-0 right-0 h-0.5 bg-primary"})]}),(0,F.jsxs)("button",{onClick:()=>i("mental-models"),className:`px-6 py-3 font-semibold text-sm transition-all relative ${"mental-models"===g?"text-primary":"text-muted-foreground hover:text-foreground"}`,children:["Mental Models","mental-models"===g&&(0,F.jsx)("div",{className:"absolute bottom-0 left-0 right-0 h-0.5 bg-primary"})]})]})}),(0,F.jsxs)("div",{children:["world"===g&&(0,F.jsxs)("div",{children:[(0,F.jsx)("p",{className:"text-sm text-muted-foreground mb-4",children:"Objective facts about the world received from external sources."}),(0,F.jsx)(me,{factType:"world"},"world")]}),"experience"===g&&(0,F.jsxs)("div",{children:[(0,F.jsx)("p",{className:"text-sm text-muted-foreground mb-4",children:"The bank's own actions, interactions, and first-person experiences."}),(0,F.jsx)(me,{factType:"experience"},"experience")]}),"observations"===g&&(h?(0,F.jsxs)("div",{children:[(0,F.jsx)("p",{className:"text-sm text-muted-foreground mb-4",children:"Consolidated knowledge synthesized from facts — patterns, preferences, and learnings that emerge from accumulated evidence."}),(0,F.jsx)(me,{factType:"observation"},"observations")]}):(0,F.jsxs)("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[(0,F.jsx)("div",{className:"text-muted-foreground mb-2",children:(0,F.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"48",height:"48",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,F.jsx)("path",{d:"M12 2a10 10 0 1 0 10 10A10 10 0 0 0 12 2Z"}),(0,F.jsx)("path",{d:"M12 8v4"}),(0,F.jsx)("path",{d:"M12 16h.01"})]})}),(0,F.jsx)("h3",{className:"text-lg font-semibold text-foreground mb-1",children:"Observations Not Enabled"}),(0,F.jsxs)("p",{className:"text-sm text-muted-foreground max-w-md",children:["Observations consolidation is disabled on this server. Set"," ",(0,F.jsx)("code",{className:"px-1 py-0.5 bg-muted rounded text-xs",children:"HINDSIGHT_API_ENABLE_OBSERVATIONS=true"})," ","to enable."]})]})),"mental-models"===g&&(0,F.jsxs)("div",{children:[(0,F.jsx)("p",{className:"text-sm text-muted-foreground mb-4",children:"User-curated summaries generated from queries — reusable knowledge snapshots that can be refreshed as memories evolve."}),(0,F.jsx)(t$,{},"mental-models")]})]})]}),"documents"===f&&(0,F.jsxs)("div",{children:[(0,F.jsx)("h1",{className:"text-3xl font-bold mb-2 text-foreground",children:"Documents"}),(0,F.jsx)("p",{className:"text-muted-foreground mb-6",children:"Manage documents and retain new memories."}),(0,F.jsx)(mL,{})]}),"entities"===f&&(0,F.jsxs)("div",{children:[(0,F.jsx)("h1",{className:"text-3xl font-bold mb-2 text-foreground",children:"Entities"}),(0,F.jsx)("p",{className:"text-muted-foreground mb-6",children:"Explore entities (people, organizations, places) mentioned in memories."}),(0,F.jsx)(mM,{})]})]})})]})]})}a.s(["default",()=>t1],73101)}];
|
|
8
|
+
${K.trim()}`:K.trim();await W.client.updateDirective(l,b.id,{content:a})}else await W.client.createDirective(l,{name:am,content:K.trim()});L(""),R(!0),setTimeout(()=>R(!1),3e3)}catch(a){console.error("Error submitting feedback:",a),alert("Error submitting feedback: "+a.message)}finally{P(!1)}}},ap=async()=>{if(l&&n){C(!0),y("answer");try{let a=D.split(",").map(a=>a.trim()).filter(a=>a.length>0),b=await W.client.reflect({bank_id:l,query:n,budget:p,max_tokens:r,include_facts:t,include_tool_calls:v,...a.length>0&&{tags:a,tags_match:G}});A(b)}catch(a){console.error("Error running reflect:",a),alert("Error running reflect: "+a.message)}finally{C(!1)}}};return l?(0,F.jsxs)("div",{className:"space-y-6",children:[(0,F.jsx)(n_,{children:(0,F.jsxs)(n3,{className:"pt-6",children:[(0,F.jsxs)("div",{className:"flex gap-3",children:[(0,F.jsxs)("div",{className:"flex-1 relative",children:[(0,F.jsx)(M,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),(0,F.jsx)(Y.Input,{type:"text",value:n,onChange:a=>o(a.target.value),placeholder:"What would you like to reflect on?",className:"pl-10 h-12 text-lg",onKeyDown:a=>"Enter"===a.key&&ap()})]}),(0,F.jsx)(X.Button,{onClick:ap,disabled:B||!n,className:"h-12 px-8",children:B?"Reflecting...":"Reflect"})]}),(0,F.jsxs)("div",{className:"flex flex-wrap items-center gap-6 mt-4 pt-4 border-t",children:[(0,F.jsxs)("div",{className:"flex items-center gap-2",children:[(0,F.jsx)("span",{className:"text-sm font-medium text-muted-foreground",children:"Budget:"}),(0,F.jsxs)(nc,{value:p,onValueChange:a=>q(a),children:[(0,F.jsx)(nV,{className:"w-24 h-8",children:(0,F.jsx)(ng,{})}),(0,F.jsxs)(nY,{children:[(0,F.jsx)(nZ,{value:"low",children:"Low"}),(0,F.jsx)(nZ,{value:"mid",children:"Mid"}),(0,F.jsx)(nZ,{value:"high",children:"High"})]})]})]}),(0,F.jsxs)("div",{className:"flex items-center gap-2",children:[(0,F.jsx)("span",{className:"text-sm text-muted-foreground",children:"Tokens:"}),(0,F.jsx)(Y.Input,{type:"number",value:r,onChange:a=>s(parseInt(a.target.value)||4096),className:"w-24 h-8"})]}),(0,F.jsx)("div",{className:"h-6 w-px bg-border"}),(0,F.jsxs)("div",{className:"flex items-center gap-4",children:[(0,F.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer",children:[(0,F.jsx)(n$.Checkbox,{checked:t,onCheckedChange:a=>u(a)}),(0,F.jsx)("span",{className:"text-sm",children:"Include Source"})]}),(0,F.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer",children:[(0,F.jsx)(n$.Checkbox,{checked:v,onCheckedChange:a=>w(a)}),(0,F.jsx)("span",{className:"text-sm",children:"Include Tools"})]})]})]}),(0,F.jsxs)("div",{className:"flex items-center gap-4 mt-4 pt-4 border-t",children:[(0,F.jsx)(bl.Tag,{className:"h-4 w-4 text-muted-foreground"}),(0,F.jsx)("div",{className:"flex-1 max-w-md",children:(0,F.jsx)(Y.Input,{type:"text",value:D,onChange:a=>E(a.target.value),placeholder:"Filter by tags (comma-separated)",className:"h-8"})}),(0,F.jsxs)(nc,{value:G,onValueChange:a=>H(a),children:[(0,F.jsx)(nV,{className:"w-40 h-8",children:(0,F.jsx)(ng,{})}),(0,F.jsxs)(nY,{children:[(0,F.jsx)(nZ,{value:"any",children:"Any (incl. untagged)"}),(0,F.jsx)(nZ,{value:"all",children:"All (incl. untagged)"}),(0,F.jsx)(nZ,{value:"any_strict",children:"Any (strict)"}),(0,F.jsx)(nZ,{value:"all_strict",children:"All (strict)"})]})]})]})]})}),B&&(0,F.jsx)(n_,{children:(0,F.jsxs)(n3,{className:"flex flex-col items-center justify-center py-16",children:[(0,F.jsx)("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary mb-4"}),(0,F.jsx)("p",{className:"text-muted-foreground",children:"Reflecting on memories..."})]})}),!B&&z&&(0,F.jsxs)("div",{className:"space-y-4",children:[(0,F.jsxs)("div",{className:"flex items-center gap-6 text-sm",children:[z.usage&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)("div",{className:"flex items-center gap-2",children:[(0,F.jsx)("span",{className:"text-muted-foreground",children:"Input tokens:"}),(0,F.jsx)("span",{className:"font-semibold",children:z.usage.input_tokens?.toLocaleString()})]}),(0,F.jsxs)("div",{className:"flex items-center gap-2",children:[(0,F.jsx)("span",{className:"text-muted-foreground",children:"Output tokens:"}),(0,F.jsx)("span",{className:"font-semibold",children:z.usage.output_tokens?.toLocaleString()})]})]}),z.trace?.tool_calls&&(0,F.jsxs)("div",{className:"flex items-center gap-2",children:[(0,F.jsx)("span",{className:"text-muted-foreground",children:"Tool calls:"}),(0,F.jsx)("span",{className:"font-semibold",children:z.trace.tool_calls.length}),(0,F.jsxs)("span",{className:"text-muted-foreground",children:["(",z.trace.tool_calls.reduce((a,b)=>a+b.duration_ms,0),"ms)"]})]}),z.trace?.llm_calls&&(0,F.jsxs)("div",{className:"flex items-center gap-2",children:[(0,F.jsx)("span",{className:"text-muted-foreground",children:"LLM calls:"}),(0,F.jsx)("span",{className:"font-semibold",children:z.trace.llm_calls.length}),(0,F.jsxs)("span",{className:"text-muted-foreground",children:["(",z.trace.llm_calls.reduce((a,b)=>a+b.duration_ms,0),"ms)"]})]}),(0,F.jsx)("div",{className:"flex-1"}),(0,F.jsx)("div",{className:"flex gap-1 bg-muted p-1 rounded-lg",children:["answer","trace","json"].map(a=>(0,F.jsx)("button",{onClick:()=>y(a),className:`px-3 py-1.5 text-sm font-medium rounded-md transition-colors ${x===a?"bg-background shadow-sm":"text-muted-foreground hover:text-foreground"}`,children:"answer"===a?"Answer":"trace"===a?"Trace":"JSON"},a))})]}),"answer"===x&&(0,F.jsxs)("div",{className:"space-y-6",children:[(0,F.jsxs)(n_,{children:[(0,F.jsx)(n0,{children:(0,F.jsx)(n1,{children:"Answer"})}),(0,F.jsx)(n3,{children:(0,F.jsx)("div",{className:"text-base leading-relaxed whitespace-pre-wrap",children:z.text})})]}),(0,F.jsxs)(n_,{className:"border-blue-200 dark:border-blue-800",children:[(0,F.jsxs)(n0,{className:"py-4",children:[(0,F.jsxs)(n1,{className:"flex items-center gap-2 text-base",children:[(0,F.jsx)(n6,{className:"w-4 h-4"}),"Add Directive"]}),(0,F.jsx)(n2,{className:"text-xs",children:"Hard rules injected into prompts that the agent must follow"})]}),(0,F.jsx)(n3,{className:"pt-0",children:Q?(0,F.jsxs)("div",{className:"flex items-center gap-2 text-green-600 dark:text-green-400",children:[(0,F.jsx)("span",{className:"text-lg",children:"✓"}),(0,F.jsxs)("span",{className:"text-sm font-medium",children:["Directive saved to ",am]})]}):(0,F.jsxs)("div",{className:"flex gap-3",children:[(0,F.jsx)(n9.Textarea,{value:K,onChange:a=>L(a.target.value),placeholder:"e.g., Always respond in formal English...",className:"flex-1 min-h-[60px] resize-none",onKeyDown:a=>{"Enter"===a.key&&(a.metaKey||a.ctrlKey)&&ao()}}),(0,F.jsx)(X.Button,{onClick:ao,disabled:O||!K.trim(),className:"self-end",children:O?"Saving...":"Save"})]})})]})]}),"trace"===x&&(0,F.jsxs)("div",{className:"space-y-4",children:[z.observations_created&&z.observations_created.length>0&&(0,F.jsxs)(n_,{className:"border-emerald-200 dark:border-emerald-800",children:[(0,F.jsxs)(n0,{className:"bg-emerald-50 dark:bg-emerald-950 py-3",children:[(0,F.jsxs)(n1,{className:"flex items-center gap-2 text-base",children:[(0,F.jsx)(n5,{className:"w-4 h-4 text-emerald-600"}),"Observations Created (",z.observations_created.length,")"]}),(0,F.jsx)(n2,{className:"text-xs",children:"New observations learned during this reflection"})]}),(0,F.jsx)(n3,{className:"pt-4",children:(0,F.jsx)("div",{className:"space-y-2",children:z.observations_created.map((a,b)=>(0,F.jsxs)("div",{className:"p-3 bg-emerald-50 dark:bg-emerald-950/50 rounded-lg border border-emerald-200 dark:border-emerald-800",children:[(0,F.jsx)("div",{className:"font-medium text-sm text-emerald-900 dark:text-emerald-100",children:a.name}),(0,F.jsx)("div",{className:"text-xs text-emerald-700 dark:text-emerald-300 mt-1",children:a.description}),(0,F.jsxs)("div",{className:"text-[10px] text-muted-foreground mt-2 font-mono",children:["ID: ",a.id]})]},b))})})]}),(0,F.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:[(0,F.jsxs)(n_,{className:"h-fit",children:[(0,F.jsxs)(n0,{className:"pb-3",children:[(0,F.jsx)(n1,{className:"text-base",children:"Execution Trace"}),(0,F.jsxs)(n2,{className:"text-xs",children:[z.iterations||0," iteration",1!==(z.iterations||0)?"s":""," •"," ",(z.trace?.llm_calls?.reduce((a,b)=>a+b.duration_ms,0)||0)+(z.trace?.tool_calls?.reduce((a,b)=>a+b.duration_ms,0)||0),"ms total"]})]}),(0,F.jsx)(n3,{children:v?z.trace?.llm_calls&&z.trace.llm_calls.length>0||z.trace?.tool_calls&&z.trace.tool_calls.length>0?(0,F.jsx)("div",{className:"max-h-[500px] overflow-y-auto pr-2",children:(a=z.trace?.llm_calls||[],b=z.trace?.tool_calls||[],c=[],a.forEach((d,e)=>{let f=b.filter(a=>a.iteration===e+1),g=e===a.length-1,h=d.scope.includes("final")||g&&0===f.length,i=h?a.length:e+1;c.push({type:"llm",llm:d,iteration:i,isFinal:h}),f.length>0&&c.push({type:"tools",tools:f,iteration:e+1})}),c.map((a,b)=>(0,F.jsxs)("div",{className:"relative",children:[b<c.length-1&&(0,F.jsx)("div",{className:"absolute left-3 top-6 bottom-0 w-0.5 bg-border"}),"llm"===a.type?(0,F.jsxs)("div",{className:"flex items-start gap-3 pb-3",children:[(0,F.jsx)("div",{className:`w-6 h-6 rounded-full flex items-center justify-center flex-shrink-0 ${a.isFinal?"bg-emerald-500/15 text-emerald-600 dark:text-emerald-400":"bg-primary/10 text-primary"}`,children:a.isFinal?(0,F.jsx)(bf.Check,{className:"w-3.5 h-3.5",strokeWidth:2.5}):(0,F.jsx)("span",{className:"text-[10px] font-semibold",children:a.iteration})}),(0,F.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,F.jsxs)("div",{className:"flex items-center justify-between",children:[(0,F.jsx)("span",{className:"font-medium text-sm",children:a.isFinal?"Response generated":"Agent decided"}),(0,F.jsxs)("span",{className:"text-xs text-muted-foreground flex items-center gap-1",children:[(0,F.jsx)(ae,{className:"w-3 h-3"}),a.llm.duration_ms,"ms"]})]}),(0,F.jsx)("span",{className:"text-xs text-muted-foreground",children:a.isFinal?"Final answer":"Called tools below"})]})]}):(0,F.jsxs)("div",{className:"flex items-start gap-3 pb-3",children:[(0,F.jsx)("div",{className:"w-6 h-6 rounded-full flex items-center justify-center bg-blue-500/15 text-blue-600 dark:text-blue-400 flex-shrink-0",children:(0,F.jsx)(n8,{className:"w-3 h-3",fill:"currentColor"})}),(0,F.jsxs)("div",{className:"flex-1 min-w-0 space-y-2",children:[(0,F.jsxs)("div",{className:"text-xs text-muted-foreground",children:["Executing ",a.tools?.length," tool",a.tools?.length!==1?"s":""]}),a.tools?.map((a,b)=>(0,F.jsxs)("div",{className:"border border-border rounded-lg overflow-hidden",children:[(0,F.jsxs)("div",{className:"flex items-center justify-between px-3 py-1.5 bg-muted/50",children:[(0,F.jsx)("span",{className:"font-medium text-sm text-foreground",children:a.tool}),(0,F.jsxs)("span",{className:"text-xs text-muted-foreground flex items-center gap-1",children:[(0,F.jsx)(ae,{className:"w-3 h-3"}),a.duration_ms,"ms"]})]}),(0,F.jsxs)("div",{className:"p-2 space-y-2",children:[(0,F.jsxs)("div",{children:[(0,F.jsx)("p",{className:"text-[10px] font-semibold text-muted-foreground mb-1",children:"Input:"}),(0,F.jsx)("div",{className:"bg-muted p-1.5 rounded text-xs overflow-auto max-h-32",children:(0,F.jsx)(oR,{src:a.input,collapsed:1,theme:"default"})})]}),a.output&&(0,F.jsxs)("div",{children:[(0,F.jsx)("p",{className:"text-[10px] font-semibold text-muted-foreground mb-1",children:"Output:"}),(0,F.jsx)("div",{className:"bg-muted p-1.5 rounded text-xs overflow-auto max-h-32",children:(0,F.jsx)(oR,{src:a.output,collapsed:1,theme:"default"})})]})]})]},b))]})]})]},b)))}):(0,F.jsxs)("div",{className:"flex items-start gap-3 p-3 bg-muted border border-border rounded-lg",children:[(0,F.jsx)(n4,{className:"w-4 h-4 text-muted-foreground mt-0.5 flex-shrink-0"}),(0,F.jsxs)("div",{children:[(0,F.jsx)("p",{className:"font-medium text-sm text-foreground",children:"No operations"}),(0,F.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5",children:"No LLM or tool calls were made during this reflection."})]})]}):(0,F.jsxs)("div",{className:"flex items-start gap-3 p-3 bg-muted border border-border rounded-lg",children:[(0,F.jsx)(n4,{className:"w-4 h-4 text-muted-foreground mt-0.5 flex-shrink-0"}),(0,F.jsxs)("div",{children:[(0,F.jsx)("p",{className:"font-medium text-sm text-foreground",children:"Not included"}),(0,F.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5",children:'Enable "Include Tool Calls" to see trace.'})]})]})})]}),(0,F.jsxs)(n_,{className:"h-fit",children:[(0,F.jsxs)(n0,{className:"pb-3",children:[(0,F.jsx)(n1,{className:"text-base",children:"Based On"}),(0,F.jsxs)(n2,{className:"text-xs",children:[(z.based_on?.memories?.length||0)+(z.based_on?.observations?.filter(a=>"directive"!==a.subtype)?.length||0)+(z.based_on?.directives?.length||0)," ","items used"]})]}),(0,F.jsx)(n3,{children:t?z.based_on?.memories&&z.based_on.memories.length>0||z.based_on?.mental_models&&z.based_on.mental_models.length>0||z.based_on?.directives&&z.based_on.directives.length>0||z.based_on?.observations&&z.based_on.observations.length>0?(e=(d=z.based_on?.memories||[]).filter(a=>"world"===a.type),f=d.filter(a=>"experience"===a.type),g=z.based_on?.mental_models||[],h=(z.based_on?.observations||[]).filter(a=>"directive"!==a.subtype),j=[{id:"directives",label:"Directives",count:(i=z.based_on?.directives||[]).length},{id:"mental_models",label:"Mental Models",count:g.length},{id:"observations",label:"Observations",count:h.length},{id:"world",label:"World",count:e.length},{id:"experience",label:"Experience",count:f.length}],k=(()=>{switch(ak){case"directives":return i;case"mental_models":return g;case"observations":return h;case"world":return e;case"experience":return f;default:return[]}})(),(0,F.jsxs)("div",{children:[(0,F.jsx)("div",{className:"flex items-center gap-1 bg-muted rounded-lg p-1 mb-4",children:j.map(a=>(0,F.jsxs)("button",{onClick:()=>al(a.id),className:`flex-1 px-3 py-1.5 rounded-md text-sm font-medium transition-all ${ak===a.id?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,children:[a.label," (",a.count,")"]},a.id))}),k.length>0?(0,F.jsx)("div",{className:"max-h-[400px] overflow-y-auto pr-2 space-y-3",children:k.map((a,b)=>{let c,d;return(0,F.jsx)("div",{className:`p-4 bg-muted/50 rounded-lg border border-border/50 ${"directives"!==ak?"cursor-pointer hover:bg-muted/80 transition-colors":""}`,onClick:()=>{"directives"!==ak&&("observations"===ak?an(a):"mental_models"===ak?aj(a.id):T(a.id))},children:"directives"===ak?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)("div",{className:"font-medium text-sm",children:a.name}),a.content&&(0,F.jsx)("p",{className:"mt-1 text-xs text-muted-foreground line-clamp-2",children:a.content})]}):"observations"===ak?(0,F.jsx)("div",{className:"font-medium text-sm",children:a.name}):"mental_models"===ak?(d=(c=a.text?.indexOf(": ")??-1)>0?a.text.slice(0,c):a.id,(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)("div",{className:"font-medium text-sm",children:d}),(0,F.jsx)("code",{className:"text-xs font-mono text-muted-foreground",children:a.id})]})):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)("p",{className:"text-sm text-foreground leading-relaxed",children:a.text}),a.context&&(0,F.jsx)("div",{className:"text-xs text-muted-foreground mt-2",children:a.context})]})},a.id||b)})}):(0,F.jsxs)("p",{className:"text-sm text-muted-foreground text-center py-4",children:["No ",ak," items"]})]})):(0,F.jsxs)("div",{className:"flex items-start gap-3 p-3 bg-amber-50 dark:bg-amber-950 border border-amber-200 dark:border-amber-800 rounded-lg",children:[(0,F.jsx)(n4,{className:"w-4 h-4 text-amber-600 dark:text-amber-400 mt-0.5 flex-shrink-0"}),(0,F.jsxs)("div",{children:[(0,F.jsx)("p",{className:"font-medium text-sm text-amber-900 dark:text-amber-100",children:"No facts found"}),(0,F.jsx)("p",{className:"text-xs text-amber-700 dark:text-amber-300 mt-0.5",children:"No memories were used to generate this answer."})]})]}):(0,F.jsxs)("div",{className:"flex items-start gap-3 p-3 bg-muted border border-border rounded-lg",children:[(0,F.jsx)(n4,{className:"w-4 h-4 text-muted-foreground mt-0.5 flex-shrink-0"}),(0,F.jsxs)("div",{children:[(0,F.jsx)("p",{className:"font-medium text-sm text-foreground",children:"Not included"}),(0,F.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5",children:'Enable "Include Source" to see memories.'})]})]})})]})]})]}),"json"===x&&(0,F.jsxs)(n_,{children:[(0,F.jsx)(n0,{children:(0,F.jsx)(n1,{className:"text-lg",children:"Raw Response"})}),(0,F.jsx)(n3,{children:(0,F.jsx)("div",{className:"bg-muted p-4 rounded-lg overflow-auto max-h-[600px]",children:(0,F.jsx)(oR,{src:z,collapsed:2,theme:"default"})})})]})]}),!B&&!z&&(0,F.jsx)(n_,{className:"border-dashed",children:(0,F.jsxs)(n3,{className:"flex flex-col items-center justify-center py-16",children:[(0,F.jsx)(M,{className:"h-12 w-12 text-muted-foreground mb-4"}),(0,F.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Ready to Reflect"}),(0,F.jsx)("p",{className:"text-muted-foreground text-center max-w-md",children:"Enter a question above to query the memory bank and generate a disposition-aware response."})]})}),(0,F.jsx)(bn,{memoryId:S,onClose:()=>T(null)}),U&&(0,F.jsx)("div",{className:"fixed right-0 top-0 h-screen w-[420px] bg-card border-l shadow-2xl z-50 overflow-y-auto",children:(0,F.jsxs)("div",{className:"p-6",children:[(0,F.jsxs)("div",{className:"flex items-center justify-between mb-6",children:[(0,F.jsxs)("div",{className:"flex items-center gap-2",children:[(0,F.jsx)(n7,{className:"w-5 h-5"}),(0,F.jsx)("h2",{className:"text-lg font-semibold",children:"Directive"})]}),(0,F.jsx)(X.Button,{variant:"ghost",size:"icon",onClick:()=>{V(null),$(null)},children:(0,F.jsx)(bg.X,{className:"w-4 h-4"})})]}),_?(0,F.jsx)("div",{className:"flex items-center justify-center py-8",children:(0,F.jsx)("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary"})}):(0,F.jsxs)("div",{className:"space-y-4",children:[(0,F.jsxs)("div",{children:[(0,F.jsx)("h3",{className:"text-sm font-medium text-muted-foreground",children:"Name"}),(0,F.jsx)("p",{className:"mt-1 font-medium",children:Z?.name||U.name})]}),Z?.description&&(0,F.jsxs)("div",{children:[(0,F.jsx)("h3",{className:"text-sm font-medium text-muted-foreground",children:"Description"}),(0,F.jsx)("p",{className:"mt-1 text-sm",children:Z.description})]}),Z?.tags&&Z.tags.length>0&&(0,F.jsxs)("div",{children:[(0,F.jsx)("h3",{className:"text-sm font-medium text-muted-foreground mb-1",children:"Tags"}),(0,F.jsx)("div",{className:"flex flex-wrap gap-1",children:Z.tags.map(a=>(0,F.jsxs)("span",{className:"text-xs px-2 py-0.5 rounded bg-muted text-muted-foreground flex items-center gap-1",children:[(0,F.jsx)(bl.Tag,{className:"w-2.5 h-2.5"}),a]},a))})]}),(Z?.content||U.content)&&(0,F.jsxs)("div",{children:[(0,F.jsx)("h3",{className:"text-sm font-medium text-muted-foreground mb-2",children:"Content"}),(0,F.jsx)("div",{className:"p-3 bg-muted rounded-lg",children:(0,F.jsx)("div",{className:"text-sm text-muted-foreground whitespace-pre-wrap",children:Z?.content||U.content})})]}),(0,F.jsxs)("div",{className:"pt-2 border-t",children:[(0,F.jsx)("h3",{className:"text-sm font-medium text-muted-foreground",children:"ID"}),(0,F.jsx)("p",{className:"mt-1 font-mono text-xs text-muted-foreground",children:U.id})]})]})]})}),ab&&(0,F.jsx)("div",{className:"fixed right-0 top-0 h-screen w-[420px] bg-card border-l shadow-2xl z-50 overflow-y-auto",children:(0,F.jsxs)("div",{className:"p-6",children:[(0,F.jsxs)("div",{className:"flex items-center justify-between mb-6",children:[(0,F.jsxs)("div",{className:"flex items-center gap-2",children:[(0,F.jsx)(n5,{className:"w-5 h-5"}),(0,F.jsx)("h2",{className:"text-lg font-semibold",children:"Observation"})]}),(0,F.jsx)(X.Button,{variant:"ghost",size:"icon",onClick:()=>{ac(null),af(null)},children:(0,F.jsx)(bg.X,{className:"w-4 h-4"})})]}),ag?(0,F.jsx)("div",{className:"flex items-center justify-center py-8",children:(0,F.jsx)("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary"})}):(0,F.jsxs)("div",{className:"space-y-4",children:[(0,F.jsxs)("div",{children:[(0,F.jsx)("h3",{className:"text-sm font-medium text-muted-foreground",children:"Text"}),(0,F.jsx)("p",{className:"mt-1 font-medium",children:ad?.text||ab.text})]}),ad?.tags&&ad.tags.length>0&&(0,F.jsxs)("div",{children:[(0,F.jsx)("h3",{className:"text-sm font-medium text-muted-foreground mb-1",children:"Tags"}),(0,F.jsx)("div",{className:"flex flex-wrap gap-1",children:ad.tags.map(a=>(0,F.jsxs)("span",{className:"text-xs px-2 py-0.5 rounded bg-muted text-muted-foreground flex items-center gap-1",children:[(0,F.jsx)(bl.Tag,{className:"w-2.5 h-2.5"}),a]},a))})]}),ad?.source_memories&&ad.source_memories.length>0&&(0,F.jsxs)("div",{children:[(0,F.jsxs)("h3",{className:"text-sm font-medium text-muted-foreground mb-2",children:["Source Memories (",ad.source_memories.length,")"]}),(0,F.jsx)("div",{className:"space-y-2",children:ad.source_memories.map((a,b)=>(0,F.jsx)("div",{className:"p-3 bg-muted rounded-lg",children:(0,F.jsx)("div",{className:"text-sm text-muted-foreground whitespace-pre-wrap",children:a.text||("string"==typeof a?a:"")})},b))})]}),(0,F.jsxs)("div",{className:"pt-2 border-t",children:[(0,F.jsx)("h3",{className:"text-sm font-medium text-muted-foreground",children:"ID"}),(0,F.jsx)("p",{className:"mt-1 font-mono text-xs text-muted-foreground",children:ab.id})]})]})]})}),(0,F.jsx)(si,{mentalModelId:ai,onClose:()=>aj(null)})]}):(0,F.jsx)(n_,{className:"border-dashed",children:(0,F.jsxs)(n3,{className:"flex flex-col items-center justify-center py-16",children:[(0,F.jsx)(N,{className:"h-12 w-12 text-muted-foreground mb-4"}),(0,F.jsx)("h3",{className:"text-xl font-semibold mb-2",children:"No Bank Selected"}),(0,F.jsx)("p",{className:"text-muted-foreground",children:"Select a memory bank to start reflecting."})]})})}let sk=(0,L.default)("arrow-down",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);function sl(){let a,b,c,d,e,f,g,h,i,j,k,l,n,o,{currentBank:p}=(0,J.useBank)(),[q,r]=(0,I.useState)(""),[s,t]=(0,I.useState)(["world"]),[u,v]=(0,I.useState)("mid"),[w,x]=(0,I.useState)(4096),[y,z]=(0,I.useState)(""),[A,B]=(0,I.useState)(!1),[C,D]=(0,I.useState)(!1),[E,G]=(0,I.useState)(""),[H,L]=(0,I.useState)("any"),[M,Q]=(0,I.useState)(null),[S,T]=(0,I.useState)(null),[U,V]=(0,I.useState)(null),[$,_]=(0,I.useState)(null),[aa,ab]=(0,I.useState)(null),[ac,ad]=(0,I.useState)(!1),[af,ag]=(0,I.useState)("results"),[ah,ai]=(0,I.useState)(null),[aj,ak]=(0,I.useState)(new Set),[al,am]=(0,I.useState)(new Set),an=a=>{ak(b=>{let c=new Set(b);return c.has(a)?c.delete(a):c.add(a),c})},ao=a=>{am(b=>{let c=new Set(b);return c.has(a)?c.delete(a):c.add(a),c})},ap=a=>{let b=a.id||a.node_id;ai(M?.find(a=>a.id===b||a.node_id===b)||a)},aq=async()=>{if(!p)return void alert("Please select a memory bank first");if(q){if(0===s.length)return void alert("Please select at least one type (World, Experience, or Observations)");ad(!0);try{let a=E.split(",").map(a=>a.trim()).filter(a=>a.length>0),b={bank_id:p,query:q,types:s,budget:u,max_tokens:w,trace:!0,include:{entities:C?{max_tokens:500}:null,chunks:A?{max_tokens:8192}:null},...y&&{query_timestamp:y},...a.length>0&&{tags:a,tags_match:H}},c=await W.client.recall(b);Q(c.results||[]),T(c.entities||null),V(c.chunks||null),_(c.observations||null),ab(c.trace||null),ag("results")}catch(a){console.error("Error running search:",a),alert("Error running search: "+a.message)}finally{ad(!1)}}},ar=a=>{t(b=>b.includes(a)?b.filter(b=>b!==a):[...b,a])};return p?(0,F.jsxs)("div",{className:"space-y-6",children:[(0,F.jsx)(n_,{children:(0,F.jsxs)(n3,{className:"pt-6",children:[(0,F.jsxs)("div",{className:"flex gap-3",children:[(0,F.jsxs)("div",{className:"flex-1 relative",children:[(0,F.jsx)(K.Search,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),(0,F.jsx)(Y.Input,{type:"text",value:q,onChange:a=>r(a.target.value),placeholder:"What would you like to recall?",className:"pl-10 h-12 text-lg",onKeyDown:a=>"Enter"===a.key&&aq()})]}),(0,F.jsx)(X.Button,{onClick:aq,disabled:ac||!q,className:"h-12 px-8",children:ac?"Searching...":"Recall"})]}),(0,F.jsxs)("div",{className:"flex flex-wrap items-center gap-6 mt-4 pt-4 border-t",children:[(0,F.jsxs)("div",{className:"flex items-center gap-4",children:[(0,F.jsx)("span",{className:"text-sm font-medium text-muted-foreground",children:"Types:"}),(0,F.jsxs)("div",{className:"flex gap-3",children:[["world","experience"].map(a=>(0,F.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer",children:[(0,F.jsx)(n$.Checkbox,{checked:s.includes(a),onCheckedChange:()=>ar(a)}),(0,F.jsx)("span",{className:"text-sm capitalize",children:a})]},a)),(0,F.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer",children:[(0,F.jsx)(n$.Checkbox,{checked:s.includes("observation"),onCheckedChange:()=>ar("observation")}),(0,F.jsx)("span",{className:"text-sm",children:"Observations"})]})]})]}),(0,F.jsx)("div",{className:"h-6 w-px bg-border"}),(0,F.jsxs)("div",{className:"flex items-center gap-2",children:[(0,F.jsx)(oS,{className:"h-4 w-4 text-muted-foreground"}),(0,F.jsxs)(nc,{value:u,onValueChange:a=>v(a),children:[(0,F.jsx)(nV,{className:"w-24 h-8",children:(0,F.jsx)(ng,{})}),(0,F.jsxs)(nY,{children:[(0,F.jsx)(nZ,{value:"low",children:"Low"}),(0,F.jsx)(nZ,{value:"mid",children:"Mid"}),(0,F.jsx)(nZ,{value:"high",children:"High"})]})]})]}),(0,F.jsxs)("div",{className:"flex items-center gap-2",children:[(0,F.jsx)("span",{className:"text-sm text-muted-foreground",children:"Tokens:"}),(0,F.jsx)(Y.Input,{type:"number",value:w,onChange:a=>x(parseInt(a.target.value)),className:"w-24 h-8"})]}),(0,F.jsxs)("div",{className:"flex items-center gap-2",children:[(0,F.jsx)(ae,{className:"h-4 w-4 text-muted-foreground"}),(0,F.jsx)(Y.Input,{type:"datetime-local",value:y,onChange:a=>z(a.target.value),className:"h-8",placeholder:"Query date"})]}),(0,F.jsx)("div",{className:"h-6 w-px bg-border"}),(0,F.jsxs)("div",{className:"flex items-center gap-4",children:[(0,F.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer",children:[(0,F.jsx)(n$.Checkbox,{checked:A,onCheckedChange:a=>B(a)}),(0,F.jsx)(O.FileText,{className:"h-4 w-4 text-muted-foreground"}),(0,F.jsx)("span",{className:"text-sm",children:"Chunks"})]}),(0,F.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer",children:[(0,F.jsx)(n$.Checkbox,{checked:C,onCheckedChange:a=>D(a)}),(0,F.jsx)(P,{className:"h-4 w-4 text-muted-foreground"}),(0,F.jsx)("span",{className:"text-sm",children:"Entities"})]})]})]}),(0,F.jsxs)("div",{className:"flex items-center gap-4 mt-4 pt-4 border-t",children:[(0,F.jsx)(bl.Tag,{className:"h-4 w-4 text-muted-foreground"}),(0,F.jsx)("div",{className:"flex-1 max-w-md",children:(0,F.jsx)(Y.Input,{type:"text",value:E,onChange:a=>G(a.target.value),placeholder:"Filter by tags (comma-separated)",className:"h-8"})}),(0,F.jsxs)(nc,{value:H,onValueChange:a=>L(a),children:[(0,F.jsx)(nV,{className:"w-40 h-8",children:(0,F.jsx)(ng,{})}),(0,F.jsxs)(nY,{children:[(0,F.jsx)(nZ,{value:"any",children:"Any (incl. untagged)"}),(0,F.jsx)(nZ,{value:"all",children:"All (incl. untagged)"}),(0,F.jsx)(nZ,{value:"any_strict",children:"Any (strict)"}),(0,F.jsx)(nZ,{value:"all_strict",children:"All (strict)"})]})]})]})]})}),ac&&(0,F.jsx)(n_,{children:(0,F.jsxs)(n3,{className:"flex flex-col items-center justify-center py-16",children:[(0,F.jsx)("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary mb-4"}),(0,F.jsx)("p",{className:"text-muted-foreground",children:"Searching memories..."})]})}),!ac&&M&&(0,F.jsxs)("div",{className:"space-y-4",children:[aa?.summary&&(0,F.jsxs)("div",{className:"flex items-center gap-6 text-sm",children:[(0,F.jsxs)("div",{className:"flex items-center gap-2",children:[(0,F.jsx)("span",{className:"text-muted-foreground",children:"Results:"}),(0,F.jsx)("span",{className:"font-semibold",children:M.length})]}),(0,F.jsxs)("div",{className:"flex items-center gap-2",children:[(0,F.jsx)("span",{className:"text-muted-foreground",children:"Duration:"}),(0,F.jsxs)("span",{className:"font-semibold",children:[aa.summary.total_duration_seconds?.toFixed(2),"s"]})]}),(0,F.jsxs)("div",{className:"flex items-center gap-2",children:[(0,F.jsx)("span",{className:"text-muted-foreground",children:"Nodes visited:"}),(0,F.jsx)("span",{className:"font-semibold",children:aa.summary.total_nodes_visited})]}),(0,F.jsx)("div",{className:"flex-1"}),(0,F.jsx)("div",{className:"flex gap-1 bg-muted p-1 rounded-lg",children:["results","trace","json"].map(a=>(0,F.jsx)("button",{onClick:()=>ag(a),className:`px-3 py-1.5 text-sm font-medium rounded-md transition-colors ${af===a?"bg-background shadow-sm":"text-muted-foreground hover:text-foreground"}`,children:"results"===a?"Results":"trace"===a?"Trace":"JSON"},a))})]}),"results"===af&&(0,F.jsxs)("div",{className:"space-y-4",children:[$&&$.length>0&&(0,F.jsxs)(n_,{className:"border-orange-500/30 bg-orange-500/5",children:[(0,F.jsx)(n0,{className:"py-3",children:(0,F.jsxs)(n1,{className:"text-base flex items-center gap-2",children:[(0,F.jsx)(N,{className:"h-4 w-4 text-orange-500"}),(0,F.jsx)("span",{children:"Observations"}),(0,F.jsxs)("span",{className:"text-xs text-muted-foreground",children:["(",$.length,")"]})]})}),(0,F.jsx)(n3,{className:"pt-0 space-y-2",children:$.map((a,b)=>(0,F.jsxs)("div",{className:"p-3 bg-background rounded-lg border border-orange-500/20",children:[(0,F.jsx)("p",{className:"text-sm text-foreground",children:a.text}),(0,F.jsxs)("div",{className:"flex items-center gap-3 mt-2 text-xs text-muted-foreground",children:[(0,F.jsx)("span",{className:"px-2 py-0.5 rounded bg-orange-500/10 text-orange-600",children:"Observation"}),(0,F.jsxs)("span",{children:["Proof count: ",a.proof_count||1]}),(0,F.jsxs)("span",{children:["Relevance: ",(a.relevance||0).toFixed(3)]})]})]},a.id||b))})]}),(0,F.jsx)("div",{className:"space-y-3",children:0!==M.length||$&&0!==$.length?M.map((a,b)=>{let c=aa?.visits?.find(b=>b.node_id===a.id),d=c?c.weights.final_weight:a.score||0;return(0,F.jsx)(n_,{className:"cursor-pointer hover:border-primary/50 transition-colors",onClick:()=>ai(a),children:(0,F.jsx)(n3,{className:"py-4",children:(0,F.jsxs)("div",{className:"flex items-start gap-4",children:[(0,F.jsx)("div",{className:"flex-shrink-0 w-8 h-8 rounded-full bg-primary/10 flex items-center justify-center",children:(0,F.jsx)("span",{className:"text-sm font-semibold text-primary",children:b+1})}),(0,F.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,F.jsx)("p",{className:"text-foreground",children:a.text}),(0,F.jsxs)("div",{className:"flex items-center gap-4 mt-2 text-xs text-muted-foreground",children:[(0,F.jsx)("span",{className:"px-2 py-0.5 rounded bg-muted capitalize",children:a.type||"world"}),a.context&&(0,F.jsx)("span",{className:"truncate max-w-xs",children:a.context}),a.occurred_start&&(0,F.jsx)("span",{children:new Date(a.occurred_start).toLocaleDateString()})]})]}),(0,F.jsxs)("div",{className:"flex-shrink-0 text-right",children:[(0,F.jsx)("div",{className:"text-sm font-semibold",children:d.toFixed(3)}),(0,F.jsx)("div",{className:"text-xs text-muted-foreground",children:"score"})]}),(0,F.jsx)(R,{className:"h-5 w-5 text-muted-foreground flex-shrink-0"})]})})},b)}):(0,F.jsx)(n_,{children:(0,F.jsxs)(n3,{className:"flex flex-col items-center justify-center py-12",children:[(0,F.jsx)(K.Search,{className:"h-12 w-12 text-muted-foreground mb-4"}),(0,F.jsx)("p",{className:"text-muted-foreground",children:"No memories found for this query."})]})})})]}),"trace"===af&&aa&&(0,F.jsxs)("div",{className:"space-y-4",children:[aa.retrieval_results&&aa.retrieval_results.length>0&&(a={},aa.retrieval_results.forEach(b=>{let c=b.fact_type||"all";a[c]||(a[c]=[]),a[c].push(b)}),b=Object.keys(a),(0,F.jsxs)("div",{children:[(0,F.jsxs)("div",{className:"text-xs font-medium text-muted-foreground mb-3 flex items-center gap-2",children:[(0,F.jsx)("div",{className:"flex-1 h-px bg-border"}),(0,F.jsx)("span",{children:"PARALLEL RETRIEVAL"}),(0,F.jsx)("div",{className:"flex-1 h-px bg-border"})]}),(0,F.jsx)("div",{className:"space-y-2",children:b.map((b,c)=>{let d=a[b],e=`lane-${b}`,f=aj.has(e),g=d.reduce((a,b)=>a+(b.results?.length||0),0),h=Math.max(...d.map(a=>a.duration_seconds||0)),i={world:{bg:"bg-blue-500/10",text:"text-blue-500",border:"border-blue-500/30"},experience:{bg:"bg-green-500/10",text:"text-green-500",border:"border-green-500/30"},opinion:{bg:"bg-purple-500/10",text:"text-purple-500",border:"border-purple-500/30"},all:{bg:"bg-gray-500/10",text:"text-gray-500",border:"border-gray-500/30"}},j=i[b]||i.all;return(0,F.jsx)(n_,{className:`transition-colors ${f?"border-primary":j.border}`,children:(0,F.jsxs)(n3,{className:"py-3 px-4",children:[(0,F.jsxs)("div",{className:"flex items-center gap-3 cursor-pointer",onClick:()=>an(e),children:[(0,F.jsx)("div",{className:`w-8 h-8 rounded-lg ${j.bg} flex items-center justify-center`,children:(0,F.jsx)("span",{className:`text-sm font-bold ${j.text} capitalize`,children:b.charAt(0).toUpperCase()})}),(0,F.jsxs)("div",{className:"flex-1",children:[(0,F.jsxs)("div",{className:"flex items-center gap-2",children:[(0,F.jsx)("span",{className:"font-semibold text-foreground capitalize",children:b}),(0,F.jsxs)("span",{className:"text-xs text-muted-foreground",children:[d.length," methods"]})]}),(0,F.jsx)("div",{className:"flex gap-1.5 mt-1",children:d.map((a,b)=>(0,F.jsxs)("span",{className:"text-[10px] px-2 py-0.5 rounded-full bg-muted text-muted-foreground capitalize",children:[a.method_name,": ",a.results?.length||0]},b))})]}),(0,F.jsxs)("div",{className:"text-right",children:[(0,F.jsx)("div",{className:"text-2xl font-bold text-foreground",children:g}),(0,F.jsxs)("div",{className:"text-[10px] text-muted-foreground",children:[h.toFixed(2),"s"]})]}),f?(0,F.jsx)(nT,{className:"h-5 w-5 text-muted-foreground"}):(0,F.jsx)(R,{className:"h-5 w-5 text-muted-foreground"})]}),f&&(0,F.jsx)("div",{className:"mt-4 pt-4 border-t border-border",children:(0,F.jsx)("div",{className:`grid gap-3 ${1===d.length?"grid-cols-1":2===d.length?"grid-cols-2":3===d.length?"grid-cols-3":"grid-cols-4"}`,children:d.map((a,b)=>{let c,d,f,g,h=`${e}-method-${b}`,i=aj.has(h),j=a.results||[];return(0,F.jsxs)("div",{className:"flex flex-col",children:[(0,F.jsxs)("div",{className:`p-3 rounded-lg cursor-pointer transition-colors ${i?"bg-primary/10 border border-primary":"bg-muted/50 hover:bg-muted"}`,onClick:a=>{a.stopPropagation(),an(h)},children:[(0,F.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,F.jsxs)("div",{className:"flex items-center gap-2",children:[(0,F.jsx)("span",{className:"font-medium text-sm text-foreground capitalize",children:a.method_name}),"temporal"===a.method_name&&a.metadata?.constraint&&(0,F.jsxs)("span",{className:"flex items-center gap-1 text-[10px] text-muted-foreground",children:[(0,F.jsx)(Z,{className:"h-3 w-3"}),a.metadata.constraint.start?new Date(a.metadata.constraint.start).toLocaleDateString():"any"," → ",a.metadata.constraint.end?new Date(a.metadata.constraint.end).toLocaleDateString():"any"]})]}),i?(0,F.jsx)(nT,{className:"h-3 w-3 text-muted-foreground"}):(0,F.jsx)(R,{className:"h-3 w-3 text-muted-foreground"})]}),(0,F.jsxs)("div",{className:"flex items-end justify-between",children:[(0,F.jsx)("div",{className:"text-2xl font-bold text-foreground",children:j.length}),(0,F.jsxs)("div",{className:"text-[10px] text-muted-foreground",children:[a.duration_seconds?.toFixed(2),"s"]})]})]}),i&&j.length>0&&(c=`results-${h}`,f=(d=al.has(c))?j:j.slice(0,5),g=j.length>5,(0,F.jsxs)("div",{className:"mt-2 space-y-1.5 max-h-[300px] overflow-y-auto",children:[f.map((a,b)=>(0,F.jsx)("div",{className:"p-2 bg-background rounded cursor-pointer hover:bg-muted/50 transition-colors border border-border",onClick:b=>{b.stopPropagation(),ap(a)},children:(0,F.jsxs)("div",{className:"flex items-start gap-2",children:[(0,F.jsx)("span",{className:"text-[10px] font-mono text-muted-foreground mt-0.5",children:b+1}),(0,F.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,F.jsx)("p",{className:"text-xs text-foreground line-clamp-2",children:a.text}),(0,F.jsx)("div",{className:"flex items-center gap-2 mt-1",children:(0,F.jsx)("span",{className:"text-[10px] text-muted-foreground",children:(a.score||a.similarity||0).toFixed(4)})})]})]})},b)),g&&(0,F.jsx)("button",{className:"w-full text-[10px] text-primary hover:text-primary/80 py-1.5 hover:bg-muted/50 rounded transition-colors",onClick:a=>{a.stopPropagation(),ao(c)},children:d?"Show less":`View all ${j.length} results`})]}))]},h)})})})]})},e)})}),(0,F.jsx)("div",{className:"flex justify-center py-2",children:(0,F.jsx)("div",{className:"flex items-center gap-2",children:b.map((a,b)=>{let c={world:"bg-blue-500",experience:"bg-green-500",opinion:"bg-purple-500",all:"bg-gray-500"};return(0,F.jsx)("div",{className:"flex flex-col items-center",children:(0,F.jsx)("div",{className:`w-1 h-4 ${c[a]||c.all} rounded-full opacity-50`})},b)})})}),(0,F.jsx)("div",{className:"flex justify-center",children:(0,F.jsx)(sk,{className:"h-5 w-5 text-muted-foreground/50"})})]})),aa.rrf_merged&&(c="rrf-merge",d=aj.has(c),(0,F.jsxs)("div",{children:[(0,F.jsx)(n_,{className:`cursor-pointer transition-colors ${d?"border-primary":"hover:border-primary/50"}`,onClick:()=>an(c),children:(0,F.jsx)(n3,{className:"py-4",children:(0,F.jsxs)("div",{className:"flex items-center gap-4",children:[(0,F.jsx)("div",{className:"flex-shrink-0 w-10 h-10 rounded-full bg-purple-500/10 flex items-center justify-center",children:(0,F.jsx)("span",{className:"text-sm font-bold text-purple-500",children:"∪"})}),(0,F.jsxs)("div",{className:"flex-1",children:[(0,F.jsxs)("div",{className:"flex items-center gap-2",children:[(0,F.jsx)("span",{className:"font-semibold text-foreground",children:"RRF Fusion"}),(0,F.jsx)("span",{className:"text-xs px-2 py-0.5 rounded bg-muted text-muted-foreground",children:"merge"})]}),(0,F.jsx)("div",{className:"text-sm text-muted-foreground mt-0.5",children:"Reciprocal Rank Fusion of all retrieval results"})]}),(0,F.jsx)("div",{className:"text-2xl font-bold text-foreground",children:aa.rrf_merged.length}),d?(0,F.jsx)(nT,{className:"h-5 w-5 text-muted-foreground"}):(0,F.jsx)(R,{className:"h-5 w-5 text-muted-foreground"})]})})}),d&&aa.rrf_merged.length>0&&(e="results-rrf",g=(f=al.has(e))?aa.rrf_merged:aa.rrf_merged.slice(0,5),h=aa.rrf_merged.length>5,(0,F.jsxs)("div",{className:"ml-6 mt-2 space-y-2 border-l-2 border-muted pl-4 max-h-[400px] overflow-y-auto",children:[g.map((a,b)=>(0,F.jsx)("div",{className:"p-3 bg-muted/30 rounded-lg cursor-pointer hover:bg-muted/50 transition-colors",onClick:b=>{b.stopPropagation(),ap(a)},children:(0,F.jsxs)("div",{className:"flex items-start gap-3",children:[(0,F.jsx)("span",{className:"text-xs font-mono text-muted-foreground",children:b+1}),(0,F.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,F.jsx)("p",{className:"text-sm text-foreground line-clamp-2",children:a.text}),(0,F.jsxs)("div",{className:"text-xs text-muted-foreground mt-1",children:["RRF Score: ",(a.rrf_score||a.score||0).toFixed(4)]})]})]})},b)),h&&(0,F.jsx)("button",{className:"w-full text-xs text-primary hover:text-primary/80 py-2 hover:bg-muted/50 rounded transition-colors",onClick:a=>{a.stopPropagation(),ao(e)},children:f?"Show less":`View all ${aa.rrf_merged.length} results`})]})),(0,F.jsx)("div",{className:"flex justify-center py-2",children:(0,F.jsx)(sk,{className:"h-4 w-4 text-muted-foreground/50"})})]})),aa.reranked&&(i="reranking",j=aj.has(i),(0,F.jsxs)("div",{children:[(0,F.jsx)(n_,{className:`cursor-pointer transition-colors ${j?"border-primary":"hover:border-primary/50"}`,onClick:()=>an(i),children:(0,F.jsx)(n3,{className:"py-4",children:(0,F.jsxs)("div",{className:"flex items-center gap-4",children:[(0,F.jsx)("div",{className:"flex-shrink-0 w-10 h-10 rounded-full bg-amber-500/10 flex items-center justify-center",children:(0,F.jsx)("span",{className:"text-sm font-bold text-amber-500",children:"⚡"})}),(0,F.jsxs)("div",{className:"flex-1",children:[(0,F.jsxs)("div",{className:"flex items-center gap-2",children:[(0,F.jsx)("span",{className:"font-semibold text-foreground",children:"Combined Scoring"}),(0,F.jsx)("span",{className:"text-xs px-2 py-0.5 rounded bg-muted text-muted-foreground",children:"rerank"})]}),(0,F.jsx)("div",{className:"text-sm text-muted-foreground mt-0.5",children:(0,F.jsx)("span",{className:"font-mono text-xs",children:"0.6×cross_encoder + 0.2×rrf + 0.1×temporal + 0.1×recency"})})]}),(0,F.jsx)("div",{className:"text-2xl font-bold text-foreground",children:aa.reranked.length}),j?(0,F.jsx)(nT,{className:"h-5 w-5 text-muted-foreground"}):(0,F.jsx)(R,{className:"h-5 w-5 text-muted-foreground"})]})})}),j&&aa.reranked.length>0&&(k="results-rerank",n=(l=al.has(k))?aa.reranked:aa.reranked.slice(0,5),o=aa.reranked.length>5,(0,F.jsxs)("div",{className:"ml-6 mt-2 space-y-2 border-l-2 border-muted pl-4 max-h-[400px] overflow-y-auto",children:[n.map((a,b)=>{let c=a.score_components||{};return(0,F.jsx)("div",{className:"p-3 bg-muted/30 rounded-lg cursor-pointer hover:bg-muted/50 transition-colors",onClick:b=>{b.stopPropagation(),ap(a)},children:(0,F.jsxs)("div",{className:"flex items-start gap-3",children:[(0,F.jsx)("span",{className:"text-xs font-mono text-muted-foreground",children:b+1}),(0,F.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,F.jsx)("p",{className:"text-sm text-foreground line-clamp-2",children:a.text}),(0,F.jsxs)("div",{className:"flex flex-wrap gap-x-3 gap-y-1 mt-2 text-[10px] text-muted-foreground font-mono",children:[(0,F.jsxs)("span",{className:"font-semibold text-foreground",children:["= ",(a.rerank_score||a.score||0).toFixed(4)]}),void 0!==c.cross_encoder_score_normalized&&(0,F.jsxs)("span",{title:"Cross-encoder (60%)",children:["CE: ",c.cross_encoder_score_normalized.toFixed(3)]}),void 0!==c.rrf_normalized&&(0,F.jsxs)("span",{title:`RRF normalized (20%) - raw: ${c.rrf_score?.toFixed(4)||"N/A"}`,children:["RRF: ",c.rrf_normalized.toFixed(3)]}),void 0!==c.temporal&&(0,F.jsxs)("span",{title:"Temporal proximity (10%)",children:["Tmp: ",c.temporal.toFixed(3)]}),void 0!==c.recency&&(0,F.jsxs)("span",{title:"Recency (10%)",children:["Rec: ",c.recency.toFixed(3)]})]})]})]})},b)}),o&&(0,F.jsx)("button",{className:"w-full text-xs text-primary hover:text-primary/80 py-2 hover:bg-muted/50 rounded transition-colors",onClick:a=>{a.stopPropagation(),ao(k)},children:l?"Show less":`View all ${aa.reranked.length} results`})]})),(0,F.jsx)("div",{className:"flex justify-center py-2",children:(0,F.jsx)(sk,{className:"h-4 w-4 text-muted-foreground/50"})})]})),(0,F.jsx)(n_,{className:"border-primary bg-primary/5",children:(0,F.jsx)(n3,{className:"py-4",children:(0,F.jsxs)("div",{className:"flex items-center gap-4",children:[(0,F.jsx)("div",{className:"flex-shrink-0 w-10 h-10 rounded-full bg-primary/20 flex items-center justify-center",children:(0,F.jsx)("span",{className:"text-sm font-bold text-primary",children:"✓"})}),(0,F.jsxs)("div",{className:"flex-1",children:[(0,F.jsxs)("div",{className:"flex items-center gap-2",children:[(0,F.jsx)("span",{className:"font-semibold text-foreground",children:"Final Results"}),(0,F.jsx)("span",{className:"text-xs px-2 py-0.5 rounded bg-primary/20 text-primary",children:"output"})]}),(0,F.jsx)("div",{className:"text-sm text-muted-foreground mt-0.5",children:"Top results after all processing steps"})]}),(0,F.jsx)("div",{className:"text-2xl font-bold text-primary",children:M?.length||0})]})})})]}),"json"===af&&(0,F.jsxs)(n_,{children:[(0,F.jsx)(n0,{children:(0,F.jsx)(n1,{className:"text-lg",children:"Raw Response"})}),(0,F.jsx)(n3,{children:(0,F.jsx)("div",{className:"bg-muted p-4 rounded-lg overflow-auto max-h-[600px]",children:(0,F.jsx)(oR,{src:{results:M,...S&&{entities:S},...U&&{chunks:U},...$&&{observations:$},trace:aa},collapsed:2,theme:"default"})})})]})]}),!ac&&!M&&(0,F.jsx)(n_,{className:"border-dashed",children:(0,F.jsxs)(n3,{className:"flex flex-col items-center justify-center py-16",children:[(0,F.jsx)(K.Search,{className:"h-12 w-12 text-muted-foreground mb-4"}),(0,F.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Ready to Recall"}),(0,F.jsx)("p",{className:"text-muted-foreground text-center max-w-md",children:"Enter a query above to search through your memories. Use filters to narrow down by fact type, budget, and more."})]})}),ah&&(0,F.jsx)("div",{className:"fixed right-0 top-0 h-screen w-[420px] bg-card border-l shadow-2xl z-50 overflow-y-auto",children:(0,F.jsx)(bo,{memory:ah,onClose:()=>ai(null),inPanel:!0,bankId:p||void 0})})]}):(0,F.jsx)(n_,{className:"border-dashed",children:(0,F.jsxs)(n3,{className:"flex flex-col items-center justify-center py-16",children:[(0,F.jsx)(N,{className:"h-12 w-12 text-muted-foreground mb-4"}),(0,F.jsx)("h3",{className:"text-xl font-semibold mb-2",children:"No Bank Selected"}),(0,F.jsx)("p",{className:"text-muted-foreground",children:"Select a memory bank to start recalling."})]})})}var sm=a.i(74206),sn=a.i(77192),so=a.i(24050),sp=Symbol("radix.slottable");function sq(a){return I.isValidElement(a)&&"function"==typeof a.type&&"__radixId"in a.type&&a.type.__radixId===sp}var sr=["Enter"," "],ss=["ArrowUp","PageDown","End"],st=["ArrowDown","PageUp","Home",...ss],su={ltr:[...sr,"ArrowRight"],rtl:[...sr,"ArrowLeft"]},sv={ltr:["ArrowLeft"],rtl:["ArrowRight"]},sw="Menu",[sx,sy,sz]=(0,aC.createCollection)(sw),[sA,sB]=(0,aw.createContextScope)(sw,[sz,mR.createPopperScope,so.createRovingFocusGroupScope]),sC=(0,mR.createPopperScope)(),sD=(0,so.createRovingFocusGroupScope)(),[sE,sF]=sA(sw),[sG,sH]=sA(sw),sI=a=>{let{__scopeMenu:b,open:c=!1,children:d,dir:e,onOpenChange:f,modal:g=!0}=a,h=sC(b),[i,j]=I.useState(null),k=I.useRef(!1),l=(0,mV.useCallbackRef)(f),n=(0,ay.useDirection)(e);return I.useEffect(()=>{let a=()=>{k.current=!0,document.addEventListener("pointerdown",b,{capture:!0,once:!0}),document.addEventListener("pointermove",b,{capture:!0,once:!0})},b=()=>k.current=!1;return document.addEventListener("keydown",a,{capture:!0}),()=>{document.removeEventListener("keydown",a,{capture:!0}),document.removeEventListener("pointerdown",b,{capture:!0}),document.removeEventListener("pointermove",b,{capture:!0})}},[]),(0,F.jsx)(mR.Root,{...h,children:(0,F.jsx)(sE,{scope:b,open:c,onOpenChange:l,content:i,onContentChange:j,children:(0,F.jsx)(sG,{scope:b,onClose:I.useCallback(()=>l(!1),[l]),isUsingKeyboardRef:k,dir:n,modal:g,children:d})})})};sI.displayName=sw;var sJ=I.forwardRef((a,b)=>{let{__scopeMenu:c,...d}=a,e=sC(c);return(0,F.jsx)(mR.Anchor,{...e,...d,ref:b})});sJ.displayName="MenuAnchor";var sK="MenuPortal",[sL,sM]=sA(sK,{forceMount:void 0}),sN=a=>{let{__scopeMenu:b,forceMount:c,children:d,container:e}=a,f=sF(sK,b);return(0,F.jsx)(sL,{scope:b,forceMount:c,children:(0,F.jsx)(sn.Presence,{present:c||f.open,children:(0,F.jsx)(mS.Portal,{asChild:!0,container:e,children:d})})})};sN.displayName=sK;var sO="MenuContent",[sP,sQ]=sA(sO),sR=I.forwardRef((a,b)=>{let c=sM(sO,a.__scopeMenu),{forceMount:d=c.forceMount,...e}=a,f=sF(sO,a.__scopeMenu),g=sH(sO,a.__scopeMenu);return(0,F.jsx)(sx.Provider,{scope:a.__scopeMenu,children:(0,F.jsx)(sn.Presence,{present:d||f.open,children:(0,F.jsx)(sx.Slot,{scope:a.__scopeMenu,children:g.modal?(0,F.jsx)(sS,{...e,ref:b}):(0,F.jsx)(sT,{...e,ref:b})})})})}),sS=I.forwardRef((a,b)=>{let c=sF(sO,a.__scopeMenu),d=I.useRef(null),e=(0,av.useComposedRefs)(b,d);return I.useEffect(()=>{let a=d.current;if(a)return(0,mZ.hideOthers)(a)},[]),(0,F.jsx)(sV,{...a,ref:e,trapFocus:c.open,disableOutsidePointerEvents:c.open,disableOutsideScroll:!0,onFocusOutside:(0,au.composeEventHandlers)(a.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>c.onOpenChange(!1)})}),sT=I.forwardRef((a,b)=>{let c=sF(sO,a.__scopeMenu);return(0,F.jsx)(sV,{...a,ref:b,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>c.onOpenChange(!1)})}),sU=((h=I.forwardRef((a,b)=>{let{children:c,...d}=a;if(I.isValidElement(c)){var e;let a,f,g=(e=c,(f=(a=Object.getOwnPropertyDescriptor(e.props,"ref")?.get)&&"isReactWarning"in a&&a.isReactWarning)?e.ref:(f=(a=Object.getOwnPropertyDescriptor(e,"ref")?.get)&&"isReactWarning"in a&&a.isReactWarning)?e.props.ref:e.props.ref||e.ref),h=function(a,b){let c={...b};for(let d in b){let e=a[d],f=b[d];/^on[A-Z]/.test(d)?e&&f?c[d]=(...a)=>{let b=f(...a);return e(...a),b}:e&&(c[d]=e):"style"===d?c[d]={...e,...f}:"className"===d&&(c[d]=[e,f].filter(Boolean).join(" "))}return{...a,...c}}(d,c.props);return c.type!==I.Fragment&&(h.ref=b?(0,av.composeRefs)(b,g):g),I.cloneElement(c,h)}return I.Children.count(c)>1?I.Children.only(null):null})).displayName="MenuContent.ScrollLock.SlotClone",e=h,(f=I.forwardRef((a,b)=>{let{children:c,...d}=a,f=I.Children.toArray(c),g=f.find(sq);if(g){let a=g.props.children,c=f.map(b=>b!==g?b:I.Children.count(a)>1?I.Children.only(null):I.isValidElement(a)?a.props.children:null);return(0,F.jsx)(e,{...d,ref:b,children:I.isValidElement(a)?I.cloneElement(a,void 0,c):null})}return(0,F.jsx)(e,{...d,ref:b,children:c})})).displayName="MenuContent.ScrollLock.Slot",f),sV=I.forwardRef((a,b)=>{let{__scopeMenu:c,loop:d=!1,trapFocus:e,onOpenAutoFocus:f,onCloseAutoFocus:g,disableOutsidePointerEvents:h,onEntryFocus:i,onEscapeKeyDown:j,onPointerDownOutside:k,onFocusOutside:l,onInteractOutside:n,onDismiss:o,disableOutsideScroll:p,...q}=a,r=sF(sO,c),s=sH(sO,c),t=sC(c),u=sD(c),v=sy(c),[w,x]=I.useState(null),y=I.useRef(null),z=(0,av.useComposedRefs)(b,y,r.onContentChange),A=I.useRef(0),B=I.useRef(""),C=I.useRef(0),D=I.useRef(null),E=I.useRef("right"),G=I.useRef(0),H=p?m$.RemoveScroll:I.Fragment;I.useEffect(()=>()=>window.clearTimeout(A.current),[]),(0,mO.useFocusGuards)();let J=I.useCallback(a=>{var b,c;return E.current===D.current?.side&&(b=a,!!(c=D.current?.area)&&function(a,b){let{x:c,y:d}=a,e=!1;for(let a=0,f=b.length-1;a<b.length;f=a++){let g=b[a],h=b[f],i=g.x,j=g.y,k=h.x,l=h.y;j>d!=l>d&&c<(k-i)*(d-j)/(l-j)+i&&(e=!e)}return e}({x:b.clientX,y:b.clientY},c))},[]);return(0,F.jsx)(sP,{scope:c,searchRef:B,onItemEnter:I.useCallback(a=>{J(a)&&a.preventDefault()},[J]),onItemLeave:I.useCallback(a=>{J(a)||(y.current?.focus(),x(null))},[J]),onTriggerLeave:I.useCallback(a=>{J(a)&&a.preventDefault()},[J]),pointerGraceTimerRef:C,onPointerGraceIntentChange:I.useCallback(a=>{D.current=a},[]),children:(0,F.jsx)(H,{...p?{as:sU,allowPinchZoom:!0}:void 0,children:(0,F.jsx)(mP.FocusScope,{asChild:!0,trapped:e,onMountAutoFocus:(0,au.composeEventHandlers)(f,a=>{a.preventDefault(),y.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:g,children:(0,F.jsx)(mN.DismissableLayer,{asChild:!0,disableOutsidePointerEvents:h,onEscapeKeyDown:j,onPointerDownOutside:k,onFocusOutside:l,onInteractOutside:n,onDismiss:o,children:(0,F.jsx)(so.Root,{asChild:!0,...u,dir:s.dir,orientation:"vertical",loop:d,currentTabStopId:w,onCurrentTabStopIdChange:x,onEntryFocus:(0,au.composeEventHandlers)(i,a=>{s.isUsingKeyboardRef.current||a.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,F.jsx)(mR.Content,{role:"menu","aria-orientation":"vertical","data-state":tj(r.open),"data-radix-menu-content":"",dir:s.dir,...t,...q,ref:z,style:{outline:"none",...q.style},onKeyDown:(0,au.composeEventHandlers)(q.onKeyDown,a=>{let b=a.target.closest("[data-radix-menu-content]")===a.currentTarget,c=a.ctrlKey||a.altKey||a.metaKey,d=1===a.key.length;if(b){var e;let b,f,g,h,i,j;"Tab"===a.key&&a.preventDefault(),!c&&d&&(e=a.key,b=B.current+e,f=v().filter(a=>!a.disabled),g=document.activeElement,h=f.find(a=>a.ref.current===g)?.textValue,i=function(a,b,c){var d;let e=b.length>1&&Array.from(b).every(a=>a===b[0])?b[0]:b,f=c?a.indexOf(c):-1,g=(d=Math.max(f,0),a.map((b,c)=>a[(d+c)%a.length]));1===e.length&&(g=g.filter(a=>a!==c));let h=g.find(a=>a.toLowerCase().startsWith(e.toLowerCase()));return h!==c?h:void 0}(f.map(a=>a.textValue),b,h),j=f.find(a=>a.textValue===i)?.ref.current,function a(b){B.current=b,window.clearTimeout(A.current),""!==b&&(A.current=window.setTimeout(()=>a(""),1e3))}(b),j&&setTimeout(()=>j.focus()))}let f=y.current;if(a.target!==f||!st.includes(a.key))return;a.preventDefault();let g=v().filter(a=>!a.disabled).map(a=>a.ref.current);ss.includes(a.key)&&g.reverse(),function(a){let b=document.activeElement;for(let c of a)if(c===b||(c.focus(),document.activeElement!==b))return}(g)}),onBlur:(0,au.composeEventHandlers)(a.onBlur,a=>{a.currentTarget.contains(a.target)||(window.clearTimeout(A.current),B.current="")}),onPointerMove:(0,au.composeEventHandlers)(a.onPointerMove,tm(a=>{let b=a.target,c=G.current!==a.clientX;a.currentTarget.contains(b)&&c&&(E.current=a.clientX>G.current?"right":"left",G.current=a.clientX)}))})})})})})})});sR.displayName=sO;var sW=I.forwardRef((a,b)=>{let{__scopeMenu:c,...d}=a;return(0,F.jsx)(aB.Primitive.div,{role:"group",...d,ref:b})});sW.displayName="MenuGroup";var sX=I.forwardRef((a,b)=>{let{__scopeMenu:c,...d}=a;return(0,F.jsx)(aB.Primitive.div,{...d,ref:b})});sX.displayName="MenuLabel";var sY="MenuItem",sZ="menu.itemSelect",s$=I.forwardRef((a,b)=>{let{disabled:c=!1,onSelect:d,...e}=a,f=I.useRef(null),g=sH(sY,a.__scopeMenu),h=sQ(sY,a.__scopeMenu),i=(0,av.useComposedRefs)(b,f),j=I.useRef(!1);return(0,F.jsx)(s_,{...e,ref:i,disabled:c,onClick:(0,au.composeEventHandlers)(a.onClick,()=>{let a=f.current;if(!c&&a){let b=new CustomEvent(sZ,{bubbles:!0,cancelable:!0});a.addEventListener(sZ,a=>d?.(a),{once:!0}),(0,aB.dispatchDiscreteCustomEvent)(a,b),b.defaultPrevented?j.current=!1:g.onClose()}}),onPointerDown:b=>{a.onPointerDown?.(b),j.current=!0},onPointerUp:(0,au.composeEventHandlers)(a.onPointerUp,a=>{j.current||a.currentTarget?.click()}),onKeyDown:(0,au.composeEventHandlers)(a.onKeyDown,a=>{let b=""!==h.searchRef.current;c||b&&" "===a.key||sr.includes(a.key)&&(a.currentTarget.click(),a.preventDefault())})})});s$.displayName=sY;var s_=I.forwardRef((a,b)=>{let{__scopeMenu:c,disabled:d=!1,textValue:e,...f}=a,g=sQ(sY,c),h=sD(c),i=I.useRef(null),j=(0,av.useComposedRefs)(b,i),[k,l]=I.useState(!1),[n,o]=I.useState("");return I.useEffect(()=>{let a=i.current;a&&o((a.textContent??"").trim())},[f.children]),(0,F.jsx)(sx.ItemSlot,{scope:c,disabled:d,textValue:e??n,children:(0,F.jsx)(so.Item,{asChild:!0,...h,focusable:!d,children:(0,F.jsx)(aB.Primitive.div,{role:"menuitem","data-highlighted":k?"":void 0,"aria-disabled":d||void 0,"data-disabled":d?"":void 0,...f,ref:j,onPointerMove:(0,au.composeEventHandlers)(a.onPointerMove,tm(a=>{d?g.onItemLeave(a):(g.onItemEnter(a),a.defaultPrevented||a.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:(0,au.composeEventHandlers)(a.onPointerLeave,tm(a=>g.onItemLeave(a))),onFocus:(0,au.composeEventHandlers)(a.onFocus,()=>l(!0)),onBlur:(0,au.composeEventHandlers)(a.onBlur,()=>l(!1))})})})}),s0=I.forwardRef((a,b)=>{let{checked:c=!1,onCheckedChange:d,...e}=a;return(0,F.jsx)(s8,{scope:a.__scopeMenu,checked:c,children:(0,F.jsx)(s$,{role:"menuitemcheckbox","aria-checked":tk(c)?"mixed":c,...e,ref:b,"data-state":tl(c),onSelect:(0,au.composeEventHandlers)(e.onSelect,()=>d?.(!!tk(c)||!c),{checkForDefaultPrevented:!1})})})});s0.displayName="MenuCheckboxItem";var s1="MenuRadioGroup",[s2,s3]=sA(s1,{value:void 0,onValueChange:()=>{}}),s4=I.forwardRef((a,b)=>{let{value:c,onValueChange:d,...e}=a,f=(0,mV.useCallbackRef)(d);return(0,F.jsx)(s2,{scope:a.__scopeMenu,value:c,onValueChange:f,children:(0,F.jsx)(sW,{...e,ref:b})})});s4.displayName=s1;var s5="MenuRadioItem",s6=I.forwardRef((a,b)=>{let{value:c,...d}=a,e=s3(s5,a.__scopeMenu),f=c===e.value;return(0,F.jsx)(s8,{scope:a.__scopeMenu,checked:f,children:(0,F.jsx)(s$,{role:"menuitemradio","aria-checked":f,...d,ref:b,"data-state":tl(f),onSelect:(0,au.composeEventHandlers)(d.onSelect,()=>e.onValueChange?.(c),{checkForDefaultPrevented:!1})})})});s6.displayName=s5;var s7="MenuItemIndicator",[s8,s9]=sA(s7,{checked:!1}),ta=I.forwardRef((a,b)=>{let{__scopeMenu:c,forceMount:d,...e}=a,f=s9(s7,c);return(0,F.jsx)(sn.Presence,{present:d||tk(f.checked)||!0===f.checked,children:(0,F.jsx)(aB.Primitive.span,{...e,ref:b,"data-state":tl(f.checked)})})});ta.displayName=s7;var tb=I.forwardRef((a,b)=>{let{__scopeMenu:c,...d}=a;return(0,F.jsx)(aB.Primitive.div,{role:"separator","aria-orientation":"horizontal",...d,ref:b})});tb.displayName="MenuSeparator";var tc=I.forwardRef((a,b)=>{let{__scopeMenu:c,...d}=a,e=sC(c);return(0,F.jsx)(mR.Arrow,{...e,...d,ref:b})});tc.displayName="MenuArrow";var[td,te]=sA("MenuSub"),tf="MenuSubTrigger",tg=I.forwardRef((a,b)=>{let c=sF(tf,a.__scopeMenu),d=sH(tf,a.__scopeMenu),e=te(tf,a.__scopeMenu),f=sQ(tf,a.__scopeMenu),g=I.useRef(null),{pointerGraceTimerRef:h,onPointerGraceIntentChange:i}=f,j={__scopeMenu:a.__scopeMenu},k=I.useCallback(()=>{g.current&&window.clearTimeout(g.current),g.current=null},[]);return I.useEffect(()=>k,[k]),I.useEffect(()=>{let a=h.current;return()=>{window.clearTimeout(a),i(null)}},[h,i]),(0,F.jsx)(sJ,{asChild:!0,...j,children:(0,F.jsx)(s_,{id:e.triggerId,"aria-haspopup":"menu","aria-expanded":c.open,"aria-controls":e.contentId,"data-state":tj(c.open),...a,ref:(0,av.composeRefs)(b,e.onTriggerChange),onClick:b=>{a.onClick?.(b),a.disabled||b.defaultPrevented||(b.currentTarget.focus(),c.open||c.onOpenChange(!0))},onPointerMove:(0,au.composeEventHandlers)(a.onPointerMove,tm(b=>{f.onItemEnter(b),!b.defaultPrevented&&(a.disabled||c.open||g.current||(f.onPointerGraceIntentChange(null),g.current=window.setTimeout(()=>{c.onOpenChange(!0),k()},100)))})),onPointerLeave:(0,au.composeEventHandlers)(a.onPointerLeave,tm(a=>{k();let b=c.content?.getBoundingClientRect();if(b){let d=c.content?.dataset.side,e="right"===d,g=b[e?"left":"right"],i=b[e?"right":"left"];f.onPointerGraceIntentChange({area:[{x:a.clientX+(e?-5:5),y:a.clientY},{x:g,y:b.top},{x:i,y:b.top},{x:i,y:b.bottom},{x:g,y:b.bottom}],side:d}),window.clearTimeout(h.current),h.current=window.setTimeout(()=>f.onPointerGraceIntentChange(null),300)}else{if(f.onTriggerLeave(a),a.defaultPrevented)return;f.onPointerGraceIntentChange(null)}})),onKeyDown:(0,au.composeEventHandlers)(a.onKeyDown,b=>{let e=""!==f.searchRef.current;a.disabled||e&&" "===b.key||su[d.dir].includes(b.key)&&(c.onOpenChange(!0),c.content?.focus(),b.preventDefault())})})})});tg.displayName=tf;var th="MenuSubContent",ti=I.forwardRef((a,b)=>{let c=sM(sO,a.__scopeMenu),{forceMount:d=c.forceMount,...e}=a,f=sF(sO,a.__scopeMenu),g=sH(sO,a.__scopeMenu),h=te(th,a.__scopeMenu),i=I.useRef(null),j=(0,av.useComposedRefs)(b,i);return(0,F.jsx)(sx.Provider,{scope:a.__scopeMenu,children:(0,F.jsx)(sn.Presence,{present:d||f.open,children:(0,F.jsx)(sx.Slot,{scope:a.__scopeMenu,children:(0,F.jsx)(sV,{id:h.contentId,"aria-labelledby":h.triggerId,...e,ref:j,align:"start",side:"rtl"===g.dir?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:a=>{g.isUsingKeyboardRef.current&&i.current?.focus(),a.preventDefault()},onCloseAutoFocus:a=>a.preventDefault(),onFocusOutside:(0,au.composeEventHandlers)(a.onFocusOutside,a=>{a.target!==h.trigger&&f.onOpenChange(!1)}),onEscapeKeyDown:(0,au.composeEventHandlers)(a.onEscapeKeyDown,a=>{g.onClose(),a.preventDefault()}),onKeyDown:(0,au.composeEventHandlers)(a.onKeyDown,a=>{let b=a.currentTarget.contains(a.target),c=sv[g.dir].includes(a.key);b&&c&&(f.onOpenChange(!1),h.trigger?.focus(),a.preventDefault())})})})})})});function tj(a){return a?"open":"closed"}function tk(a){return"indeterminate"===a}function tl(a){return tk(a)?"indeterminate":a?"checked":"unchecked"}function tm(a){return b=>"mouse"===b.pointerType?a(b):void 0}ti.displayName=th;var tn="DropdownMenu",[to,tp]=(0,aw.createContextScope)(tn,[sB]),tq=sB(),[tr,ts]=to(tn),tt=a=>{let{__scopeDropdownMenu:b,children:c,dir:d,open:e,defaultOpen:f,onOpenChange:g,modal:h=!0}=a,i=tq(b),j=I.useRef(null),[k,l]=(0,ax.useControllableState)({prop:e,defaultProp:f??!1,onChange:g,caller:tn});return(0,F.jsx)(tr,{scope:b,triggerId:(0,mQ.useId)(),triggerRef:j,contentId:(0,mQ.useId)(),open:k,onOpenChange:l,onOpenToggle:I.useCallback(()=>l(a=>!a),[l]),modal:h,children:(0,F.jsx)(sI,{...i,open:k,onOpenChange:l,dir:d,modal:h,children:c})})};tt.displayName=tn;var tu="DropdownMenuTrigger",tv=I.forwardRef((a,b)=>{let{__scopeDropdownMenu:c,disabled:d=!1,...e}=a,f=ts(tu,c),g=tq(c);return(0,F.jsx)(sJ,{asChild:!0,...g,children:(0,F.jsx)(aB.Primitive.button,{type:"button",id:f.triggerId,"aria-haspopup":"menu","aria-expanded":f.open,"aria-controls":f.open?f.contentId:void 0,"data-state":f.open?"open":"closed","data-disabled":d?"":void 0,disabled:d,...e,ref:(0,av.composeRefs)(b,f.triggerRef),onPointerDown:(0,au.composeEventHandlers)(a.onPointerDown,a=>{!d&&0===a.button&&!1===a.ctrlKey&&(f.onOpenToggle(),f.open||a.preventDefault())}),onKeyDown:(0,au.composeEventHandlers)(a.onKeyDown,a=>{!d&&(["Enter"," "].includes(a.key)&&f.onOpenToggle(),"ArrowDown"===a.key&&f.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});tv.displayName=tu;var tw=a=>{let{__scopeDropdownMenu:b,...c}=a,d=tq(b);return(0,F.jsx)(sN,{...d,...c})};tw.displayName="DropdownMenuPortal";var tx="DropdownMenuContent",ty=I.forwardRef((a,b)=>{let{__scopeDropdownMenu:c,...d}=a,e=ts(tx,c),f=tq(c),g=I.useRef(!1);return(0,F.jsx)(sR,{id:e.contentId,"aria-labelledby":e.triggerId,...f,...d,ref:b,onCloseAutoFocus:(0,au.composeEventHandlers)(a.onCloseAutoFocus,a=>{g.current||e.triggerRef.current?.focus(),g.current=!1,a.preventDefault()}),onInteractOutside:(0,au.composeEventHandlers)(a.onInteractOutside,a=>{let b=a.detail.originalEvent,c=0===b.button&&!0===b.ctrlKey,d=2===b.button||c;(!e.modal||d)&&(g.current=!0)}),style:{...a.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});ty.displayName=tx,I.forwardRef((a,b)=>{let{__scopeDropdownMenu:c,...d}=a,e=tq(c);return(0,F.jsx)(sW,{...e,...d,ref:b})}).displayName="DropdownMenuGroup";var tz=I.forwardRef((a,b)=>{let{__scopeDropdownMenu:c,...d}=a,e=tq(c);return(0,F.jsx)(sX,{...e,...d,ref:b})});tz.displayName="DropdownMenuLabel";var tA=I.forwardRef((a,b)=>{let{__scopeDropdownMenu:c,...d}=a,e=tq(c);return(0,F.jsx)(s$,{...e,...d,ref:b})});tA.displayName="DropdownMenuItem";var tB=I.forwardRef((a,b)=>{let{__scopeDropdownMenu:c,...d}=a,e=tq(c);return(0,F.jsx)(s0,{...e,...d,ref:b})});tB.displayName="DropdownMenuCheckboxItem",I.forwardRef((a,b)=>{let{__scopeDropdownMenu:c,...d}=a,e=tq(c);return(0,F.jsx)(s4,{...e,...d,ref:b})}).displayName="DropdownMenuRadioGroup";var tC=I.forwardRef((a,b)=>{let{__scopeDropdownMenu:c,...d}=a,e=tq(c);return(0,F.jsx)(s6,{...e,...d,ref:b})});tC.displayName="DropdownMenuRadioItem";var tD=I.forwardRef((a,b)=>{let{__scopeDropdownMenu:c,...d}=a,e=tq(c);return(0,F.jsx)(ta,{...e,...d,ref:b})});tD.displayName="DropdownMenuItemIndicator";var tE=I.forwardRef((a,b)=>{let{__scopeDropdownMenu:c,...d}=a,e=tq(c);return(0,F.jsx)(tb,{...e,...d,ref:b})});tE.displayName="DropdownMenuSeparator",I.forwardRef((a,b)=>{let{__scopeDropdownMenu:c,...d}=a,e=tq(c);return(0,F.jsx)(tc,{...e,...d,ref:b})}).displayName="DropdownMenuArrow";var tF=I.forwardRef((a,b)=>{let{__scopeDropdownMenu:c,...d}=a,e=tq(c);return(0,F.jsx)(tg,{...e,...d,ref:b})});tF.displayName="DropdownMenuSubTrigger";var tG=I.forwardRef((a,b)=>{let{__scopeDropdownMenu:c,...d}=a,e=tq(c);return(0,F.jsx)(ti,{...e,...d,ref:b,style:{...a.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});tG.displayName="DropdownMenuSubContent";let tH=(0,L.default)("circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);I.forwardRef(({className:a,inset:b,children:c,...d},e)=>(0,F.jsxs)(tF,{ref:e,className:(0,T.cn)("flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",b&&"pl-8",a),...d,children:[c,(0,F.jsx)(R,{className:"ml-auto"})]})).displayName=tF.displayName,I.forwardRef(({className:a,...b},c)=>(0,F.jsx)(tG,{ref:c,className:(0,T.cn)("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]",a),...b})).displayName=tG.displayName;let tI=I.forwardRef(({className:a,sideOffset:b=4,...c},d)=>(0,F.jsx)(tw,{children:(0,F.jsx)(ty,{ref:d,sideOffset:b,className:(0,T.cn)("z-50 max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]",a),...c})}));tI.displayName=ty.displayName;let tJ=I.forwardRef(({className:a,inset:b,...c},d)=>(0,F.jsx)(tA,{ref:d,className:(0,T.cn)("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",b&&"pl-8",a),...c}));tJ.displayName=tA.displayName,I.forwardRef(({className:a,children:b,checked:c,...d},e)=>(0,F.jsxs)(tB,{ref:e,className:(0,T.cn)("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",a),checked:c,...d,children:[(0,F.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,F.jsx)(tD,{children:(0,F.jsx)(bf.Check,{className:"h-4 w-4"})})}),b]})).displayName=tB.displayName,I.forwardRef(({className:a,children:b,...c},d)=>(0,F.jsxs)(tC,{ref:d,className:(0,T.cn)("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",a),...c,children:[(0,F.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,F.jsx)(tD,{children:(0,F.jsx)(tH,{className:"h-2 w-2 fill-current"})})}),b]})).displayName=tC.displayName,I.forwardRef(({className:a,inset:b,...c},d)=>(0,F.jsx)(tz,{ref:d,className:(0,T.cn)("px-2 py-1.5 text-sm font-semibold",b&&"pl-8",a),...c})).displayName=tz.displayName;let tK=I.forwardRef(({className:a,...b},c)=>(0,F.jsx)(tE,{ref:c,className:(0,T.cn)("-mx-1 my-1 h-px bg-muted",a),...b}));tK.displayName=tE.displayName;let tL=(0,L.default)("save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]),tM=(0,L.default)("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]),tN=(0,L.default)("link-2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]),tO=(0,L.default)("folder-open",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]),tP=(0,L.default)("activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]),tQ=(0,L.default)("target",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]),tR=(0,L.default)("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);var tS=a.i(15618);let tT=(0,L.default)("ellipsis-vertical",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]]),tU=(0,L.default)("pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]),tV={skepticism:{label:"Skepticism",shortLabel:"S",description:"How skeptical vs trusting when forming observations",lowLabel:"Trusting",highLabel:"Skeptical"},literalism:{label:"Literalism",shortLabel:"L",description:"How literally to interpret information when forming observations",lowLabel:"Flexible",highLabel:"Literal"},empathy:{label:"Empathy",shortLabel:"E",description:"How much to consider emotional context when forming observations",lowLabel:"Detached",highLabel:"Empathetic"}};function tW({disposition:a,editMode:b,editDisposition:c,onEditChange:d}){let e=b?c:a;return(0,F.jsx)("div",{className:"space-y-4",children:Object.keys(tV).map(a=>(0,F.jsxs)("div",{className:"space-y-2",children:[(0,F.jsxs)("div",{className:"flex justify-between items-center",children:[(0,F.jsxs)("div",{children:[(0,F.jsx)("label",{className:"text-sm font-medium text-foreground",children:tV[a].label}),(0,F.jsx)("p",{className:"text-xs text-muted-foreground",children:tV[a].description})]}),(0,F.jsxs)("span",{className:"text-sm font-bold text-primary",children:[e[a],"/5"]})]}),b?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)("div",{className:"flex justify-between text-[10px] text-muted-foreground",children:[(0,F.jsx)("span",{children:tV[a].lowLabel}),(0,F.jsx)("span",{children:tV[a].highLabel})]}),(0,F.jsx)("input",{type:"range",min:"1",max:"5",step:"1",value:c[a],onChange:b=>d(a,parseInt(b.target.value)),className:"w-full h-2 bg-muted rounded-lg appearance-none cursor-pointer accent-primary"})]}):(0,F.jsxs)("div",{className:"flex items-center gap-2",children:[(0,F.jsx)("span",{className:"text-xs text-muted-foreground",children:tV[a].lowLabel}),(0,F.jsx)("div",{className:"flex-1 h-2 bg-muted rounded-full overflow-hidden",children:(0,F.jsx)("div",{className:"h-full bg-primary rounded-full transition-all",style:{width:`${(e[a]-1)/4*100}%`}})}),(0,F.jsx)("span",{className:"text-xs text-muted-foreground",children:tV[a].highLabel})]})]},a))})}function tX(){let a=(0,G.useRouter)(),{currentBank:b,setCurrentBank:c,loadBanks:d}=(0,J.useBank)(),{features:e}=(0,sm.useFeatures)(),f=e?.observations??!1,[g,h]=(0,I.useState)(null),[i,j]=(0,I.useState)(null),[k,l]=(0,I.useState)([]),[n,o]=(0,I.useState)(0),[p,q]=(0,I.useState)([]),[r,s]=(0,I.useState)(0),[t,u]=(0,I.useState)(!1),[v,w]=(0,I.useState)(!1),[x,y]=(0,I.useState)(!1),[z,A]=(0,I.useState)(!1),[B,C]=(0,I.useState)(null),[D,E]=(0,I.useState)(null),[H,K]=(0,I.useState)(!1),L=(0,I.useRef)(x);(0,I.useEffect)(()=>{L.current=x},[x]);let[M,O]=(0,I.useState)(!1),[P,Q]=(0,I.useState)(!1),[R,S]=(0,I.useState)(!1),[T,U]=(0,I.useState)(!1),[V,Y]=(0,I.useState)(!1),[Z,$]=(0,I.useState)(null),[_]=(0,I.useState)(10),[aa,ab]=(0,I.useState)(0),[af,ag]=(0,I.useState)(null),[an,ao]=(0,I.useState)(""),[ap,aq]=(0,I.useState)({skepticism:3,literalism:3,empathy:3}),ar=async(a=Z,c=aa)=>{if(b)try{let d=await W.client.listOperations(b,{status:a||void 0,limit:_,offset:c});l(d.operations||[]),o(d.total||0)}catch(a){console.error("Error loading operations:",a)}},as=async(a=!1)=>{if(b){if(a){try{let[a,c,d]=await Promise.all([W.client.getBankStats(b),W.client.listDirectives(b),W.client.listMentalModels(b)]);j(a),q(c.items||[]),s(d.items?.length||0)}catch(a){console.error("Error refreshing stats:",a)}return}u(!0);try{let[a,c,d,e]=await Promise.all([W.client.getBankProfile(b),W.client.getBankStats(b),W.client.listDirectives(b),W.client.listMentalModels(b)]);h(a),j(c),q(d.items||[]),s(e.items?.length||0),await ar(),L.current||(ao(a.mission||""),aq(a.disposition))}catch(a){console.error("Error loading bank profile:",a),alert("Error loading bank profile: "+a.message)}finally{u(!1)}}},at=async()=>{if(b){w(!0);try{await W.client.updateBankProfile(b,{mission:an,disposition:ap}),await as(),y(!1)}catch(a){console.error("Error saving bank profile:",a),alert("Error saving bank profile: "+a.message)}finally{w(!1)}}},au=async()=>{if(b){Q(!0);try{await W.client.deleteBank(b),O(!1),c(null),await d(),a.push("/")}catch(a){console.error("Error deleting bank:",a),alert("Error deleting bank: "+a.message)}finally{Q(!1)}}},av=async()=>{if(b){U(!0);try{let a=await W.client.clearObservations(b);S(!1),await as(),alert(a.message||"Observations cleared successfully")}catch(a){console.error("Error clearing observations:",a),alert("Error clearing observations: "+a.message)}finally{U(!1)}}},aw=async()=>{if(b){Y(!0);try{await W.client.triggerConsolidation(b),await as(),await ar()}catch(a){console.error("Error triggering consolidation:",a),alert("Error triggering consolidation: "+a.message)}finally{Y(!1)}}},ax=a=>{ab(a),ar(Z,a)},ay=async a=>{if(b){ag(a);try{await W.client.cancelOperation(b,a),await ar()}catch(a){console.error("Error cancelling operation:",a),alert("Error cancelling operation: "+a.message)}finally{ag(null)}}},az=async()=>{if(b&&D){K(!0);try{await W.client.deleteDirective(b,D.id),q(a=>a.filter(a=>a.id!==D.id)),B?.id===D.id&&C(null),E(null)}catch(a){console.error("Error deleting directive:",a),alert("Error deleting: "+a.message)}finally{K(!1)}}};return((0,I.useEffect)(()=>{if(b){as();let a=setInterval(()=>as(!0),5e3);return()=>clearInterval(a)}},[b]),(0,I.useEffect)(()=>{let a=a=>{"Escape"===a.key&&C(null)};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[]),b)?t&&!g?(0,F.jsx)(n_,{children:(0,F.jsxs)(n3,{className:"text-center py-10",children:[(0,F.jsx)(ae,{className:"w-12 h-12 mx-auto mb-3 text-muted-foreground animate-pulse"}),(0,F.jsx)("div",{className:"text-lg text-muted-foreground",children:"Loading profile..."})]})}):(0,F.jsxs)("div",{className:"space-y-6",children:[(0,F.jsxs)("div",{className:"flex justify-between items-center",children:[(0,F.jsxs)("div",{children:[(0,F.jsx)("h2",{className:"text-2xl font-bold text-foreground",children:g?.name||b}),(0,F.jsx)("p",{className:"text-sm text-muted-foreground font-mono",children:b})]}),(0,F.jsx)("div",{className:"flex gap-2",children:x?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(X.Button,{onClick:()=>{g&&(ao(g.mission||""),aq(g.disposition)),y(!1)},variant:"secondary",disabled:v,children:"Cancel"}),(0,F.jsx)(X.Button,{onClick:at,disabled:v,children:v?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(ac,{className:"w-4 h-4 mr-2 animate-spin"}),"Saving..."]}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(tL,{className:"w-4 h-4 mr-2"}),"Save Changes"]})})]}):(0,F.jsxs)(tt,{children:[(0,F.jsx)(tv,{asChild:!0,children:(0,F.jsxs)(X.Button,{variant:"outline",size:"sm",children:["Actions",(0,F.jsx)(tT,{className:"w-4 h-4 ml-2"})]})}),(0,F.jsxs)(tI,{align:"end",className:"w-48",children:[(0,F.jsxs)(tJ,{onClick:()=>y(!0),children:[(0,F.jsx)(tU,{className:"w-4 h-4 mr-2"}),"Edit Profile"]}),(0,F.jsx)(tK,{}),(0,F.jsxs)(tJ,{onClick:aw,disabled:V||!f,title:f?void 0:"Observations feature is not enabled",children:[V?(0,F.jsx)(bh,{className:"w-4 h-4 mr-2 animate-spin"}):(0,F.jsx)(n5,{className:"w-4 h-4 mr-2"}),V?"Consolidating...":"Run Consolidation",!f&&(0,F.jsx)("span",{className:"ml-auto text-xs text-muted-foreground",children:"Off"})]}),(0,F.jsxs)(tJ,{onClick:()=>S(!0),disabled:!f,className:"text-amber-600 dark:text-amber-400 focus:text-amber-700 dark:focus:text-amber-300",title:f?void 0:"Observations feature is not enabled",children:[(0,F.jsx)(mK,{className:"w-4 h-4 mr-2"}),"Clear Observations",!f&&(0,F.jsx)("span",{className:"ml-auto text-xs text-muted-foreground",children:"Off"})]}),(0,F.jsx)(tK,{}),(0,F.jsxs)(tJ,{onClick:()=>O(!0),className:"text-red-600 dark:text-red-400 focus:text-red-700 dark:focus:text-red-300",children:[(0,F.jsx)(mK,{className:"w-4 h-4 mr-2"}),"Delete Bank"]})]})]})})]}),i&&(0,F.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[(0,F.jsx)(n_,{className:"bg-gradient-to-br from-blue-500/10 to-blue-600/5 border-blue-500/20",children:(0,F.jsx)(n3,{className:"p-4",children:(0,F.jsxs)("div",{className:"flex items-center gap-3",children:[(0,F.jsx)("div",{className:"p-2 rounded-lg bg-blue-500/20",children:(0,F.jsx)(N,{className:"w-5 h-5 text-blue-500"})}),(0,F.jsxs)("div",{children:[(0,F.jsx)("p",{className:"text-xs text-muted-foreground font-medium",children:"Memories"}),(0,F.jsx)("p",{className:"text-2xl font-bold text-foreground",children:i.total_nodes})]})]})})}),(0,F.jsx)(n_,{className:"bg-gradient-to-br from-purple-500/10 to-purple-600/5 border-purple-500/20",children:(0,F.jsx)(n3,{className:"p-4",children:(0,F.jsxs)("div",{className:"flex items-center gap-3",children:[(0,F.jsx)("div",{className:"p-2 rounded-lg bg-purple-500/20",children:(0,F.jsx)(tN,{className:"w-5 h-5 text-purple-500"})}),(0,F.jsxs)("div",{children:[(0,F.jsx)("p",{className:"text-xs text-muted-foreground font-medium",children:"Links"}),(0,F.jsx)("p",{className:"text-2xl font-bold text-foreground",children:i.total_links})]})]})})}),(0,F.jsx)(n_,{className:"bg-gradient-to-br from-emerald-500/10 to-emerald-600/5 border-emerald-500/20",children:(0,F.jsx)(n3,{className:"p-4",children:(0,F.jsxs)("div",{className:"flex items-center gap-3",children:[(0,F.jsx)("div",{className:"p-2 rounded-lg bg-emerald-500/20",children:(0,F.jsx)(tO,{className:"w-5 h-5 text-emerald-500"})}),(0,F.jsxs)("div",{children:[(0,F.jsx)("p",{className:"text-xs text-muted-foreground font-medium",children:"Documents"}),(0,F.jsx)("p",{className:"text-2xl font-bold text-foreground",children:i.total_documents})]})]})})}),(0,F.jsx)(n_,{className:`bg-gradient-to-br ${i.pending_operations>0?"from-amber-500/10 to-amber-600/5 border-amber-500/20":"from-slate-500/10 to-slate-600/5 border-slate-500/20"}`,children:(0,F.jsx)(n3,{className:"p-4",children:(0,F.jsxs)("div",{className:"flex items-center gap-3",children:[(0,F.jsx)("div",{className:`p-2 rounded-lg ${i.pending_operations>0?"bg-amber-500/20":"bg-slate-500/20"}`,children:(0,F.jsx)(tP,{className:`w-5 h-5 ${i.pending_operations>0?"text-amber-500 animate-pulse":"text-slate-500"}`})}),(0,F.jsxs)("div",{children:[(0,F.jsx)("p",{className:"text-xs text-muted-foreground font-medium",children:"Pending"}),(0,F.jsx)("p",{className:"text-2xl font-bold text-foreground",children:i.pending_operations})]})]})})})]}),i&&(0,F.jsxs)("div",{className:"grid grid-cols-5 gap-3",children:[(0,F.jsxs)("div",{className:"bg-blue-500/10 border border-blue-500/20 rounded-xl p-4 text-center",children:[(0,F.jsx)("p",{className:"text-xs text-blue-600 dark:text-blue-400 font-semibold uppercase tracking-wide",children:"World Facts"}),(0,F.jsx)("p",{className:"text-2xl font-bold text-blue-600 dark:text-blue-400 mt-1",children:i.nodes_by_fact_type?.world||0})]}),(0,F.jsxs)("div",{className:"bg-purple-500/10 border border-purple-500/20 rounded-xl p-4 text-center",children:[(0,F.jsx)("p",{className:"text-xs text-purple-600 dark:text-purple-400 font-semibold uppercase tracking-wide",children:"Experience"}),(0,F.jsx)("p",{className:"text-2xl font-bold text-purple-600 dark:text-purple-400 mt-1",children:i.nodes_by_fact_type?.experience||0})]}),(0,F.jsxs)("div",{className:`rounded-xl p-4 text-center ${f?"bg-amber-500/10 border border-amber-500/20":"bg-muted/50 border border-muted"}`,title:f?void 0:"Observations feature is not enabled",children:[(0,F.jsxs)("p",{className:`text-xs font-semibold uppercase tracking-wide ${f?"text-amber-600 dark:text-amber-400":"text-muted-foreground"}`,children:["Observations",!f&&(0,F.jsx)("span",{className:"ml-1 normal-case",children:"(Off)"})]}),(0,F.jsx)("p",{className:`text-2xl font-bold mt-1 ${f?"text-amber-600 dark:text-amber-400":"text-muted-foreground"}`,children:f?i.total_mental_models||0:"—"})]}),(0,F.jsxs)("div",{className:"bg-cyan-500/10 border border-cyan-500/20 rounded-xl p-4 text-center",children:[(0,F.jsx)("p",{className:"text-xs text-cyan-600 dark:text-cyan-400 font-semibold uppercase tracking-wide",children:"Mental Models"}),(0,F.jsx)("p",{className:"text-2xl font-bold text-cyan-600 dark:text-cyan-400 mt-1",children:r})]}),(0,F.jsxs)("div",{className:"bg-rose-500/10 border border-rose-500/20 rounded-xl p-4 text-center",children:[(0,F.jsx)("p",{className:"text-xs text-rose-600 dark:text-rose-400 font-semibold uppercase tracking-wide",children:"Directives"}),(0,F.jsx)("p",{className:"text-2xl font-bold text-rose-600 dark:text-rose-400 mt-1",children:p.length})]})]}),(0,F.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[(0,F.jsxs)(n_,{children:[(0,F.jsxs)(n0,{className:"pb-2",children:[(0,F.jsxs)(n1,{className:"flex items-center gap-2 text-lg",children:[(0,F.jsx)(n5,{className:"w-5 h-5 text-primary"}),"Disposition Profile"]}),(0,F.jsx)(n2,{children:"Traits that shape how observations are formed via Reflect"})]}),(0,F.jsx)(n3,{children:g&&(0,F.jsx)(tW,{disposition:g.disposition,editMode:x,editDisposition:ap,onEditChange:(a,b)=>aq(c=>({...c,[a]:b}))})})]}),(0,F.jsxs)(n_,{children:[(0,F.jsxs)(n0,{className:"pb-2",children:[(0,F.jsxs)(n1,{className:"flex items-center gap-2 text-lg",children:[(0,F.jsx)(tQ,{className:"w-5 h-5 text-primary"}),"Mission"]}),(0,F.jsx)(n2,{children:"Who the agent is and what they're trying to accomplish. Used for mental models and reflect."})]}),(0,F.jsx)(n3,{children:x?(0,F.jsx)(n9.Textarea,{value:an,onChange:a=>ao(a.target.value),placeholder:"e.g., I am a PM for the engineering team. I help coordinate sprints and track project progress...",rows:6,className:"resize-none"}):(0,F.jsx)("p",{className:"text-sm text-foreground whitespace-pre-wrap leading-relaxed",children:g?.mission||"No mission set. Set a mission to derive structural mental models and personalize reflect responses."})})]})]}),(0,F.jsxs)(n_,{children:[(0,F.jsx)(n0,{className:"pb-2",children:(0,F.jsxs)("div",{className:"flex items-center justify-between",children:[(0,F.jsxs)("div",{children:[(0,F.jsxs)(n1,{className:"flex items-center gap-2 text-lg",children:[(0,F.jsx)(tR,{className:"w-5 h-5 text-rose-500"}),"Directives"]}),(0,F.jsx)(n2,{children:"Hard rules that must be followed during reflect"})]}),(0,F.jsxs)(X.Button,{onClick:()=>A(!0),variant:"outline",size:"sm",className:"h-8",children:[(0,F.jsx)(tS.Plus,{className:"w-4 h-4 mr-1"}),"Add"]})]})}),(0,F.jsx)(n3,{children:p.length>0?(0,F.jsx)("div",{className:"grid grid-cols-2 gap-3",children:p.map(a=>(0,F.jsx)(n_,{className:`cursor-pointer transition-colors border-rose-500/30 ${B?.id===a.id?"bg-rose-500/10 border-rose-500":"hover:bg-rose-500/5"}`,onClick:()=>C(a),children:(0,F.jsx)(n3,{className:"p-3",children:(0,F.jsxs)("div",{className:"flex items-start gap-2",children:[(0,F.jsx)(tR,{className:"w-4 h-4 text-rose-500 shrink-0 mt-0.5"}),(0,F.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,F.jsx)("span",{className:"font-medium text-sm text-foreground",children:a.name}),(0,F.jsx)("p",{className:"text-xs text-muted-foreground line-clamp-2 mt-1",children:a.content}),a.tags&&a.tags.length>0&&(0,F.jsxs)("div",{className:"flex items-center gap-1 mt-2 flex-wrap",children:[(0,F.jsx)(bl.Tag,{className:"w-3 h-3 text-muted-foreground"}),a.tags.map(a=>(0,F.jsx)("span",{className:"text-xs px-1.5 py-0.5 rounded bg-muted text-muted-foreground",children:a},a))]})]})]})})},a.id))}):(0,F.jsxs)("div",{className:"p-6 border border-dashed border-rose-500/30 rounded-lg text-center",children:[(0,F.jsx)(tR,{className:"w-6 h-6 mx-auto mb-2 text-rose-500/50"}),(0,F.jsx)("p",{className:"text-sm text-muted-foreground",children:"No directives yet. Directives are hard rules that must be followed during reflect."})]})})]}),(0,F.jsxs)(n_,{children:[(0,F.jsx)(n0,{className:"pb-2",children:(0,F.jsxs)("div",{className:"flex items-center justify-between",children:[(0,F.jsxs)("div",{children:[(0,F.jsxs)(n1,{className:"flex items-center gap-2 text-lg",children:[(0,F.jsx)(tP,{className:"w-5 h-5 text-primary"}),"Background Operations",(0,F.jsx)("button",{onClick:()=>ar(),className:"p-1 rounded hover:bg-muted transition-colors",title:"Refresh operations",children:(0,F.jsx)(ac,{className:"w-4 h-4 text-muted-foreground hover:text-foreground"})})]}),(0,F.jsxs)(n2,{children:[n," operation",1!==n?"s":"",Z?` (${Z})`:""]})]}),(0,F.jsx)("div",{className:"flex gap-1 bg-muted p-1 rounded-lg",children:[{value:null,label:"All"},{value:"pending",label:"Pending"},{value:"completed",label:"Completed"},{value:"failed",label:"Failed"}].map(a=>(0,F.jsx)("button",{onClick:()=>{var b;$(b=a.value),ab(0),ar(b,0)},className:`px-3 py-1.5 text-sm font-medium rounded-md transition-colors ${Z===a.value?"bg-background shadow-sm":"text-muted-foreground hover:text-foreground"}`,children:a.label},a.value??"all"))})]})}),(0,F.jsx)(n3,{children:k.length>0?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)("div",{className:"overflow-x-auto",children:(0,F.jsxs)(ah,{children:[(0,F.jsx)(ai,{children:(0,F.jsxs)(ak,{children:[(0,F.jsx)(al,{className:"w-[100px]",children:"ID"}),(0,F.jsx)(al,{children:"Type"}),(0,F.jsx)(al,{children:"Created"}),(0,F.jsx)(al,{children:"Status"}),(0,F.jsx)(al,{className:"w-[80px]"})]})}),(0,F.jsx)(aj,{children:k.map(a=>(0,F.jsxs)(ak,{className:"failed"===a.status?"bg-red-500/5":"",children:[(0,F.jsx)(am,{className:"font-mono text-xs text-muted-foreground",children:a.id.substring(0,8)}),(0,F.jsx)(am,{className:"font-medium",children:a.task_type}),(0,F.jsx)(am,{className:"text-sm text-muted-foreground",children:new Date(a.created_at).toLocaleString()}),(0,F.jsxs)(am,{children:["pending"===a.status&&(0,F.jsxs)("span",{className:"inline-flex items-center gap-1.5 px-2 py-0.5 rounded-full text-xs font-medium bg-amber-500/10 text-amber-600 dark:text-amber-400 border border-amber-500/20",children:[(0,F.jsx)(ae,{className:"w-3 h-3"}),"pending"]}),"failed"===a.status&&(0,F.jsxs)("span",{className:"inline-flex items-center gap-1.5 px-2 py-0.5 rounded-full text-xs font-medium bg-red-500/10 text-red-600 dark:text-red-400 border border-red-500/20",title:a.error_message??void 0,children:[(0,F.jsx)(tM,{className:"w-3 h-3"}),"failed"]}),"completed"===a.status&&(0,F.jsxs)("span",{className:"inline-flex items-center gap-1.5 px-2 py-0.5 rounded-full text-xs font-medium bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 border border-emerald-500/20",children:[(0,F.jsx)(ad,{className:"w-3 h-3"}),"completed"]})]}),(0,F.jsx)(am,{children:"pending"===a.status&&(0,F.jsxs)(X.Button,{variant:"ghost",size:"sm",className:"h-7 text-xs text-muted-foreground hover:text-red-600 dark:hover:text-red-400",onClick:()=>ay(a.id),disabled:af===a.id,children:[af===a.id?(0,F.jsx)(bh,{className:"w-3 h-3 animate-spin"}):(0,F.jsx)(bg.X,{className:"w-3 h-3 mr-1"}),af===a.id?"":"Cancel"]})})]},a.id))})]})}),n>_&&(0,F.jsxs)("div",{className:"flex items-center justify-between mt-4 pt-4 border-t",children:[(0,F.jsxs)("p",{className:"text-sm text-muted-foreground",children:["Showing ",aa+1,"-",Math.min(aa+_,n)," of"," ",n]}),(0,F.jsxs)("div",{className:"flex gap-2",children:[(0,F.jsx)(X.Button,{variant:"outline",size:"sm",onClick:()=>ax(Math.max(0,aa-_)),disabled:0===aa,children:"Previous"}),(0,F.jsx)(X.Button,{variant:"outline",size:"sm",onClick:()=>ax(aa+_),disabled:aa+_>=n,children:"Next"})]})]})]}):(0,F.jsxs)("p",{className:"text-muted-foreground text-center py-8 text-sm",children:["No ",Z?`${Z} `:"","operations"]})})]}),(0,F.jsx)(mm,{open:M,onOpenChange:O,children:(0,F.jsxs)(mD,{children:[(0,F.jsxs)(mE,{children:[(0,F.jsx)(mG,{children:"Delete Memory Bank"}),(0,F.jsx)(mH,{asChild:!0,children:(0,F.jsxs)("div",{className:"space-y-2 text-sm text-muted-foreground",children:[(0,F.jsxs)("p",{children:["Are you sure you want to delete the memory bank"," ",(0,F.jsx)("span",{className:"font-semibold text-foreground",children:b}),"?"]}),(0,F.jsx)("p",{className:"text-red-600 dark:text-red-400 font-medium",children:"This action cannot be undone. All memories, entities, documents, and the bank profile will be permanently deleted."}),i&&(0,F.jsxs)("p",{children:["This will delete ",i.total_nodes," memories, ",i.total_documents," ","documents, and ",i.total_links," links."]})]})})]}),(0,F.jsxs)(mF,{children:[(0,F.jsx)(mJ,{disabled:P,children:"Cancel"}),(0,F.jsx)(mI,{onClick:au,disabled:P,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:P?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(ac,{className:"w-4 h-4 mr-2 animate-spin"}),"Deleting..."]}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(mK,{className:"w-4 h-4 mr-2"}),"Delete Bank"]})})]})]})}),(0,F.jsx)(mm,{open:R,onOpenChange:S,children:(0,F.jsxs)(mD,{children:[(0,F.jsxs)(mE,{children:[(0,F.jsx)(mG,{children:"Clear Observations"}),(0,F.jsx)(mH,{asChild:!0,children:(0,F.jsxs)("div",{className:"space-y-2 text-sm text-muted-foreground",children:[(0,F.jsxs)("p",{children:["Are you sure you want to clear all observations for"," ",(0,F.jsx)("span",{className:"font-semibold text-foreground",children:b}),"?"]}),(0,F.jsx)("p",{className:"text-amber-600 dark:text-amber-400 font-medium",children:"This will delete all consolidated knowledge. Observations will be regenerated the next time consolidation runs."}),i&&i.total_mental_models>0&&(0,F.jsxs)("p",{children:["This will delete ",i.total_mental_models," observations."]})]})})]}),(0,F.jsxs)(mF,{children:[(0,F.jsx)(mJ,{disabled:T,children:"Cancel"}),(0,F.jsx)(mI,{onClick:av,disabled:T,className:"bg-amber-500 text-white hover:bg-amber-600",children:T?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(bh,{className:"w-4 h-4 mr-2 animate-spin"}),"Clearing..."]}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(mK,{className:"w-4 h-4 mr-2"}),"Clear Observations"]})})]})]})}),(0,F.jsx)(tY,{open:z,mode:"create",onClose:()=>A(!1),onCreated:a=>{q(b=>[a,...b]),A(!1)}}),(0,F.jsx)(mm,{open:!!D,onOpenChange:a=>!a&&E(null),children:(0,F.jsxs)(mD,{children:[(0,F.jsxs)(mE,{children:[(0,F.jsx)(mG,{children:"Delete Directive"}),(0,F.jsxs)(mH,{children:["Are you sure you want to delete"," ",(0,F.jsxs)("span",{className:"font-semibold",children:['"',D?.name,'"']}),"?",(0,F.jsx)("br",{}),(0,F.jsx)("br",{}),(0,F.jsx)("span",{className:"text-destructive font-semibold",children:"This action cannot be undone."})]})]}),(0,F.jsxs)(mF,{className:"flex-row justify-end space-x-2",children:[(0,F.jsx)(mJ,{className:"mt-0",children:"Cancel"}),(0,F.jsxs)(mI,{onClick:az,disabled:H,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:[H?(0,F.jsx)(bh,{className:"w-4 h-4 animate-spin mr-1"}):null,"Delete"]})]})]})}),B&&(0,F.jsx)(tZ,{directive:B,onClose:()=>C(null),onDelete:()=>E({id:B.id,name:B.name}),onUpdated:a=>{q(b=>b.map(b=>b.id===a.id?a:b)),C(a)}})]}):(0,F.jsx)(n_,{children:(0,F.jsxs)(n3,{className:"p-10 text-center",children:[(0,F.jsx)("h3",{className:"text-xl font-semibold mb-2 text-card-foreground",children:"No Bank Selected"}),(0,F.jsx)("p",{className:"text-muted-foreground",children:"Please select a memory bank from the dropdown above to view its profile."})]})})}function tY({open:a,mode:b,directive:c,onClose:d,onCreated:e,onSaved:f}){let{currentBank:g}=(0,J.useBank)(),[h,i]=(0,I.useState)(!1),[j,k]=(0,I.useState)({name:"",content:"",tags:""});(0,I.useEffect)(()=>{"edit"===b&&c?k({name:c.name,content:c.content,tags:(c.tags||[]).join(", ")}):"create"===b&&k({name:"",content:"",tags:""})},[a,b,c]);let l=async()=>{if(g&&j.name.trim()&&j.content.trim()){i(!0);try{let a=j.tags.split(",").map(a=>a.trim()).filter(a=>a.length>0);if("create"===b){let b=await W.client.createDirective(g,{name:j.name.trim(),content:j.content.trim(),tags:a.length>0?a:void 0});k({name:"",content:"",tags:""}),e?.(b)}else if(c){let b=await W.client.updateDirective(g,c.id,{name:j.name.trim(),content:j.content.trim(),tags:a});f?.(b),d()}}catch(a){console.error(`Error ${"create"===b?"creating":"updating"} directive:`,a),alert(`Error ${"create"===b?"creating":"updating"}: `+a.message)}finally{i(!1)}}},n=()=>{"create"===b&&k({name:"",content:"",tags:""}),d()};return(0,F.jsx)(bi.Dialog,{open:a,onOpenChange:a=>!a&&n(),children:(0,F.jsxs)(bi.DialogContent,{className:"sm:max-w-lg",children:[(0,F.jsxs)(bi.DialogHeader,{children:[(0,F.jsxs)(bi.DialogTitle,{className:"flex items-center gap-2",children:[(0,F.jsx)(tR,{className:"w-5 h-5 text-rose-500"}),"create"===b?"Create":"Edit"," Directive"]}),(0,F.jsx)(bi.DialogDescription,{children:"Directives are hard rules that must be followed during reflect."})]}),(0,F.jsxs)("div",{className:"space-y-4 py-4",children:[(0,F.jsxs)("div",{className:"space-y-2",children:[(0,F.jsx)("label",{className:"text-sm font-medium text-foreground",children:"Name *"}),(0,F.jsx)(Y.Input,{value:j.name,onChange:a=>k({...j,name:a.target.value}),placeholder:"e.g., Competitor Policy"})]}),(0,F.jsxs)("div",{className:"space-y-2",children:[(0,F.jsx)("label",{className:"text-sm font-medium text-foreground",children:"Rule *"}),(0,F.jsx)(n9.Textarea,{value:j.content,onChange:a=>k({...j,content:a.target.value}),placeholder:"e.g., Never mention competitor products directly.",className:"min-h-[120px]"})]}),(0,F.jsxs)("div",{className:"space-y-2",children:[(0,F.jsxs)("label",{className:"text-sm font-medium text-foreground",children:["Tags ",(0,F.jsx)("span",{className:"text-muted-foreground font-normal",children:"(optional)"})]}),(0,F.jsx)(Y.Input,{value:j.tags,onChange:a=>k({...j,tags:a.target.value}),placeholder:"e.g., project-x, team-alpha (comma-separated)"})]})]}),(0,F.jsxs)(bi.DialogFooter,{children:[(0,F.jsx)(X.Button,{variant:"outline",onClick:n,disabled:h,children:"Cancel"}),(0,F.jsxs)(X.Button,{onClick:l,disabled:h||!j.name.trim()||!j.content.trim(),className:"bg-rose-500 hover:bg-rose-600",children:[h?(0,F.jsx)(bh,{className:"w-4 h-4 animate-spin mr-1"}):null,"create"===b?"Create":"Save"]})]})]})})}function tZ({directive:a,onClose:b,onDelete:c,onUpdated:d}){let[e,f]=(0,I.useState)(!1);return(0,F.jsxs)("div",{className:"fixed right-0 top-0 h-screen w-1/2 bg-card border-l-2 border-rose-500 shadow-2xl z-50 overflow-y-auto animate-in slide-in-from-right duration-300 ease-out",children:[(0,F.jsxs)("div",{className:"p-6",children:[(0,F.jsxs)("div",{className:"flex justify-between items-start mb-8 pb-5 border-b border-border",children:[(0,F.jsxs)("div",{className:"flex items-start gap-3",children:[(0,F.jsx)(tR,{className:"w-5 h-5 text-rose-500"}),(0,F.jsxs)("div",{children:[(0,F.jsxs)("div",{className:"flex items-center gap-2",children:[(0,F.jsx)("h3",{className:"text-xl font-bold text-foreground",children:a.name}),(0,F.jsx)(X.Button,{variant:"ghost",size:"sm",onClick:()=>f(!0),className:"h-7 w-7 p-0",children:(0,F.jsx)(tU,{className:"h-3.5 w-3.5"})})]}),(0,F.jsx)("span",{className:"text-xs px-1.5 py-0.5 rounded bg-rose-500/10 text-rose-600 dark:text-rose-400",children:"directive"})]})]}),(0,F.jsxs)("div",{className:"flex items-center gap-2",children:[(0,F.jsx)(X.Button,{variant:"ghost",size:"sm",onClick:c,className:"h-8 w-8 p-0 text-muted-foreground hover:text-rose-500",children:(0,F.jsx)(mK,{className:"h-4 w-4"})}),(0,F.jsx)(X.Button,{variant:"ghost",size:"sm",onClick:b,className:"h-8 w-8 p-0",children:(0,F.jsx)(bg.X,{className:"h-4 w-4"})})]})]}),(0,F.jsxs)("div",{className:"space-y-6",children:[(0,F.jsxs)("div",{children:[(0,F.jsx)("div",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide mb-3",children:"Rule"}),(0,F.jsx)("div",{className:"prose prose-base dark:prose-invert max-w-none",children:(0,F.jsx)(se,{children:a.content})})]}),a.tags&&a.tags.length>0&&(0,F.jsxs)("div",{children:[(0,F.jsx)("div",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide mb-3",children:"Tags"}),(0,F.jsx)("div",{className:"flex flex-wrap gap-2",children:a.tags.map(a=>(0,F.jsx)("span",{className:"px-2 py-1 rounded bg-muted text-muted-foreground text-sm",children:a},a))})]}),(0,F.jsxs)("div",{children:[(0,F.jsx)("div",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide mb-2",children:"ID"}),(0,F.jsx)("code",{className:"text-sm font-mono break-all text-muted-foreground",children:a.id})]})]})]}),(0,F.jsx)(tY,{open:e,mode:"edit",directive:a,onClose:()=>f(!1),onSaved:d})]})}function t$(){let{currentBank:a}=(0,J.useBank)(),[b,c]=(0,I.useState)([]),[d,e]=(0,I.useState)(!1),[f,g]=(0,I.useState)(""),[h,i]=(0,I.useState)(1),[j,k]=(0,I.useState)(!1),[l,n]=(0,I.useState)(null),[o,p]=(0,I.useState)(null),[q,r]=(0,I.useState)(!1),s=b.filter(a=>{if(!f)return!0;let b=f.toLowerCase();return a.id.toLowerCase().includes(b)||a.name.toLowerCase().includes(b)||a.source_query.toLowerCase().includes(b)||a.content.toLowerCase().includes(b)}),t=async()=>{if(a){e(!0);try{let b=await W.client.listMentalModels(a);c(b.items||[])}catch(a){console.error("Error loading mental models:",a)}finally{e(!1)}}},u=async()=>{if(a&&o){r(!0);try{await W.client.deleteMentalModel(a,o.id),c(a=>a.filter(a=>a.id!==o.id)),l?.id===o.id&&n(null),p(null)}catch(a){console.error("Error deleting mental model:",a),alert("Error deleting: "+a.message)}finally{r(!1)}}};if((0,I.useEffect)(()=>{a&&t()},[a]),(0,I.useEffect)(()=>{let a=a=>{"Escape"===a.key&&n(null)};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[]),(0,I.useEffect)(()=>{i(1)},[f]),!a)return(0,F.jsx)(n_,{children:(0,F.jsx)(n3,{className:"p-10 text-center",children:(0,F.jsx)("p",{className:"text-muted-foreground",children:"Select a memory bank to view mental models."})})});let v=Math.ceil(s.length/100),w=(h-1)*100,x=w+100,y=s.slice(w,x);return(0,F.jsxs)("div",{children:[d?(0,F.jsxs)("div",{className:"text-center py-12",children:[(0,F.jsx)(ac,{className:"w-8 h-8 mx-auto mb-3 text-muted-foreground animate-spin"}),(0,F.jsx)("p",{className:"text-muted-foreground",children:"Loading..."})]}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)("div",{className:"mb-4",children:(0,F.jsx)(Y.Input,{type:"text",value:f,onChange:a=>g(a.target.value),placeholder:"Filter mental models by name, query, or content...",className:"max-w-md"})}),(0,F.jsxs)("div",{className:"flex items-center justify-between mb-6",children:[(0,F.jsx)("div",{className:"text-sm text-muted-foreground",children:f?`${s.length} of ${b.length} mental models`:`${b.length} mental model${1!==b.length?"s":""}`}),(0,F.jsxs)(X.Button,{onClick:()=>k(!0),variant:"outline",size:"sm",children:[(0,F.jsx)(tS.Plus,{className:"w-4 h-4 mr-2"}),"Add Mental Model"]})]}),s.length>0?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)("div",{className:"border rounded-lg overflow-hidden",children:(0,F.jsxs)(ah,{className:"table-fixed",children:[(0,F.jsx)(ai,{children:(0,F.jsxs)(ak,{className:"bg-muted/50",children:[(0,F.jsx)(al,{className:"w-[20%]",children:"ID"}),(0,F.jsx)(al,{className:"w-[20%]",children:"Name"}),(0,F.jsx)(al,{className:"w-[35%]",children:"Source Query"}),(0,F.jsx)(al,{className:"w-[15%]",children:"Last Refreshed"}),(0,F.jsx)(al,{className:"w-[10%]"})]})}),(0,F.jsx)(aj,{children:y.map(a=>{let b=new Date(a.last_refreshed_at),c=b.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}),d=b.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",hour12:!1});return(0,F.jsxs)(ak,{className:`cursor-pointer hover:bg-muted/50 ${l?.id===a.id?"bg-primary/10":""}`,onClick:()=>n(a),children:[(0,F.jsx)(am,{className:"py-2",children:(0,F.jsx)("code",{className:"text-xs font-mono text-muted-foreground truncate block",children:a.id})}),(0,F.jsx)(am,{className:"py-2",children:(0,F.jsx)("div",{className:"font-medium text-foreground",children:a.name})}),(0,F.jsx)(am,{className:"py-2",children:(0,F.jsx)("div",{className:"text-sm text-muted-foreground truncate",children:a.source_query})}),(0,F.jsxs)(am,{className:"py-2 text-sm text-foreground",children:[(0,F.jsx)("div",{children:c}),(0,F.jsx)("div",{className:"text-xs text-muted-foreground",children:d})]}),(0,F.jsx)(am,{className:"py-2",children:(0,F.jsx)(X.Button,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0 text-muted-foreground hover:text-destructive",onClick:b=>{b.stopPropagation(),p({id:a.id,name:a.name})},children:(0,F.jsx)(mK,{className:"h-4 w-4"})})})]},a.id)})})]})}),v>1&&(0,F.jsxs)("div",{className:"flex items-center justify-between mt-3 pt-3 border-t",children:[(0,F.jsxs)("div",{className:"text-xs text-muted-foreground",children:[w+1,"-",Math.min(x,s.length)," of"," ",s.length]}),(0,F.jsxs)("div",{className:"flex items-center gap-1",children:[(0,F.jsx)(X.Button,{variant:"outline",size:"sm",onClick:()=>i(1),disabled:1===h,className:"h-7 w-7 p-0",children:(0,F.jsx)(aa,{className:"h-3 w-3"})}),(0,F.jsx)(X.Button,{variant:"outline",size:"sm",onClick:()=>i(a=>Math.max(1,a-1)),disabled:1===h,className:"h-7 w-7 p-0",children:(0,F.jsx)(Q,{className:"h-3 w-3"})}),(0,F.jsxs)("span",{className:"text-xs px-2",children:[h," / ",v]}),(0,F.jsx)(X.Button,{variant:"outline",size:"sm",onClick:()=>i(a=>Math.min(v,a+1)),disabled:h===v,className:"h-7 w-7 p-0",children:(0,F.jsx)(R,{className:"h-3 w-3"})}),(0,F.jsx)(X.Button,{variant:"outline",size:"sm",onClick:()=>i(v),disabled:h===v,className:"h-7 w-7 p-0",children:(0,F.jsx)(ab,{className:"h-3 w-3"})})]})]})]}):(0,F.jsxs)("div",{className:"p-6 border border-dashed border-border rounded-lg text-center",children:[(0,F.jsx)(M,{className:"w-6 h-6 mx-auto mb-2 text-muted-foreground"}),(0,F.jsx)("p",{className:"text-sm text-muted-foreground",children:f?"No mental models match your filter":"No mental models yet. Create a mental model to generate and save a summary from your memories."})]})]}),(0,F.jsx)(t_,{open:j,onClose:()=>k(!1),onCreated:()=>{k(!1),t()}}),(0,F.jsx)(mm,{open:!!o,onOpenChange:a=>!a&&p(null),children:(0,F.jsxs)(mD,{children:[(0,F.jsxs)(mE,{children:[(0,F.jsx)(mG,{children:"Delete Mental Model"}),(0,F.jsxs)(mH,{children:["Are you sure you want to delete"," ",(0,F.jsxs)("span",{className:"font-semibold",children:['"',o?.name,'"']}),"?",(0,F.jsx)("br",{}),(0,F.jsx)("br",{}),(0,F.jsx)("span",{className:"text-destructive font-semibold",children:"This action cannot be undone."})]})]}),(0,F.jsxs)(mF,{className:"flex-row justify-end space-x-2",children:[(0,F.jsx)(mJ,{className:"mt-0",children:"Cancel"}),(0,F.jsxs)(mI,{onClick:u,disabled:q,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:[q?(0,F.jsx)(bh,{className:"w-4 h-4 animate-spin mr-1"}):null,"Delete"]})]})]})}),l&&(0,F.jsx)(t0,{mentalModel:l,onClose:()=>n(null),onDelete:()=>p({id:l.id,name:l.name}),onRefreshed:a=>{c(b=>b.map(b=>b.id===a.id?a:b)),n(a)}})]})}function t_({open:a,onClose:b,onCreated:c}){let{currentBank:d}=(0,J.useBank)(),[e,f]=(0,I.useState)(!1),[g,h]=(0,I.useState)({name:"",sourceQuery:"",maxTokens:"2048",tags:""}),i=async()=>{if(d&&g.name.trim()&&g.sourceQuery.trim()){f(!0);try{let a=g.tags.split(",").map(a=>a.trim()).filter(a=>a.length>0),b=parseInt(g.maxTokens)||2048;await W.client.createMentalModel(d,{name:g.name.trim(),source_query:g.sourceQuery.trim(),tags:a.length>0?a:void 0,max_tokens:b}),h({name:"",sourceQuery:"",maxTokens:"2048",tags:""}),c()}catch(a){console.error("Error creating mental model:",a),alert("Error creating mental model: "+a.message)}finally{f(!1)}}};return(0,F.jsx)(bi.Dialog,{open:a,onOpenChange:a=>{a||(h({name:"",sourceQuery:"",maxTokens:"2048",tags:""}),b())},children:(0,F.jsxs)(bi.DialogContent,{className:"sm:max-w-lg",children:[(0,F.jsxs)(bi.DialogHeader,{children:[(0,F.jsx)(bi.DialogTitle,{children:"Create Mental Model"}),(0,F.jsx)(bi.DialogDescription,{children:"Create a mental model by running a query. The content will be auto-generated and can be refreshed later."})]}),(0,F.jsxs)("div",{className:"space-y-4 py-4",children:[(0,F.jsxs)("div",{className:"space-y-2",children:[(0,F.jsx)("label",{className:"text-sm font-medium text-foreground",children:"Name *"}),(0,F.jsx)(Y.Input,{value:g.name,onChange:a=>h({...g,name:a.target.value}),placeholder:"e.g., Team Communication Preferences"})]}),(0,F.jsxs)("div",{className:"space-y-2",children:[(0,F.jsx)("label",{className:"text-sm font-medium text-foreground",children:"Source Query *"}),(0,F.jsx)(Y.Input,{value:g.sourceQuery,onChange:a=>h({...g,sourceQuery:a.target.value}),placeholder:"e.g., How does the team prefer to communicate?"}),(0,F.jsx)("p",{className:"text-xs text-muted-foreground",children:"This query will be run to generate the initial content, and re-run when you refresh."})]}),(0,F.jsxs)("div",{className:"space-y-2",children:[(0,F.jsx)("label",{className:"text-sm font-medium text-foreground",children:"Max Tokens"}),(0,F.jsx)(Y.Input,{type:"number",value:g.maxTokens,onChange:a=>h({...g,maxTokens:a.target.value}),placeholder:"2048",min:"256",max:"8192"}),(0,F.jsx)("p",{className:"text-xs text-muted-foreground",children:"Maximum tokens for the generated response (256-8192)."})]}),(0,F.jsxs)("div",{className:"space-y-2",children:[(0,F.jsxs)("label",{className:"text-sm font-medium text-foreground",children:["Tags ",(0,F.jsx)("span",{className:"text-muted-foreground font-normal",children:"(optional)"})]}),(0,F.jsx)(Y.Input,{value:g.tags,onChange:a=>h({...g,tags:a.target.value}),placeholder:"e.g., project-x, team-alpha (comma-separated)"})]})]}),(0,F.jsxs)(bi.DialogFooter,{children:[(0,F.jsx)(X.Button,{variant:"outline",onClick:b,disabled:e,children:"Cancel"}),(0,F.jsx)(X.Button,{onClick:i,disabled:e||!g.name.trim()||!g.sourceQuery.trim(),children:e?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(bh,{className:"w-4 h-4 animate-spin mr-1"}),"Generating..."]}):"Create"})]})]})})}function t0({mentalModel:a,onClose:b,onDelete:c,onRefreshed:d}){let{currentBank:e}=(0,J.useBank)(),[f,g]=(0,I.useState)(!1),[h,i]=(0,I.useState)(null),[j,k]=(0,I.useState)(!1),[l,n]=(0,I.useState)(a.name),[o,p]=(0,I.useState)(!1);(0,I.useEffect)(()=>{n(a.name),k(!1)},[a.id,a.name]);let q=async()=>{if(!e)return;g(!0);let b=a.last_refreshed_at;try{await W.client.refreshMentalModel(e,a.id);let c=0,f=async()=>{c++;try{let h=await W.client.getMentalModel(e,a.id);if(h.last_refreshed_at!==b){d(h),g(!1);return}if(c>=120){g(!1),alert("Refresh is taking longer than expected. Check the operations list for status.");return}setTimeout(f,1e3)}catch(a){console.error("Error polling mental model:",a),g(!1)}};setTimeout(f,1e3)}catch(a){console.error("Error refreshing mental model:",a),alert("Error refreshing: "+a.message),g(!1)}},r=async()=>{if(e&&l.trim()){p(!0);try{let b=await W.client.updateMentalModel(e,a.id,{name:l.trim()});d(b),k(!1)}catch(a){console.error("Error updating mental model:",a),alert("Error updating: "+a.message)}finally{p(!1)}}},s=a=>{let b=new Date(a);return`${b.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})} at ${b.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",hour12:!1})}`},t=a.reflect_response?.based_on?Object.entries(a.reflect_response.based_on).filter(([a])=>"observation"!==a).flatMap(([a,b])=>b.map(b=>({...b,factType:a}))):[],u=a.reflect_response?.based_on?.observation||[];return(0,F.jsxs)("div",{className:"fixed right-0 top-0 h-screen w-1/2 bg-card border-l shadow-2xl z-50 overflow-y-auto animate-in slide-in-from-right duration-300 ease-out",children:[(0,F.jsxs)("div",{className:"p-6",children:[(0,F.jsxs)("div",{className:"flex justify-between items-start mb-8 pb-5 border-b border-border",children:[(0,F.jsx)("div",{className:"flex-1 mr-4",children:j?(0,F.jsxs)("div",{className:"space-y-2",children:[(0,F.jsx)(Y.Input,{value:l,onChange:a=>n(a.target.value),className:"text-lg font-bold",autoFocus:!0}),(0,F.jsxs)("div",{className:"flex gap-2",children:[(0,F.jsxs)(X.Button,{size:"sm",onClick:r,disabled:o||!l.trim(),children:[o?(0,F.jsx)(bh,{className:"w-3 h-3 animate-spin mr-1"}):null,"Save"]}),(0,F.jsx)(X.Button,{size:"sm",variant:"outline",onClick:()=>{n(a.name),k(!1)},children:"Cancel"})]})]}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)("div",{className:"flex items-center gap-2",children:[(0,F.jsx)("h3",{className:"text-xl font-bold text-foreground",children:a.name}),(0,F.jsx)(X.Button,{variant:"ghost",size:"sm",onClick:()=>k(!0),className:"h-7 w-7 p-0",children:(0,F.jsx)(tU,{className:"h-3.5 w-3.5"})})]}),(0,F.jsx)("p",{className:"text-sm text-muted-foreground mt-1",children:a.source_query})]})}),(0,F.jsxs)("div",{className:"flex items-center gap-2",children:[(0,F.jsxs)(X.Button,{variant:"outline",size:"sm",onClick:q,disabled:f,className:"h-8",children:[f?(0,F.jsx)(bh,{className:"w-4 h-4 animate-spin mr-1"}):(0,F.jsx)(ac,{className:"w-4 h-4 mr-1"}),"Refresh"]}),(0,F.jsx)(X.Button,{variant:"ghost",size:"sm",onClick:b,className:"h-8 w-8 p-0",children:(0,F.jsx)(bg.X,{className:"h-4 w-4"})})]})]}),(0,F.jsxs)("div",{className:"space-y-6",children:[(0,F.jsxs)("div",{children:[(0,F.jsx)("div",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide mb-3",children:"Content"}),(0,F.jsx)("div",{className:"prose prose-base dark:prose-invert max-w-none",children:(0,F.jsx)(se,{children:a.content})})]}),t.length>0&&(0,F.jsxs)("div",{className:"border-t border-border pt-5",children:[(0,F.jsxs)("div",{className:"text-xs font-bold text-muted-foreground uppercase mb-3",children:["Based On (",t.length," ",1===t.length?"fact":"facts",")"]}),(0,F.jsx)("div",{className:"space-y-3",children:t.map((a,b)=>(0,F.jsxs)("div",{className:"p-4 bg-muted/50 rounded-lg border border-border/50",children:[(0,F.jsxs)("div",{className:"flex items-start justify-between gap-2 mb-2",children:[(0,F.jsx)("span",{className:`px-2 py-0.5 rounded text-xs font-medium ${"world"===a.factType?"bg-blue-500/10 text-blue-600 dark:text-blue-400":"experience"===a.factType?"bg-green-500/10 text-green-600 dark:text-green-400":"bg-purple-500/10 text-purple-600 dark:text-purple-400"}`,children:a.factType}),(0,F.jsx)(X.Button,{variant:"outline",size:"sm",className:"h-6 text-xs",onClick:()=>i(a.id),children:"View"})]}),(0,F.jsx)("p",{className:"text-sm text-foreground leading-relaxed",children:a.text})]},a.id||b))})]}),u.length>0&&(0,F.jsxs)("div",{className:"border-t border-border pt-5",children:[(0,F.jsxs)("div",{className:"text-xs font-bold text-muted-foreground uppercase mb-3",children:["Observations Used (",u.length,")"]}),(0,F.jsx)("div",{className:"space-y-3",children:u.map((a,b)=>(0,F.jsxs)("div",{className:"p-4 bg-muted/50 rounded-lg border border-border/50",children:[(0,F.jsxs)("div",{className:"flex items-start justify-between gap-2 mb-2",children:[(0,F.jsx)("span",{className:"px-2 py-0.5 rounded text-xs font-medium bg-amber-500/10 text-amber-600 dark:text-amber-400",children:"observation"}),(0,F.jsx)(X.Button,{variant:"outline",size:"sm",className:"h-6 text-xs",onClick:()=>i(a.id),children:"View"})]}),(0,F.jsx)("p",{className:"text-sm text-foreground leading-relaxed",children:a.text})]},a.id||b))})]}),!a.reflect_response&&(0,F.jsxs)("div",{className:"border-t border-border pt-5",children:[(0,F.jsx)("div",{className:"text-xs font-bold text-muted-foreground uppercase mb-3",children:"Based On"}),(0,F.jsx)("p",{className:"text-sm text-muted-foreground",children:'No source data available. Click "Refresh" to regenerate with source tracking.'})]}),a.tags&&a.tags.length>0&&(0,F.jsxs)("div",{children:[(0,F.jsx)("div",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide mb-3",children:"Tags"}),(0,F.jsx)("div",{className:"flex flex-wrap gap-2",children:a.tags.map(a=>(0,F.jsx)("span",{className:"px-2 py-1 rounded bg-muted text-muted-foreground text-sm",children:a},a))})]}),(0,F.jsxs)("div",{className:"flex gap-6 text-sm text-muted-foreground",children:[(0,F.jsxs)("span",{children:["Created: ",s(a.created_at)]}),(0,F.jsxs)("span",{children:["Refreshed: ",s(a.last_refreshed_at)]})]}),(0,F.jsxs)("div",{className:"p-4 bg-muted/50 rounded-lg",children:[(0,F.jsx)("div",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide mb-2",children:"ID"}),(0,F.jsx)("code",{className:"text-sm font-mono break-all text-muted-foreground",children:a.id})]}),(0,F.jsx)("div",{className:"pt-4 border-t border-border",children:(0,F.jsxs)(X.Button,{variant:"outline",size:"sm",onClick:c,className:"text-muted-foreground hover:text-destructive hover:border-destructive",children:[(0,F.jsx)(mK,{className:"h-4 w-4 mr-2"}),"Delete"]})})]})]}),h&&e&&(0,F.jsx)(bn,{memoryId:h,onClose:()=>i(null)})]})}function t1(){let a=(0,G.useParams)(),b=(0,G.useRouter)(),c=(0,G.useSearchParams)(),{features:d}=(0,sm.useFeatures)(),e=a.bankId,f=c.get("view")||"profile",g=c.get("subTab")||"world",h=d?.observations??!1,i=a=>{b.push(`/banks/${e}?view=data&subTab=${a}`)};return(0,F.jsxs)("div",{className:"min-h-screen bg-background flex flex-col",children:[(0,F.jsx)(H.BankSelector,{}),(0,F.jsxs)("div",{className:"flex flex-1 overflow-hidden",children:[(0,F.jsx)(V,{currentTab:f,onTabChange:a=>{b.push(`/banks/${e}?view=${a}`)}}),(0,F.jsx)("main",{className:"flex-1 overflow-y-auto",children:(0,F.jsxs)("div",{className:"p-6",children:["profile"===f&&(0,F.jsxs)("div",{children:[(0,F.jsx)("h1",{className:"text-3xl font-bold mb-2 text-foreground",children:"Bank Profile"}),(0,F.jsx)("p",{className:"text-muted-foreground mb-6",children:"View and edit the memory bank profile, disposition traits, and background information."}),(0,F.jsx)(tX,{})]}),"recall"===f&&(0,F.jsxs)("div",{children:[(0,F.jsx)("h1",{className:"text-3xl font-bold mb-2 text-foreground",children:"Recall"}),(0,F.jsx)("p",{className:"text-muted-foreground mb-6",children:"Analyze memory recall with detailed trace information and retrieval methods."}),(0,F.jsx)(sl,{})]}),"reflect"===f&&(0,F.jsxs)("div",{children:[(0,F.jsx)("h1",{className:"text-3xl font-bold mb-2 text-foreground",children:"Reflect"}),(0,F.jsx)("p",{className:"text-muted-foreground mb-6",children:"Run an agentic loop that autonomously gathers evidence and reasons through the lens of the bank's disposition to generate contextual responses."}),(0,F.jsx)(sj,{})]}),"data"===f&&(0,F.jsxs)("div",{children:[(0,F.jsx)("h1",{className:"text-3xl font-bold mb-2 text-foreground",children:"Memories"}),(0,F.jsx)("p",{className:"text-muted-foreground mb-6",children:"View and explore different types of memories stored in this memory bank."}),(0,F.jsx)("div",{className:"mb-6 border-b border-border",children:(0,F.jsxs)("div",{className:"flex gap-1",children:[(0,F.jsxs)("button",{onClick:()=>i("world"),className:`px-6 py-3 font-semibold text-sm transition-all relative ${"world"===g?"text-primary":"text-muted-foreground hover:text-foreground"}`,children:["World Facts","world"===g&&(0,F.jsx)("div",{className:"absolute bottom-0 left-0 right-0 h-0.5 bg-primary"})]}),(0,F.jsxs)("button",{onClick:()=>i("experience"),className:`px-6 py-3 font-semibold text-sm transition-all relative ${"experience"===g?"text-primary":"text-muted-foreground hover:text-foreground"}`,children:["Experience","experience"===g&&(0,F.jsx)("div",{className:"absolute bottom-0 left-0 right-0 h-0.5 bg-primary"})]}),(0,F.jsxs)("button",{onClick:()=>i("observations"),className:`px-6 py-3 font-semibold text-sm transition-all relative ${"observations"===g?"text-primary":"text-muted-foreground hover:text-foreground"}`,children:["Observations",!h&&(0,F.jsx)("span",{className:"ml-2 text-xs px-1.5 py-0.5 rounded bg-muted text-muted-foreground",children:"Off"}),"observations"===g&&(0,F.jsx)("div",{className:"absolute bottom-0 left-0 right-0 h-0.5 bg-primary"})]}),(0,F.jsxs)("button",{onClick:()=>i("mental-models"),className:`px-6 py-3 font-semibold text-sm transition-all relative ${"mental-models"===g?"text-primary":"text-muted-foreground hover:text-foreground"}`,children:["Mental Models","mental-models"===g&&(0,F.jsx)("div",{className:"absolute bottom-0 left-0 right-0 h-0.5 bg-primary"})]})]})}),(0,F.jsxs)("div",{children:["world"===g&&(0,F.jsxs)("div",{children:[(0,F.jsx)("p",{className:"text-sm text-muted-foreground mb-4",children:"Objective facts about the world received from external sources."}),(0,F.jsx)(me,{factType:"world"},"world")]}),"experience"===g&&(0,F.jsxs)("div",{children:[(0,F.jsx)("p",{className:"text-sm text-muted-foreground mb-4",children:"The bank's own actions, interactions, and first-person experiences."}),(0,F.jsx)(me,{factType:"experience"},"experience")]}),"observations"===g&&(h?(0,F.jsxs)("div",{children:[(0,F.jsx)("p",{className:"text-sm text-muted-foreground mb-4",children:"Consolidated knowledge synthesized from facts — patterns, preferences, and learnings that emerge from accumulated evidence."}),(0,F.jsx)(me,{factType:"observation"},"observations")]}):(0,F.jsxs)("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[(0,F.jsx)("div",{className:"text-muted-foreground mb-2",children:(0,F.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"48",height:"48",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,F.jsx)("path",{d:"M12 2a10 10 0 1 0 10 10A10 10 0 0 0 12 2Z"}),(0,F.jsx)("path",{d:"M12 8v4"}),(0,F.jsx)("path",{d:"M12 16h.01"})]})}),(0,F.jsx)("h3",{className:"text-lg font-semibold text-foreground mb-1",children:"Observations Not Enabled"}),(0,F.jsxs)("p",{className:"text-sm text-muted-foreground max-w-md",children:["Observations consolidation is disabled on this server. Set"," ",(0,F.jsx)("code",{className:"px-1 py-0.5 bg-muted rounded text-xs",children:"HINDSIGHT_API_ENABLE_OBSERVATIONS=true"})," ","to enable."]})]})),"mental-models"===g&&(0,F.jsxs)("div",{children:[(0,F.jsx)("p",{className:"text-sm text-muted-foreground mb-4",children:"User-curated summaries generated from queries — reusable knowledge snapshots that can be refreshed as memories evolve."}),(0,F.jsx)(t$,{},"mental-models")]})]})]}),"documents"===f&&(0,F.jsxs)("div",{children:[(0,F.jsx)("h1",{className:"text-3xl font-bold mb-2 text-foreground",children:"Documents"}),(0,F.jsx)("p",{className:"text-muted-foreground mb-6",children:"Manage documents and retain new memories."}),(0,F.jsx)(mL,{})]}),"entities"===f&&(0,F.jsxs)("div",{children:[(0,F.jsx)("h1",{className:"text-3xl font-bold mb-2 text-foreground",children:"Entities"}),(0,F.jsx)("p",{className:"text-muted-foreground mb-6",children:"Explore entities (people, organizations, places) mentioned in memories."}),(0,F.jsx)(mM,{})]})]})})]})]})}a.s(["default",()=>t1],73101)}];
|
|
9
9
|
|
|
10
10
|
//# sourceMappingURL=%5Broot-of-the-server%5D__3ff65f6b._.js.map
|