PageSourceSearch

https://rustrepo.com/_next/static/chunks/561-635b29199e16bf96.js

js rustrepo.com collected 2026-10-04 02:08:23 UTC 14,774 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[561],{3561:(e,r,s)=>{s.d(r,{z:()=>w});var t=s(5155),a=s(8173),n=s.n(a),o=s(1567);function i(e){let{className:r}=e;return(0,t.jsx)("svg",{className:r,fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11.48 3.499a.562.562 0 011.04 0l2.125 5.111a.563.563 0 00.475.345l5.518.442c.499.04.701.663.321.988l-4.204 3.602a.563.563 0 00-.182.557l1.285 5.385a.562.562 0 01-.84.61l-4.725-2.885a.563.563 0 00-.586 0L6.982 20.54a.562.562 0 01-.84-.61l1.285-5.386a.562.562 0 00-.182-.557l-4.204-3.602a.563.563 0 01.321-.988l5.518-.442a.563.563 0 00.475-.345L11.48 3.5z"})})}function l(e){let{className:r}=e;return(0,t.jsx)("svg",{className:r,fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,t.jsx)("path",{fillRule:"evenodd",d:"M10.788 3.21c.448-1.077 1.976-1.077 2.424 0l2.082 5.007 5.404.433c1.164.093 1.636 1.545.749 2.305l-4.117 3.527 1.257 5.273c.271 1.136-.964 2.033-1.96 1.425L12 18.354 7.373 21.18c-.996.608-2.231-.29-1.96-1.425l1.257-5.273-4.117-3.527c-.887-.76-.415-2.212.749-2.305l5.404-.433 2.082-5.006z",clipRule:"evenodd"})})}function c(e){let{className:r}=e;return(0,t.jsx)("svg",{className:r,fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7.217 10.9
107a2.25 2.25 0 100 2.186m0-2.186c.18.324.283.696.283 1.093s-.103.77-.283 1.093m0-2.186l9.566-5.314m-9.566 7.5l9.566 5.314m0 0a2.25 2.25 0 103.935 2.186 2.25 2.25 0 00-3.935-2.186zm0-12.814a2.25 2.25 0 103.933-2.185 2.25 2.25 0 00-3.933 2.185z"})})}function d(e){let{className:r}=e;return(0,t.jsx)("svg",{className:r,fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6v6h4.5m4.5 0a9 9 0 11-18 0 9 9 0 0118 0z"})})}function u(e){let{className:r}=e;return(0,t.jsx)("svg",{className:r,fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17.593 3.322c1.1.128 1.907 1.077 1.907 2.185V21L12 17.25 4.5 21V5.507c0-1.108.806-2.057 1.907-2.185a48.507 48.507 0 0111.186 0z"})})}function m(e){let{className:r}=e;return(0,t.jsx)("svg",{className:r,fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,t.jsx)("path",{fillRule:"evenodd",d:"M6.32 2.577a49.255 49.255 0 0111.36 0c1.497.174 2.57 1.46 2.57 2.93V21a.75.75 0 01-1.085.67L12 18.089l-7.165 3.583A.75.75 0 013.75 21V5.507c0-1.47 1.073-2.756 2.57-2.93z",clipRule:"evenodd"})})}function x(e){let{className:r}=e;return(0,t.jsx)("svg",{className:r,fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 3v17.25m0 0c-1.472 0-2.882.265-4.185.75M12 20.25c1.472 0 2.882.265 4.185.75M18.75 4.97A48.416 48.416 0 0012 4.5c-2.291 0-4.545.16-6.75.47m13.5 0c1.01.143 2.01.317 3 .52m-3-.52l2.62 10.726c.122.499-.106 1.028-.589 1.202a5.988 5.988 0 01-2.031.352 5.988 5.988 0 01-2.031-.352c-.483-.174-.711-.703-.59-1.202L18.75 4.971zm-16.5.52c.99-.203 1.99-.377 3-.52m0 0l2.62 10.726c.122.499-.106 1.028-.589 1.202a5.989 5.989 0 01-2.031.352 5.989 5.989 0 01-2.031-.352c-.483-.174-.711-.703-.59-1.202L5.25 4.971z"})})}function f(e){let{className:r}=e;return(0,t.jsx)("svg",{className:r,fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 12.75l6 6 9-13.5"})})}function h(e){let{className:r}=e;return(0,t.jsx)("svg",{className:r,fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.5 6H5.25A2.25 2.25 0 003 8.25v10.5A2.25 2.25 0 005.25 21h10.5A2.25 2.25 0 0018 18.75V10.5m-10.5 6L21 3m0 0h-5.25M21 3v5.25"})})}function g(e){return e>=1e6?"".concat((e/1e6).toFixed(1),"M"):e>=1e3?"".concat((e/1e3).toFixed(1),"K"):e.toString()}function p(e){let r=new Date(e),s=Math.floor((new Date().getTime()-r.getTime())/864e5);if(0===s)return"Today";if(1===s)return"Yesterday";if(s<7)return"".concat(s," days ago");if(s<30){let e=Math.floor(s/7);return"".concat(e," ").concat(1===e?"week":"weeks"," ago")}if(s<365){let e=Math.floor(s/30);return"".concat(e," ").concat(1===e?"month":"months"," ago")}let t=Math.floor(s/365);return"".concat(t," ").concat(1===t?"year":"years"," ago")}function b(e){let{status:r,className:s=""}=e,a=function(e){switch(e){case"active":return{bg:"bg-success/10",text:"text-success",dot:"bg-success"};case"maintained":return{bg:"bg-primary/10",text:"text-primary-500",dot:"bg-primary-500"};case"inactive":return{bg:"bg-warning/10",text:"text-warning",dot:"bg-warning"};case"archived":return{bg:"bg-error/10",text:"text-error",dot:"bg-error"};default:return{bg:"bg-surface-overlay",text:"text-foreground-muted",dot:"bg-foreground-subtle"}}}(r),n=function(e){switch(e){case"active":return"Active";case"maintained":return"Maintained";case"inactive":return"Inactive";case"archived":return"Archived";default:return"Unknown"}}(r);return(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5 rounded-full px-2 py-0.5 text-xs font-medium ".concat(a.bg," ").concat(a.text," ").concat(s),role:"status","aria-label":"Activity status: ".concat(n),children:[(0,t.jsx)("span",{className:"h-1.5 w-1.5 rounded-full ".concat(a.dot),"aria-hidden":"true"}),n]})}function v(e){let{icon:r,value:s,label:a,className:n=""}=e;return(0,t.jsxs)("div",{className:"flex items-center gap-1.5 text-foreground-muted ".concat(n),title:a,children:[r,(0,t.jsx)("span",{className:"text-sm font-medium","aria-label":a,children:s})]})}function j(e){let{onClick:r,isActive:s=!1,activeIcon:a,inactiveIcon:n,label:o,activeLabel:i,className:l=""}=e;return(0,t.jsx)("button",{type:"button",onClick:e=>{e.preventDefault(),e.stopPropagation(),r()},className:"\n        cursor-pointer rounded-lg p-2 transition-colors duration-200\n        focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500\n        ".concat(s?"bg-primary/10 text-primary-500 hover:bg-primary/20":"text-foreground-muted hover:bg-surface-overlay hover:text-foreground","\n        ").concat(l,"\n      "),"aria-label":s?i:o,"aria-pressed":s,children:s?a:n})}function N(e){let{resource:r,onBookmark:s,onCompare:a,isBookmarked:l=!1,isSelected:b=!1}=e,{github:N}=r,k=!!N,w=k?"/resource/".concat(r.id,"/"):r.url,y=!k,L=(0,t.jsxs)("article",{className:"\n        group relative flex cursor-pointer flex-col rounded-lg border bg-surface p-4\n        transition-all duration-200 hover:border-primary/50 hover:shadow-soft\n        ".concat(b?"border-primary ring-2 ring-primary/20":"border-border","\n      "),"aria-labelledby":"resource-".concat(r.id,"-name"),children:[y&&(0,t.jsx)("div",{className:"absolute -right-2 -top-2 flex h-6 w-6 items-center justify-center rounded-full bg-surface-overlay text-foreground-muted",children:(0,t.jsx)(h,{className:"h-3.5 w-3.5"})}),b&&!y&&(0,t.jsx)("div",{className:"absolute -right-2 -top-2 flex h-6 w-6 items-center justify-center rounded-full bg-primary text-white",children:(0,t.jsx)(f,{className:"h-4 w-4"})}),(0,t.jsxs)("div",{className:"mb-2 flex items-start justify-between gap-2",children:[(0,t.jsx)("h3",{id:"resource-".concat(r.id,"-name"),className:"flex-1 line-clamp-1 text-base font-semibold text-foreground transition-colors duration-200 group-hover:text-primary-500",children:r.name}),(0,t.jsxs)("div",{className:"flex items-center gap-1 opacity-0 transition-opacity duration-200 group-hover:opacity-100",children:[s&&(0,t.jsx)(j,{onClick:()=>s(r.id),isActive:l,activeIcon:(0,t.jsx)(m,{className:"h-4 w-4"}),inactiveIcon:(0,t.jsx)(u,{className:"h-4 w-4"}),label:"Add to bookmarks",activeLabel:"Remove from bookmarks"}),a&&(0,t.jsx)(j,{onClick:()=>a(r.id),isActive:b,activeIcon:(0,t.jsx)(f,{className:"h-4 w-4"}),inactiveIcon:(0,t.jsx)(x,{className:"h-4 w-4"}),label:"Add to comparison",activeLabel:"Remove from comparison"})]})]}),(0,t.jsx)("p",{className:"mb-3 line-clamp-2 flex-1 text-sm text-foreground-muted",children:(0,o.eA)(r.de
1scription)||"No description available"}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[N&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(v,{icon:(0,t.jsx)(i,{className:"h-4 w-4"}),value:g(N.stars),label:"".concat(N.stars," stars")}),(0,t.jsx)(v,{icon:(0,t.jsx)(c,{className:"h-4 w-4"}),value:g(N.forks),label:"".concat(N.forks," forks")}),(0,t.jsx)(v,{icon:(0,t.jsx)(d,{className:"h-4 w-4"}),value:p(N.lastCommit),label:"Last commit: ".concat(N.lastCommit)})]}),!N&&(0,t.jsx)("span",{className:"text-xs text-foreground-subtle",children:"External resource"})]})]});return y?(0,t.jsx)("a",{href:w,target:"_blank",rel:"noopener noreferrer",className:"block focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:ring-offset-2 rounded-lg",children:L}):(0,t.jsx)(n(),{href:w,className:"block focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:ring-offset-2 rounded-lg",children:L})}function k(e){let{resource:r,onBookmark:s,onCompare:a,isBookmarked:i=!1,isSelected:v=!1}=e,{github:N}=r,k=!!N,w=k?"/resource/".concat(r.id,"/"):r.url,y=!k,L=(0,t.jsxs)("article",{className:"\n        group relative flex cursor-pointer flex-col rounded-xl border bg-surface p-6\n        transition-all duration-200 hover:border-primary/50 hover:shadow-soft-lg\n        ".concat(v?"border-primary ring-2 ring-primary/20":"border-border","\n      "),"aria-labelledby":"resource-".concat(r.id,"-name"),children:[y&&(0,t.jsx)("div",{className:"absolute -right-2 -top-2 flex h-7 w-7 items-center justify-center rounded-full bg-surface-overlay text-foreground-muted shadow-soft",children:(0,t.jsx)(h,{className:"h-4 w-4"})}),v&&!y&&(0,t.jsx)("div",{className:"absolute -right-2 -top-2 flex h-7 w-7 items-center justify-center rounded-full bg-primary text-white shadow-soft",children:(0,t.jsx)(f,{className:"h-4 w-4"})}),(0,t.jsxs)("div",{className:"mb-3 flex items-start justify-between gap-3",children:[(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsxs)("div",{className:"mb-1 flex items-center gap-2",children:[(0,t.jsx)("h3",{id:"resource-".concat(r.id,"-name"),className:"text-lg font-semibold text-foreground transition-colors duration-200 group-hover:text-primary-500",children:r.name}),(0,t.jsx)(b,{status:r.activityStatus})]}),(0,t.jsxs)("p",{className:"text-xs text-foreground-subtle",children:[r.category,r.subcategory&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"mx-1",children:"/"}),r.subcategory]})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[s&&(0,t.jsx)(j,{onClick:()=>s(r.id),isActive:i,activeIcon:(0,t.jsx)(m,{className:"h-5 w-5"}),inactiveIcon:(0,t.jsx)(u,{className:"h-5 w-5"}),label:"Add to bookmarks",activeLabel:"Remove from bookmarks"}),a&&(0,t.jsx)(j,{onClick:()=>a(r.id),isActive:v,activeIcon:(0,t.jsx)(f,{className:"h-5 w-5"}),inactiveIcon:(0,t.jsx)(x,{className:"h-5 w-5"}),label:"Add to comparison",activeLabel:"Remove from comparison"}),k&&(0,t.jsx)("a",{href:r.url,target:"_blank",rel:"noopener noreferrer",className:"cursor-pointer rounded-lg p-2 text-foreground-muted transition-colors duration-200 hover:bg-surface-overlay hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500","aria-label":"Open ".concat(r.name," in new tab"),onClick:e=>e.stopPropagation(),children:(0,t.jsx)(h,{className:"h-5 w-5"})})]})]}),(0,t.jsx)("p",{className:"mb-4 text-sm leading-relaxed text-foreground-muted",children:(0,o.eA)(r.description)||"No description available"}),r.tags.length>0&&(0,t.jsxs)("div",{className:"mb-4 flex flex-wrap gap-2",children:[r.tags.slice(0,5).map(e=>(0,t.jsx)("span",{className:"rounded-full bg-surface-overlay px-2.5 py-0.5 text-xs font-medium text-foreground-muted",children:e},e)),r.tags.length>5&&(0,t.jsxs)("span",{className:"rounded-full bg-surface-overlay px-2.5 py-0.5 text-xs font-medium text-foreground-subtle",children:["+",r.tags.length-5," more"]})]}),N?(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4 border-t border-border pt-4 sm:grid-cols-4",children:[(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsx)("span",{className:"mb-1 text-xs font-medium uppercase tracking-wider text-foreground-subtle",children:"Stars"}),(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)(l,{className:"h-4 w-4 text-warning"}),(0,t.jsx)("span",{className:"text-base font-semibold text-foreground",children:g(N.stars)})]})]}),(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsx)("span",{className:"mb-1 text-xs font-medium uppercase tracking-wider text-foreground-subtle",children:"Forks"}),(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)(c,{className:"h-4 w-4 text-foreground-muted"}),(0,t.jsx)("span",{className:"text-base font-semibold text-foreground",children:g(N.forks)})]})]}),(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsx)("span",{className:"mb-1 text-xs font-medium uppercase tracking-wider text-foreground-subtle",children:"Last Commit"}),(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)(d,{className:"h-4 w-4 text-foreground-muted"}),(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:p(N.lastCommit)})]})]}),N.license&&(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsx)("span",{className:"mb-1 text-xs font-medium uppercase tracking-wider text-foreground-subtle",children:"License"}),(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:N.license})]})]}):(0,t.jsx)("div",{className:"border-t border-border pt-4",children:(0,t.jsx)("p",{className:"text-sm text-foreground-subtle",children:"Exter
1nal resource - click to visit"})})]});return y?(0,t.jsx)("a",{href:w,target:"_blank",rel:"noopener noreferrer",className:"block focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:ring-offset-2 rounded-xl",children:L}):(0,t.jsx)(n(),{href:w,className:"block focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:ring-offset-2 rounded-xl",children:L})}function w(e){let{resource:r,variant:s,onBookmark:a,onCompare:n,isBookmarked:o=!1,isSelected:i=!1}=e;return"compact"===s?(0,t.jsx)(N,{resource:r,onBookmark:a,onCompare:n,isBookmarked:o,isSelected:i}):(0,t.jsx)(k,{resource:r,onBookmark:a,onCompare:n,isBookmarked:o,isSelected:i})}}}]);

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