@workflow/web 4.0.1-beta.21 → 4.0.1-beta.22
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/.next/BUILD_ID +1 -1
- package/.next/build-manifest.json +2 -2
- package/.next/fallback-build-manifest.json +2 -2
- package/.next/prerender-manifest.json +3 -3
- package/.next/server/app/_global-error.html +2 -2
- package/.next/server/app/_global-error.rsc +1 -1
- package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/_not-found/page/server-reference-manifest.json +36 -21
- package/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/server/app/page/server-reference-manifest.json +37 -22
- package/.next/server/app/page.js.nft.json +1 -1
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/app/run/[runId]/page/server-reference-manifest.json +37 -22
- package/.next/server/app/run/[runId]/page.js.nft.json +1 -1
- package/.next/server/app/run/[runId]/page_client-reference-manifest.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__1365a866._.js +3 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__1365a866._.js.map +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__2168651f._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__2168651f._.js.map +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__25c4ca9a._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__25c4ca9a._.js.map +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__d416fa5e._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__d416fa5e._.js.map +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__e576a2e1._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__e576a2e1._.js.map +1 -1
- package/.next/server/chunks/ssr/_af28dabd._.js +1 -1
- package/.next/server/chunks/ssr/_af28dabd._.js.map +1 -1
- package/.next/server/chunks/ssr/_bff7cae2._.js +1 -1
- package/.next/server/chunks/ssr/_bff7cae2._.js.map +1 -1
- package/.next/server/chunks/ssr/_c8bf1458._.js +1 -1
- package/.next/server/chunks/ssr/_c8bf1458._.js.map +1 -1
- package/.next/server/chunks/ssr/packages_web_src_19bb3951._.js +3 -0
- package/.next/server/chunks/ssr/packages_web_src_19bb3951._.js.map +1 -0
- package/.next/server/chunks/ssr/packages_web_src_app_page_tsx_cd282e82._.js +2 -2
- package/.next/server/chunks/ssr/packages_web_src_app_page_tsx_cd282e82._.js.map +1 -1
- package/.next/server/chunks/ssr/packages_web_src_app_run_[runId]_page_tsx_c7d0b139._.js +1 -1
- package/.next/server/chunks/ssr/packages_web_src_app_run_[runId]_page_tsx_c7d0b139._.js.map +1 -1
- package/.next/server/pages/500.html +2 -2
- package/.next/server/server-reference-manifest.js +1 -1
- package/.next/server/server-reference-manifest.json +56 -27
- package/.next/static/chunks/{d3781b000675e89a.js → 36a636d76f662255.js} +1 -1
- package/.next/static/chunks/{1633a4677cb7eacd.js → 5cc4b7d8f173d21f.js} +1 -1
- package/.next/static/chunks/8d32c2bf0f991bbb.js +1 -0
- package/.next/static/chunks/8f6413f9323a44e5.js +14 -0
- package/.next/static/chunks/{a2fdd31ef7d1ed50.js → affb91574db5b135.js} +3 -3
- package/.next/static/chunks/c72c95cb5a7775b3.js +5 -0
- package/.next/static/chunks/f71c82ee950bb628.js +60 -0
- package/.next/trace +1 -1
- package/.next/trace-build +1 -1
- package/package.json +2 -1
- package/.next/server/chunks/ssr/packages_web_src_components_ui_select_tsx_7c5238ef._.js +0 -3
- package/.next/server/chunks/ssr/packages_web_src_components_ui_select_tsx_7c5238ef._.js.map +0 -1
- package/.next/static/chunks/7993564ea9cd3862.js +0 -60
- package/.next/static/chunks/915c48af605695f8.js +0 -5
- package/.next/static/chunks/ebaf4c277606b4fc.js +0 -14
- /package/.next/static/{1Gd0u_mHFXgTr2DR4OTNR → ieavtosUwWbQ98kcW2Cp7}/_buildManifest.js +0 -0
- /package/.next/static/{1Gd0u_mHFXgTr2DR4OTNR → ieavtosUwWbQ98kcW2Cp7}/_clientMiddlewareManifest.json +0 -0
- /package/.next/static/{1Gd0u_mHFXgTr2DR4OTNR → ieavtosUwWbQ98kcW2Cp7}/_ssgManifest.js +0 -0
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,330997,e=>{"use strict";var s=e.i(666426);e.i(169764);var t=e.i(545030),a=e.i(868924),r=e.i(531875),o=e.i(932671),l=e.i(180076),n=e.i(687602),i=e.i(886288);let d=(0,i.default)("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);var c=e.i(524914),u=e.i(495566);let h=(0,i.default)("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);var m=e.i(846220),x=e.i(811735),f=e.i(686107),p=e.i(806746),g=e.i(456944),j=e.i(260218),w=e.i(949245);let b=f.forwardRef(({className:e,...t},a)=>(0,s.jsx)("div",{ref:a,className:(0,w.cn)("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));b.displayName="Card",f.forwardRef(({className:e,...t},a)=>(0,s.jsx)("div",{ref:a,className:(0,w.cn)("flex flex-col space-y-1.5 p-6",e),...t})).displayName="CardHeader",f.forwardRef(({className:e,...t},a)=>(0,s.jsx)("div",{ref:a,className:(0,w.cn)("text-2xl font-semibold leading-none tracking-tight",e),...t})).displayName="CardTitle",f.forwardRef(({className:e,...t},a)=>(0,s.jsx)("div",{ref:a,className:(0,w.cn)("text-sm text-muted-foreground",e),...t})).displayName="CardDescription";let k=f.forwardRef(({className:e,...t},a)=>(0,s.jsx)("div",{ref:a,className:(0,w.cn)("p-6 pt-0",e),...t}));k.displayName="CardContent",f.forwardRef(({className:e,...t},a)=>(0,s.jsx)("div",{ref:a,className:(0,w.cn)("flex items-center p-6 pt-0",e),...t})).displayName="CardFooter";var N=e.i(414576);let v=f.forwardRef(({className:e,href:t,children:a,...r},o)=>{let l=t.startsWith("http")?t:`https://useworkflow.dev/docs/${t.replace(/^\//,"")}`;return(0,s.jsx)(N.default,{href:l,className:(0,w.cn)("font-medium underline underline-offset-4 transition-colors",e),style:{color:"var(--ds-blue-600)"},target:"_blank",rel:"noopener noreferrer",ref:o,...r,children:a})});v.displayName="DocsLink";var y=e.i(917955);let C=f.forwardRef(({className:e,...t},a)=>(0,s.jsx)("div",{className:"relative w-full overflow-auto",children:(0,s.jsx)("table",{ref:a,className:(0,w.cn)("w-full caption-bottom text-sm",e),...t})}));C.displayName="Table";let S=f.forwardRef(({className:e,...t},a)=>(0,s.jsx)("thead",{ref:a,className:(0,w.cn)("[&_tr]:border-b",e),...t}));S.displayName="TableHeader";let R=f.forwardRef(({className:e,...t},a)=>(0,s.jsx)("tbody",{ref:a,className:(0,w.cn)("[&_tr:last-child]:border-0",e),...t}));R.displayName="TableBody",f.forwardRef(({className:e,...t},a)=>(0,s.jsx)("tfoot",{ref:a,className:(0,w.cn)("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t})).displayName="TableFooter";let T=f.forwardRef(({className:e,...t},a)=>(0,s.jsx)("tr",{ref:a,className:(0,w.cn)("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));T.displayName="TableRow";let I=f.forwardRef(({className:e,...t},a)=>(0,s.jsx)("th",{ref:a,className:(0,w.cn)("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));I.displayName="TableHead";let D=f.forwardRef(({className:e,...t},a)=>(0,s.jsx)("td",{ref:a,className:(0,w.cn)("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));D.displayName="TableCell",f.forwardRef(({className:e,...t},a)=>(0,s.jsx)("caption",{ref:a,className:(0,w.cn)("mt-4 text-sm text-muted-foreground",e),...t})).displayName="TableCaption";var M=e.i(638322),A=e.i(620486),P=e.i(241245),E=e.i(719402),_=e.i(613087);function F({rows:e=w.DEFAULT_PAGE_SIZE,variant:t="runs"}){return(0,s.jsx)(b,{className:"overflow-hidden mt-4 bg-background",children:(0,s.jsxs)(k,{className:"p-0",children:[(()=>{switch(t){case"runs":return(0,s.jsxs)("div",{className:"grid grid-cols-[1fr_1.5fr_0.8fr_1fr_1fr_40px] items-center gap-4 py-3 px-4 border-b",children:[(0,s.jsx)(_.Skeleton,{className:"h-4 w-20"}),(0,s.jsx)(_.Skeleton,{className:"h-4 w-14"}),(0,s.jsx)(_.Skeleton,{className:"h-4 w-12"}),(0,s.jsx)(_.Skeleton,{className:"h-4 w-14"}),(0,s.jsx)(_.Skeleton,{className:"h-4 w-20"}),(0,s.jsx)("div",{className:"w-6"})]});case"hooks":return(0,s.jsxs)("div",{className:"grid grid-cols-[1.2fr_1.2fr_0.8fr_1fr_0.5fr_40px] items-center gap-4 py-3 px-4 border-b",children:[(0,s.jsx)(_.Skeleton,{className:"h-4 w-16"}),(0,s.jsx)(_.Skeleton,{className:"h-4 w-14"}),(0,s.jsx)(_.Skeleton,{className:"h-4 w-12"}),(0,s.jsx)(_.Skeleton,{className:"h-4 w-14"}),(0,s.jsx)(_.Skeleton,{className:"h-4 w-20"}),(0,s.jsx)("div",{className:"w-6"})]});case"workflows":return(0,s.jsxs)("div",{className:"grid grid-cols-[1fr_1.5fr_0.5fr] items-center gap-4 py-3 px-4 border-b",children:[(0,s.jsx)(_.Skeleton,{className:"h-4 w-20"}),(0,s.jsx)(_.Skeleton,{className:"h-4 w-10"}),(0,s.jsx)(_.Skeleton,{className:"h-4 w-12 mx-auto"})]});default:return null}})(),Array.from({length:e},(e,a)=>(e=>{switch(t){case"runs":return(0,s.jsxs)("div",{className:"grid grid-cols-[1fr_1.5fr_0.8fr_1fr_1fr_40px] items-center gap-4 py-3 px-4",children:[(0,s.jsx)(_.Skeleton,{className:"h-4 w-3/4"}),(0,s.jsx)(_.Skeleton,{className:"h-4 w-4/5"}),(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,s.jsx)(_.Skeleton,{className:"h-3 w-14"}),(0,s.jsx)(_.Skeleton,{className:"h-2 w-8"})]}),(0,s.jsx)(_.Skeleton,{className:"h-3 w-3/4"}),(0,s.jsx)(_.Skeleton,{className:"h-3 w-3/4"}),(0,s.jsx)(_.Skeleton,{className:"h-6 w-6 rounded"})]},`skeleton-row-${e}`);case"hooks":return(0,s.jsxs)("div",{className:"grid grid-cols-[1.2fr_1.2fr_0.8fr_1fr_0.5fr_40px] items-center gap-4 py-3 px-4",children:[(0,s.jsx)(_.Skeleton,{className:"h-4 w-4/5"}),(0,s.jsx)(_.Skeleton,{className:"h-4 w-4/5"}),(0,s.jsx)(_.Skeleton,{className:"h-4 w-3/4"}),(0,s.jsx)(_.Skeleton,{className:"h-3 w-3/4"}),(0,s.jsx)(_.Skeleton,{className:"h-4 w-8"}),(0,s.jsx)(_.Skeleton,{className:"h-6 w-6 rounded"})]},`skeleton-row-${e}`);case"workflows":return(0,s.jsxs)("div",{className:"grid grid-cols-[1fr_1.5fr_0.5fr] items-center gap-4 py-3 px-4",children:[(0,s.jsx)(_.Skeleton,{className:"h-4 w-3/4"}),(0,s.jsx)(_.Skeleton,{className:"h-4 w-4/5"}),(0,s.jsx)(_.Skeleton,{className:"h-5 w-16 rounded-full mx-auto"})]},`skeleton-row-${e}`);default:return null}})(a))]})})}function z({config:e,runId:t,onHookClick:a,selectedHookId:i}){let[w,N]=(0,f.useState)(()=>new Date),_=(0,f.useMemo)(()=>(0,A.worldConfigToEnvMap)(e),[e]),{data:z,error:O,nextPage:W,previousPage:B,hasNextPage:H,hasPreviousPage:$,reload:L,pageInfo:U}=(0,r.useWorkflowHooks)(_,{runId:t,sortOrder:"desc"}),V=(0,o.useHookActions)({env:_,callbacks:{onSuccess:L}}),G=z.isLoading,K=z.data??[],[Z,q]=(0,f.useState)(new Map);return(0,f.useEffect)(()=>{K.length&&(async()=>{let e=new Map;for(let s of K)e.set(s.hookId,{count:0,hasMore:!1,loading:!0});q(e);let s=await Promise.allSettled(K.map(async e=>{try{let s=await (0,l.fetchEventsByCorrelationId)(_,e.hookId,{sortOrder:"asc",limit:100});if(!s.success)return{hookId:e.hookId,count:Error(s.error?.message||"Failed to fetch events"),hasMore:!1};let t=s.data,a=t.data.filter(e=>"hook_received"===e.eventType).length;return{hookId:e.hookId,count:a,hasMore:t.hasMore}}catch(s){return{hookId:e.hookId,count:s,hasMore:!1}}}));q(e=>{let t=new Map(e);for(let e=0;e<s.length;e++){let a=s[e],r=K[e].hookId;"fulfilled"===a.status?t.set(a.value.hookId,{count:a.value.count,hasMore:a.value.hasMore,loading:!1}):t.set(r,{count:0,hasMore:!1,loading:!1})}return t})})()},[K,_]),(0,s.jsxs)("div",{children:[(0,s.jsx)(o.HookResolveModalWrapper,{hookActions:V}),(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("div",{className:"flex items-end gap-2",children:[(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:"Last refreshed"}),w&&(0,s.jsx)(E.RelativeTime,{date:w,className:"text-sm text-muted-foreground",type:"distance"})]}),(0,s.jsx)("div",{className:"flex items-center gap-4",children:(0,s.jsxs)(M.Tooltip,{children:[(0,s.jsx)(M.TooltipTrigger,{asChild:!0,children:(0,s.jsxs)(j.Button,{variant:"outline",size:"sm",onClick:()=>{N(()=>new Date),L()},disabled:G,children:[(0,s.jsx)(h,{className:G?"animate-spin":""}),"Refresh"]})}),(0,s.jsx)(M.TooltipContent,{children:"Note that this resets pages"})]})})]}),O?(0,s.jsxs)(g.Alert,{variant:"destructive",children:[(0,s.jsx)(n.AlertCircle,{className:"h-4 w-4"}),(0,s.jsx)(g.AlertTitle,{children:"Error loading hooks"}),(0,s.jsx)(g.AlertDescription,{children:(0,r.getErrorMessage)(O)})]}):G||K&&0!==K.length?G&&!z?.data?(0,s.jsx)(F,{variant:"hooks"}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(b,{className:"overflow-hidden mt-4 bg-background",children:(0,s.jsx)(k,{className:"p-0 max-h-[calc(100vh-280px)] overflow-auto",children:(0,s.jsxs)(C,{children:[(0,s.jsx)(S,{children:(0,s.jsxs)(T,{children:[(0,s.jsx)(I,{className:"sticky top-0 bg-background z-10 border-b shadow-sm h-10",children:"Hook ID"}),(0,s.jsx)(I,{className:"sticky top-0 bg-background z-10 border-b shadow-sm h-10",children:"Run ID"}),(0,s.jsx)(I,{className:"sticky top-0 bg-background z-10 border-b shadow-sm h-10",children:"Token"}),(0,s.jsx)(I,{className:"sticky top-0 bg-background z-10 border-b shadow-sm h-10",children:"Created"}),(0,s.jsx)(I,{className:"sticky top-0 bg-background z-10 border-b shadow-sm h-10",children:"Invocations"}),(0,s.jsx)(I,{className:"sticky top-0 bg-background z-10 border-b shadow-sm h-10 w-10"})]})}),(0,s.jsx)(R,{children:K.map(e=>(0,s.jsxs)(T,{className:"cursor-pointer group relative",onClick:()=>a(e.hookId,e.runId),"data-selected":e.hookId===i,children:[(0,s.jsx)(D,{className:"font-mono text-xs py-2",children:(0,s.jsx)(P.CopyableText,{text:e.hookId,overlay:!0,children:e.hookId})}),(0,s.jsx)(D,{className:"font-mono text-xs py-2",children:(0,s.jsx)(P.CopyableText,{text:e.runId,overlay:!0,children:e.runId})}),(0,s.jsx)(D,{className:"font-mono text-xs py-2",children:(0,s.jsx)(P.CopyableText,{text:e.token,overlay:!0,children:(0,s.jsx)("span",{className:"text-muted-foreground",children:"••••••••••••"})})}),(0,s.jsx)(D,{className:"py-2 text-muted-foreground text-xs",children:e.createdAt?(0,s.jsx)(E.RelativeTime,{date:e.createdAt}):"-"}),(0,s.jsx)(D,{className:"py-2",children:(e=>{let t=Z.get(e.hookId);if(!t||t.loading)return(0,s.jsx)("span",{className:"text-muted-foreground text-xs",children:"..."});if(t.count instanceof Error)return(0,s.jsx)("span",{className:"text-muted-foreground",children:"Error"});if(0===t.count)return(0,s.jsx)("span",{className:"text-muted-foreground",children:"0"});let a=t.hasMore?`${t.count}+`:`${t.count}`;return t.hasMore?(0,s.jsxs)(M.Tooltip,{children:[(0,s.jsx)(M.TooltipTrigger,{asChild:!0,children:(0,s.jsx)("span",{className:"font-semibold cursor-help",children:a})}),(0,s.jsx)(M.TooltipContent,{className:"max-w-xs",children:(0,s.jsx)("div",{className:"text-xs",children:"Showing first 100 invocations. There may be more."})})]}):(0,s.jsx)("span",{className:"font-semibold",children:a})})(e)}),(0,s.jsx)(D,{className:"py-2",children:(0,s.jsxs)(y.DropdownMenu,{children:[(0,s.jsx)(y.DropdownMenuTrigger,{asChild:!0,children:(0,s.jsx)(j.Button,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:e=>e.stopPropagation(),children:(0,s.jsx)(u.MoreHorizontal,{className:"h-4 w-4"})})}),(0,s.jsxs)(y.DropdownMenuContent,{align:"end",children:[(0,s.jsx)(o.ResolveHookDropdownItem,{hook:e,stopPropagation:!0,onResolveClick:V.openResolveModal,DropdownMenuItem:y.DropdownMenuItem}),(0,s.jsxs)(y.DropdownMenuItem,{onClick:async s=>{s.stopPropagation();try{let s=await (0,r.recreateRun)(_,e.runId);p.toast.success("New run started",{description:`Run ID: ${s}`}),L()}catch(e){p.toast.error("Failed to re-run",{description:e instanceof Error?e.message:"Unknown error"})}},children:[(0,s.jsx)(m.RotateCw,{className:"h-4 w-4 mr-2"}),"Replay Run"]}),(0,s.jsxs)(y.DropdownMenuItem,{onClick:async s=>{s.stopPropagation();try{await (0,r.cancelRun)(_,e.runId),p.toast.success("Run cancelled"),L()}catch(e){p.toast.error("Failed to cancel",{description:e instanceof Error?e.message:"Unknown error"})}},children:[(0,s.jsx)(x.XCircle,{className:"h-4 w-4 mr-2"}),"Cancel"]})]})]})})]},e.hookId))})]})})}),(0,s.jsxs)("div",{className:"flex items-center justify-between mt-4",children:[(0,s.jsx)("div",{className:"text-sm text-muted-foreground",children:U}),(0,s.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,s.jsxs)(j.Button,{variant:"outline",size:"sm",onClick:B,disabled:!$,children:[(0,s.jsx)(d,{}),"Previous"]}),(0,s.jsxs)(j.Button,{variant:"outline",size:"sm",onClick:W,disabled:!H,children:["Next",(0,s.jsx)(c.ChevronRight,{})]})]})]})]}):(0,s.jsxs)("div",{className:"text-center py-8 text-muted-foreground",children:["No active hooks found. ",(0,s.jsx)("br",{}),(0,s.jsx)(v,{href:"https://useworkflow.dev/docs/api-reference/workflow/create-hook",children:"Learn how to create a hook"})]})]})}var O=e.i(360088),W=e.i(914666),B=e.i(187152);let H=(0,i.default)("ArrowDownAZ",[["path",{d:"m3 16 4 4 4-4",key:"1co6wj"}],["path",{d:"M7 20V4",key:"1yoxec"}],["path",{d:"M20 8h-5",key:"1vsyxs"}],["path",{d:"M15 10V6.5a2.5 2.5 0 0 1 5 0V10",key:"ag13bf"}],["path",{d:"M15 14h5l-5 6h5",key:"ur5jdg"}]]),$=(0,i.default)("ArrowUpAZ",[["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}],["path",{d:"M20 8h-5",key:"1vsyxs"}],["path",{d:"M15 10V6.5a2.5 2.5 0 0 1 5 0V10",key:"ag13bf"}],["path",{d:"M15 14h5l-5 6h5",key:"ur5jdg"}]]);var L=e.i(346131),U=e.i(218264),V=e.i(451675),G=e.i(708341);function K({env:e,runId:t,runStatus:a,onSuccess:r,showDebugActions:o}){let[l,n]=(0,f.useState)(void 0),[i,d]=(0,f.useState)(!0),[c,u]=(0,f.useState)(void 0),h=c?.status||a;return(0,f.useEffect)(()=>{d(!0),Promise.all([(0,B.fetchRun)(e,t,"none"),(0,W.fetchEvents)(e,t,{limit:1e3,sortOrder:"desc"})]).then(([e,s])=>{e.success&&u(e.data),s.success&&n(s.data.data)}).catch(e=>{console.error("Failed to fetch run or events:",e)}).finally(()=>{d(!1)})},[e,t]),(0,s.jsx)(G.RunActionsDropdownItems,{env:e,runId:t,runStatus:h,events:l,eventsLoading:i,stopPropagation:!0,callbacks:{onSuccess:r},showDebugActions:o})}function Z({env:e,runId:t,runStatus:a,onSuccess:r,showDebugActions:o}){let[l,n]=(0,f.useState)(!1);return(0,s.jsxs)(y.DropdownMenu,{open:l,onOpenChange:n,children:[(0,s.jsx)(y.DropdownMenuTrigger,{asChild:!0,children:(0,s.jsx)(j.Button,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:e=>e.stopPropagation(),children:(0,s.jsx)(u.MoreHorizontal,{className:"h-4 w-4"})})}),l&&(0,s.jsx)(y.DropdownMenuContent,{align:"end",children:(0,s.jsx)(K,{env:e,runId:t,runStatus:a,onSuccess:r,showDebugActions:o})})]})}let q={pending:{label:"Pending",color:"bg-neutral-600 dark:bg-neutral-400"},running:{label:"Running",color:"bg-blue-600 dark:bg-blue-400"},completed:{label:"Completed",color:"bg-green-600 dark:bg-green-400"},failed:{label:"Failed",color:"bg-red-600 dark:bg-red-400"},paused:{label:"Paused",color:"bg-yellow-600 dark:bg-yellow-400"},cancelled:{label:"Cancelled",color:"bg-gray-600 dark:bg-gray-400"}};function Q({workflowNameFilter:e,status:t,seenWorkflowNames:a,sortOrder:r,loading:o,statusFilterRequiresWorkflowNameFilter:l,onWorkflowChange:n,onStatusChange:i,onSortToggle:d,onRefresh:c,lastRefreshTime:u}){return(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("div",{className:"flex items-end gap-2",children:[(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:"Last refreshed"}),u&&(0,s.jsx)(E.RelativeTime,{date:u,className:"text-sm text-muted-foreground",type:"distance"})]}),(0,s.jsxs)("div",{className:"flex items-center gap-4",children:[(0,s.jsxs)(L.Select,{value:e??"all",onValueChange:n,disabled:o,children:[(0,s.jsx)(L.SelectTrigger,{className:"w-[180px] h-9",children:(0,s.jsx)(L.SelectValue,{placeholder:"Filter by workflow"})}),(0,s.jsxs)(L.SelectContent,{children:[(0,s.jsx)(L.SelectItem,{value:"all",children:"All Workflows"}),Array.from(a).sort().map(e=>(0,s.jsx)(L.SelectItem,{value:e,children:(0,O.parseWorkflowName)(e)?.shortName||e},e))]})]}),(0,s.jsxs)(M.Tooltip,{children:[(0,s.jsx)(M.TooltipTrigger,{asChild:!0,children:(0,s.jsx)("div",{children:(0,s.jsxs)(L.Select,{value:t||"all",onValueChange:i,disabled:o||l&&!e,children:[(0,s.jsx)(L.SelectTrigger,{className:"w-[140px] h-9",children:(0,s.jsx)(L.SelectValue,{placeholder:"Filter by status"})}),(0,s.jsxs)(L.SelectContent,{children:[(0,s.jsx)(L.SelectItem,{value:"all",children:"Any status"}),Object.entries(q).map(([e,{label:t,color:a}])=>(0,s.jsx)(L.SelectItem,{value:e,children:(0,s.jsxs)("div",{className:"flex items-center",children:[(0,s.jsx)("span",{className:`${a} size-1.5 rounded-full mr-2`}),t]})},e))]})]})})}),(0,s.jsx)(M.TooltipContent,{children:l&&"all"===e?"Select a workflow first to filter by status":"Filter runs by status"})]}),(0,s.jsxs)(M.Tooltip,{children:[(0,s.jsx)(M.TooltipTrigger,{asChild:!0,children:(0,s.jsxs)(j.Button,{variant:"outline",size:"sm",onClick:d,disabled:o,children:["desc"===r?(0,s.jsx)(H,{className:"h-4 w-4"}):(0,s.jsx)($,{className:"h-4 w-4"}),"desc"===r?"Newest":"Oldest"]})}),(0,s.jsx)(M.TooltipContent,{children:"desc"===r?"Showing newest first":"Showing oldest first"})]}),(0,s.jsxs)(M.Tooltip,{children:[(0,s.jsx)(M.TooltipTrigger,{asChild:!0,children:(0,s.jsxs)(j.Button,{variant:"outline",size:"sm",onClick:c,disabled:o,children:[(0,s.jsx)(h,{className:o?"animate-spin":""}),"Refresh"]})}),(0,s.jsx)(M.TooltipContent,{children:"Note that this resets pages"})]})]})]})}function X({config:e,onRunClick:t}){let o,l,i,u,h,m,x=(0,a.useSearchParams)(),p=(o=(0,a.useRouter)(),l=(0,a.usePathname)(),i=(0,a.useSearchParams)(),(0,f.useCallback)(e=>{let s=new URLSearchParams(i.toString());"all"===e?(s.delete("workflow"),s.delete("status")):s.set("workflow",e),o.push(`${l}?${s.toString()}`)},[o,l,i])),w=(u=(0,a.useRouter)(),h=(0,a.usePathname)(),m=(0,a.useSearchParams)(),(0,f.useCallback)(e=>{let s=new URLSearchParams(m.toString());"all"===e?s.delete("status"):s.set("status",e),u.push(`${h}?${s.toString()}`)},[u,h,m])),N=x.get("status"),v=Object.keys(q),y="all"===N||N&&v.includes(N)?N:void 0,M=x.get("workflow"),_="1"===x.get("debug"),[z,W]=(0,f.useState)("desc"),[B,H]=(0,f.useState)(()=>new Date),$=(0,f.useMemo)(()=>(0,A.worldConfigToEnvMap)(e),[e]),L="local"===e.backend||!e.backend,{data:G,isLoading:K}=(0,U.useDataDirInfo)(e.dataDir),X=e.backend?.includes("vercel")||!1,[J,Y]=(0,f.useState)(new Set),{data:ee,error:es,nextPage:et,previousPage:ea,hasNextPage:er,hasPreviousPage:eo,reload:el,pageInfo:en}=(0,r.useWorkflowRuns)($,{sortOrder:z,workflowName:"all"===M?void 0:M,status:"all"===y?void 0:y}),ei=L&&(!G?.dataDir||!ee?.data?.length)&&!K;(0,f.useEffect)(()=>{if(ee.data&&ee.data.length>0){let e=new Set(ee.data.map(e=>e.workflowName));Y(s=>{let t=new Set(s);for(let s of e)t.add(s);return t})}},[ee.data]);let ed=ee.isLoading,ec=(0,f.useCallback)(()=>{H(()=>new Date),el()},[el]);(0,f.useEffect)(()=>{if(ei){let e=setInterval(()=>{ec()},3e3);return()=>clearInterval(e)}},[ei,ec]);let eu=(0,s.jsx)("code",{className:"font-mono",children:G?.shortName||"current directory"});return(0,s.jsxs)("div",{children:[(0,s.jsx)(Q,{workflowNameFilter:M,status:y,seenWorkflowNames:J,sortOrder:z,loading:ed,statusFilterRequiresWorkflowNameFilter:X,onWorkflowChange:p,onStatusChange:w,onSortToggle:()=>{W(e=>"desc"===e?"asc":"desc")},onRefresh:ec,lastRefreshTime:B}),es?(0,s.jsxs)(g.Alert,{variant:"destructive",children:[(0,s.jsx)(n.AlertCircle,{className:"h-4 w-4"}),(0,s.jsx)(g.AlertTitle,{children:"Error loading runs"}),(0,s.jsx)(g.AlertDescription,{children:(0,r.getErrorMessage)(es)})]}):ed&&!ee?.data?(0,s.jsx)(F,{}):ed||ee.data&&0!==ee.data.length?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(b,{className:"overflow-hidden mt-4 bg-background",children:(0,s.jsx)(k,{className:"p-0 max-h-[calc(100vh-280px)] overflow-auto",children:(0,s.jsxs)(C,{children:[(0,s.jsx)(S,{children:(0,s.jsxs)(T,{children:[(0,s.jsx)(I,{className:"sticky top-0 bg-background z-10 border-b shadow-sm h-10",children:"Workflow"}),(0,s.jsx)(I,{className:"sticky top-0 bg-background z-10 border-b shadow-sm h-10",children:"Run ID"}),(0,s.jsx)(I,{className:"sticky top-0 bg-background z-10 border-b shadow-sm h-10",children:"Status"}),(0,s.jsx)(I,{className:"sticky top-0 bg-background z-10 border-b shadow-sm h-10",children:"Started"}),(0,s.jsx)(I,{className:"sticky top-0 bg-background z-10 border-b shadow-sm h-10",children:"Completed"}),(0,s.jsx)(I,{className:"sticky top-0 bg-background z-10 border-b shadow-sm h-10 w-10"})]})}),(0,s.jsx)(R,{children:ee.data?.map(e=>(0,s.jsxs)(T,{className:"cursor-pointer group relative",onClick:()=>t(e.runId),children:[(0,s.jsx)(D,{className:"py-2",children:(0,s.jsx)(P.CopyableText,{text:e.workflowName,overlay:!0,children:(0,O.parseWorkflowName)(e.workflowName)?.shortName||"?"})}),(0,s.jsx)(D,{className:"font-mono text-xs py-2",children:(0,s.jsx)(P.CopyableText,{text:e.runId,overlay:!0,children:e.runId})}),(0,s.jsx)(D,{className:"py-2",children:(0,s.jsx)(V.StatusBadge,{status:e.status,context:e,durationMs:e.startedAt?(e.completedAt?new Date(e.completedAt).getTime():Date.now())-new Date(e.startedAt).getTime():void 0})}),(0,s.jsx)(D,{className:"py-2 text-muted-foreground text-xs",children:e.startedAt?(0,s.jsx)(E.RelativeTime,{date:e.startedAt}):"-"}),(0,s.jsx)(D,{className:"py-2 text-muted-foreground text-xs",children:e.completedAt?(0,s.jsx)(E.RelativeTime,{date:e.completedAt}):"-"}),(0,s.jsx)(D,{className:"py-2",children:(0,s.jsx)(Z,{env:$,runId:e.runId,runStatus:e.status,onSuccess:ec,showDebugActions:_})})]},e.runId))})]})})}),(0,s.jsxs)("div",{className:"flex items-center justify-between mt-4",children:[(0,s.jsx)("div",{className:"text-sm text-muted-foreground",children:en}),(0,s.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,s.jsxs)(j.Button,{variant:"outline",size:"sm",onClick:ea,disabled:!eo,children:[(0,s.jsx)(d,{}),"Previous"]}),(0,s.jsxs)(j.Button,{variant:"outline",size:"sm",onClick:et,disabled:!er,children:["Next",(0,s.jsx)(c.ChevronRight,{})]})]})]})]}):(0,s.jsxs)("div",{className:"text-sm text-center py-8 text-muted-foreground flex flex-col items-center justify-center gap-3",children:[(0,s.jsxs)("span",{className:"text-sm",children:["No workflow runs found",ei?(0,s.jsxs)(s.Fragment,{children:[" in ",eu]}):"","."]}),ei&&(0,s.jsx)("span",{className:"text-sm flex items-center gap-2",children:"This view will update once you run a workflow."})]})]})}var J=e.i(889840),Y=e.i(400138);let ee=(0,i.default)("Workflow",[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]]);var es=e.i(93698),et=e.i(562918),ea=e.i(291967),er=e.i(221588),eo=e.i(810096),el=e.i(244107),en=e.i(802313),ei=e.i(975287),ed=e.i(376268),ec=e.i(153840),eu=e.i(110515),eh=e.i(692792),em=e.i(345594),ex=e.i(891246),ef=e.i(73772),ep=e.i(545136),eg="Dialog",[ej,ew]=(0,eo.createContextScope)(eg),[eb,ek]=ej(eg),eN=e=>{let{__scopeDialog:t,children:a,open:r,defaultOpen:o,onOpenChange:l,modal:n=!0}=e,i=f.useRef(null),d=f.useRef(null),[c,u]=(0,en.useControllableState)({prop:r,defaultProp:o??!1,onChange:l,caller:eg});return(0,s.jsx)(eb,{scope:t,triggerRef:i,contentRef:d,contentId:(0,el.useId)(),titleId:(0,el.useId)(),descriptionId:(0,el.useId)(),open:c,onOpenChange:u,onOpenToggle:f.useCallback(()=>u(e=>!e),[u]),modal:n,children:a})};eN.displayName=eg;var ev="DialogTrigger";f.forwardRef((e,t)=>{let{__scopeDialog:a,...r}=e,o=ek(ev,a),l=(0,er.useComposedRefs)(t,o.triggerRef);return(0,s.jsx)(eh.Primitive.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":eL(o.open),...r,ref:l,onClick:(0,ea.composeEventHandlers)(e.onClick,o.onOpenToggle)})}).displayName=ev;var ey="DialogPortal",[eC,eS]=ej(ey,{forceMount:void 0}),eR=e=>{let{__scopeDialog:t,forceMount:a,children:r,container:o}=e,l=ek(ey,t);return(0,s.jsx)(eC,{scope:t,forceMount:a,children:f.Children.map(r,e=>(0,s.jsx)(eu.Presence,{present:a||l.open,children:(0,s.jsx)(ec.Portal,{asChild:!0,container:o,children:e})}))})};eR.displayName=ey;var eT="DialogOverlay",eI=f.forwardRef((e,t)=>{let a=eS(eT,e.__scopeDialog),{forceMount:r=a.forceMount,...o}=e,l=ek(eT,e.__scopeDialog);return l.modal?(0,s.jsx)(eu.Presence,{present:r||l.open,children:(0,s.jsx)(eM,{...o,ref:t})}):null});eI.displayName=eT;var eD=(0,ep.createSlot)("DialogOverlay.RemoveScroll"),eM=f.forwardRef((e,t)=>{let{__scopeDialog:a,...r}=e,o=ek(eT,a);return(0,s.jsx)(ex.RemoveScroll,{as:eD,allowPinchZoom:!0,shards:[o.contentRef],children:(0,s.jsx)(eh.Primitive.div,{"data-state":eL(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),eA="DialogContent",eP=f.forwardRef((e,t)=>{let a=eS(eA,e.__scopeDialog),{forceMount:r=a.forceMount,...o}=e,l=ek(eA,e.__scopeDialog);return(0,s.jsx)(eu.Presence,{present:r||l.open,children:l.modal?(0,s.jsx)(eE,{...o,ref:t}):(0,s.jsx)(e_,{...o,ref:t})})});eP.displayName=eA;var eE=f.forwardRef((e,t)=>{let a=ek(eA,e.__scopeDialog),r=f.useRef(null),o=(0,er.useComposedRefs)(t,a.contentRef,r);return f.useEffect(()=>{let e=r.current;if(e)return(0,ef.hideOthers)(e)},[]),(0,s.jsx)(eF,{...e,ref:o,trapFocus:a.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:(0,ea.composeEventHandlers)(e.onCloseAutoFocus,e=>{e.preventDefault(),a.triggerRef.current?.focus()}),onPointerDownOutside:(0,ea.composeEventHandlers)(e.onPointerDownOutside,e=>{let s=e.detail.originalEvent,t=0===s.button&&!0===s.ctrlKey;(2===s.button||t)&&e.preventDefault()}),onFocusOutside:(0,ea.composeEventHandlers)(e.onFocusOutside,e=>e.preventDefault())})}),e_=f.forwardRef((e,t)=>{let a=ek(eA,e.__scopeDialog),r=f.useRef(!1),o=f.useRef(!1);return(0,s.jsx)(eF,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{e.onCloseAutoFocus?.(s),s.defaultPrevented||(r.current||a.triggerRef.current?.focus(),s.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:s=>{e.onInteractOutside?.(s),s.defaultPrevented||(r.current=!0,"pointerdown"===s.detail.originalEvent.type&&(o.current=!0));let t=s.target;a.triggerRef.current?.contains(t)&&s.preventDefault(),"focusin"===s.detail.originalEvent.type&&o.current&&s.preventDefault()}})}),eF=f.forwardRef((e,t)=>{let{__scopeDialog:a,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:l,...n}=e,i=ek(eA,a),d=f.useRef(null),c=(0,er.useComposedRefs)(t,d);return(0,em.useFocusGuards)(),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(ed.FocusScope,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:l,children:(0,s.jsx)(ei.DismissableLayer,{role:"dialog",id:i.contentId,"aria-describedby":i.descriptionId,"aria-labelledby":i.titleId,"data-state":eL(i.open),...n,ref:c,onDismiss:()=>i.onOpenChange(!1)})}),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(eK,{titleId:i.titleId}),(0,s.jsx)(eZ,{contentRef:d,descriptionId:i.descriptionId})]})]})}),ez="DialogTitle",eO=f.forwardRef((e,t)=>{let{__scopeDialog:a,...r}=e,o=ek(ez,a);return(0,s.jsx)(eh.Primitive.h2,{id:o.titleId,...r,ref:t})});eO.displayName=ez;var eW="DialogDescription",eB=f.forwardRef((e,t)=>{let{__scopeDialog:a,...r}=e,o=ek(eW,a);return(0,s.jsx)(eh.Primitive.p,{id:o.descriptionId,...r,ref:t})});eB.displayName=eW;var eH="DialogClose",e$=f.forwardRef((e,t)=>{let{__scopeDialog:a,...r}=e,o=ek(eH,a);return(0,s.jsx)(eh.Primitive.button,{type:"button",...r,ref:t,onClick:(0,ea.composeEventHandlers)(e.onClick,()=>o.onOpenChange(!1))})});function eL(e){return e?"open":"closed"}e$.displayName=eH;var eU="DialogTitleWarning",[eV,eG]=(0,eo.createContext)(eU,{contentName:eA,titleName:ez,docsSlug:"dialog"}),eK=({titleId:e})=>{let s=eG(eU),t=`\`${s.contentName}\` requires a \`${s.titleName}\` for the component to be accessible for screen reader users.
|
|
2
|
+
|
|
3
|
+
If you want to hide the \`${s.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
4
|
+
|
|
5
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${s.docsSlug}`;return f.useEffect(()=>{e&&(document.getElementById(e)||console.error(t))},[t,e]),null},eZ=({contentRef:e,descriptionId:s})=>{let t=eG("DialogDescriptionWarning"),a=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${t.contentName}}.`;return f.useEffect(()=>{let t=e.current?.getAttribute("aria-describedby");s&&t&&(document.getElementById(s)||console.warn(a))},[a,e,s]),null},eq=e.i(897884),eq=eq;function eQ({...e}){return(0,s.jsx)(eN,{"data-slot":"sheet",...e})}function eX({...e}){return(0,s.jsx)(eR,{"data-slot":"sheet-portal",...e})}function eJ({className:e,...t}){return(0,s.jsx)(eI,{"data-slot":"sheet-overlay",className:(0,w.cn)("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...t})}function eY({className:e,children:t,side:a="right",...r}){return(0,s.jsxs)(eX,{children:[(0,s.jsx)(eJ,{}),(0,s.jsxs)(eP,{"data-slot":"sheet-content",className:(0,w.cn)("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500","right"===a&&"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm","left"===a&&"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm","top"===a&&"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b","bottom"===a&&"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",e),...r,children:[t,(0,s.jsxs)(e$,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none",children:[(0,s.jsx)(eq.default,{className:"size-4"}),(0,s.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})}function e0({className:e,...t}){return(0,s.jsx)("div",{"data-slot":"sheet-header",className:(0,w.cn)("flex flex-col gap-1.5 p-4",e),...t})}function e1({className:e,...t}){return(0,s.jsx)(eO,{"data-slot":"sheet-title",className:(0,w.cn)("text-foreground font-semibold",e),...t})}function e4({className:e,...t}){return(0,s.jsx)(eB,{"data-slot":"sheet-description",className:(0,w.cn)("text-muted-foreground text-sm",e),...t})}var e2=e.i(479823);function e5({config:e,onWorkflowSelect:t}){let[a,r]=(0,f.useState)(!1),[o,l]=(0,f.useState)(null),{manifest:i,loading:d,error:c}=(0,e2.useWorkflowGraphManifest)(e),u=i?Object.values(i.workflows):[],h=(0,f.useMemo)(()=>[...u].sort((e,s)=>e.workflowName.localeCompare(s.workflowName)),[u]);return d?(0,s.jsx)(F,{variant:"workflows",rows:6}):c?(0,s.jsxs)(g.Alert,{variant:"destructive",children:[(0,s.jsx)(n.AlertCircle,{className:"h-4 w-4"}),(0,s.jsx)(g.AlertTitle,{children:"Error Loading Workflows"}),(0,s.jsx)(g.AlertDescription,{children:c.message})]}):0===u.length?(0,s.jsx)(b,{children:(0,s.jsxs)(k,{className:"p-12 text-center",children:[(0,s.jsx)(ee,{className:"mx-auto h-12 w-12 text-muted-foreground mb-4"}),(0,s.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"No Workflows Found"}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:"No workflow definitions were found in the graph manifest."})]})}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(b,{className:"overflow-hidden bg-background",children:(0,s.jsx)(k,{className:"p-0 max-h-[calc(100vh-200px)] overflow-auto",children:(0,s.jsxs)(C,{children:[(0,s.jsx)(S,{children:(0,s.jsxs)(T,{children:[(0,s.jsx)(I,{className:"sticky top-0 bg-background z-10 border-b shadow-sm h-10",children:"Workflow"}),(0,s.jsx)(I,{className:"sticky top-0 bg-background z-10 border-b shadow-sm h-10",children:"File"}),(0,s.jsx)(I,{className:"text-center sticky top-0 bg-background z-10 border-b shadow-sm h-10",children:"Steps"})]})}),(0,s.jsx)(R,{children:h.map(e=>{let a=e.nodes.filter(e=>"step"===e.data.nodeKind).length;return(0,s.jsxs)(T,{className:"cursor-pointer",onClick:()=>{l(e),r(!0),t?.(e.workflowName)},children:[(0,s.jsx)(D,{className:"py-2",children:(0,s.jsx)("span",{className:"font-medium",children:e.workflowName})}),(0,s.jsx)(D,{className:"py-2",children:(0,s.jsx)("code",{className:"text-xs text-muted-foreground",children:e.filePath})}),(0,s.jsx)(D,{className:"text-center py-2",children:(0,s.jsxs)(et.Badge,{variant:"secondary",className:"gap-1",children:[(0,s.jsx)(Y.GitBranch,{className:"h-3 w-3"}),a," ",1===a?"step":"steps"]})})]},e.workflowId)})})]})})}),(0,s.jsx)(eQ,{open:a,onOpenChange:r,children:(0,s.jsxs)(eY,{side:"right",className:"w-[75vw] max-w-[75vw] sm:max-w-[75vw]",children:[(0,s.jsxs)(e0,{children:[(0,s.jsxs)(e1,{className:"flex items-center gap-2",children:[(0,s.jsx)(ee,{className:"h-5 w-5"}),o?.workflowName]}),o&&(0,s.jsx)(e4,{asChild:!0,children:(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("code",{className:"text-xs",children:o.filePath}),(0,s.jsx)("div",{children:(0,s.jsxs)(et.Badge,{variant:"outline",className:"gap-1",children:[(0,s.jsx)(Y.GitBranch,{className:"h-3 w-3"}),o.nodes.filter(e=>"step"===e.data.nodeKind).length," ",1===o.nodes.filter(e=>"step"===e.data.nodeKind).length?"step":"steps"]})})]})})]}),(0,s.jsx)("div",{className:"mt-6 h-[calc(100vh-180px)]",children:o&&(0,s.jsx)(es.WorkflowGraphViewer,{workflow:o})})]})})]})}var e6=e.i(480462);function e3(){let e=(0,a.useRouter)(),r=(0,A.useQueryParamConfig)(),[o]=(0,e6.useSidebarState)(),[l]=(0,e6.useHookIdState)(),[n,i]=(0,e6.useTabState)(),d="local"===r.backend;return(0,s.jsx)("div",{className:"max-w-7xl mx-auto px-4",children:(0,s.jsxs)(J.Tabs,{value:n,onValueChange:i,className:"w-full",children:[(0,s.jsxs)(J.TabsList,{className:"mb-4",children:[(0,s.jsx)(J.TabsTrigger,{value:"runs",children:"Runs"}),(0,s.jsx)(J.TabsTrigger,{value:"hooks",children:"Hooks"}),d&&(0,s.jsx)(J.TabsTrigger,{value:"workflows",children:"Workflows"})]}),(0,s.jsx)(J.TabsContent,{value:"runs",children:(0,s.jsx)(t.ErrorBoundary,{title:"Runs Error",description:"Failed to load workflow runs. Please try refreshing the page.",children:(0,s.jsx)(X,{config:r,onRunClick:(s,t)=>{t?e.push((0,A.buildUrlWithConfig)(`/run/${s}/streams/${t}`,r)):e.push((0,A.buildUrlWithConfig)(`/run/${s}`,r))}})})}),(0,s.jsx)(J.TabsContent,{value:"hooks",children:(0,s.jsx)(t.ErrorBoundary,{title:"Hooks Error",description:"Failed to load hooks. Please try refreshing the page.",children:(0,s.jsx)(z,{config:r,onHookClick:(s,t)=>{s?e.push((0,A.buildUrlWithConfig)(`/run/${t}`,r,{sidebar:"hook",hookId:s})):e.push((0,A.buildUrlWithConfig)(`/run/${t}`,r))},selectedHookId:"hook"===o&&l?l:void 0})})}),d&&(0,s.jsx)(J.TabsContent,{value:"workflows",children:(0,s.jsx)(t.ErrorBoundary,{title:"Workflows Error",description:"Failed to load workflow graph data. Please try refreshing the page.",children:(0,s.jsx)(e5,{config:r})})})]})})}e.s(["default",()=>e3],330997)}]);
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,51379,e=>{"use strict";function t(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var r=t(),s={exec:()=>null};function n(e,t=""){let r="string"==typeof e?e:e.source,s={replace:(e,t)=>{let n="string"==typeof t?t:t.source;return n=n.replace(l.caret,"$1"),r=r.replace(e,n),s},getRegex:()=>new RegExp(r,t)};return s}var l={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i")},i=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,a=/(?:[*+-]|\d{1,9}[.)])/,o=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,c=n(o).replace(/bull/g,a).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),h=n(o).replace(/bull/g,a).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),u=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,p=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,d=n(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",p).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),g=n(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,a).getRegex(),f="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|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",m=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,k=n("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",m).replace("tag",f).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),x=n(u).replace("hr",i).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",f).getRegex(),b={blockquote:n(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",x).getRegex(),code:/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,def:d,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,hr:i,html:k,lheading:c,list:g,newline:/^(?:[ \t]*(?:\n|$))+/,paragraph:x,table:s,text:/^[^\n]+/},w=n("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",i).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",f).getRegex(),y={...b,lheading:h,table:w,paragraph:n(u).replace("hr",i).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",w).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",f).getRegex()},v={...b,html:n(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",m).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:s,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:n(u).replace("hr",i).replace("heading",` *#{1,6} *[^
|
|
2
|
+
]`).replace("lheading",c).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},j=/^( {2,}|\\)\n(?!\s*$)/,S=/[\p{P}\p{S}]/u,C=/[\s\p{P}\p{S}]/u,$=/[^\s\p{P}\p{S}]/u,T=n(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,C).getRegex(),R=/(?!~)[\p{P}\p{S}]/u,N=n(/link|code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<!`)(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("code",/(?<!`)(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),L=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,A=n(L,"u").replace(/punct/g,S).getRegex(),z=n(L,"u").replace(/punct/g,R).getRegex(),P="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",I=n(P,"gu").replace(/notPunctSpace/g,$).replace(/punctSpace/g,C).replace(/punct/g,S).getRegex(),_=n(P,"gu").replace(/notPunctSpace/g,/(?:[^\s\p{P}\p{S}]|~)/u).replace(/punctSpace/g,/(?!~)[\s\p{P}\p{S}]/u).replace(/punct/g,R).getRegex(),E=n("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,$).replace(/punctSpace/g,C).replace(/punct/g,S).getRegex(),M=n(/\\(punct)/,"gu").replace(/punct/g,S).getRegex(),q=n(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),H=n(m).replace("(?:-->|$)","-->").getRegex(),D=n("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",H).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),B=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,V=n(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",B).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Z=n(/^!?\[(label)\]\[(ref)\]/).replace("label",B).replace("ref",p).getRegex(),U=n(/^!?\[(ref)\](?:\[\])?/).replace("ref",p).getRegex(),O=n("reflink|nolink(?!\\()","g").replace("reflink",Z).replace("nolink",U).getRegex(),F=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,W={_backpedal:s,anyPunctuation:M,autolink:q,blockSkip:N,br:j,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,del:s,emStrongLDelim:A,emStrongRDelimAst:I,emStrongRDelimUnd:E,escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,link:V,nolink:U,punctuation:T,reflink:Z,reflinkSearch:O,tag:D,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,url:s},Q={...W,link:n(/^!?\[(label)\]\((.*?)\)/).replace("label",B).getRegex(),reflink:n(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",B).getRegex()},G={...W,emStrongRDelimAst:_,emStrongLDelim:z,url:n(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",F).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:n(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",F).getRegex()},K={...G,br:n(j).replace("{2,}","*").getRegex(),text:n(G.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},X={normal:b,gfm:y,pedantic:v},J={normal:W,gfm:G,breaks:K,pedantic:Q},Y={"&":"&","<":"<",">":">",'"':""","'":"'"},ee=e=>Y[e];function et(e,t){if(t){if(l.escapeTest.test(e))return e.replace(l.escapeReplace,ee)}else if(l.escapeTestNoEncode.test(e))return e.replace(l.escapeReplaceNoEncode,ee);return e}function er(e){try{e=encodeURI(e).replace(l.percentDecode,"%")}catch{return null}return e}function es(e,t){let r=e.replace(l.findPipe,(e,t,r)=>{let s=!1,n=t;for(;--n>=0&&"\\"===r[n];)s=!s;return s?"|":" |"}).split(l.splitPipe),s=0;if(r[0].trim()||r.shift(),r.length>0&&!r.at(-1)?.trim()&&r.pop(),t)if(r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;s<r.length;s++)r[s]=r[s].trim().replace(l.slashPipe,"|");return r}function en(e,t,r){let s=e.length;if(0===s)return"";let n=0;for(;n<s;){let l=e.charAt(s-n-1);if(l!==t||r)if(l!==t&&r)n++;else break;else n++}return e.slice(0,s-n)}function el(e,t,r,s,n){let l=t.href,i=t.title||null,a=e[1].replace(n.other.outputLinkReplace,"$1");s.state.inLink=!0;let o={type:"!"===e[0].charAt(0)?"image":"link",raw:r,href:l,title:i,text:a,tokens:s.inlineTokens(a)};return s.state.inLink=!1,o}var ei=class{options;rules;lexer;constructor(e){this.options=e||r}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:en(e,`
|
|
3
|
+
`)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],r=function(e,t,r){let s=e.match(r.other.indentCodeCompensation);if(null===s)return t;let n=s[1];return t.split(`
|
|
4
|
+
`).map(e=>{let t=e.match(r.other.beginningSpace);if(null===t)return e;let[s]=t;return s.length>=n.length?e.slice(n.length):e}).join(`
|
|
5
|
+
`)}(e,t[3]||"",this.rules);return{type:"code",raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:r}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let t=en(e,"#");(this.options.pedantic||!t||this.rules.other.endingSpaceChar.test(t))&&(e=t.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:en(t[0],`
|
|
6
|
+
`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=en(t[0],`
|
|
7
|
+
`).split(`
|
|
8
|
+
`),r="",s="",n=[];for(;e.length>0;){let t=!1,l=[],i;for(i=0;i<e.length;i++)if(this.rules.other.blockquoteStart.test(e[i]))l.push(e[i]),t=!0;else if(t)break;else l.push(e[i]);e=e.slice(i);let a=l.join(`
|
|
9
|
+
`),o=a.replace(this.rules.other.blockquoteSetextReplace,`
|
|
10
|
+
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");r=r?`${r}
|
|
11
|
+
${a}`:a,s=s?`${s}
|
|
12
|
+
${o}`:o;let c=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(o,n,!0),this.lexer.state.top=c,0===e.length)break;let h=n.at(-1);if(h?.type==="code")break;if(h?.type==="blockquote"){let t=h.raw+`
|
|
13
|
+
`+e.join(`
|
|
14
|
+
`),l=this.blockquote(t);n[n.length-1]=l,r=r.substring(0,r.length-h.raw.length)+l.raw,s=s.substring(0,s.length-h.text.length)+l.text;break}if(h?.type==="list"){let t=h.raw+`
|
|
15
|
+
`+e.join(`
|
|
16
|
+
`),l=this.list(t);n[n.length-1]=l,r=r.substring(0,r.length-h.raw.length)+l.raw,s=s.substring(0,s.length-h.raw.length)+l.raw,e=t.substring(n.at(-1).raw.length).split(`
|
|
17
|
+
`);continue}}return{type:"blockquote",raw:r,tokens:n,text:s}}}list(e){let t=this.rules.block.list.exec(e);if(t){let r=t[1].trim(),s=r.length>1,n={type:"list",raw:"",ordered:s,start:s?+r.slice(0,-1):"",loose:!1,items:[]};r=s?`\\d{1,9}\\${r.slice(-1)}`:`\\${r}`,this.options.pedantic&&(r=s?r:"[*+-]");let l=this.rules.other.listItemRegex(r),i=!1;for(;e;){let r=!1,s="",a="";if(!(t=l.exec(e))||this.rules.block.hr.test(e))break;s=t[0],e=e.substring(s.length);let o=t[2].split(`
|
|
18
|
+
`,1)[0].replace(this.rules.other.listReplaceTabs,e=>" ".repeat(3*e.length)),c=e.split(`
|
|
19
|
+
`,1)[0],h=!o.trim(),u=0;if(this.options.pedantic?(u=2,a=o.trimStart()):h?u=t[1].length+1:(u=(u=t[2].search(this.rules.other.nonSpaceChar))>4?1:u,a=o.slice(u),u+=t[1].length),h&&this.rules.other.blankLine.test(c)&&(s+=c+`
|
|
20
|
+
`,e=e.substring(c.length+1),r=!0),!r){let t=this.rules.other.nextBulletRegex(u),r=this.rules.other.hrRegex(u),n=this.rules.other.fencesBeginRegex(u),l=this.rules.other.headingBeginRegex(u),i=this.rules.other.htmlBeginRegex(u);for(;e;){let p=e.split(`
|
|
21
|
+
`,1)[0],d;if(c=p,d=this.options.pedantic?c=c.replace(this.rules.other.listReplaceNesting," "):c.replace(this.rules.other.tabCharGlobal," "),n.test(c)||l.test(c)||i.test(c)||t.test(c)||r.test(c))break;if(d.search(this.rules.other.nonSpaceChar)>=u||!c.trim())a+=`
|
|
22
|
+
`+d.slice(u);else{if(h||o.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||n.test(o)||l.test(o)||r.test(o))break;a+=`
|
|
23
|
+
`+c}h||c.trim()||(h=!0),s+=p+`
|
|
24
|
+
`,e=e.substring(p.length+1),o=d.slice(u)}}n.loose||(i?n.loose=!0:this.rules.other.doubleBlankLine.test(s)&&(i=!0));let p=null,d;this.options.gfm&&(p=this.rules.other.listIsTask.exec(a))&&(d="[ ] "!==p[0],a=a.replace(this.rules.other.listReplaceTask,"")),n.items.push({type:"list_item",raw:s,task:!!p,checked:d,loose:!1,text:a,tokens:[]}),n.raw+=s}let a=n.items.at(-1);if(!a)return;a.raw=a.raw.trimEnd(),a.text=a.text.trimEnd(),n.raw=n.raw.trimEnd();for(let e=0;e<n.items.length;e++)if(this.lexer.state.top=!1,n.items[e].tokens=this.lexer.blockTokens(n.items[e].text,[]),!n.loose){let t=n.items[e].tokens.filter(e=>"space"===e.type);n.loose=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw))}if(n.loose)for(let e=0;e<n.items.length;e++)n.items[e].loose=!0;return n}}html(e){let t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:"pre"===t[1]||"script"===t[1]||"style"===t[1],text:t[0]}}def(e){let t=this.rules.block.def.exec(e);if(t){let e=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),r=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",s=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:e,raw:t[0],href:r,title:s}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let r=es(t[1]),s=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),n=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
25
|
+
`):[],l={type:"table",raw:t[0],header:[],align:[],rows:[]};if(r.length===s.length){for(let e of s)this.rules.other.tableAlignRight.test(e)?l.align.push("right"):this.rules.other.tableAlignCenter.test(e)?l.align.push("center"):this.rules.other.tableAlignLeft.test(e)?l.align.push("left"):l.align.push(null);for(let e=0;e<r.length;e++)l.header.push({text:r[e],tokens:this.lexer.inline(r[e]),header:!0,align:l.align[e]});for(let e of n)l.rows.push(es(e,l.header.length).map((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:l.align[t]})));return l}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:"="===t[2].charAt(0)?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let e=t[1].charAt(t[1].length-1)===`
|
|
26
|
+
`?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let e=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(e)){if(!this.rules.other.endAngleBracket.test(e))return;let t=en(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{let e=function(e,t){if(-1===e.indexOf(")"))return -1;let r=0;for(let t=0;t<e.length;t++)if("\\"===e[t])t++;else if("("===e[t])r++;else if(")"===e[t]&&--r<0)return t;return r>0?-2:-1}(t[2],0);if(-2===e)return;if(e>-1){let r=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,r).trim(),t[3]=""}}let r=t[2],s="";if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(r);e&&(r=e[1],s=e[3])}else s=t[3]?t[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(r=this.options.pedantic&&!this.rules.other.endAngleBracket.test(e)?r.slice(1):r.slice(1,-1)),el(t,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:s&&s.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let r;if((r=this.rules.inline.reflink.exec(e))||(r=this.rules.inline.nolink.exec(e))){let e=t[(r[2]||r[1]).replace(this.rules.other.multipleSpaceGlobal," ").toLowerCase()];if(!e){let e=r[0].charAt(0);return{type:"text",raw:e,text:e}}return el(r,e,r[0],this.lexer,this.rules)}}emStrong(e,t,r=""){let s=this.rules.inline.emStrongLDelim.exec(e);if(!(!s||s[3]&&r.match(this.rules.other.unicodeAlphaNumeric))&&(!(s[1]||s[2])||!r||this.rules.inline.punctuation.exec(r))){let r=[...s[0]].length-1,n,l,i=r,a=0,o="*"===s[0][0]?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(o.lastIndex=0,t=t.slice(-1*e.length+r);null!=(s=o.exec(t));){if(!(n=s[1]||s[2]||s[3]||s[4]||s[5]||s[6]))continue;if(l=[...n].length,s[3]||s[4]){i+=l;continue}if((s[5]||s[6])&&r%3&&!((r+l)%3)){a+=l;continue}if((i-=l)>0)continue;l=Math.min(l,l+i+a);let t=[...s[0]][0].length,o=e.slice(0,r+s.index+t+l);if(Math.min(r,l)%2){let e=o.slice(1,-1);return{type:"em",raw:o,text:e,tokens:this.lexer.inlineTokens(e)}}let c=o.slice(2,-2);return{type:"strong",raw:o,text:c,tokens:this.lexer.inlineTokens(c)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal," "),r=this.rules.other.nonSpaceChar.test(e),s=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return r&&s&&(e=e.substring(1,e.length-1)),{type:"codespan",raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){let t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let e,r;return r="@"===t[2]?"mailto:"+(e=t[1]):e=t[1],{type:"link",raw:t[0],text:e,href:r,tokens:[{type:"text",raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,r;if("@"===t[2])r="mailto:"+(e=t[0]);else{let s;do s=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??"";while(s!==t[0])e=t[0],r="www."===t[1]?"http://"+t[0]:t[0]}return{type:"link",raw:t[0],text:e,href:r,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:e}}}},ea=class e{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||r,this.options.tokenizer=this.options.tokenizer||new ei,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let t={other:l,block:X.normal,inline:J.normal};this.options.pedantic?(t.block=X.pedantic,t.inline=J.pedantic):this.options.gfm&&(t.block=X.gfm,this.options.breaks?t.inline=J.breaks:t.inline=J.gfm),this.tokenizer.rules=t}static get rules(){return{block:X,inline:J}}static lex(t,r){return new e(r).lex(t)}static lexInline(t,r){return new e(r).inlineTokens(t)}lex(e){e=e.replace(l.carriageReturn,`
|
|
27
|
+
`),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],r=!1){for(this.options.pedantic&&(e=e.replace(l.tabCharGlobal," ").replace(l.spaceLine,""));e;){let s;if(this.options.extensions?.block?.some(r=>!!(s=r.call({lexer:this},e,t))&&(e=e.substring(s.raw.length),t.push(s),!0)))continue;if(s=this.tokenizer.space(e)){e=e.substring(s.raw.length);let r=t.at(-1);1===s.raw.length&&void 0!==r?r.raw+=`
|
|
28
|
+
`:t.push(s);continue}if(s=this.tokenizer.code(e)){e=e.substring(s.raw.length);let r=t.at(-1);r?.type==="paragraph"||r?.type==="text"?(r.raw+=(r.raw.endsWith(`
|
|
29
|
+
`)?"":`
|
|
30
|
+
`)+s.raw,r.text+=`
|
|
31
|
+
`+s.text,this.inlineQueue.at(-1).src=r.text):t.push(s);continue}if((s=this.tokenizer.fences(e))||(s=this.tokenizer.heading(e))||(s=this.tokenizer.hr(e))||(s=this.tokenizer.blockquote(e))||(s=this.tokenizer.list(e))||(s=this.tokenizer.html(e))){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.def(e)){e=e.substring(s.raw.length);let r=t.at(-1);r?.type==="paragraph"||r?.type==="text"?(r.raw+=(r.raw.endsWith(`
|
|
32
|
+
`)?"":`
|
|
33
|
+
`)+s.raw,r.text+=`
|
|
34
|
+
`+s.raw,this.inlineQueue.at(-1).src=r.text):this.tokens.links[s.tag]||(this.tokens.links[s.tag]={href:s.href,title:s.title},t.push(s));continue}if((s=this.tokenizer.table(e))||(s=this.tokenizer.lheading(e))){e=e.substring(s.raw.length),t.push(s);continue}let n=e;if(this.options.extensions?.startBlock){let t=1/0,r=e.slice(1),s;this.options.extensions.startBlock.forEach(e=>{"number"==typeof(s=e.call({lexer:this},r))&&s>=0&&(t=Math.min(t,s))}),t<1/0&&t>=0&&(n=e.substring(0,t+1))}if(this.state.top&&(s=this.tokenizer.paragraph(n))){let l=t.at(-1);r&&l?.type==="paragraph"?(l.raw+=(l.raw.endsWith(`
|
|
35
|
+
`)?"":`
|
|
36
|
+
`)+s.raw,l.text+=`
|
|
37
|
+
`+s.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=l.text):t.push(s),r=n.length!==e.length,e=e.substring(s.raw.length);continue}if(s=this.tokenizer.text(e)){e=e.substring(s.raw.length);let r=t.at(-1);r?.type==="text"?(r.raw+=(r.raw.endsWith(`
|
|
38
|
+
`)?"":`
|
|
39
|
+
`)+s.raw,r.text+=`
|
|
40
|
+
`+s.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=r.text):t.push(s);continue}if(e){let t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let r=e,s=null;if(this.tokens.links){let e=Object.keys(this.tokens.links);if(e.length>0)for(;null!=(s=this.tokenizer.rules.inline.reflinkSearch.exec(r));)e.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(s=this.tokenizer.rules.inline.anyPunctuation.exec(r));)r=r.slice(0,s.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;null!=(s=this.tokenizer.rules.inline.blockSkip.exec(r));)r=r.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);r=this.options.hooks?.emStrongMask?.call({lexer:this},r)??r;let n=!1,l="";for(;e;){let s;if(n||(l=""),n=!1,this.options.extensions?.inline?.some(r=>!!(s=r.call({lexer:this},e,t))&&(e=e.substring(s.raw.length),t.push(s),!0)))continue;if((s=this.tokenizer.escape(e))||(s=this.tokenizer.tag(e))||(s=this.tokenizer.link(e))){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(s.raw.length);let r=t.at(-1);"text"===s.type&&r?.type==="text"?(r.raw+=s.raw,r.text+=s.text):t.push(s);continue}if((s=this.tokenizer.emStrong(e,r,l))||(s=this.tokenizer.codespan(e))||(s=this.tokenizer.br(e))||(s=this.tokenizer.del(e))||(s=this.tokenizer.autolink(e))||!this.state.inLink&&(s=this.tokenizer.url(e))){e=e.substring(s.raw.length),t.push(s);continue}let i=e;if(this.options.extensions?.startInline){let t=1/0,r=e.slice(1),s;this.options.extensions.startInline.forEach(e=>{"number"==typeof(s=e.call({lexer:this},r))&&s>=0&&(t=Math.min(t,s))}),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(s=this.tokenizer.inlineText(i)){e=e.substring(s.raw.length),"_"!==s.raw.slice(-1)&&(l=s.raw.slice(-1)),n=!0;let r=t.at(-1);r?.type==="text"?(r.raw+=s.raw,r.text+=s.text):t.push(s);continue}if(e){let t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw Error(t)}}return t}},eo=class{options;parser;constructor(e){this.options=e||r}space(e){return""}code({text:e,lang:t,escaped:r}){let s=(t||"").match(l.notSpaceStart)?.[0],n=e.replace(l.endingNewline,"")+`
|
|
41
|
+
`;return s?'<pre><code class="language-'+et(s)+'">'+(r?n:et(n,!0))+`</code></pre>
|
|
42
|
+
`:"<pre><code>"+(r?n:et(n,!0))+`</code></pre>
|
|
43
|
+
`}blockquote({tokens:e}){return`<blockquote>
|
|
44
|
+
${this.parser.parse(e)}</blockquote>
|
|
45
|
+
`}html({text:e}){return e}def(e){return""}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
|
|
46
|
+
`}hr(e){return`<hr>
|
|
47
|
+
`}list(e){let t=e.ordered,r=e.start,s="";for(let t=0;t<e.items.length;t++){let r=e.items[t];s+=this.listitem(r)}let n=t?"ol":"ul";return"<"+n+(t&&1!==r?' start="'+r+'"':"")+`>
|
|
48
|
+
`+s+"</"+n+`>
|
|
49
|
+
`}listitem(e){let t="";if(e.task){let r=this.checkbox({checked:!!e.checked});e.loose?e.tokens[0]?.type==="paragraph"?(e.tokens[0].text=r+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&"text"===e.tokens[0].tokens[0].type&&(e.tokens[0].tokens[0].text=r+" "+et(e.tokens[0].tokens[0].text),e.tokens[0].tokens[0].escaped=!0)):e.tokens.unshift({type:"text",raw:r+" ",text:r+" ",escaped:!0}):t+=r+" "}return t+=this.parser.parse(e.tokens,!!e.loose),`<li>${t}</li>
|
|
50
|
+
`}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
|
|
51
|
+
`}table(e){let t="",r="";for(let t=0;t<e.header.length;t++)r+=this.tablecell(e.header[t]);t+=this.tablerow({text:r});let s="";for(let t=0;t<e.rows.length;t++){let n=e.rows[t];r="";for(let e=0;e<n.length;e++)r+=this.tablecell(n[e]);s+=this.tablerow({text:r})}return s&&(s=`<tbody>${s}</tbody>`),`<table>
|
|
52
|
+
<thead>
|
|
53
|
+
`+t+`</thead>
|
|
54
|
+
`+s+`</table>
|
|
55
|
+
`}tablerow({text:e}){return`<tr>
|
|
56
|
+
${e}</tr>
|
|
57
|
+
`}tablecell(e){let t=this.parser.parseInline(e.tokens),r=e.header?"th":"td";return(e.align?`<${r} align="${e.align}">`:`<${r}>`)+t+`</${r}>
|
|
58
|
+
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${et(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:r}){let s=this.parser.parseInline(r),n=er(e);if(null===n)return s;let l='<a href="'+(e=n)+'"';return t&&(l+=' title="'+et(t)+'"'),l+=">"+s+"</a>"}image({href:e,title:t,text:r,tokens:s}){s&&(r=this.parser.parseInline(s,this.parser.textRenderer));let n=er(e);if(null===n)return et(r);e=n;let l=`<img src="${e}" alt="${r}"`;return t&&(l+=` title="${et(t)}"`),l+=">"}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:et(e.text)}},ec=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}},eh=class e{options;renderer;textRenderer;constructor(e){this.options=e||r,this.options.renderer=this.options.renderer||new eo,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new ec}static parse(t,r){return new e(r).parse(t)}static parseInline(t,r){return new e(r).parseInline(t)}parse(e,t=!0){let r="";for(let s=0;s<e.length;s++){let n=e[s];if(this.options.extensions?.renderers?.[n.type]){let e=this.options.extensions.renderers[n.type].call({parser:this},n);if(!1!==e||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(n.type)){r+=e||"";continue}}switch(n.type){case"space":r+=this.renderer.space(n);continue;case"hr":r+=this.renderer.hr(n);continue;case"heading":r+=this.renderer.heading(n);continue;case"code":r+=this.renderer.code(n);continue;case"table":r+=this.renderer.table(n);continue;case"blockquote":r+=this.renderer.blockquote(n);continue;case"list":r+=this.renderer.list(n);continue;case"html":r+=this.renderer.html(n);continue;case"def":r+=this.renderer.def(n);continue;case"paragraph":r+=this.renderer.paragraph(n);continue;case"text":{let l=n,i=this.renderer.text(l);for(;s+1<e.length&&"text"===e[s+1].type;)l=e[++s],i+=`
|
|
59
|
+
`+this.renderer.text(l);t?r+=this.renderer.paragraph({type:"paragraph",raw:i,text:i,tokens:[{type:"text",raw:i,text:i,escaped:!0}]}):r+=i;continue}default:{let e='Token with "'+n.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw Error(e)}}}return r}parseInline(e,t=this.renderer){let r="";for(let s=0;s<e.length;s++){let n=e[s];if(this.options.extensions?.renderers?.[n.type]){let e=this.options.extensions.renderers[n.type].call({parser:this},n);if(!1!==e||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(n.type)){r+=e||"";continue}}switch(n.type){case"escape":case"text":r+=t.text(n);break;case"html":r+=t.html(n);break;case"link":r+=t.link(n);break;case"image":r+=t.image(n);break;case"strong":r+=t.strong(n);break;case"em":r+=t.em(n);break;case"codespan":r+=t.codespan(n);break;case"br":r+=t.br(n);break;case"del":r+=t.del(n);break;default:{let e='Token with "'+n.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw Error(e)}}}return r}},eu=class{options;block;constructor(e){this.options=e||r}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(){return this.block?ea.lex:ea.lexInline}provideParser(){return this.block?eh.parse:eh.parseInline}},ep=new class{defaults=t();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=eh;Renderer=eo;TextRenderer=ec;Lexer=ea;Tokenizer=ei;Hooks=eu;constructor(...e){this.use(...e)}walkTokens(e,t){let r=[];for(let s of e)switch(r=r.concat(t.call(this,s)),s.type){case"table":for(let e of s.header)r=r.concat(this.walkTokens(e.tokens,t));for(let e of s.rows)for(let s of e)r=r.concat(this.walkTokens(s.tokens,t));break;case"list":r=r.concat(this.walkTokens(s.items,t));break;default:{let e=s;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(s=>{let n=e[s].flat(1/0);r=r.concat(this.walkTokens(n,t))}):e.tokens&&(r=r.concat(this.walkTokens(e.tokens,t)))}}return r}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let r={...e};if(r.async=this.defaults.async||r.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error("extension name required");if("renderer"in e){let r=t.renderers[e.name];r?t.renderers[e.name]=function(...t){let s=e.renderer.apply(this,t);return!1===s&&(s=r.apply(this,t)),s}:t.renderers[e.name]=e.renderer}if("tokenizer"in e){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw Error("extension level must be 'block' or 'inline'");let r=t[e.level];r?r.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&("block"===e.level?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:"inline"===e.level&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}"childTokens"in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),r.extensions=t),e.renderer){let t=this.defaults.renderer||new eo(this.defaults);for(let r in e.renderer){if(!(r in t))throw Error(`renderer '${r}' does not exist`);if(["options","parser"].includes(r))continue;let s=e.renderer[r],n=t[r];t[r]=(...e)=>{let r=s.apply(t,e);return!1===r&&(r=n.apply(t,e)),r||""}}r.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new ei(this.defaults);for(let r in e.tokenizer){if(!(r in t))throw Error(`tokenizer '${r}' does not exist`);if(["options","rules","lexer"].includes(r))continue;let s=e.tokenizer[r],n=t[r];t[r]=(...e)=>{let r=s.apply(t,e);return!1===r&&(r=n.apply(t,e)),r}}r.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new eu;for(let r in e.hooks){if(!(r in t))throw Error(`hook '${r}' does not exist`);if(["options","block"].includes(r))continue;let s=e.hooks[r],n=t[r];eu.passThroughHooks.has(r)?t[r]=e=>{if(this.defaults.async&&eu.passThroughHooksRespectAsync.has(r))return(async()=>{let r=await s.call(t,e);return n.call(t,r)})();let l=s.call(t,e);return n.call(t,l)}:t[r]=(...e)=>{if(this.defaults.async)return(async()=>{let r=await s.apply(t,e);return!1===r&&(r=await n.apply(t,e)),r})();let r=s.apply(t,e);return!1===r&&(r=n.apply(t,e)),r}}r.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,s=e.walkTokens;r.walkTokens=function(e){let r=[];return r.push(s.call(this,e)),t&&(r=r.concat(t.call(this,e))),r}}this.defaults={...this.defaults,...r}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return ea.lex(e,t??this.defaults)}parser(e,t){return eh.parse(e,t??this.defaults)}parseMarkdown(e){return(t,r)=>{let s={...r},n={...this.defaults,...s},l=this.onError(!!n.silent,!!n.async);if(!0===this.defaults.async&&!1===s.async)return l(Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof t>"u"||null===t)return l(Error("marked(): input parameter is undefined or null"));if("string"!=typeof t)return l(Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));if(n.hooks&&(n.hooks.options=n,n.hooks.block=e),n.async)return(async()=>{let r=n.hooks?await n.hooks.preprocess(t):t,s=await (n.hooks?await n.hooks.provideLexer():e?ea.lex:ea.lexInline)(r,n),l=n.hooks?await n.hooks.processAllTokens(s):s;n.walkTokens&&await Promise.all(this.walkTokens(l,n.walkTokens));let i=await (n.hooks?await n.hooks.provideParser():e?eh.parse:eh.parseInline)(l,n);return n.hooks?await n.hooks.postprocess(i):i})().catch(l);try{n.hooks&&(t=n.hooks.preprocess(t));let r=(n.hooks?n.hooks.provideLexer():e?ea.lex:ea.lexInline)(t,n);n.hooks&&(r=n.hooks.processAllTokens(r)),n.walkTokens&&this.walkTokens(r,n.walkTokens);let s=(n.hooks?n.hooks.provideParser():e?eh.parse:eh.parseInline)(r,n);return n.hooks&&(s=n.hooks.postprocess(s)),s}catch(e){return l(e)}}}onError(e,t){return r=>{if(r.message+=`
|
|
60
|
+
Please report this to https://github.com/markedjs/marked.`,e){let e="<p>An error occurred:</p><pre>"+et(r.message+"",!0)+"</pre>";return t?Promise.resolve(e):e}if(t)return Promise.reject(r);throw r}}};function ed(e,t){return ep.parse(e,t)}ed.options=ed.setOptions=function(e){return ep.setOptions(e),ed.defaults=ep.defaults,r=ed.defaults,ed},ed.getDefaults=t,ed.defaults=r,ed.use=function(...e){return ep.use(...e),ed.defaults=ep.defaults,r=ed.defaults,ed},ed.walkTokens=function(e,t){return ep.walkTokens(e,t)},ed.parseInline=ep.parseInline,ed.Parser=eh,ed.parser=eh.parse,ed.Renderer=eo,ed.TextRenderer=ec,ed.Lexer=ea,ed.lexer=ea.lex,ed.Tokenizer=ei,ed.Hooks=eu,ed.parse=ed,ed.options,ed.setOptions,ed.use,ed.walkTokens,ed.parseInline,eh.parse,ea.lex,e.s(["Lexer",()=>ea,"marked",()=>ed])},170349,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"warnOnce",{enumerable:!0,get:function(){return s}});let s=e=>{}},809737,e=>{e.v("/_next/static/media/worker.e575ad4f.js")},693144,e=>{"use strict";var t=e.i(349011),r=e.i(610062);function s(){(0,t.c)("[nuqs] Aborting queues"),r.t.abortAll(),r.n.abort().forEach(e=>r.t.queuedQuerySync.emit(e))}var n=e.i(686107),l=e.i(868924);let i=0;function a(){i=0,s()}function o(){--i<=0&&(i=0,queueMicrotask(s))}function c(){return(0,n.useEffect)(()=>(!function(){var e;if(e="next/app","undefined"==typeof history||(history.nuqs?.version&&"2.8.3"!==history.nuqs.version?(console.error((0,t.s)(409),history.nuqs.version,"2.8.3",e),!0):!!history.nuqs?.adapters?.includes(e)))return;let r=history.replaceState,s=history.pushState;history.replaceState=function(e,t,s){return o(),r.call(history,e,t,s)},history.pushState=function(e,t,r){return o(),s.call(history,e,t,r)},history.nuqs=history.nuqs??{version:"2.8.3",adapters:[]},history.nuqs.adapters.push("next/app")}(),window.addEventListener("popstate",a),()=>window.removeEventListener("popstate",a)),[]),null}let h=(0,t.n)(function(){let e=(0,l.useRouter)(),[r,s]=(0,n.useOptimistic)((0,l.useSearchParams)());return{searchParams:r,updateUrl:(0,n.useCallback)((r,l)=>{(0,n.startTransition)(()=>{l.shallow||s(r);let n=function(e){let{origin:r,pathname:s,hash:n}=location;return r+s+(0,t.o)(e)+n}(r);(0,t.c)("[nuqs next/app] Updating url: %s",n);let a="push"===l.history?history.pushState:history.replaceState;i=3,a.call(history,null,"",n),l.scroll&&window.scrollTo(0,0),l.shallow||e.replace(n,{scroll:!1})})},[]),rateLimitFactor:3,autoResetQueueOnUpdate:!1}});function u({children:e,...t}){return(0,n.createElement)(h,{...t,children:[(0,n.createElement)(n.Suspense,{key:"nuqs-adapter-suspense-navspy",children:(0,n.createElement)(c)}),e]})}e.s(["NuqsAdapter",()=>u],693144)},608576,e=>{"use strict";var t=e.i(666426),r=e.i(912738),s=e.i(414576),n=e.i(868924),l=e.i(686107),i=(e,t,r,s,n,l,i,a)=>{let o=document.documentElement,c=["light","dark"];function h(t){var r;(Array.isArray(e)?e:[e]).forEach(e=>{let r="class"===e,s=r&&l?n.map(e=>l[e]||e):n;r?(o.classList.remove(...s),o.classList.add(l&&l[t]?l[t]:t)):o.setAttribute(e,t)}),r=t,a&&c.includes(r)&&(o.style.colorScheme=r)}if(s)h(s);else try{let e=localStorage.getItem(t)||r,s=i&&"system"===e?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e;h(s)}catch(e){}},a=["light","dark"],o="(prefers-color-scheme: dark)",c="undefined"==typeof window,h=l.createContext(void 0),u={setTheme:e=>{},themes:[]},p=()=>{var e;return null!=(e=l.useContext(h))?e:u},d=e=>l.useContext(h)?l.createElement(l.Fragment,null,e.children):l.createElement(f,{...e}),g=["light","dark"],f=({forcedTheme:e,disableTransitionOnChange:t=!1,enableSystem:r=!0,enableColorScheme:s=!0,storageKey:n="theme",themes:i=g,defaultTheme:c=r?"system":"light",attribute:u="data-theme",value:p,children:d,nonce:f,scriptProps:w})=>{let[y,v]=l.useState(()=>k(n,c)),[j,S]=l.useState(()=>"system"===y?b():y),C=p?Object.values(p):i,$=l.useCallback(e=>{let n=e;if(!n)return;"system"===e&&r&&(n=b());let l=p?p[n]:n,i=t?x(f):null,o=document.documentElement,h=e=>{"class"===e?(o.classList.remove(...C),l&&o.classList.add(l)):e.startsWith("data-")&&(l?o.setAttribute(e,l):o.removeAttribute(e))};if(Array.isArray(u)?u.forEach(h):h(u),s){let e=a.includes(c)?c:null,t=a.includes(n)?n:e;o.style.colorScheme=t}null==i||i()},[f]),T=l.useCallback(e=>{let t="function"==typeof e?e(y):e;v(t);try{localStorage.setItem(n,t)}catch(e){}},[y]),R=l.useCallback(t=>{S(b(t)),"system"===y&&r&&!e&&$("system")},[y,e]);l.useEffect(()=>{let e=window.matchMedia(o);return e.addListener(R),R(e),()=>e.removeListener(R)},[R]),l.useEffect(()=>{let e=e=>{e.key===n&&(e.newValue?v(e.newValue):T(c))};return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)},[T]),l.useEffect(()=>{$(null!=e?e:y)},[e,y]);let N=l.useMemo(()=>({theme:y,setTheme:T,forcedTheme:e,resolvedTheme:"system"===y?j:y,themes:r?[...i,"system"]:i,systemTheme:r?j:void 0}),[y,T,e,j,r,i]);return l.createElement(h.Provider,{value:N},l.createElement(m,{forcedTheme:e,storageKey:n,attribute:u,enableSystem:r,enableColorScheme:s,defaultTheme:c,value:p,themes:i,nonce:f,scriptProps:w}),d)},m=l.memo(({forcedTheme:e,storageKey:t,attribute:r,enableSystem:s,enableColorScheme:n,defaultTheme:a,value:o,themes:c,nonce:h,scriptProps:u})=>{let p=JSON.stringify([r,t,a,e,c,o,s,n]).slice(1,-1);return l.createElement("script",{...u,suppressHydrationWarning:!0,nonce:"undefined"==typeof window?h:"",dangerouslySetInnerHTML:{__html:`(${i.toString()})(${p})`}})}),k=(e,t)=>{let r;if(!c){try{r=localStorage.getItem(e)||void 0}catch(e){}return r||t}},x=e=>{let t=document.createElement("style");return e&&t.setAttribute("nonce",e),t.appendChild(document.createTextNode("*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(t),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(t)},1)}},b=e=>(e||(e=window.matchMedia(o)),e.matches?"dark":"light"),w=e.i(886288);let y=(0,w.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"}]]);var v=e.i(638322),j=e.i(218264);function S({config:e}){let r=e.backend||"local",{data:s}=(0,j.useDataDirInfo)(e.dataDir),{provider:n,parts:l}=((e,t,r)=>{if("vercel"===e){let e=[];return t.env&&e.push(`env: ${t.env}`),t.project&&e.push(`project: ${t.project}`),t.team&&e.push(`team: ${t.team}`),{provider:"Vercel",parts:e}}if("local"===e){let e=[];return r?.projectDir&&e.push(`project: ${r.projectDir}`),t.port&&e.push(`port: ${t.port}`),{provider:"Local",parts:e}}return{provider:t.backend||"unknown",parts:[]}})(r,e,s),i="local"===r?s?.shortName:"vercel"===r?e.env:void 0;return(0,t.jsxs)("div",{className:"text-sm text-muted-foreground flex items-center gap-2",children:[(0,t.jsxs)("span",{className:"font-medium",children:["Connected to: ",n," ",i?`(${i})`:""]}),(0,t.jsxs)(v.Tooltip,{children:[(0,t.jsx)(v.TooltipTrigger,{asChild:!0,children:(0,t.jsx)(y,{className:"w-4 h-4"})}),(0,t.jsx)(v.TooltipContent,{children:(0,t.jsx)("div",{className:"flex flex-col gap-1",children:l.map(e=>(0,t.jsx)("span",{children:e},e))})})]})]})}let C=(0,w.default)("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]),$=(0,w.default)("Monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]),T=(0,w.default)("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]),R=(0,w.default)("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]),N=(0,w.default)("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);var L=e.i(260218),A=e.i(917955),z=e.i(949245);function P({value:e,onValueChange:r,options:s,className:n}){return(0,t.jsx)("div",{className:(0,z.cn)("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",n),children:s.map(s=>(0,t.jsxs)("button",{type:"button",onClick:()=>r(s.value),className:(0,z.cn)("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",e===s.value?"bg-background text-foreground shadow":"hover:bg-background/50"),children:[s.icon,s.label&&(0,t.jsx)("span",{className:"ml-2",children:s.label})]},s.value))})}var I=e.i(687602);let _=(0,w.default)("TriangleAlert",[["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 E=e.i(259280),M=e.i(456944);let q=l.forwardRef(({className:e,type:r,...s},n)=>(0,t.jsx)("input",{type:r,className:(0,z.cn)("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:n,...s}));q.displayName="Input";var H=e.i(692792),D=l.forwardRef((e,r)=>(0,t.jsx)(H.Primitive.label,{...e,ref:r,onMouseDown:t=>{t.target.closest("button, input, select, textarea")||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));D.displayName="Label";let B=(0,e.i(294237).cva)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),V=l.forwardRef(({className:e,...r},s)=>(0,t.jsx)(D,{ref:s,className:(0,z.cn)(B(),e),...r}));V.displayName=D.displayName;var Z=e.i(346131),U=e.i(620486),O=e.i(202311),F=(0,O.createServerReference)("40e5e1cbe91f1381c4884c3567fdbb2dd0015727c2",O.callServer,void 0,O.findSourceMapURL,"validateWorldConfig");function W({open:e,onOpenChange:r}={}){let s,n=(0,U.useQueryParamConfig)(),i=(0,U.useUpdateConfigQueryParams)(),[a,o]=(0,l.useState)(!1),c=r||o,[h,u]=(0,l.useState)(n),[p,d]=(0,l.useState)([]),[g,f]=(0,l.useState)(!1),{data:m=[],isLoading:k}=(0,j.useWorldsAvailability)(),{data:x}=(0,j.useDataDirInfo)(h.dataDir),b=h.backend||"local",w="local"===b,y="postgres"===b;(0,l.useEffect)(()=>{u(n)},[n]);let v=async()=>{f(!0);try{let e=await F(h);d(e),0===e.length&&(i(h),c(!1))}catch(e){console.error("Validation error:",e),d([{field:"general",message:e instanceof Error?e.message:"Unknown error"}])}finally{f(!1)}},S=(e,t)=>{u(r=>({...r,[e]:t})),d(t=>t.filter(t=>t.field!==e))},C=e=>p.find(t=>t.field===e)?.message,$=JSON.stringify(h)!==JSON.stringify(n)||p.length>0;return(0,t.jsxs)(t.Fragment,{children:[void 0===e&&(0,t.jsx)("button",{type:"button",onClick:()=>c(!0),className:"p-2 rounded-full hover:bg-accent transition-colors",title:"Configuration",children:(0,t.jsx)(R,{className:"h-6 w-6"})}),(void 0!==e?e:a)&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("button",{type:"button",className:"fixed inset-0 bg-black/50 z-40 cursor-default",onClick:()=>c(!1),"aria-label":"Close configuration panel"}),(0,t.jsx)("div",{className:"fixed top-0 right-0 h-full w-96 bg-background border-l shadow-lg z-50 overflow-y-auto",children:(0,t.jsxs)("div",{className:"p-6",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-6",children:[(0,t.jsx)("h2",{className:"text-2xl font-bold",children:"Configuration"}),(0,t.jsx)(L.Button,{type:"button",onClick:()=>c(!1),variant:"outline",size:"icon",children:(0,t.jsx)(E.X,{className:"h-5 w-5"})})]}),(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(V,{htmlFor:"backend",children:"Backend"}),(0,t.jsxs)(Z.Select,{value:h.backend||"local",onValueChange:e=>S("backend",e),children:[(0,t.jsx)(Z.SelectTrigger,{id:"backend",children:(0,t.jsx)(Z.SelectValue,{placeholder:"Select backend"})}),(0,t.jsx)(Z.SelectContent,{children:k?(0,t.jsx)(Z.SelectItem,{value:"loading",disabled:!0,children:"Loading worlds..."}):m.length>0?m.map(e=>(0,t.jsx)(Z.SelectItem,{value:e.id,children:e.displayName},e.id)):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(Z.SelectItem,{value:"local",children:"Local"}),(0,t.jsx)(Z.SelectItem,{value:"vercel",children:"Vercel"}),(0,t.jsx)(Z.SelectItem,{value:"postgres",children:"PostgreSQL"})]})})]}),(s=m.find(e=>e.id===b))&&!s.isInstalled?(0,t.jsxs)("div",{className:"flex items-start gap-2 p-2 rounded-md bg-amber-500/10 border border-amber-500/20 text-amber-600 dark:text-amber-400",children:[(0,t.jsx)(_,{className:"h-4 w-4 mt-0.5 shrink-0"}),(0,t.jsxs)("div",{className:"text-xs",children:[(0,t.jsx)("p",{className:"font-medium",children:"Package not installed"}),(0,t.jsxs)("p",{className:"mt-1 text-muted-foreground",children:["Run:"," ",(0,t.jsx)("code",{className:"bg-muted px-1 py-0.5 rounded",children:s.installCommand})]})]})]}):null]}),w&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(V,{htmlFor:"port",children:"Port"}),(0,t.jsx)(q,{id:"port",value:h.port||"",onChange:e=>S("port",e.target.value),placeholder:"3001",className:C("port")?"border-destructive":""}),C("port")&&(0,t.jsx)("p",{className:"text-sm text-destructive break-words",children:C("port")})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(V,{htmlFor:"dataDir",children:"Data Directory"}),(0,t.jsx)(q,{id:"dataDir",value:h.dataDir||"",onChange:e=>S("dataDir",e.target.value),placeholder:"Path to your project directory",className:C("dataDir")?"border-destructive":""}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Path to your project or its workflow data directory. Relative paths allowed. Leave empty to search current directory."})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(V,{htmlFor:"manifestPath",children:"Manifest Path"}),(0,t.jsx)(q,{id:"manifestPath",value:h.manifestPath||"",onChange:e=>S("manifestPath",e.target.value),placeholder:"app/.well-known/workflow/v1/manifest.json",className:C("manifestPath")?"border-destructive":""}),C("manifestPath")&&(0,t.jsx)("p",{className:"text-sm text-destructive break-words",children:C("manifestPath")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Path to the workflow manifest file. Leave empty to use default locations."})]})]}),y&&(0,t.jsx)(t.Fragment,{children:(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(V,{htmlFor:"postgresUrl",children:"Connection URL"}),(0,t.jsx)(q,{id:"postgresUrl",value:h.postgresUrl||"",onChange:e=>S("postgresUrl",e.target.value),placeholder:"postgres://user:pass@host:5432/db",className:C("postgresUrl")?"border-destructive":""}),C("postgresUrl")&&(0,t.jsx)("p",{className:"text-sm text-destructive",children:C("postgresUrl")})]})}),!w&&!y&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(V,{htmlFor:"env",children:"Environment"}),(0,t.jsx)(q,{id:"env",value:h.env||"production",onChange:e=>S("env",e.target.value),placeholder:"production or preview"})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(V,{htmlFor:"authToken",children:"Auth Token"}),(0,t.jsx)(q,{id:"authToken",type:"password",value:h.authToken||"",onChange:e=>S("authToken",e.target.value),placeholder:"Vercel auth token"})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(V,{htmlFor:"project",children:"Project ID"}),(0,t.jsx)(q,{id:"project",value:h.project||"",onChange:e=>S("project",e.target.value),placeholder:"prj_..."})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(V,{htmlFor:"team",children:"Team ID"}),(0,t.jsx)(q,{id:"team",value:h.team||"",onChange:e=>S("team",e.target.value),placeholder:"team_..."})]})]}),p.length>0&&(0,t.jsxs)(M.Alert,{variant:"destructive",className:"!bg-destructive/10 !border-destructive",children:[(0,t.jsx)(I.AlertCircle,{className:"h-4 w-4"}),(0,t.jsx)(M.AlertTitle,{children:"Configuration Error"}),(0,t.jsx)(M.AlertDescription,{children:(0,t.jsx)("ul",{className:"list-disc list-inside space-y-1",children:p.map((e,r)=>(0,t.jsxs)("li",{className:"break-words",children:["general"!==e.field&&(0,t.jsxs)("strong",{children:[e.field,":"]})," ",e.message]},`error-${r}`))})})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-2 pt-4",children:[(0,t.jsx)(L.Button,{onClick:v,disabled:g||!$||m.some(e=>e.id===b&&!e.isInstalled),className:"w-full",children:g?"Validating...":"Apply Configuration"}),(0,t.jsx)(L.Button,{variant:"outline",onClick:()=>{u(n),d([]),c(!1)},className:"w-full",children:"Cancel"})]})]})]})})]})]})}function Q({open:e,onOpenChange:r}){return(0,t.jsx)(W,{open:e,onOpenChange:r})}function G(){let[e,r]=(0,l.useState)(!1),{theme:s,setTheme:n}=p();return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(A.DropdownMenu,{children:[(0,t.jsx)(A.DropdownMenuTrigger,{asChild:!0,children:(0,t.jsxs)(L.Button,{variant:"outline",size:"icon",children:[(0,t.jsx)(R,{className:"h-[1.2rem] w-[1.2rem]"}),(0,t.jsx)("span",{className:"sr-only",children:"Settings"})]})}),(0,t.jsxs)(A.DropdownMenuContent,{align:"end",className:"w-56",children:[(0,t.jsxs)("div",{className:"px-2 py-1.5 flex items-center gap-3",children:[(0,t.jsx)(A.DropdownMenuLabel,{className:"px-0 mb-0",children:"Theme"}),(0,t.jsx)(P,{value:s||"system",onValueChange:n,options:[{value:"system",icon:(0,t.jsx)($,{className:"h-4 w-4"})},{value:"light",icon:(0,t.jsx)(N,{className:"h-4 w-4"})},{value:"dark",icon:(0,t.jsx)(T,{className:"h-4 w-4"})}]})]}),(0,t.jsx)(A.DropdownMenuSeparator,{}),(0,t.jsxs)(A.DropdownMenuItem,{onSelect:()=>r(!0),children:[(0,t.jsx)("span",{children:"Configuration"}),(0,t.jsx)(R,{className:"ml-auto h-4 w-4"})]}),(0,t.jsx)(A.DropdownMenuItem,{asChild:!0,children:(0,t.jsxs)("a",{href:"https://useworkflow.dev/docs/getting-started",target:"_blank",rel:"noopener noreferrer",children:[(0,t.jsx)("span",{children:"Docs"}),(0,t.jsx)(C,{className:"ml-auto h-4 w-4"})]})})]})]}),(0,t.jsx)(Q,{open:e,onOpenChange:r})]})}var K=e.i(806746);let X=({...e})=>{let{theme:r="system"}=p();return(0,t.jsx)(K.Toaster,{theme:r,className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground",error:"group-[.toaster]:bg-destructive group-[.toaster]:text-destructive-foreground group-[.toaster]:border-destructive",success:"group-[.toaster]:bg-green-600 group-[.toaster]:text-white group-[.toaster]:border-green-600"}},...e})};function J({className:e}={}){return(0,t.jsxs)("svg",{viewBox:"0 0 1792 240",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e||"h-6 w-auto",role:"img","aria-label":"Workflow Logo",children:[(0,t.jsx)("title",{children:"Workflow Logo"}),(0,t.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M753.933 55.627C806.249 55.627 840.685 91.718 840.685 147.345C840.685 202.971 806.249 239.062 753.933 239.062C701.286 239.062 666.851 202.971 666.851 147.345C666.851 91.7181 701.286 55.6271 753.933 55.627ZM753.933 90.0625C726.451 90.0626 710.889 111.254 710.889 147.345C710.889 183.436 726.451 204.627 753.933 204.627C781.084 204.627 796.978 183.436 796.978 147.345C796.978 111.254 781.084 90.0625 753.933 90.0625Z",className:"fill-foreground"}),(0,t.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1445.65 55.627C1497.96 55.627 1532.4 91.718 1532.4 147.345C1532.4 202.971 1497.96 239.062 1445.65 239.062C1393 239.062 1358.56 202.971 1358.56 147.345C1358.56 91.718 1393 55.627 1445.65 55.627ZM1445.65 90.0625C1418.16 90.0625 1402.6 111.254 1402.6 147.345C1402.6 183.436 1418.16 204.627 1445.65 204.627C1472.8 204.627 1488.69 183.436 1488.69 147.345C1488.69 111.254 1472.8 90.0626 1445.65 90.0625Z",className:"fill-foreground"}),(0,t.jsx)("path",{d:"M902.473 94.0361C909.095 70.8584 922.34 59.5997 944.855 59.5996H961.079V92.3799H944.524C916.38 92.38 904.128 106.949 904.128 135.094V235.089H861.746V59.5996H901.48L902.473 94.0361Z",className:"fill-foreground"}),(0,t.jsx)("path",{d:"M1019.25 138.735L1091.11 59.5996H1143.09L1074.55 132.113L1146.4 235.089H1098.72L1046.74 157.609L1019.25 187.078V235.089H976.872V0H1019.25V138.735Z",className:"fill-foreground"}),(0,t.jsx)("path",{d:"M1263.63 32.7803H1235.82C1224.89 32.7803 1217.28 41.3893 1217.28 54.9648V59.5996H1260.98V92.3799H1217.28V235.089H1174.56V92.3799H1149.4V59.5996H1174.56V54.9648C1174.56 19.5359 1191.78 0 1230.85 0H1263.63V32.7803Z",className:"fill-foreground"}),(0,t.jsx)("path",{d:"M1322.58 189.396C1322.58 197.673 1327.22 202.309 1335.5 202.31H1348.74V235.089H1324.57C1298.08 235.089 1280.2 218.534 1280.2 191.052V0H1322.58V189.396Z",className:"fill-foreground"}),(0,t.jsx)("path",{d:"M1604.59 186.416L1641.02 59.5996H1677.77L1713.86 186.416L1749.95 59.5996H1791.34L1737.7 235.089H1694.32L1659.56 116.883L1624.79 235.089H1581.42L1527.77 59.5996H1568.83L1604.59 186.416Z",className:"fill-foreground"}),(0,t.jsx)("path",{d:"M472.173 174.847L514.895 0.671875H554.66L598.038 174.847L640.432 0.671875H685.454L623.015 234H575.692L534.942 77.5713L493.863 234H446.869L384.1 0.671875H429.122L472.173 174.847Z",className:"fill-foreground"}),(0,t.jsx)("path",{d:"M125.776 0C120.929 1.64945e-05 117 3.9291 117 8.77539V61.4248C117 66.2711 120.929 70.2002 125.776 70.2002H160.875L161.253 70.2051C169.032 70.4023 175.301 76.6734 175.495 84.4531L175.5 84.8252V143.325C175.5 148.171 179.429 152.101 184.276 152.101H219.375L219.753 152.105C227.53 152.303 233.798 158.571 233.995 166.348L234 166.726V225.225C234 230.071 237.929 234 242.776 234H295.425C300.271 234 304.2 230.071 304.2 225.225V172.575C304.2 167.729 300.271 163.8 295.425 163.8H260.25C252.334 163.76 245.905 157.43 245.705 149.553L245.7 149.176V90.6758C245.7 85.8295 241.771 81.9004 236.925 81.9004H201.825C193.874 81.9004 187.405 75.5551 187.205 67.6523L187.2 67.2754V8.77539C187.2 3.9291 183.271 1.64951e-05 178.425 0H125.776Z",className:"fill-foreground"}),(0,t.jsx)("path",{d:"M67.2755 81.9004C62.4293 81.9004 58.5002 85.8295 58.5002 90.6758V143.325C58.5004 148.171 62.4294 152.101 67.2755 152.101H102.375L102.753 152.105C110.53 152.303 116.798 158.571 116.995 166.348L117 166.726V225.225C117 230.071 120.929 234 125.776 234H178.425C183.271 234 187.2 230.071 187.2 225.225V172.575C187.2 167.729 183.271 163.8 178.425 163.8H143.25C135.334 163.76 128.905 157.43 128.705 149.553L128.7 149.176V90.6758C128.7 85.8295 124.771 81.9004 119.925 81.9004H67.2755Z",className:"fill-foreground"}),(0,t.jsx)("path",{d:"M8.77454 163.8C3.92844 163.8 0.00012207 167.729 0.00012207 172.575V225.225C0.00012207 230.071 3.92844 234 8.77454 234H61.4249C66.2712 234 70.2003 230.071 70.2003 225.225V172.575C70.2003 167.729 66.2712 163.8 61.4249 163.8H8.77454Z",className:"fill-foreground"})]})}function Y({children:e}){let i=(0,n.useRouter)(),a=(0,n.usePathname)(),o=(0,n.useSearchParams)(),c=(0,U.useQueryParamConfig)(),{setTheme:h}=p(),u=o.get("id"),d=o.get("runId"),g=o.get("stepId"),f=o.get("hookId"),m=o.get("resource"),k=o.get("theme"),x=(0,l.useRef)(!1);return(0,l.useEffect)(()=>{k&&("light"===k||"dark"===k||"system"===k)&&h(k)},[k,h]),(0,l.useEffect)(()=>{let e;if("/"===a||!x.current){if(a.startsWith("/run/")){x.current=!0;return}if(!m){if(d){let e;e=g?(0,U.buildUrlWithConfig)(`/run/${d}`,c,{sidebar:"step",stepId:g}):f?(0,U.buildUrlWithConfig)(`/run/${d}`,c,{sidebar:"hook",hookId:f}):(0,U.buildUrlWithConfig)(`/run/${d}`,c),x.current=!0,i.push(e)}return}if(u){if("run"===m)e=(0,U.buildUrlWithConfig)(`/run/${u}`,c);else if("step"===m&&d)e=(0,U.buildUrlWithConfig)(`/run/${d}`,c,{sidebar:"step",stepId:u});else if("stream"===m&&d)e=(0,U.buildUrlWithConfig)(`/run/${d}`,c,{sidebar:"stream",streamId:u});else if("event"===m&&d)e=(0,U.buildUrlWithConfig)(`/run/${d}`,c,{sidebar:"event",eventId:u});else if("hook"===m&&d)e=(0,U.buildUrlWithConfig)(`/run/${d}`,c,{sidebar:"hook",hookId:u});else{if("hook"!==m||d)return void console.warn(`Can't deep-link to ${m} ${u}.`);e=(0,U.buildUrlWithConfig)("/",c,{sidebar:"hook",hookId:u})}x.current=!0,i.push(e)}}},[m,u,d,g,f,i,c,a]),(0,t.jsxs)("div",{className:"min-h-screen flex flex-col",children:[(0,t.jsxs)(r.TooltipProvider,{delayDuration:0,children:[(0,t.jsx)("div",{className:"sticky top-0 z-50 bg-background border-b px-6 py-4",children:(0,t.jsxs)("div",{className:"flex items-center justify-between w-full",children:[(0,t.jsx)(s.default,{href:(0,U.buildUrlWithConfig)("/",c),children:(0,t.jsx)("h1",{className:"flex items-center gap-2",title:"Workflow Observability",children:(0,t.jsx)(J,{})})}),(0,t.jsxs)("div",{className:"ml-auto flex items-center gap-2",children:[(0,t.jsx)(S,{config:c}),(0,t.jsx)(G,{})]})]})}),(0,t.jsx)("div",{className:"flex-1 px-6 pt-6",children:e})]}),(0,t.jsx)(X,{})]})}function ee({children:e}){return(0,t.jsx)(d,{attribute:"class",defaultTheme:"system",enableSystem:!0,disableTransitionOnChange:!0,storageKey:"workflow-theme",children:(0,t.jsx)(Y,{children:e})})}e.s(["LayoutClient",()=>ee],608576)}]);
|
package/.next/trace
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"name":"generate-buildid","duration":
|
|
1
|
+
[{"name":"generate-buildid","duration":241,"timestamp":452858029,"id":4,"parentId":1,"tags":{},"startTime":1766941681481,"traceId":"65e6290fd089fbcc"},{"name":"load-custom-routes","duration":299,"timestamp":452858369,"id":5,"parentId":1,"tags":{},"startTime":1766941681482,"traceId":"65e6290fd089fbcc"},{"name":"create-dist-dir","duration":224,"timestamp":452858694,"id":6,"parentId":1,"tags":{},"startTime":1766941681482,"traceId":"65e6290fd089fbcc"},{"name":"clean","duration":190,"timestamp":452859336,"id":7,"parentId":1,"tags":{},"startTime":1766941681483,"traceId":"65e6290fd089fbcc"},{"name":"create-pages-mapping","duration":227,"timestamp":452910086,"id":8,"parentId":1,"tags":{},"startTime":1766941681533,"traceId":"65e6290fd089fbcc"},{"name":"collect-app-files","duration":1449,"timestamp":452910347,"id":9,"parentId":1,"tags":{},"startTime":1766941681534,"traceId":"65e6290fd089fbcc"},{"name":"create-app-mapping","duration":1487,"timestamp":452911824,"id":10,"parentId":1,"tags":{},"startTime":1766941681535,"traceId":"65e6290fd089fbcc"},{"name":"create-app-layouts","duration":133,"timestamp":452913387,"id":11,"parentId":1,"tags":{},"startTime":1766941681537,"traceId":"65e6290fd089fbcc"},{"name":"collect-default-files","duration":460,"timestamp":452914325,"id":13,"parentId":1,"tags":{},"startTime":1766941681538,"traceId":"65e6290fd089fbcc"},{"name":"generate-route-types","duration":11376,"timestamp":452913820,"id":12,"parentId":1,"tags":{},"startTime":1766941681537,"traceId":"65e6290fd089fbcc"},{"name":"public-dir-conflict-check","duration":75,"timestamp":452925288,"id":14,"parentId":1,"tags":{},"startTime":1766941681548,"traceId":"65e6290fd089fbcc"},{"name":"generate-routes-manifest","duration":1837,"timestamp":452925418,"id":15,"parentId":1,"tags":{},"startTime":1766941681549,"traceId":"65e6290fd089fbcc"},{"name":"run-turbopack","duration":14619998,"timestamp":452930349,"id":17,"parentId":1,"tags":{},"startTime":1766941681554,"traceId":"65e6290fd089fbcc"},{"name":"run-typescript","duration":5128844,"timestamp":467559074,"id":19,"parentId":1,"tags":{},"startTime":1766941696182,"traceId":"65e6290fd089fbcc"},{"name":"check-static-error-page","duration":2630,"timestamp":472741232,"id":22,"parentId":21,"tags":{},"startTime":1766941701364,"traceId":"65e6290fd089fbcc"},{"name":"is-page-static","duration":259095,"timestamp":472748220,"id":29,"parentId":24,"tags":{},"startTime":1766941701371,"traceId":"65e6290fd089fbcc"},{"name":"check-page","duration":264042,"timestamp":472743360,"id":24,"parentId":21,"tags":{"page":"/_global-error"},"startTime":1766941701367,"traceId":"65e6290fd089fbcc"},{"name":"is-page-static","duration":290104,"timestamp":472748694,"id":30,"parentId":27,"tags":{},"startTime":1766941701372,"traceId":"65e6290fd089fbcc"},{"name":"check-page","duration":295107,"timestamp":472743739,"id":27,"parentId":21,"tags":{"page":"/favicon.ico"},"startTime":1766941701367,"traceId":"65e6290fd089fbcc"},{"name":"is-page-static","duration":363334,"timestamp":472752162,"id":32,"parentId":26,"tags":{},"startTime":1766941701375,"traceId":"65e6290fd089fbcc"},{"name":"check-page","duration":371900,"timestamp":472743653,"id":26,"parentId":21,"tags":{"page":"/run/[runId]"},"startTime":1766941701367,"traceId":"65e6290fd089fbcc"},{"name":"is-page-static","duration":394164,"timestamp":472752119,"id":31,"parentId":25,"tags":{},"startTime":1766941701375,"traceId":"65e6290fd089fbcc"},{"name":"check-page","duration":402777,"timestamp":472743560,"id":25,"parentId":21,"tags":{"page":"/"},"startTime":1766941701367,"traceId":"65e6290fd089fbcc"},{"name":"is-page-static","duration":403101,"timestamp":472747923,"id":28,"parentId":23,"tags":{},"startTime":1766941701371,"traceId":"65e6290fd089fbcc"},{"name":"check-page","duration":408678,"timestamp":472742377,"id":23,"parentId":21,"tags":{"page":"/_not-found"},"startTime":1766941701366,"traceId":"65e6290fd089fbcc"},{"name":"static-check","duration":410583,"timestamp":472740493,"id":21,"parentId":1,"tags":{},"startTime":1766941701364,"traceId":"65e6290fd089fbcc"},{"name":"generate-required-server-files","duration":411,"timestamp":473151202,"id":34,"parentId":1,"tags":{},"startTime":1766941701774,"traceId":"65e6290fd089fbcc"},{"name":"write-routes-manifest","duration":224,"timestamp":473151917,"id":35,"parentId":1,"tags":{},"startTime":1766941701775,"traceId":"65e6290fd089fbcc"},{"name":"load-dotenv","duration":29,"timestamp":473159782,"id":38,"parentId":37,"tags":{},"startTime":1766941701783,"traceId":"65e6290fd089fbcc"},{"name":"run-export-path-map","duration":288,"timestamp":473161283,"id":39,"parentId":37,"tags":{},"startTime":1766941701784,"traceId":"65e6290fd089fbcc"},{"name":"next-export","duration":597293,"timestamp":473158926,"id":37,"parentId":1,"tags":{},"startTime":1766941701782,"traceId":"65e6290fd089fbcc"},{"name":"move-exported-app-not-found-","duration":89,"timestamp":473757535,"id":40,"parentId":36,"tags":{},"startTime":1766941702381,"traceId":"65e6290fd089fbcc"},{"name":"move-exported-app-global-error-","duration":479,"timestamp":473757678,"id":41,"parentId":36,"tags":{},"startTime":1766941702381,"traceId":"65e6290fd089fbcc"},{"name":"static-generation","duration":604082,"timestamp":473155465,"id":36,"parentId":1,"tags":{},"startTime":1766941701779,"traceId":"65e6290fd089fbcc"},{"name":"write-routes-manifest","duration":242,"timestamp":473759666,"id":42,"parentId":1,"tags":{},"startTime":1766941702383,"traceId":"65e6290fd089fbcc"},{"name":"print-tree-view","duration":2181,"timestamp":473763858,"id":43,"parentId":1,"tags":{},"startTime":1766941702387,"traceId":"65e6290fd089fbcc"},{"name":"telemetry-flush","duration":73716,"timestamp":473766048,"id":44,"parentId":1,"tags":{},"startTime":1766941702389,"traceId":"65e6290fd089fbcc"},{"name":"next-build","duration":21181739,"timestamp":452658039,"id":1,"tags":{"buildMode":"default","version":"16.0.10","bundler":"turbopack","has-custom-webpack-config":"false","use-build-worker":"true"},"startTime":1766941681281,"traceId":"65e6290fd089fbcc"}]
|
package/.next/trace-build
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"name":"run-turbopack","duration":
|
|
1
|
+
[{"name":"run-turbopack","duration":14619998,"timestamp":452930349,"id":17,"parentId":1,"tags":{},"startTime":1766941681554,"traceId":"65e6290fd089fbcc"},{"name":"run-typescript","duration":5128844,"timestamp":467559074,"id":19,"parentId":1,"tags":{},"startTime":1766941696182,"traceId":"65e6290fd089fbcc"},{"name":"static-check","duration":410583,"timestamp":472740493,"id":21,"parentId":1,"tags":{},"startTime":1766941701364,"traceId":"65e6290fd089fbcc"},{"name":"static-generation","duration":604082,"timestamp":473155465,"id":36,"parentId":1,"tags":{},"startTime":1766941701779,"traceId":"65e6290fd089fbcc"},{"name":"telemetry-flush","duration":73716,"timestamp":473766048,"id":44,"parentId":1,"tags":{},"startTime":1766941702389,"traceId":"65e6290fd089fbcc"},{"name":"next-build","duration":21181739,"timestamp":452658039,"id":1,"tags":{"buildMode":"default","version":"16.0.10","bundler":"turbopack","has-custom-webpack-config":"false","use-build-worker":"true"},"startTime":1766941681281,"traceId":"65e6290fd089fbcc"}]
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@workflow/web",
|
|
3
3
|
"description": "Workflow Observability UI",
|
|
4
|
-
"version": "4.0.1-beta.
|
|
4
|
+
"version": "4.0.1-beta.22",
|
|
5
5
|
"private": false,
|
|
6
6
|
"files": [
|
|
7
7
|
".next",
|
|
@@ -51,6 +51,7 @@
|
|
|
51
51
|
"tailwindcss": "4",
|
|
52
52
|
"typescript": "^5.9.3",
|
|
53
53
|
"@workflow/core": "4.0.1-beta.32",
|
|
54
|
+
"@workflow/utils": "4.0.1-beta.9",
|
|
54
55
|
"@workflow/world": "4.0.1-beta.11",
|
|
55
56
|
"@workflow/web-shared": "4.0.1-beta.34"
|
|
56
57
|
},
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
module.exports=[175196,8930,665106,a=>{"use strict";let b;var c=a.i(857446),d=a.i(253220),e=a.i(991307);function f(a,[b,c]){return Math.min(c,Math.max(b,a))}var g=a.i(559653),h=a.i(523358),i=a.i(840861),j=a.i(333702),k=a.i(539536),l=a.i(443343),m=0;function n(){d.useEffect(()=>{let a=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",a[0]??o()),document.body.insertAdjacentElement("beforeend",a[1]??o()),m++,()=>{1===m&&document.querySelectorAll("[data-radix-focus-guard]").forEach(a=>a.remove()),m--}},[])}function o(){let a=document.createElement("span");return a.setAttribute("data-radix-focus-guard",""),a.tabIndex=0,a.style.outline="none",a.style.opacity="0",a.style.position="fixed",a.style.pointerEvents="none",a}a.s(["useFocusGuards",()=>n],8930);var p=a.i(518243),q=a.i(393352),r="focusScope.autoFocusOnMount",s="focusScope.autoFocusOnUnmount",t={bubbles:!1,cancelable:!0},u=d.forwardRef((a,b)=>{let{loop:e=!1,trapped:f=!1,onMountAutoFocus:g,onUnmountAutoFocus:h,...j}=a,[k,l]=d.useState(null),m=(0,q.useCallbackRef)(g),n=(0,q.useCallbackRef)(h),o=d.useRef(null),u=(0,i.useComposedRefs)(b,a=>l(a)),z=d.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;d.useEffect(()=>{if(f){let a=function(a){if(z.paused||!k)return;let b=a.target;k.contains(b)?o.current=b:x(o.current,{select:!0})},b=function(a){if(z.paused||!k)return;let b=a.relatedTarget;null!==b&&(k.contains(b)||x(o.current,{select:!0}))};document.addEventListener("focusin",a),document.addEventListener("focusout",b);let c=new MutationObserver(function(a){if(document.activeElement===document.body)for(let b of a)b.removedNodes.length>0&&x(k)});return k&&c.observe(k,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",a),document.removeEventListener("focusout",b),c.disconnect()}}},[f,k,z.paused]),d.useEffect(()=>{if(k){y.add(z);let a=document.activeElement;if(!k.contains(a)){let b=new CustomEvent(r,t);k.addEventListener(r,m),k.dispatchEvent(b),b.defaultPrevented||(function(a,{select:b=!1}={}){let c=document.activeElement;for(let d of a)if(x(d,{select:b}),document.activeElement!==c)return}(v(k).filter(a=>"A"!==a.tagName),{select:!0}),document.activeElement===a&&x(k))}return()=>{k.removeEventListener(r,m),setTimeout(()=>{let b=new CustomEvent(s,t);k.addEventListener(s,n),k.dispatchEvent(b),b.defaultPrevented||x(a??document.body,{select:!0}),k.removeEventListener(s,n),y.remove(z)},0)}}},[k,m,n,z]);let A=d.useCallback(a=>{if(!e&&!f||z.paused)return;let b="Tab"===a.key&&!a.altKey&&!a.ctrlKey&&!a.metaKey,c=document.activeElement;if(b&&c){var d;let b,f=a.currentTarget,[g,h]=[w(b=v(d=f),d),w(b.reverse(),d)];g&&h?a.shiftKey||c!==h?a.shiftKey&&c===g&&(a.preventDefault(),e&&x(h,{select:!0})):(a.preventDefault(),e&&x(g,{select:!0})):c===f&&a.preventDefault()}},[e,f,z.paused]);return(0,c.jsx)(p.Primitive.div,{tabIndex:-1,...j,ref:u,onKeyDown:A})});function v(a){let b=[],c=document.createTreeWalker(a,NodeFilter.SHOW_ELEMENT,{acceptNode:a=>{let b="INPUT"===a.tagName&&"hidden"===a.type;return a.disabled||a.hidden||b?NodeFilter.FILTER_SKIP:a.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;c.nextNode();)b.push(c.currentNode);return b}function w(a,b){for(let c of a)if(!function(a,{upTo:b}){if("hidden"===getComputedStyle(a).visibility)return!0;for(;a&&(void 0===b||a!==b);){if("none"===getComputedStyle(a).display)return!0;a=a.parentElement}return!1}(c,{upTo:b}))return c}function x(a,{select:b=!1}={}){if(a&&a.focus){var c;let d=document.activeElement;a.focus({preventScroll:!0}),a!==d&&(c=a)instanceof HTMLInputElement&&"select"in c&&b&&a.select()}}u.displayName="FocusScope";var y=(b=[],{add(a){let c=b[0];a!==c&&c?.pause(),(b=z(b,a)).unshift(a)},remove(a){b=z(b,a),b[0]?.resume()}});function z(a,b){let c=[...a],d=c.indexOf(b);return -1!==d&&c.splice(d,1),c}a.s(["FocusScope",()=>u],665106);var A=a.i(192534),B=a.i(248968),C=a.i(549033),D=a.i(523776),E=a.i(984295),F=a.i(677482),G=a.i(721777),H=a.i(516164),I=a.i(513358),J=[" ","Enter","ArrowUp","ArrowDown"],K=[" ","Enter"],L="Select",[M,N,O]=(0,h.createCollection)(L),[P,Q]=(0,j.createContextScope)(L,[O,B.createPopperScope]),R=(0,B.createPopperScope)(),[S,T]=P(L),[U,V]=P(L),W=a=>{let{__scopeSelect:b,children:e,open:f,defaultOpen:g,onOpenChange:h,value:i,defaultValue:j,onValueChange:l,dir:m,name:n,autoComplete:o,disabled:p,required:q,form:r}=a,s=R(b),[t,u]=d.useState(null),[v,w]=d.useState(null),[x,y]=d.useState(!1),z=(0,k.useDirection)(m),[C,D]=(0,E.useControllableState)({prop:f,defaultProp:g??!1,onChange:h,caller:L}),[F,G]=(0,E.useControllableState)({prop:i,defaultProp:j,onChange:l,caller:L}),H=d.useRef(null),I=!t||r||!!t.closest("form"),[J,K]=d.useState(new Set),N=Array.from(J).map(a=>a.props.value).join(";");return(0,c.jsx)(B.Root,{...s,children:(0,c.jsxs)(S,{required:q,scope:b,trigger:t,onTriggerChange:u,valueNode:v,onValueNodeChange:w,valueNodeHasChildren:x,onValueNodeHasChildrenChange:y,contentId:(0,A.useId)(),value:F,onValueChange:G,open:C,onOpenChange:D,dir:z,triggerPointerDownPosRef:H,disabled:p,children:[(0,c.jsx)(M.Provider,{scope:b,children:(0,c.jsx)(U,{scope:a.__scopeSelect,onNativeOptionAdd:d.useCallback(a=>{K(b=>new Set(b).add(a))},[]),onNativeOptionRemove:d.useCallback(a=>{K(b=>{let c=new Set(b);return c.delete(a),c})},[]),children:e})}),I?(0,c.jsxs)(aH,{"aria-hidden":!0,required:q,tabIndex:-1,name:n,autoComplete:o,value:F,onChange:a=>G(a.target.value),disabled:p,form:r,children:[void 0===F?(0,c.jsx)("option",{value:""}):null,Array.from(J)]},N):null]})})};W.displayName=L;var X="SelectTrigger",Y=d.forwardRef((a,b)=>{let{__scopeSelect:e,disabled:f=!1,...h}=a,j=R(e),k=T(X,e),l=k.disabled||f,m=(0,i.useComposedRefs)(b,k.onTriggerChange),n=N(e),o=d.useRef("touch"),[q,r,s]=aJ(a=>{let b=n().filter(a=>!a.disabled),c=b.find(a=>a.value===k.value),d=aK(b,a,c);void 0!==d&&k.onValueChange(d.value)}),t=a=>{l||(k.onOpenChange(!0),s()),a&&(k.triggerPointerDownPosRef.current={x:Math.round(a.pageX),y:Math.round(a.pageY)})};return(0,c.jsx)(B.Anchor,{asChild:!0,...j,children:(0,c.jsx)(p.Primitive.button,{type:"button",role:"combobox","aria-controls":k.contentId,"aria-expanded":k.open,"aria-required":k.required,"aria-autocomplete":"none",dir:k.dir,"data-state":k.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":aI(k.value)?"":void 0,...h,ref:m,onClick:(0,g.composeEventHandlers)(h.onClick,a=>{a.currentTarget.focus(),"mouse"!==o.current&&t(a)}),onPointerDown:(0,g.composeEventHandlers)(h.onPointerDown,a=>{o.current=a.pointerType;let b=a.target;b.hasPointerCapture(a.pointerId)&&b.releasePointerCapture(a.pointerId),0===a.button&&!1===a.ctrlKey&&"mouse"===a.pointerType&&(t(a),a.preventDefault())}),onKeyDown:(0,g.composeEventHandlers)(h.onKeyDown,a=>{let b=""!==q.current;a.ctrlKey||a.altKey||a.metaKey||1!==a.key.length||r(a.key),(!b||" "!==a.key)&&J.includes(a.key)&&(t(),a.preventDefault())})})})});Y.displayName=X;var Z="SelectValue",$=d.forwardRef((a,b)=>{let{__scopeSelect:d,className:e,style:f,children:g,placeholder:h="",...j}=a,k=T(Z,d),{onValueNodeHasChildrenChange:l}=k,m=void 0!==g,n=(0,i.useComposedRefs)(b,k.onValueNodeChange);return(0,F.useLayoutEffect)(()=>{l(m)},[l,m]),(0,c.jsx)(p.Primitive.span,{...j,ref:n,style:{pointerEvents:"none"},children:aI(k.value)?(0,c.jsx)(c.Fragment,{children:h}):g})});$.displayName=Z;var _=d.forwardRef((a,b)=>{let{__scopeSelect:d,children:e,...f}=a;return(0,c.jsx)(p.Primitive.span,{"aria-hidden":!0,...f,ref:b,children:e||"▼"})});_.displayName="SelectIcon";var aa=a=>(0,c.jsx)(C.Portal,{asChild:!0,...a});aa.displayName="SelectPortal";var ab="SelectContent",ac=d.forwardRef((a,b)=>{let f=T(ab,a.__scopeSelect),[g,h]=d.useState();return((0,F.useLayoutEffect)(()=>{h(new DocumentFragment)},[]),f.open)?(0,c.jsx)(ag,{...a,ref:b}):g?e.createPortal((0,c.jsx)(ad,{scope:a.__scopeSelect,children:(0,c.jsx)(M.Slot,{scope:a.__scopeSelect,children:(0,c.jsx)("div",{children:a.children})})}),g):null});ac.displayName=ab;var[ad,ae]=P(ab),af=(0,D.createSlot)("SelectContent.RemoveScroll"),ag=d.forwardRef((a,b)=>{let{__scopeSelect:e,position:f="item-aligned",onCloseAutoFocus:h,onEscapeKeyDown:j,onPointerDownOutside:k,side:m,sideOffset:o,align:p,alignOffset:q,arrowPadding:r,collisionBoundary:s,collisionPadding:t,sticky:v,hideWhenDetached:w,avoidCollisions:x,...y}=a,z=T(ab,e),[A,B]=d.useState(null),[C,D]=d.useState(null),E=(0,i.useComposedRefs)(b,a=>B(a)),[F,G]=d.useState(null),[J,K]=d.useState(null),L=N(e),[M,O]=d.useState(!1),P=d.useRef(!1);d.useEffect(()=>{if(A)return(0,H.hideOthers)(A)},[A]),n();let Q=d.useCallback(a=>{let[b,...c]=L().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&&C&&(C.scrollTop=0),c===d&&C&&(C.scrollTop=C.scrollHeight),c?.focus(),document.activeElement!==e))return},[L,C]),R=d.useCallback(()=>Q([F,A]),[Q,F,A]);d.useEffect(()=>{M&&R()},[M,R]);let{onOpenChange:S,triggerPointerDownPosRef:U}=z;d.useEffect(()=>{if(A){let a={x:0,y:0},b=b=>{a={x:Math.abs(Math.round(b.pageX)-(U.current?.x??0)),y:Math.abs(Math.round(b.pageY)-(U.current?.y??0))}},c=c=>{a.x<=10&&a.y<=10?c.preventDefault():A.contains(c.target)||S(!1),document.removeEventListener("pointermove",b),U.current=null};return null!==U.current&&(document.addEventListener("pointermove",b),document.addEventListener("pointerup",c,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",b),document.removeEventListener("pointerup",c,{capture:!0})}}},[A,S,U]),d.useEffect(()=>{let a=()=>S(!1);return window.addEventListener("blur",a),window.addEventListener("resize",a),()=>{window.removeEventListener("blur",a),window.removeEventListener("resize",a)}},[S]);let[V,W]=aJ(a=>{let b=L().filter(a=>!a.disabled),c=b.find(a=>a.ref.current===document.activeElement),d=aK(b,a,c);d&&setTimeout(()=>d.ref.current.focus())}),X=d.useCallback((a,b,c)=>{let d=!P.current&&!c;(void 0!==z.value&&z.value===b||d)&&(G(a),d&&(P.current=!0))},[z.value]),Y=d.useCallback(()=>A?.focus(),[A]),Z=d.useCallback((a,b,c)=>{let d=!P.current&&!c;(void 0!==z.value&&z.value===b||d)&&K(a)},[z.value]),$="popper"===f?ai:ah,_=$===ai?{side:m,sideOffset:o,align:p,alignOffset:q,arrowPadding:r,collisionBoundary:s,collisionPadding:t,sticky:v,hideWhenDetached:w,avoidCollisions:x}:{};return(0,c.jsx)(ad,{scope:e,content:A,viewport:C,onViewportChange:D,itemRefCallback:X,selectedItem:F,onItemLeave:Y,itemTextRefCallback:Z,focusSelectedItem:R,selectedItemText:J,position:f,isPositioned:M,searchRef:V,children:(0,c.jsx)(I.RemoveScroll,{as:af,allowPinchZoom:!0,children:(0,c.jsx)(u,{asChild:!0,trapped:z.open,onMountAutoFocus:a=>{a.preventDefault()},onUnmountAutoFocus:(0,g.composeEventHandlers)(h,a=>{z.trigger?.focus({preventScroll:!0}),a.preventDefault()}),children:(0,c.jsx)(l.DismissableLayer,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:j,onPointerDownOutside:k,onFocusOutside:a=>a.preventDefault(),onDismiss:()=>z.onOpenChange(!1),children:(0,c.jsx)($,{role:"listbox",id:z.contentId,"data-state":z.open?"open":"closed",dir:z.dir,onContextMenu:a=>a.preventDefault(),...y,..._,onPlaced:()=>O(!0),ref:E,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:(0,g.composeEventHandlers)(y.onKeyDown,a=>{let b=a.ctrlKey||a.altKey||a.metaKey;if("Tab"===a.key&&a.preventDefault(),b||1!==a.key.length||W(a.key),["ArrowUp","ArrowDown","Home","End"].includes(a.key)){let b=L().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(()=>Q(b)),a.preventDefault()}})})})})})})});ag.displayName="SelectContentImpl";var ah=d.forwardRef((a,b)=>{let{__scopeSelect:e,onPlaced:g,...h}=a,j=T(ab,e),k=ae(ab,e),[l,m]=d.useState(null),[n,o]=d.useState(null),q=(0,i.useComposedRefs)(b,a=>o(a)),r=N(e),s=d.useRef(!1),t=d.useRef(!0),{viewport:u,selectedItem:v,selectedItemText:w,focusSelectedItem:x}=k,y=d.useCallback(()=>{if(j.trigger&&j.valueNode&&l&&n&&u&&v&&w){let a=j.trigger.getBoundingClientRect(),b=n.getBoundingClientRect(),c=j.valueNode.getBoundingClientRect(),d=w.getBoundingClientRect();if("rtl"!==j.dir){let e=d.left-b.left,g=c.left-e,h=a.left-g,i=a.width+h,j=Math.max(i,b.width),k=f(g,[10,Math.max(10,window.innerWidth-10-j)]);l.style.minWidth=i+"px",l.style.left=k+"px"}else{let e=b.right-d.right,g=window.innerWidth-c.right-e,h=window.innerWidth-a.right-g,i=a.width+h,j=Math.max(i,b.width),k=f(g,[10,Math.max(10,window.innerWidth-10-j)]);l.style.minWidth=i+"px",l.style.right=k+"px"}let e=r(),h=window.innerHeight-20,i=u.scrollHeight,k=window.getComputedStyle(n),m=parseInt(k.borderTopWidth,10),o=parseInt(k.paddingTop,10),p=parseInt(k.borderBottomWidth,10),q=m+o+i+parseInt(k.paddingBottom,10)+p,t=Math.min(5*v.offsetHeight,q),x=window.getComputedStyle(u),y=parseInt(x.paddingTop,10),z=parseInt(x.paddingBottom,10),A=a.top+a.height/2-10,B=v.offsetHeight/2,C=m+o+(v.offsetTop+B);if(C<=A){let a=e.length>0&&v===e[e.length-1].ref.current;l.style.bottom="0px";let b=Math.max(h-A,B+(a?z:0)+(n.clientHeight-u.offsetTop-u.offsetHeight)+p);l.style.height=C+b+"px"}else{let a=e.length>0&&v===e[0].ref.current;l.style.top="0px";let b=Math.max(A,m+u.offsetTop+(a?y:0)+B);l.style.height=b+(q-C)+"px",u.scrollTop=C-A+u.offsetTop}l.style.margin="10px 0",l.style.minHeight=t+"px",l.style.maxHeight=h+"px",g?.(),requestAnimationFrame(()=>s.current=!0)}},[r,j.trigger,j.valueNode,l,n,u,v,w,j.dir,g]);(0,F.useLayoutEffect)(()=>y(),[y]);let[z,A]=d.useState();(0,F.useLayoutEffect)(()=>{n&&A(window.getComputedStyle(n).zIndex)},[n]);let B=d.useCallback(a=>{a&&!0===t.current&&(y(),x?.(),t.current=!1)},[y,x]);return(0,c.jsx)(aj,{scope:e,contentWrapper:l,shouldExpandOnScrollRef:s,onScrollButtonChange:B,children:(0,c.jsx)("div",{ref:m,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:z},children:(0,c.jsx)(p.Primitive.div,{...h,ref:q,style:{boxSizing:"border-box",maxHeight:"100%",...h.style}})})})});ah.displayName="SelectItemAlignedPosition";var ai=d.forwardRef((a,b)=>{let{__scopeSelect:d,align:e="start",collisionPadding:f=10,...g}=a,h=R(d);return(0,c.jsx)(B.Content,{...h,...g,ref:b,align:e,collisionPadding:f,style:{boxSizing:"border-box",...g.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)"}})});ai.displayName="SelectPopperPosition";var[aj,ak]=P(ab,{}),al="SelectViewport",am=d.forwardRef((a,b)=>{let{__scopeSelect:e,nonce:f,...h}=a,j=ae(al,e),k=ak(al,e),l=(0,i.useComposedRefs)(b,j.onViewportChange),m=d.useRef(0);return(0,c.jsxs)(c.Fragment,{children:[(0,c.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:f}),(0,c.jsx)(M.Slot,{scope:e,children:(0,c.jsx)(p.Primitive.div,{"data-radix-select-viewport":"",role:"presentation",...h,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...h.style},onScroll:(0,g.composeEventHandlers)(h.onScroll,a=>{let b=a.currentTarget,{contentWrapper:c,shouldExpandOnScrollRef:d}=k;if(d?.current&&c){let a=Math.abs(m.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")}}}m.current=b.scrollTop})})})]})});am.displayName=al;var an="SelectGroup",[ao,ap]=P(an);d.forwardRef((a,b)=>{let{__scopeSelect:d,...e}=a,f=(0,A.useId)();return(0,c.jsx)(ao,{scope:d,id:f,children:(0,c.jsx)(p.Primitive.div,{role:"group","aria-labelledby":f,...e,ref:b})})}).displayName=an;var aq="SelectLabel",ar=d.forwardRef((a,b)=>{let{__scopeSelect:d,...e}=a,f=ap(aq,d);return(0,c.jsx)(p.Primitive.div,{id:f.id,...e,ref:b})});ar.displayName=aq;var as="SelectItem",[at,au]=P(as),av=d.forwardRef((a,b)=>{let{__scopeSelect:e,value:f,disabled:h=!1,textValue:j,...k}=a,l=T(as,e),m=ae(as,e),n=l.value===f,[o,q]=d.useState(j??""),[r,s]=d.useState(!1),t=(0,i.useComposedRefs)(b,a=>m.itemRefCallback?.(a,f,h)),u=(0,A.useId)(),v=d.useRef("touch"),w=()=>{h||(l.onValueChange(f),l.onOpenChange(!1))};if(""===f)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,c.jsx)(at,{scope:e,value:f,disabled:h,textId:u,isSelected:n,onItemTextChange:d.useCallback(a=>{q(b=>b||(a?.textContent??"").trim())},[]),children:(0,c.jsx)(M.ItemSlot,{scope:e,value:f,disabled:h,textValue:o,children:(0,c.jsx)(p.Primitive.div,{role:"option","aria-labelledby":u,"data-highlighted":r?"":void 0,"aria-selected":n&&r,"data-state":n?"checked":"unchecked","aria-disabled":h||void 0,"data-disabled":h?"":void 0,tabIndex:h?void 0:-1,...k,ref:t,onFocus:(0,g.composeEventHandlers)(k.onFocus,()=>s(!0)),onBlur:(0,g.composeEventHandlers)(k.onBlur,()=>s(!1)),onClick:(0,g.composeEventHandlers)(k.onClick,()=>{"mouse"!==v.current&&w()}),onPointerUp:(0,g.composeEventHandlers)(k.onPointerUp,()=>{"mouse"===v.current&&w()}),onPointerDown:(0,g.composeEventHandlers)(k.onPointerDown,a=>{v.current=a.pointerType}),onPointerMove:(0,g.composeEventHandlers)(k.onPointerMove,a=>{v.current=a.pointerType,h?m.onItemLeave?.():"mouse"===v.current&&a.currentTarget.focus({preventScroll:!0})}),onPointerLeave:(0,g.composeEventHandlers)(k.onPointerLeave,a=>{a.currentTarget===document.activeElement&&m.onItemLeave?.()}),onKeyDown:(0,g.composeEventHandlers)(k.onKeyDown,a=>{(m.searchRef?.current===""||" "!==a.key)&&(K.includes(a.key)&&w()," "===a.key&&a.preventDefault())})})})})});av.displayName=as;var aw="SelectItemText",ax=d.forwardRef((a,b)=>{let{__scopeSelect:f,className:g,style:h,...j}=a,k=T(aw,f),l=ae(aw,f),m=au(aw,f),n=V(aw,f),[o,q]=d.useState(null),r=(0,i.useComposedRefs)(b,a=>q(a),m.onItemTextChange,a=>l.itemTextRefCallback?.(a,m.value,m.disabled)),s=o?.textContent,t=d.useMemo(()=>(0,c.jsx)("option",{value:m.value,disabled:m.disabled,children:s},m.value),[m.disabled,m.value,s]),{onNativeOptionAdd:u,onNativeOptionRemove:v}=n;return(0,F.useLayoutEffect)(()=>(u(t),()=>v(t)),[u,v,t]),(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(p.Primitive.span,{id:m.textId,...j,ref:r}),m.isSelected&&k.valueNode&&!k.valueNodeHasChildren?e.createPortal(j.children,k.valueNode):null]})});ax.displayName=aw;var ay="SelectItemIndicator",az=d.forwardRef((a,b)=>{let{__scopeSelect:d,...e}=a;return au(ay,d).isSelected?(0,c.jsx)(p.Primitive.span,{"aria-hidden":!0,...e,ref:b}):null});az.displayName=ay;var aA="SelectScrollUpButton",aB=d.forwardRef((a,b)=>{let e=ae(aA,a.__scopeSelect),f=ak(aA,a.__scopeSelect),[g,h]=d.useState(!1),j=(0,i.useComposedRefs)(b,f.onScrollButtonChange);return(0,F.useLayoutEffect)(()=>{if(e.viewport&&e.isPositioned){let a=function(){h(b.scrollTop>0)},b=e.viewport;return a(),b.addEventListener("scroll",a),()=>b.removeEventListener("scroll",a)}},[e.viewport,e.isPositioned]),g?(0,c.jsx)(aE,{...a,ref:j,onAutoScroll:()=>{let{viewport:a,selectedItem:b}=e;a&&b&&(a.scrollTop=a.scrollTop-b.offsetHeight)}}):null});aB.displayName=aA;var aC="SelectScrollDownButton",aD=d.forwardRef((a,b)=>{let e=ae(aC,a.__scopeSelect),f=ak(aC,a.__scopeSelect),[g,h]=d.useState(!1),j=(0,i.useComposedRefs)(b,f.onScrollButtonChange);return(0,F.useLayoutEffect)(()=>{if(e.viewport&&e.isPositioned){let a=function(){let a=b.scrollHeight-b.clientHeight;h(Math.ceil(b.scrollTop)<a)},b=e.viewport;return a(),b.addEventListener("scroll",a),()=>b.removeEventListener("scroll",a)}},[e.viewport,e.isPositioned]),g?(0,c.jsx)(aE,{...a,ref:j,onAutoScroll:()=>{let{viewport:a,selectedItem:b}=e;a&&b&&(a.scrollTop=a.scrollTop+b.offsetHeight)}}):null});aD.displayName=aC;var aE=d.forwardRef((a,b)=>{let{__scopeSelect:e,onAutoScroll:f,...h}=a,i=ae("SelectScrollButton",e),j=d.useRef(null),k=N(e),l=d.useCallback(()=>{null!==j.current&&(window.clearInterval(j.current),j.current=null)},[]);return d.useEffect(()=>()=>l(),[l]),(0,F.useLayoutEffect)(()=>{let a=k().find(a=>a.ref.current===document.activeElement);a?.ref.current?.scrollIntoView({block:"nearest"})},[k]),(0,c.jsx)(p.Primitive.div,{"aria-hidden":!0,...h,ref:b,style:{flexShrink:0,...h.style},onPointerDown:(0,g.composeEventHandlers)(h.onPointerDown,()=>{null===j.current&&(j.current=window.setInterval(f,50))}),onPointerMove:(0,g.composeEventHandlers)(h.onPointerMove,()=>{i.onItemLeave?.(),null===j.current&&(j.current=window.setInterval(f,50))}),onPointerLeave:(0,g.composeEventHandlers)(h.onPointerLeave,()=>{l()})})}),aF=d.forwardRef((a,b)=>{let{__scopeSelect:d,...e}=a;return(0,c.jsx)(p.Primitive.div,{"aria-hidden":!0,...e,ref:b})});aF.displayName="SelectSeparator";var aG="SelectArrow";d.forwardRef((a,b)=>{let{__scopeSelect:d,...e}=a,f=R(d),g=T(aG,d),h=ae(aG,d);return g.open&&"popper"===h.position?(0,c.jsx)(B.Arrow,{...f,...e,ref:b}):null}).displayName=aG;var aH=d.forwardRef(({__scopeSelect:a,value:b,...e},f)=>{let g,h=d.useRef(null),j=(0,i.useComposedRefs)(f,h),k=(g=d.useRef({value:b,previous:b}),d.useMemo(()=>(g.current.value!==b&&(g.current.previous=g.current.value,g.current.value=b),g.current.previous),[b]));return d.useEffect(()=>{let a=h.current;if(!a)return;let c=Object.getOwnPropertyDescriptor(window.HTMLSelectElement.prototype,"value").set;if(k!==b&&c){let d=new Event("change",{bubbles:!0});c.call(a,b),a.dispatchEvent(d)}},[k,b]),(0,c.jsx)(p.Primitive.select,{...e,style:{...G.VISUALLY_HIDDEN_STYLES,...e.style},ref:j,defaultValue:b})});function aI(a){return""===a||void 0===a}function aJ(a){let b=(0,q.useCallbackRef)(a),c=d.useRef(""),e=d.useRef(0),f=d.useCallback(a=>{let d=c.current+a;b(d),function a(b){c.current=b,window.clearTimeout(e.current),""!==b&&(e.current=window.setTimeout(()=>a(""),1e3))}(d)},[b]),g=d.useCallback(()=>{c.current="",window.clearTimeout(e.current)},[]);return d.useEffect(()=>()=>window.clearTimeout(e.current),[]),[c,f,g]}function aK(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}aH.displayName="SelectBubbleInput";var aL=a.i(602774),aM=a.i(622427);let aN=(0,aM.default)("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]),aO=(0,aM.default)("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);var aP=a.i(676653);let aQ=d.forwardRef(({className:a,children:b,...d},e)=>(0,c.jsxs)(Y,{ref:e,className:(0,aP.cn)("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",a),...d,children:[b,(0,c.jsx)(_,{asChild:!0,children:(0,c.jsx)(aN,{className:"h-4 w-4 opacity-50"})})]}));aQ.displayName=Y.displayName;let aR=d.forwardRef(({className:a,...b},d)=>(0,c.jsx)(aB,{ref:d,className:(0,aP.cn)("flex cursor-default items-center justify-center py-1",a),...b,children:(0,c.jsx)(aO,{className:"h-4 w-4"})}));aR.displayName=aB.displayName;let aS=d.forwardRef(({className:a,...b},d)=>(0,c.jsx)(aD,{ref:d,className:(0,aP.cn)("flex cursor-default items-center justify-center py-1",a),...b,children:(0,c.jsx)(aN,{className:"h-4 w-4"})}));aS.displayName=aD.displayName;let aT=d.forwardRef(({className:a,children:b,position:d="popper",...e},f)=>(0,c.jsx)(aa,{children:(0,c.jsxs)(ac,{ref:f,className:(0,aP.cn)("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2","popper"===d&&"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:d,...e,children:[(0,c.jsx)(aR,{}),(0,c.jsx)(am,{className:(0,aP.cn)("p-1","popper"===d&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:b}),(0,c.jsx)(aS,{})]})}));aT.displayName=ac.displayName,d.forwardRef(({className:a,...b},d)=>(0,c.jsx)(ar,{ref:d,className:(0,aP.cn)("py-1.5 pl-8 pr-2 text-sm font-semibold",a),...b})).displayName=ar.displayName;let aU=d.forwardRef(({className:a,children:b,...d},e)=>(0,c.jsxs)(av,{ref:e,className:(0,aP.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),...d,children:[(0,c.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,c.jsx)(az,{children:(0,c.jsx)(aL.Check,{className:"h-4 w-4"})})}),(0,c.jsx)(ax,{children:b})]}));aU.displayName=av.displayName,d.forwardRef(({className:a,...b},d)=>(0,c.jsx)(aF,{ref:d,className:(0,aP.cn)("-mx-1 my-1 h-px bg-muted",a),...b})).displayName=aF.displayName,a.s(["Select",()=>W,"SelectContent",()=>aT,"SelectItem",()=>aU,"SelectTrigger",()=>aQ,"SelectValue",()=>$],175196)}];
|
|
2
|
-
|
|
3
|
-
//# sourceMappingURL=packages_web_src_components_ui_select_tsx_7c5238ef._.js.map
|