1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6748],{86748:function(e,a,s){s.r(a);var l=s(57437),t=s(2265),r=s(38472);a.default=()=>{let[e,a]=(0,t.useState)(null),[s,d]=(0,t.useState)(null),[n,c]=(0,t.useState)(!1),[i,m]=(0,t.useState)(null),o=async e=>{let s=e.target.files[0];if(!s)return;a(s),c(!0),m(null);let l=new FormData;l.append("image",s);try{let{data:e}=await r.Z.post("/api/analyze-chess-board",l,{headers:{"Content-Type":"multipart/form-data"}});d(e)}catch(e){console.error("Error analyzing chess board:",e),m("Failed to analyze chess board. Please try again.")}finally{c(!1)}};return(0,l.jsxs)("div",{className:"bg-white shadow-md rounded-lg p-6 max-w-2xl mx-auto",children:[(0,l.jsx)("h1",{className:"text-2xl font-bold mb-4",children:"Chess Board Analyzer"}),(0,l.jsxs)("div",{className:"mb-4",children:[(0,l.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Upload Chess Board Screenshot"}),(0,l.jsx)("input",{type:"file",accept:"image/*",onChange:o,className:"w-full border border-gray-300 rounded-md py-2 px-3"})]}),e&&(0,l.jsx)("div",{className:"mb-4",children:(0,l.jsx)("img",{src:URL.createObjectURL(e),alt:"Uploaded chess board",className:"max-w-full h-auto rounded-md"})}),n&&(0,l.jsx)("div",{className:"text-center py-4",children:(0,l.jsx)("p",{children:"Analyzing chess board..."})}),i&&(0,l.jsx)("p",{className:"mt-2 text-red-600",children:i}),s&&(0,l.jsxs)("div",{className:"mt-4",children:[(0,l.jsx)("h2",{className:"text-xl font-semibold mb-2",children:"Board Configuration"}),(0,l.jsx)("pre",{className:"bg-gray-100 p-4 rounded-md overflow-auto",children:JSON.stringify(s,null,2)}),(0,l.jsx)("div",{className:"mt-4 grid grid-cols-2 gap-4",children:s.debugImages&&Object.entries(s.debugImages).map(e=>{let[a,s]=e;return(0,l.jsxs)("div",{children:[(0,l.jsx)("h3",{className:"text-lg font-medium mb-2",children:a.charAt(0).toUpperCase()+a.slice(1)}),(0,l.jsx)("img",{src:s,alt:a,className:"rounded-md"})]},a)})})]})]})}}}]);
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.