PageSourceSearch

https://recall94.netlify.app/assets/cards-CH9OwfRv.js

js recall94.netlify.app collected 2026-10-03 11:19:49 UTC 5,254 bytes, 1 lines download raw bytes

1import{c as x,u as L,a as s,j as e}from"./index-B2pGVpKf.js";const R=[["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"}]],q=x("external-link",R);const $=[["path",{d:"m16 6 4 14",key:"ji33uf"}],["path",{d:"M12 6v14",key:"1n7gus"}],["path",{d:"M8 8v12",key:"1gg7y9"}],["path",{d:"M4 4v16",key:"6qkkli"}]],E=x("library",$);const P=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],A=x("search",P),F=["Black Lotus","Mox Pearl","Mox Sapphire","Mox Jet","Mox Ruby","Mox Emerald","Ancestral Recall","Time Walk","Timetwister"],O=`(game:paper) legal:oldschool prefer:best ${F.map(c=>`-!"${c}"`).join(" ")}`,z={it:{eyebrow:"Archivio di formato",title:"Carte legali",intro:"La ricerca usa la legalità Old School 93/94 di Scryfall ed esclude la Power Nine. Le immagini mostrano la stampa preferita con illustrazione originale; per la legalità della singola stampa fa fede il regolamento Recall ’94.",placeholder:"Nome, tipo o testo della carta",submit:"Cerca",preset:"Recall ’94",all:"Archivio completo",initial:"Caricamento dell’archivio legale…",noResults:"Nessuna carta corrisponde ai criteri indicati.",error:"Scryfall non è raggiungibile in questo momento.",results:"carte",source:"Dati e immagini: Scryfall",open:"Scheda Scryfall",hint:"Lascia il campo vuoto per consultare l’intero archivio.",more:"Mostra altre carte",loadingMore:"Caricamento…"},en:{eyebrow:"Format archive",title:"Legal cards",intro:"Search uses Scryfall’s Old School 93/94 legality and excludes the Power Nine. Images show the preferred printing with original artwork; the Recall ’94 rules remain authoritative for exact printing legality.",placeholder:"Card name, type or rules text",submit:"Search",preset:"Recall ’94",all:"Full archive",initial:"Loading the legal archive…",noResults:"No cards match the selected criteria.",error:"Scryfall is unavailable right now.",results:"cards",source:"Data and images: Scryfall",open:"Scryfall record",hint:"Leave the field empty to browse the complete archive.",more:"Show more cards",loadingMore:"Loading…"}};function I(){const{language:c}=L(),r=z[c],[d,b]=s.useState(""),[h,S]=s.useState(!0),[N,u]=s.useState([]),[w,y]=s.useState(0),[m,p]=s.useState(),[f,j]=s.useState(!1),[l,i]=s.useState("idle");async function k(a){const t=await fetch(`https://api.scryfall.com/cards/search?q=${encodeURIComponent(a)}&unique=cards&order=name`);if(t.status!==404){if(!t.ok)throw new Error("Search failed");return t.json()}}async function g(a=d,t=h){i("loading"),p(void 0);try{const o=a.trim(),C=t?`${O}${o?` (${o})`:""}`:o||"game:paper",n=await k(C);if(!n){u([]),y(0),i("empty");return}u(n.data),y(n.total_cards),p(n.next_page),i(n.data.length?"success":"empty")}catch{i("error")}}s.useEffect(()=>{g("",!0)},[]);async function M(a){a.preventDefault(),await g()}async function v(a){S(a),await g(d,a)}async function _(){if(m){j(!0);try{const a=await fetch(m);if(!a.ok)throw new Error("Search failed");const t=await a.json();u(o=>[...o,...t.data]),p(t.next_page)}catch{i("error")}finally{j(!1)}}}return e.jsxs("div",{className:"cards-page page-section",children:[e.jsxs("header",{className:"cards-heading",children:[e.jsx("p",{className:"eyebrow",children:r.eyebrow}),e.jsx("h1",{children:r.title}),e.jsx("p",{children:r.intro})]}),e.jsxs("form",{className:"card-search",onSubmit:M,children:[e.jsxs("label",{children:[e.jsx(A,{}),e.jsx("input",{value:d,onChange:a=>b(a.target.value),placeholder:r.placeholder,"aria-label":r.placeholder})]}),e.jsx("button",{className:"button primary",type:"submit",children:r.submit}),e.jsxs("div",{className:"scope-switch",children:[e.jsx("button",{type:"button",className:h?"active":"",onClick:()=>{v(!0)},children:r.preset}),e.jsx("button",{type:"button",className:h?"":"active",onClick:()=>{v(!1)},children:r.all})]}),e.jsx("small",{children:r.hint})]}),e.jsxs("div",{className:"search-status","aria-live":"polite",children:[l==="idle"&&e.jsxs(e.Fragment,{children:[e.jsx(E,{}),e.jsx("p",{children:r.initial})]}),l==="loading"&&e.jsx("div",{className:"skeleton-grid",children:Array.from({length:8}).map((a,t)=>e.jsx("span",{},t))}),l==="empty"&&e.jsx("p",{children:r.noResults}),l==="error"&&e.jsx("p",{className:"error",children:r.error})]}),l==="success"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"results-meta",children:[e.jsxs("strong",{children:[w," ",r.results]}),e.jsx("span",{children:r.source})]}),e.jsx("div",{className:"card-grid",children:N.map(a=>{const t=a.image_uris?.normal??a.card_faces?.[0]?.image_uris?.normal;return e.jsxs("article",{className:"result-card",children:[t?e.jsx("img",{src:t,alt:a.name,loading:"lazy"}):e.jsx("div",{className:"missing-card",children:a.name}),e.jsxs("div",{children:[e.jsx("h2",{children:a.name}),e.jsxs("p",{children:[a.set_name," · ",a.released_at.slice(0,4)]}),e.jsxs("a",{href:a.scryfall_uri,target:"_blank",rel:"noreferrer",children:[r.open,e.jsx(q,{size:14})]})]})]},a.id)})}),m&&e.jsx("div",{className:"load-more",children:e.jsx("button",{className:"button ghost",type:"button",disabled:f,onClick:()=>{_()},children:f?r.loadingMore:r.more})})]})]})}export{I as component};

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.