@ahmedrowaihi/8n 6.0.58 → 6.0.60

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/dist/index.mjs CHANGED
@@ -3533,7 +3533,7 @@ async function checkSelfUpdate() {
3533
3533
  });
3534
3534
  if (!res.ok) return;
3535
3535
  const { version: latest } = await res.json();
3536
- const current = "6.0.58";
3536
+ const current = "6.0.60";
3537
3537
  if (latest !== current) console.log(pc.yellow("⚠") + pc.dim(` new version available: `) + pc.cyan(latest) + pc.dim(` (current: ${current}) — run `) + pc.cyan("npm i -g @ahmedrowaihi/8n") + pc.dim(" to update"));
3538
3538
  } catch {}
3539
3539
  }
@@ -3643,7 +3643,7 @@ async function dev() {
3643
3643
  async function build({ server = false } = {}) {
3644
3644
  const { config, contentDir } = await resolveProject();
3645
3645
  const projectDir = process.cwd();
3646
- console.log(pc.cyan("8n") + pc.dim(` v6.0.58 build → ${contentDir}`));
3646
+ console.log(pc.cyan("8n") + pc.dim(` v6.0.60 build → ${contentDir}`));
3647
3647
  if (server) await runNextFlat(projectDir, "build", buildEnv({
3648
3648
  config,
3649
3649
  contentDir,
@@ -4018,7 +4018,7 @@ async function mcp() {
4018
4018
  const mcpDir = join(getStarterDir(), "content", "mcp");
4019
4019
  const server = new McpServer({
4020
4020
  name: "8n",
4021
- version: "6.0.58"
4021
+ version: "6.0.60"
4022
4022
  });
4023
4023
  server.registerTool("read_me", {
4024
4024
  description: "Returns how to use the 8n MCP tools. Call this BEFORE documenting anything with 8n.",
@@ -4136,7 +4136,7 @@ async function generateApi({ input, output }) {
4136
4136
 
4137
4137
  //#endregion
4138
4138
  //#region src/index.ts
4139
- const program = new Command().name("8n").description("Run your 8n docs site").version("6.0.58").addOption(new Option("--debug").hideHelp()).hook("preAction", (cmd) => {
4139
+ const program = new Command().name("8n").description("Run your 8n docs site").version("6.0.60").addOption(new Option("--debug").hideHelp()).hook("preAction", (cmd) => {
4140
4140
  if (cmd.opts().debug) process.env.DEBUG_8N = "1";
4141
4141
  });
4142
4142
  program.command("init").description("Scaffold a new docs project in the current directory").action(init);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ahmedrowaihi/8n",
3
- "version": "6.0.58",
3
+ "version": "6.0.60",
4
4
  "description": "8n docs — run your docs site from your content directory",
5
5
  "bin": {
6
6
  "8n": "./dist/index.mjs"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ahmedrowaihi/8n-starter",
3
- "version": "6.0.58",
3
+ "version": "6.0.60",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "exports": {
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- import{jsx as e,jsxs as t,Fragment as r}from"react/jsx-runtime";import{Fragment as a,useState as n}from"react";import{cva as i}from"class-variance-authority";import{Link as l}from"../../../../lib/navigation";import{cn as s}from"../../../../lib/cn";import{renderTitleNav as o,useLinkItems as m}from"../shared";import{LinkItem as c}from"../link-item";import{NavigationMenu as d,NavigationMenuContent as f,NavigationMenuItem as u,NavigationMenuLink as p,NavigationMenuList as h,NavigationMenuTrigger as x}from"../../../ui/navigation-menu";import{buttonVariants as g}from"../../../ui/button";import{LargeSearchToggle as v,SearchToggle as N}from"../search-toggle";import{ThemeToggle as b}from"../theme-toggle";import{ChevronDown as y}from"lucide-react";import{useIsScrollTop as w}from"@fumadocs/base-ui/utils/use-is-scroll-top";import{useI18n as z}from"@fumadocs/base-ui/contexts/i18n";import{LanguageSwitcher as j}from"../../../language-switcher";export const navItemVariants=i("[&_svg]:size-4",{variants:{variant:{main:"inline-flex items-center gap-1 p-2 text-fd-muted-foreground transition-colors hover:text-fd-accent-foreground data-[active=true]:text-fd-primary",button:g({variant:"secondary",className:"gap-1.5"}),icon:g({variant:"ghost",size:"icon"})}},defaultVariants:{variant:"main"}});export function Header({nav:r={},links:a,githubUrl:n,themeSwitch:i={},searchToggle:l={}}){let{navItems:c,menuItems:d}=m({links:a,githubUrl:n}),{text:p}=z();return t(V,{transparentMode:r.transparentMode,children:[o(r,{className:"inline-flex items-center gap-2.5 font-semibold"}),r.children,e("ul",{className:"flex flex-row items-center gap-2 px-6 max-sm:hidden",children:c.filter(e=>!I(e)).map((t,r)=>e(_,{item:t,className:"text-sm"},r))}),t("div",{className:"flex flex-row items-center justify-end gap-1.5 flex-1 max-lg:hidden",children:[!1!==l.enabled&&(l.components?.lg??e(v,{className:"w-full rounded-full ps-2.5 max-w-60",hideIfDisabled:!0})),!1!==i.enabled&&(i.component??e(b,{mode:i?.mode})),e(j,{}),e("ul",{className:"flex flex-row gap-2 items-center empty:hidden",children:c.filter(I).map((t,r)=>e(_,{className:s("icon"===t.type&&"-mx-1 first:ms-0 last:me-0"),item:t},r))})]}),t("div",{className:"flex flex-row items-center ms-auto -me-1.5 lg:hidden",children:[!1!==l.enabled&&(l.components?.sm??e(N,{className:"p-2",hideIfDisabled:!0})),t(u,{render:e("div",{}),children:[e(x,{"aria-label":p.toggleMenu,className:s(g({size:"icon",variant:"ghost",className:"group [&_svg]:size-5.5"})),onPointerMove:r.enableHoverToOpen?void 0:e=>e.preventDefault(),children:e(y,{className:"transition-transform duration-300 group-data-[state=open]:rotate-180"})}),t(f,{className:"flex flex-col p-4 sm:flex-row sm:items-center sm:justify-end",children:[d.filter(e=>!I(e)).map((t,r)=>e(k,{item:t,className:"sm:hidden"},r)),t("div",{className:"-ms-1.5 flex flex-row items-center gap-2 max-sm:mt-2",children:[d.filter(I).map((t,r)=>e(k,{item:t,className:s("icon"===t.type&&"-mx-1 first:ms-0")},r)),e("div",{role:"separator",className:"flex-1"}),e(j,{}),!1!==i.enabled&&(i.component??e(b,{mode:i?.mode}))]})]})]})]})]})}function I(e){return"secondary"in e&&null!=e.secondary?e.secondary:"icon"===e.type}function V({transparentMode:t="none",children:r,...a}){let[i,l]=n(""),o=w({enabled:"top"===t})??!0;return e("header",{id:"nd-nav",...a,className:s("sticky h-14 top-0 z-40",a.className),children:e(d,{value:i,onValueChange:e=>l(e??""),className:"w-full max-w-none",children:e("div",{className:s("w-full backdrop-blur-lg border-b transition-colors *:mx-auto *:max-w-(--fd-layout-width)",i&&i.length>0&&"max-lg:shadow-lg max-lg:rounded-b-2xl",(!("top"===t?o:"always"===t)||i&&i.length>0)&&"bg-fd-background/80"),children:e(h,{className:"flex h-14 w-full items-center justify-start px-4",render:e("nav",{}),children:r})})})})}function _({item:n,...i}){if("custom"===n.type)return n.children;if("menu"===n.type){let o=n.items.map((n,i)=>{if("custom"===n.type)return e(a,{children:n.children},i);let{banner:o=n.icon?e("div",{className:"w-fit rounded-md border bg-fd-muted p-1 [&_svg]:size-4",children:n.icon}):null,className:m,children:c,...d}=n.menu??{};return e(p,{render:e(l,{href:n.url,external:n.external,...d}),className:s("flex flex-col gap-2 rounded-lg border bg-fd-card p-3 transition-colors hover:bg-fd-accent/80 hover:text-fd-accent-foreground",m),children:c??t(r,{children:[o,e("p",{className:"text-base font-medium",children:n.text}),e("p",{className:"text-sm text-fd-muted-foreground empty:hidden",children:n.description})]})},`${i}-${n.url}`)});return t(u,{...i,children:[e(x,{className:s(navItemVariants(),"rounded-md"),children:n.url?e(l,{href:n.url,external:n.external,children:n.text}):n.text}),e(f,{className:"grid grid-cols-1 gap-2 p-4 md:grid-cols-2 lg:grid-cols-3",children:o})]})}return e(u,{...i,children:e(p,{render:e(c,{item:n,"aria-label":"icon"===n.type?n.label:void 0}),className:s(navItemVariants({variant:n.type})),children:"icon"===n.type?n.icon:n.text})})}function k({item:a,...n}){if("custom"===a.type)return e("div",{className:s("grid",n.className),children:a.children});if("menu"===a.type){let i=t(r,{children:[a.icon,a.text]});return t("div",{className:s("mb-4 flex flex-col",n.className),children:[e("p",{className:"mb-1 text-sm text-fd-muted-foreground",children:a.url?e(p,{render:e(l,{href:a.url,external:a.external}),children:i}):i}),a.items.map((t,r)=>e(k,{item:t},r))]})}return t(p,{render:e(c,{item:a,"aria-label":"icon"===a.type?a.label:void 0}),className:s({main:"inline-flex items-center gap-2 py-1.5 transition-colors hover:text-fd-popover-foreground/50 data-[active=true]:font-medium data-[active=true]:text-fd-primary [&_svg]:size-4",icon:g({size:"icon",variant:"ghost"}),button:g({variant:"secondary",className:"gap-1.5 [&_svg]:size-4"})}[a.type??"main"],n.className),children:[a.icon,"icon"===a.type?void 0:a.text]})}
2
+ import{jsx as e,jsxs as t,Fragment as r}from"react/jsx-runtime";import{Fragment as a,useState as n}from"react";import{cva as i}from"class-variance-authority";import{Link as l}from"../../../../lib/navigation";import{cn as o}from"../../../../lib/cn";import{renderTitleNav as s,useLinkItems as d}from"../shared";import{LinkItem as m}from"../link-item";import{NavigationMenu as c,NavigationMenuContent as f,NavigationMenuItem as u,NavigationMenuLink as p,NavigationMenuList as h,NavigationMenuTrigger as g}from"../../../ui/navigation-menu";import{buttonVariants as x}from"../../../ui/button";import{LargeSearchToggle as v,SearchToggle as b}from"../search-toggle";import{ThemeToggle as N}from"../theme-toggle";import{ChevronDown as y,MoreHorizontal as w}from"lucide-react";import{Menu as z}from"@base-ui/react/menu";import{useIsScrollTop as I}from"@fumadocs/base-ui/utils/use-is-scroll-top";import{useI18n as j}from"@fumadocs/base-ui/contexts/i18n";import{LanguageSwitcher as V}from"../../../language-switcher";export const navItemVariants=i("[&_svg]:size-4",{variants:{variant:{main:"inline-flex items-center gap-1 p-2 text-fd-muted-foreground transition-colors hover:text-fd-accent-foreground data-[active=true]:text-fd-primary",button:x({variant:"secondary",className:"gap-1.5"}),icon:x({variant:"ghost",size:"icon"})}},defaultVariants:{variant:"main"}});export function Header({nav:r={},links:a,githubUrl:n,themeSwitch:i={},searchToggle:l={}}){let{navItems:m,menuItems:c}=d({links:a,githubUrl:n}),{text:p}=j();return t(k,{transparentMode:r.transparentMode,children:[s(r,{className:"inline-flex items-center gap-2.5 font-semibold"}),r.children,t("ul",{className:"flex flex-row items-center gap-2 px-6 max-sm:hidden",children:[m.filter(e=>!P(e)).slice(0,_).map((t,r)=>e(D,{item:t,className:"text-sm"},r)),m.filter(e=>!P(e)).length>_&&e(M,{items:m.filter(e=>!P(e)).slice(_)})]}),t("div",{className:"flex flex-row items-center justify-end gap-1.5 flex-1 max-lg:hidden",children:[!1!==l.enabled&&(l.components?.lg??e(v,{className:"w-full rounded-full ps-2.5 max-w-60",hideIfDisabled:!0})),!1!==i.enabled&&(i.component??e(N,{mode:i?.mode})),e(V,{}),e("ul",{className:"flex flex-row gap-2 items-center empty:hidden",children:m.filter(P).map((t,r)=>e(D,{className:o("icon"===t.type&&"-mx-1 first:ms-0 last:me-0"),item:t},r))})]}),t("div",{className:"flex flex-row items-center ms-auto -me-1.5 lg:hidden",children:[!1!==l.enabled&&(l.components?.sm??e(b,{className:"p-2",hideIfDisabled:!0})),t(u,{render:e("div",{}),children:[e(g,{"aria-label":p.toggleMenu,className:o(x({size:"icon",variant:"ghost",className:"group [&_svg]:size-5.5"})),onPointerMove:r.enableHoverToOpen?void 0:e=>e.preventDefault(),children:e(y,{className:"transition-transform duration-300 group-data-[state=open]:rotate-180"})}),t(f,{className:"flex flex-col p-4 sm:flex-row sm:items-center sm:justify-end",children:[c.filter(e=>!P(e)).map((t,r)=>e(H,{item:t,className:"sm:hidden"},r)),t("div",{className:"-ms-1.5 flex flex-row items-center gap-2 max-sm:mt-2",children:[c.filter(P).map((t,r)=>e(H,{item:t,className:o("icon"===t.type&&"-mx-1 first:ms-0")},r)),e("div",{role:"separator",className:"flex-1"}),e(V,{}),!1!==i.enabled&&(i.component??e(N,{mode:i?.mode}))]})]})]})]})]})}let _=4;function M({items:r}){return t(z.Root,{children:[e(z.Trigger,{className:o(navItemVariants(),"rounded-md text-sm cursor-pointer"),children:e(w,{className:"size-4"})}),e(z.Portal,{children:e(z.Positioner,{side:"bottom",align:"start",sideOffset:8,children:e(z.Popup,{className:"z-50 min-w-36 rounded-lg border border-fd-border bg-fd-popover p-1 text-fd-popover-foreground shadow-md outline-none data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",children:r.map((r,a)=>"custom"!==r.type&&"url"in r&&r.url?t(z.Item,{render:e(m,{item:r}),className:o(navItemVariants({variant:"main"}),"w-full justify-start rounded-md px-3 py-2 text-sm cursor-pointer hover:bg-fd-accent hover:text-fd-accent-foreground data-highlighted:bg-fd-accent data-highlighted:text-fd-accent-foreground"),children:["icon"in r&&r.icon,"text"in r&&r.text]},a):null)})})})]})}function P(e){return"secondary"in e&&null!=e.secondary?e.secondary:"icon"===e.type}function k({transparentMode:t="none",children:r,...a}){let[i,l]=n(""),s=I({enabled:"top"===t})??!0;return e("header",{id:"nd-nav",...a,className:o("h-14",a.className),children:e(c,{value:i,onValueChange:e=>l(e??""),className:"w-full max-w-none",children:e("div",{className:o("w-full backdrop-blur-lg border-b transition-colors *:mx-auto *:max-w-(--fd-layout-width)",i&&i.length>0&&"max-lg:shadow-lg max-lg:rounded-b-2xl",(!("top"===t?s:"always"===t)||i&&i.length>0)&&"bg-fd-background/80"),children:e(h,{className:"flex h-14 w-full items-center justify-start px-4",render:e("nav",{}),children:r})})})})}function D({item:n,...i}){if("custom"===n.type)return n.children;if("menu"===n.type){let s=n.items.map((n,i)=>{if("custom"===n.type)return e(a,{children:n.children},i);let{banner:s=n.icon?e("div",{className:"w-fit rounded-md border bg-fd-muted p-1 [&_svg]:size-4",children:n.icon}):null,className:d,children:m,...c}=n.menu??{};return e(p,{render:e(l,{href:n.url,external:n.external,...c}),className:o("flex flex-col gap-2 rounded-lg border bg-fd-card p-3 transition-colors hover:bg-fd-accent/80 hover:text-fd-accent-foreground",d),children:m??t(r,{children:[s,e("p",{className:"text-base font-medium",children:n.text}),e("p",{className:"text-sm text-fd-muted-foreground empty:hidden",children:n.description})]})},`${i}-${n.url}`)});return t(u,{...i,children:[e(g,{className:o(navItemVariants(),"rounded-md"),children:n.url?e(l,{href:n.url,external:n.external,children:n.text}):n.text}),e(f,{className:"grid grid-cols-1 gap-2 p-4 md:grid-cols-2 lg:grid-cols-3",children:s})]})}return e(u,{...i,children:e(p,{render:e(m,{item:n,"aria-label":"icon"===n.type?n.label:void 0}),className:o(navItemVariants({variant:n.type})),children:"icon"===n.type?n.icon:n.text})})}function H({item:a,...n}){if("custom"===a.type)return e("div",{className:o("grid",n.className),children:a.children});if("menu"===a.type){let i=t(r,{children:[a.icon,a.text]});return t("div",{className:o("mb-4 flex flex-col",n.className),children:[e("p",{className:"mb-1 text-sm text-fd-muted-foreground",children:a.url?e(p,{render:e(l,{href:a.url,external:a.external}),children:i}):i}),a.items.map((t,r)=>e(H,{item:t},r))]})}return t(p,{render:e(m,{item:a,"aria-label":"icon"===a.type?a.label:void 0}),className:o({main:"inline-flex items-center gap-2 py-1.5 transition-colors hover:text-fd-popover-foreground/50 data-[active=true]:font-medium data-[active=true]:text-fd-primary [&_svg]:size-4",icon:x({size:"icon",variant:"ghost"}),button:x({variant:"secondary",className:"gap-1.5 [&_svg]:size-4"})}[a.type??"main"],n.className),children:[a.icon,"icon"===a.type?void 0:a.text]})}
@@ -1 +1 @@
1
- function e(e){if(!e)return null;let t=new Date(e.trim());return isNaN(t.getTime())?null:t}export async function fetchFeed(t,r){try{var n,l;let o=await fetch(t),u=await o.text(),i=new DOMParser().parseFromString(u,"text/xml");if(i.querySelector("parsererror"))return{status:"error",source:r,message:"Invalid XML"};return{status:"ok",items:(n=i,l=r,null!==n.querySelector("feed")?Array.from(n.querySelectorAll("entry")).map(t=>({title:t.querySelector("title")?.textContent?.trim()??"(no title)",url:t.querySelector("link[rel='alternate']")?.getAttribute("href")??t.querySelector("link")?.getAttribute("href")??"",date:e(t.querySelector("published")?.textContent??t.querySelector("updated")?.textContent),summary:t.querySelector("summary")?.textContent?.trim()??t.querySelector("content")?.textContent?.slice(0,200)?.trim()??"",source:l})):Array.from(n.querySelectorAll("item")).map(t=>({title:t.querySelector("title")?.textContent?.trim()??"(no title)",url:t.querySelector("link")?.textContent?.trim()??t.querySelector("guid")?.textContent?.trim()??"",date:e(t.querySelector("pubDate")?.textContent),summary:t.querySelector("description")?.textContent?.slice(0,200)?.trim()??"",source:l})))}}catch(t){let e=t instanceof TypeError?t.message:String(t);if(e.includes("Failed to fetch")||e.includes("NetworkError")||e.includes("CORS"))return{status:"cors",source:r};return{status:"error",source:r,message:e}}}
1
+ function e(e){return new DOMParser().parseFromString(e,"text/html").body.textContent?.trim()??""}function t(e){if(!e)return null;let t=new Date(e.trim());return isNaN(t.getTime())?null:t}export async function fetchFeed(r,n){try{var o,l;let u=await fetch(r),i=await u.text(),c=new DOMParser().parseFromString(i,"text/xml");if(c.querySelector("parsererror"))return{status:"error",source:n,message:"Invalid XML"};return{status:"ok",items:(o=c,l=n,null!==o.querySelector("feed")?Array.from(o.querySelectorAll("entry")).map(r=>({title:r.querySelector("title")?.textContent?.trim()??"(no title)",url:r.querySelector("link[rel='alternate']")?.getAttribute("href")??r.querySelector("link")?.getAttribute("href")??"",date:t(r.querySelector("published")?.textContent??r.querySelector("updated")?.textContent),summary:e(r.querySelector("summary")?.textContent??r.querySelector("content")?.textContent??"").slice(0,200),source:l})):Array.from(o.querySelectorAll("item")).map(r=>({title:r.querySelector("title")?.textContent?.trim()??"(no title)",url:r.querySelector("link")?.textContent?.trim()??r.querySelector("guid")?.textContent?.trim()??"",date:t(r.querySelector("pubDate")?.textContent),summary:e(r.querySelector("description")?.textContent??"").slice(0,200),source:l})))}}catch(t){let e=t instanceof TypeError?t.message:String(t);if(e.includes("Failed to fetch")||e.includes("NetworkError")||e.includes("CORS"))return{status:"cors",source:n};return{status:"error",source:n,message:e}}}
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- import{jsx as e,jsxs as r,Fragment as a}from"react/jsx-runtime";import{env as t}from"../../config";import{localeConfig as s,defaultLocale as l}from"../../locale.config";import{LogoLoader as n}from"../../components/logo-loader";import{useUpstreamFeeds as o}from"./use-upstream-feeds";import{ExternalLink as i,AlertTriangle as m}from"lucide-react";export function UpstreamPage({lang:c}){var d;let p=(d=c,s[d]?.translations??s[l].translations),{loading:u,results:x,items:f}=o(t.NEXT_PUBLIC_UPSTREAM_SOURCES),h=x.filter(e=>"ok"!==e.status);return r("div",{className:"container max-w-3xl py-12 px-4",children:[e("h1",{className:"text-2xl font-bold mb-8",children:p.upstream}),u&&e("div",{className:"flex justify-center py-24",children:e(n,{className:"size-12"})}),!u&&h.length>0&&e("div",{className:"mb-8 flex flex-col gap-3",children:h.map((a,t)=>r("div",{className:"flex gap-3 rounded-lg border border-amber-500/30 bg-amber-500/10 px-4 py-3 text-sm text-amber-700 dark:text-amber-400",children:[e(m,{className:"mt-0.5 size-4 shrink-0"}),r("div",{children:[e("span",{className:"font-medium",children:a.source})," — ","cors"===a.status?p.upstreamCorsHint:p.upstreamError]})]},t))}),!u&&0===f.length&&0===h.length&&e("p",{className:"text-muted-foreground",children:p.upstreamEmpty}),!u&&f.length>0&&e("div",{className:"flex flex-col divide-y divide-border",children:f.map((t,l)=>r("a",{href:t.url,target:"_blank",rel:"noopener noreferrer",className:"group flex flex-col gap-1 py-5 hover:bg-muted/40 -mx-4 px-4 rounded-lg transition-colors",children:[r("div",{className:"flex items-start justify-between gap-4",children:[e("span",{className:"font-medium group-hover:text-primary transition-colors line-clamp-2",children:t.title}),e(i,{className:"mt-1 size-3.5 shrink-0 opacity-40 group-hover:opacity-70 transition-opacity"})]}),t.summary&&e("p",{className:"text-sm text-muted-foreground line-clamp-2",children:t.summary}),r("div",{className:"flex gap-2 text-xs text-muted-foreground/70 mt-1",children:[e("span",{children:t.source}),t.date&&r(a,{children:[e("span",{children:"·"}),e("span",{children:t.date.toLocaleDateString(s[c]?.translations.dateLocale??"en-US",{year:"numeric",month:"short",day:"numeric"})})]})]})]},l))})]})}
2
+ import{jsx as e,jsxs as r}from"react/jsx-runtime";import{env as t}from"../../config";import{localeConfig as a,defaultLocale as s}from"../../locale.config";import{LogoLoader as l}from"../../components/logo-loader";import{useUpstreamFeeds as n}from"./use-upstream-feeds";import{ExternalLink as i,AlertTriangle as m,Rss as o}from"lucide-react";export function UpstreamPage({lang:d}){var c;let p=(c=d,a[c]?.translations??a[s].translations),u=t.NEXT_PUBLIC_UPSTREAM_SOURCES,{loading:g,results:x,items:h}=n(u),f=x.filter(e=>"ok"!==e.status),N=a[d]?.translations.dateLocale??"en-US";return r("div",{className:"container max-w-6xl py-12 px-4",children:[r("div",{className:"flex items-center gap-3 mb-10",children:[e("div",{className:"flex size-9 items-center justify-center rounded-lg bg-primary/10 text-primary",children:e(o,{className:"size-4"})}),r("div",{children:[e("h1",{className:"text-xl font-semibold leading-tight",children:p.upstream}),!g&&h.length>0&&r("p",{className:"text-xs text-muted-foreground mt-0.5",children:[h.length," articles · ",u.length," sources"]})]})]}),g&&e("div",{className:"flex justify-center py-24",children:e(l,{className:"size-10"})}),!g&&f.length>0&&e("div",{className:"mb-8 flex flex-col gap-2",children:f.map((t,a)=>r("div",{className:"flex gap-3 rounded-lg border border-amber-500/20 bg-amber-500/5 px-4 py-3 text-sm text-amber-700 dark:text-amber-400",children:[e(m,{className:"mt-0.5 size-4 shrink-0"}),r("span",{children:[e("span",{className:"font-medium",children:t.source})," — ","cors"===t.status?p.upstreamCorsHint:p.upstreamError]})]},a))}),!g&&0===h.length&&0===f.length&&e("p",{className:"text-muted-foreground",children:p.upstreamEmpty}),!g&&h.length>0&&e("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3",children:h.map((t,a)=>r("a",{href:t.url,target:"_blank",rel:"noopener noreferrer",className:"group relative flex flex-col gap-2 rounded-xl border border-border/60 bg-card px-5 py-4 shadow-sm transition-all hover:border-border hover:shadow-md",children:[r("div",{className:"flex items-start justify-between gap-4",children:[e("span",{className:"font-medium leading-snug group-hover:text-primary transition-colors line-clamp-2",children:t.title}),e(i,{className:"mt-0.5 size-3.5 shrink-0 text-muted-foreground/40 group-hover:text-primary/60 transition-colors"})]}),t.summary&&e("p",{className:"text-sm text-muted-foreground line-clamp-2 leading-relaxed",children:t.summary}),r("div",{className:"flex items-center gap-2 mt-1",children:[e("span",{className:"inline-flex items-center rounded-md bg-muted px-2 py-0.5 text-[11px] font-medium text-muted-foreground",children:t.source}),t.date&&e("span",{className:"text-[11px] text-muted-foreground/60",children:t.date.toLocaleDateString(N,{year:"numeric",month:"short",day:"numeric"})})]})]},a))})]})}