PageSourceSearch

https://ganeshjoshi.dev/_next/static/chunks/34223.6297fb143c94e0a3.js

js ganeshjoshi.dev collected 2026-10-02 01:57:16 UTC 43,840 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[34223],{5196:(e,t,l)=>{l.d(t,{A:()=>a});let a=(0,l(19946).A)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]])},13052:(e,t,l)=>{l.d(t,{A:()=>a});let a=(0,l(19946).A)("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]])},14827:(e,t,l)=>{l.d(t,{default:()=>r});var a=l(95155),s=l(13741),n=l(66440);function r(e){let{open:t,onClose:l,onConfirm:r,title:i,description:o,confirmLabel:c="Confirm",cancelLabel:d="Cancel",confirmVariant:u="secondary",className:m=""}=e,x="confirm-dialog-".concat(i.replace(/\s/g,"-").toLowerCase()),h=o?"".concat(x,"-desc"):void 0;return(0,a.jsx)(n.default,{open:t,onClose:l,contentClassName:m,"aria-label":i,children:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("h3",{id:x,className:"text-lg font-semibold text-white",children:i}),o&&(0,a.jsx)("p",{id:h,className:"mt-2 text-text-secondary text-sm",children:o}),(0,a.jsxs)("div",{className:"mt-5 flex gap-3 justify-end",children:[(0,a.jsx)(s.default,{type:"button",variant:"ghost",size:"sm",onClick:l,children:d}),(0,a.jsx)(s.default,{type:"button",variant:u,size:"sm",onClick:r,children:c})]})]})})}},25589:(e,t,l)=>{l.r(t),l.d(t,{default:()=>i});var a=l(95155),s=l(12115),n=l(66474);function r(e){var t;let{item:l,isExpanded:r,onToggle:i}=e,o=(0,s.useRef)(null),[c,d]=(0,s.useState)(0);(0,s.useEffect)(()=>{if(r&&o.current){var e;d(null==(e=o.current)?void 0:e.scrollHeight)}else d(0)},[r]),(0,s.useEffect)(()=>{if(r&&o.current){let e=new ResizeObserver(()=>{var e,t;d(null!=(t=null==(e=o.current)?void 0:e.scrollHeight)?t:0)});return e.observe(o.current),()=>e.disconnect()}},[r]);let u=e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),i())};return(0,a.jsxs)("div",{className:"border border-border/60 rounded-lg overflow-visible",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 p-4 bg-background/40 hover:bg-background/60",children:[(0,a.jsx)("button",{id:"accordion-button-".concat(l.id),onClick:i,onKeyDown:u,"aria-expanded":r,"aria-controls":"accordion-content-".concat(l.id),"aria-label":l.title,className:" flex-1 min-w-0 flex items-center gap-2 text-left transition-all duration-300 cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent rounded ",children:(0,a.jsx)("span",{className:"font-medium text-white text-sm sm:text-base truncate",children:null!=(t=l.titleContent)?t:l.title})}),null!=l.titleAction&&(0,a.jsx)("span",{className:"shrink-0 flex items-center",onClick:e=>e.stopPropagation(),children:l.titleAction}),(0,a.jsx)("button",{type:"button",onClick:i,onKeyDown:u,"aria-expanded":r,"aria-controls":"accordion-content-".concat(l.id),"aria-label":"".concat(l.title,", ").concat(r?"collapse":"expand"),className:" shrink-0 p-1 rounded transition-all duration-300 cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent text-text-secondary hover:text-foreground hover:bg-slate-600/50 ",children:(0,a.jsx)(n.A,{className:"w-5 h-5 transition-transform duration-300 ".concat(r?"rotate-180":"")})})]}),(0,a.jsx)("div",{id:"accordion-content-".concat(l.id),role:"region","aria-labelledby":"accordion-button-".concat(l.id),className:"transition-all duration-300 ease-in-out overflow-hidden",style:{height:c},children:(0,a.jsx)("div",{ref:o,className:"p-4 bg-background/20 text-text-secondary text-sm sm:text-base",children:l.content})})]})}function i(e){let{items:t,allowMultiple:l=!1,className:n=""}=e,[i,o]=(0,s.useState)(()=>{let e=new Set;return t.forEach(t=>{t.defaultExpanded&&e.add(t.id)}),e});return(0,a.jsx)("div",{className:"space-y-3 ".concat(n),children:t.map(e=>(0,a.jsx)(r,{item:e,isExpanded:i.has(e.id),onToggle:()=>{var t;return t=e.id,void o(e=>{let a=new Set(e);return a.has(t)?a.delete(t):(l||a.clear(),a.add(t)),a})}},e.id))})}},30353:(e,t,l)=>{l.d(t,{default:()=>i});var a=l(95155),s=l(12115),n=l(26723);let r=(0,s.forwardRef)((e,t)=>{let{label:l,options:r,placeholder:i,error:o,className:c,selectClassName:d,id:u,...m}=e,x=(0,s.useId)(),h=u||x,{select:p,input:f}=n.A.components,v=[p.base,o&&p.error,d].filter(Boolean).join(" ");return(0,a.jsxs)("div",{className:c,children:[l&&(0,a.jsx)("label",{htmlFor:h,className:f.label,children:l}),(0,a.jsxs)("select",{ref:t,id:h,className:v,"aria-invalid":o?"true":void 0,"aria-describedby":o?"".concat(h,"-error"):void 0,...m,children:[i&&(0,a.jsx)("option",{value:"",disabled:!0,children:i}),r.map(e=>(0,a.jsx)("option",{value:e.value,disabled:e.disabled,children:e.label},e.value))]}),o&&(0,a.jsx)("p",{id:"".concat(h,"-error"),className:f.errorText,role:"alert",children:o})]})});r.displayName="Select";let i=r},35169:(e,t,l)=>{l.d(t,{A:()=>a});let a=(0,l(19946).A)("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]])},51294:(e,t,l)=>{l.d(t,{default:()=>i});var a=l(95155),s=l(12115),n=l(5196);let r=e=>{let{id:t,label:l,description:r,className:i="",labelClassName:o="",descriptionClassName:c="",...d}=e,u=(0,s.useId)(),m=null!=t?t:u,x=r?"".concat(m,"-desc"):void 0;return(0,a.jsxs)("label",{htmlFor:m,className:"flex items-center gap-3 cursor-pointer ".concat(i),children:[(0,a.jsxs)("span",{className:"relative flex h-4 w-4 shrink-0 items-center justify-center",children:[(0,a.jsx)("input",{type:"checkbox",id:m,"aria-describedby":x,className:"peer absolute inset-0 z-10 cursor-pointer opacity-0 disabled:cursor-not-allowed",...d}),(0,a.jsx)("span",{className:"pointer-events-none absolute inset-0 rounded border-2 border-slate-500 bg-card/60 transition-[border-color,background-color] duration-200 ease-out peer-checked:border-accent peer-checked:bg-slate-700/80 peer-disabled:opacity-50 peer-focus-visible:ring-2 peer-focus-visible:ring-accent/50 peer-focus-visible:ring-offset-2 peer-focus-visible:ring-offset-background","aria-hidden":!0}),(0,a.jsx)("span",{className:"pointer-events-none absolute inset-0 flex items-center justify-center opacity-0 scale-75 transition-[opacity,transform] duration-200 ease-out peer-checked:opacity-100 peer-checked:scale-100","aria-hidden":!0,
1children:(0,a.jsx)(n.A,{className:"h-3 w-3 text-accent stroke-[2.5]",strokeLinecap:"round",strokeLinejoin:"round"})})]}),(null!=l||null!=r)&&(0,a.jsxs)("span",{className:"flex flex-col min-w-0",children:[null!=l&&(0,a.jsx)("span",{className:"text-sm font-medium text-text-secondary ".concat(o),children:l}),null!=r&&(0,a.jsx)("span",{id:x,className:"text-text-muted text-xs mt-0.5 ".concat(c),children:r})]})]})};r.displayName="Checkbox";let i=r},57340:(e,t,l)=>{l.d(t,{A:()=>a});let a=(0,l(19946).A)("house",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]])},66440:(e,t,l)=>{l.d(t,{default:()=>o});var a=l(95155),s=l(12115),n=l(19114),r=l(90086),i=l(54416);function o(e){let{open:t,onClose:l,children:o,contentClassName:c="",dismissOnBackdrop:d=!!l,"aria-label":u,compact:m=!1}=e,x=d&&l?l:void 0;return(0,s.useEffect)(()=>{if(t){let e=window.scrollY,t=document.documentElement.style.overflow,l=document.body.style.overflow,a=document.body.style.position,s=document.body.style.width,n=document.body.style.top;return document.documentElement.style.overflow="hidden",document.body.style.overflow="hidden",document.body.style.position="fixed",document.body.style.width="100%",document.body.style.top="-".concat(e,"px"),()=>{document.documentElement.style.overflow=t,document.body.style.overflow=l,document.body.style.position=a,document.body.style.width=s,document.body.style.top=n,window.scrollTo(0,e)}}},[t]),(0,a.jsx)(n.N,{children:t&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(r.P.div,{initial:{opacity:0}
1,animate:{opacity:1},exit:{opacity:0},transition:{duration:.15},className:"fixed inset-0 z-[60] min-h-screen bg-background/90 backdrop-blur-sm","aria-hidden":"true",onClick:x}),(0,a.jsx)(r.P.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},transition:{type:"spring",stiffness:300,damping:28},className:"fixed left-1/2 top-1/2 z-[70] w-full -translate-x-1/2 -translate-y-1/2 px-4 ".concat(c||"max-w-sm").trim(),role:"dialog","aria-modal":"true","aria-label":u,children:(0,a.jsxs)("div",{className:"rounded-xl border border-border bg-card shadow-xl relative max-h-[90vh] flex flex-col ".concat(m?"p-4":"pl-6 pt-6 pb-6 pr-12"),onClick:e=>e.stopPropagation(),children:[l&&(0,a.jsx)("button",{type:"button",onClick:l,className:"absolute right-3 top-3 p-1.5 rounded-md text-text-secondary hover:text-white hover:bg-slate-600/50 focus:outline-none focus-visible:ring-2 focus-visible:ring-accent cursor-pointer z-10","aria-label":"Close",children:(0,a.jsx)(i.A,{className:"w-5 h-5"})}),(0,a.jsx)("div",{className:"overflow-y-auto min-h-0 flex-1 pr-6".trim(),children:o})]})})]})})}},66474:(e,t,l)=>{l.d(t,{A:()=>a});let a=(0,l(19946).A)("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]])},66516:(e,t,l)=>{l.d(t,{A:()=>a});let a=(0,l(19946).A)("share-2",[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]])},71202:(e,t,l)=>{l.r(t),l.d(t,{default:()=>H});var a=l(95155),s=l(12115),n=l(81284),r=l(19946);let i=(0,r.A)("volume-2",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]]),o=(0,r.A)("volume-x",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["line",{x1:"22",x2:"16",y1:"9",y2:"15",key:"1ewh16"}],["line",{x1:"16",x2:"22",y1:"9",y2:"15",key:"5ykzw1"}]]);var c=l(53123),d=l(87347),u=l(25589),m=l(66440),x=l(14827),h=l(93915),p=l(30353),f=l(51294),v=l(13741);let y=(()=>{let e={},t=(t,l)=>{let a=String(t),s=String(l);e[a]||(e[a]=[]),e[a].includes(s)||e[a].push(s),e[s]||(e[s]=[]),e[s].includes(a)||e[s].push(a)};for(let l of(t(0,1),t(0,3),t(1,2),t(1,4),t(2,5),t(3,4),t(3,8),t(4,5),t(4,8),t(5,8),t(6,7),t(6,11),t(6,12),t(7,8),t(7,12),t(8,9),t(8,12),t(8,13),t(8,14),t(9,10),t(9,14),t(10,14),t(10,15),t(11,12),t(11,16),t(12,13),t(12,16),t(12,17),t(12,18),t(13,14),t(13,18),t(14,15),t(14,18),t(14,19),t(14,20),t(15,20),t(16,17),t(16,21),t(16,22),t(17,18),t(17,22),t(18,19),t(18,22),t(18,23),t(18,24),t(19,20),t(19,24),t(20,24),t(20,25),t(21,22),t(21,26),t(22,23),t(22,26),t(22,27),t(23,24),t(23,28),t(24,25),t(24,28),t(24,29),t(24,30),t(25,30),t(26,27),t(27,28),t(28,29),t(28,31),t(28,32),t(28,33),t(28,22),t(28,23),t(28,24),t(29,30),t(30,25),t(31,32),t(31,34),t(32,33),t(32,35),t(33,36),t(34,35),t(35,36),t(36,33),e["18"]=["12","13","14","17","19","22","23","24"],[12,13,14,17,19,22,23,24]))e[String(l)].includes("18")||e[String(l)].push("18");for(let t of Object.keys(e)){let l=Number(t);if(18===l)continue;let a=e[t],s=[12,13,14,17,19,22,23,24];a.includes("18")&&!s.includes(l)&&(e[t]=a.filter(e=>"18"!==e))}return e})();function b(e){let t=y[String(e)];return t?t.map(Number):[]}let g=(()=>{let e=[],t=e=>22+18*e;e[0]={x:24,y:t(0)},e[1]={x:60,y:t(0)},e[2]={x:96,y:t(0)},e[3]={x:42,y:t(1)},e[4]={x:60,y:t(1)},e[5]={x:78,y:t(1)};for(let l=0;l<5;l++)e.push({x:60+(l-2)*24,y:t(2)});for(let l=0;l<5;l++)e.push({x:60+(l-2)*24,y:t(3)});let l=t(4);for(let t=0;t<5;t++)e.push({x:60+(t-2)*24,y:l});let a=t(5);for(let t=0;t<5;t++)e.push({x:60+(t-2)*24,y:a});for(let t=0;t<5;t++)e.push({x:60+(t-2)*24,y:a+18});return e[31]={x:42,y:a+36},e[32]={x:60,y:a+36},e[33]={x:78,y:a+36},e[34]={x:24,y:a+54},e[35]={x:60,y:a+54},e[36]={x:96,y:a+54},e})(),j=(()=>{let e=[];return["N1","N2","N3"].forEach((t,l)=>{e[l]=t}),["N4","N5","N6"].forEach((t,l)=>{e[3+l]=t}),["N7","N8","N9","N10","N11"].forEach((t,l)=>{e[6+l]=t}),["N12","N13","N14","N15","N16"].forEach((t,l)=>{e[11+l]=t}),["B1","B2","B3","B4","B5"].forEach((t,l)=>{e[16+l]=t}),["M12","M13","M14","M15","M16"].forEach((t,l)=>{e[21+l]=t}),["M7","M8","M9","M10","M11"].forEach((t,l)=>{e[26+l]=t}),["M4","M5","M6"].forEach((t,l)=>{e[31+l]=t}),["M1","M2","M3"].forEach((t,l)=>{e[34+l]=t}),e})(),k=[{value:"amber",label:"Yellow",fill:"fill-amber-400",stroke:"stroke-amber-500/80"},{value:"cyan",label:"Cyan",fill:"fill-cyan-400",stroke:"stroke-cyan-500/80"},{value:"emerald",label:"Green",fill:"fill-emerald-400",stroke:"stroke-emerald-500/80"},{value:"rose",label:"Pink",fill:"fill-rose-400",stroke:"stroke-rose-500/80"},{value:"violet",label:"Purple",fill:"fill-violet-400",stroke:"stroke-violet-500/80"},{value:"orange",label:"Orange",fill:"fill-orange-400",stroke:"stroke-orange-500/80"}],N=[{value:"round",label:"Round"},{value:"square",label:"Square"},{value:"diamond",label:"Diamond"}],w=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15],P=[21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36];function C(e){let t=Array(37).fill(null);if("P1"===e){for(let e of P)t[e]="P1";for(let e of w)t[e]="P2"}else{for(let e of P)t[e]="P2";for(let e of w)t[e]="P1"}return t}function M(e,t,l,a){let s=[];for(let l of b(t))null===e[l]&&(void 0===a||l!==a)&&s.push(l);return s}function S(e,t,l,a){let s="P1"===l?"P2":"P1",n=[];for(let l of b(t))if(e[l]===s)for(let s of b(l))null===e[s]&&s!==t&&(void 0===a||s!==a)&&function(e,t,l){let a=g[e],s=g[t],n=g[l],r=s.x-a.x,i=s.y-a.y,o=n.x-s.x,c=n.y-s.y,d=r*o+i*c;return!(d<=0)&&d/((Math.hypot(r,i)||1)*(Math.hypot(o,c)||1))>=Math.cos(15*Math.PI/180)}(t,l,s)&&n.push({to:s,captured:l});return n}function A(e,t,l){let a=[];for(let l=0;l<37;l++)if(e[l]===t)for(let s of function e(t,l,a,s,n){let r=S(t,l,a,n);if(0===r.length)return s.length>0?[{kind:"capture",from:l,to:l,captured:s}]:[];let i=[];for(let{to:n,captured:o}of r){let r=t.slice();for(let t of(r[l]=null,r[o]=null,r[n]=a,e(r,n,a,[...s,o],l)))"capture"===t.kind&&t.captured.length>s.length&&i.push({kind:"capture",from:l,to:t.to,captured:t.captured});i.push({kind:"capture",from:l,to:n,captured:[...s,o]})}return i}(e,l,t,[]))s.captured.length>0&&s.from!==s.to&&a.push(s);if(a.length>0||l)return a;for(let l=0;l<37;l++)if(e[l]===t)for(let s of M(e,l,t))a.push({kind:"simple",from:l,to:s});return a}function E(e,t){let l=e.slice();if("simple"===t.kind)l[t.to]=l[t.from],l[t.from]=null;else for(let e of(l[t.to]=l[t.from],l[t.from]=null,t.captured))l[e]=null;return l}function B(e,t){let l=e.filter(e=>"P1"===e).length,a=e.filter(e=>"P2"===e).length;if(0===l)return"P2";if(0===a)return"P1";let s=A(e,"P1").length,n=A(e,"P2").length;return 0===s&&0===n?"draw":0===A(e,t).length?"P1"===t?"P2":"P1":null}let T={easy:1,medium:3,hard:5},z={easy:400,medium:400,hard:700};function q(e,t,l,a,s,n){let r=B(e,a?"P2":"P1");if("P2"===r)return 1e3-t;if("P1"===r)return -1e3+t;if("draw"===r)return 0;if(t>=l){let t;return t=0+(e.filter(e=>"P2"===e).length-e.filter(e=>"P1"===e).length)*10,t+(A(e,"P2").length-A(e,"P1").length)*.5}let i=A(e,a?"P2":"P1");if(0===i.length)return a?-1e3:1e3;if(a){let a=-1/0;for(let r of i){let i=q(E(e,r),t+1,l,!1,s,n);if(a=Math.max(a,i),n<=(s=Math.max(s,i)))break}return a}{let a=1/0;for(let r of i){let i=q(E(e,r),t+1,l,!0,s,n);if(a=Math.min(a,i),(n=Math.min(n,i))<=s)break}return a}}function W(e,t,l){let a=A(e,"P2",l);if(0===a.length)return null;let s=a[0],n=-1/0;for(let l of a){let a=q(E(e,l),1,t,!1,-1/0,1/0);a>n&&(n=a,s=l)}return s}function I(e){var t,l,s,n;
1let{color:r,shape:i}=e,o=null!=(s=null==(t=k.find(e=>e.value===r))?void 0:t.fill)?s:"fill-slate-400",c=null!=(n=null==(l=k.find(e=>e.value===r))?void 0:l.stroke)?n:"stroke-slate-500/80",d={className:"".concat(o," ").concat(c),strokeWidth:.8};return"round"===i?(0,a.jsx)("svg",{width:10,height:10,viewBox:"0 0 ".concat(10," ").concat(10),className:"shrink-0","aria-hidden":!0,children:(0,a.jsx)("circle",{...d,cx:5,cy:5,r:4.5})}):"square"===i?(0,a.jsx)("svg",{width:10,height:10,viewBox:"0 0 ".concat(10," ").concat(10),className:"shrink-0","aria-hidden":!0,children:(0,a.jsx)("rect",{...d,x:.5,y:.5,width:9,height:9})}):(0,a.jsx)("svg",{width:10,height:10,viewBox:"0 0 ".concat(10," ").concat(10),className:"shrink-0","aria-hidden":!0,children:(0,a.jsx)("polygon",{...d,points:"".concat(5,",0.5 ").concat(9.5,",").concat(5," ").concat(5,",").concat(9.5," 0.5,").concat(5)})})}function H(e){var t,l,r,b,w,P,H,R,F,O,D,L,G,V,Y,_;let{slug:K}=e,U=(0,c.Bu)(K),[J,Q]=(0,s.useState)(()=>C("P1")),[X,Z]=(0,s.useState)("P1"),[$,ee]=(0,s.useState)(null),[et,el]=(0,s.useState)("2p"),[ea,es]=(0,s.useState)(!1),[en,er]=(0,s.useState)(null),[ei,eo]=(0,s.useState)(void 0),[ec,ed]=(0,s.useState)("amber"),[eu,em]=(0,s.useState)("cyan"),[ex,eh]=(0,s.use
1State)("round"),[ep,ef]=(0,s.useState)("square"),[ev,ey]=(0,s.useState)("P1"),[eb,eg]=(0,s.useState)("Player 1"),[ej,ek]=(0,s.useState)("Player 2"),[eN,ew]=(0,s.useState)(!1),[eP,eC]=(0,s.useState)(0),[eM,eS]=(0,s.useState)(0),[eA,eE]=(0,s.useState)([]),[eB,eT]=(0,s.useState)(!1),[ez,eq]=(0,s.useState)(!0),[eW,eI]=(0,s.useState)(null),[eH,eR]=(0,s.useState)("medium"),[eF,eO]=(0,s.useState)(1),[eD,eL]=(0,s.useState)([]),[eG,eV]=(0,s.useState)(!1),[eY,e_]=(0,s.useState)(null),[eK,eU]=(0,s.useState)(0),[eJ,eQ]=(0,s.useState)(null),[eX,eZ]=(0,s.useState)(!1),e$=(null==eb?void 0:eb.trim())||"Player 1",e0=(null==ej?void 0:ej.trim())||"Player 2",e1=(0,s.useCallback)(e=>{if(eX)try{let t=new(window.AudioContext||window.webkitAudioContext),l=t.createOscillator(),a=t.createGain();l.connect(a),a.connect(t.destination),l.frequency.value="move"===e?400:"capture"===e?600:800,a.gain.setValueAtTime(.15,t.currentTime),a.gain.exponentialRampToValueAtTime(.01,t.currentTime+.1),l.start(t.currentTime),l.stop(t.currentTime+.1)}catch(e){}},[eX]);(0,s.useEffect)(()=>{if(ec===eu){let e=k.find(e=>e.value!==ec);e&&em(e.value)}},[ec,eu]);let e2=(0,s.useMemo)(()=>B(J,X),[J,X]),e5=null!==e2;(0,s.useEffect)(()=>{e5&&e2&&(eq(!0),e1("gameover"))},[e5,e2,e1]),(0,s.useEffect)(()=>{let e;if(null===eY)return;let t=performance.now(),l=a=>{let s=Math.min(1,(a-t)/250);eU(s),s<1?e=requestAnimationFrame(l):(e_(null),eU(0))};return e=requestAnimationFrame(l),()=>cancelAnimationFrame(e)},[eY]);let e4=(0,s.useMemo)(()=>null===$||J[$]!==X||null!==en?[]:M(J,$,X,ei),[J,X,$,en,ei]),e3=(0,s.useMemo)(()=>null===$||J[$]!==X?[]:S(J,null!=en?en:$,X,ei).map(e=>e.to),[J,X,$,en,ei]),e6=(0,s.useMemo)(()=>A(J,X).some(e=>"capture"===e.kind),[J,X]),e8=(0,s.useMemo)(()=>eG&&e6?[...e3]:[...new Set([...e3,...e4])],[eG,e6,e3,e4]),e9=(0,s.useCallback)(e=>{if(!e5&&("ai"!==et||"P2"!==X)){if(J[e]===X){ee(e),er(null),eo(void 0);return}if(null!==en&&!e8.includes(e)){ee(null),er(null),eo(void 0),Z("P1"===X?"P2":"P1");return}if(e8.includes(e)){let t=null!=en?en:$,l=S(J,t,X,ei),a=l.some(t=>t.to===e);if(a&&0!==S((()=>{let a=J.slice();return a[t]=null,a[l.find(t=>t.to===e).captured]=null,a[e]=X,a})(),e,X,t).length||eL(e=>[...e,{board:J.slice(),turn:X,capturesByP1:eP,capturesByP2:eM,moveHistory:[...eA],fullMoveNumber:eF}]),a){let a=l.find(t=>t.to===e),s=J.slice();
1s[t]=null,s[a.captured]=null,s[e]=X,"P1"===X?eC(e=>e+1):eS(e=>e+1),eE(l=>[...l,{player:X,kind:"capture",from:t,to:e,captured:[a.captured]}]),Q(s),e_({from:t,to:e,captured:[a.captured],player:X}),eU(0),e1("capture"),S(s,e,X,t).length>0?(ee(e),er(e),eo(t)):(ee(null),er(null),eo(void 0),Z("P1"===X?"P2":"P1"),"P2"===X&&eO(e=>e+1))}else{let l=J.slice();l[e]=X,l[t]=null,eE(l=>[...l,{player:X,kind:"simple",from:t,to:e}]),Q(l),e_({from:t,to:e,player:X}),eU(0),e1("move"),ee(null),er(null),eo(void 0),Z("P1"===X?"P2":"P1"),"P2"===X&&eO(e=>e+1)}return}ee(null),er(null),eo(void 0)}},[J,X,$,en,ei,e8,e5,et,eP,eM,eA,eF,e1]),e7=(0,s.useCallback)(()=>{if(0===eD.length||"ai"===et&&"P2"===X)return;let e=eD[eD.length-1];Q(e.board.slice()),Z(e.turn),eC(e.capturesByP1),eS(e.capturesByP2),eE([...e.moveHistory]),eO(e.fullMoveNumber),ee(null),er(null),eo(void 0),eL(e=>e.slice(0,-1))},[eD,et,X]),te=(0,s.useCallback)(()=>{if(e5||"ai"===et&&"P2"===X)return;let e="P1"===X?function(e,t){let l=A(e,"P1",t);if(0===l.length)return null;let a=l[0],s=1/0;for(let t of l){let l=q(E(e,t),1,3,!0,-1/0,1/0);l<s&&(s=l,a=t)}return{from:a.from,to:a.to}}(J,eG):(()=>{let e=W(J,3,eG);return e?{from:e.from,to:e.to}:null})();e&&eQ(e)},[J,X,e5,et,eG]);(0,s.useEffect)(()=>{if(null===eJ)return;let e=setTimeout(()=>eQ(null),3e3);return()=>clearTimeout(e)},[eJ]),(0,s.useEffect)(()=>{if("ai"!==et||"P2"!==X||e5)return;let e=z[eH],t=T[eH],l=setTimeout(()=>{let e=W(J,t,eG);e&&("capture"===e.kind&&eS(t=>t+e.captured.length),eE(t=>[...t,{player:"P2",kind:e.kind,from:e.from,to:e.to,captured:"capture"===e.kind?e.captured:void 0}]),Q(E(J,e)),e_({from:e.from,to:e.to,captured:"capture"===e.kind?e.captured:void 0,player:"P2"}),eU(0),"capture"===e.kind?e1("capture"):e1("move"),Z("P1"),eO(e=>e+1))},e);return()=>clearTimeout(l)},[et,X,e5,J,eH,eG,e1]);let tt=(0,s.useCallback)(()=>"random"===ev?.5>Math.random()?"P1":"P2":ev,[ev]),tl=(0,s.useCallback)(()=>{let e=tt();Q(C(e)),Z(e),ee(null),er(null),eo(void 0),eC(0),eS(0),eE([]),eO(1),eL([])},[tt]),ta=(0,s.useCallback)(()=>{ew(!0)},[]),ts=(0,s.useCallback)(()=>{tl(),ew(!1)},[tl]),tn=(0,s.useCallback)(()=>{ew(!1)},[]),tr=(0,s.useCallback)(()=>{let e=tt();el("2p"),es(!0),Q(C(e)),ee(null),er(null),eo(void 0),eC(0),eS(0),eE([]),eO(1),eL([]),Z(e)},[tt]),ti=(0,s.useCallback)(()=>{let e=tt();el("ai"),es(!0),Q(C(e)),ee(null),er(null),eo(void 0),eC(0),eS(0),eE([]),eO(1),eL([]),Z(e)},[tt]),to=[{id:"how-to-play",title:"How to play",content:(0,a.jsxs)("div",{className:"space-y-3 text-slate-300",children:[(0,a.jsxs)("p",{children:[(0,a.jsx)("strong",{className:"text-white",children:"Also known as"})," Sixteen Soldiers (Sholo Gutti). Traditional board game with 37 points: a 5\xd75 alquerque grid plus two triangular camps. Sola Haadi is famous in Rajasthan, India."]}),(0,a.jsxs)("p",{children:[(0,a.jsx)("strong",{className:"text-white",children:"Objective:"})," Capture all opponent pieces or block them completely."]}),(0,a.jsxs)("p",{children:[(0,a.jsx)("strong",{className:"text-white",children:"Move:"})," Move one piece to an adjacent empty point along a line, OR jump over opponent pieces in a straight line to capture them. Multiple jumps in sequence are allowed."]}),(0,a.jsxs)("p",{children:[(0,a.jsx)("strong",{className:"text-white",children:"Rule:"})," During multi-jump captures, you cannot immediately return to the point you just left."]}),(0,a.jsxs)("p",{children:[(0,a.jsx)("strong",{className:"text-white",children:"Must capture:"}),' If you enable "Must capture if possible" in setup, you must take a capture when one is available (you cannot make a simple move instead).']})]})},...ea?[{id:"move-history",title:"Move history (".concat(eA.length,")"),titleContent:"Move history (".concat(eA.length,")"),titleAction:(0,a.jsx)("button",{type:"button",onClick:()=>eT(!0),className:"p-1 rounded text-slate-400 hover:text-slate-200 hover:bg-slate-600/50 focus:outline-none focus-visible:ring-2 focus-visible:ring-cyan-400 cursor-pointer","aria-label":"View board reference (node names)",title:"View board reference (node names)",children:(0,a.jsx)(n.A,{className:"w-4 h-4"})}),content:(0,a.jsxs)("div",{className:"max-h-52 overflow-y-auto rounded border border-slate-600/50 bg-slate-800/20 p-2 space-y-2",children:[(0,a.jsxs)("p",{className:"text-slate-400 text-xs",children:["Click the ",(0,a.jsx)("span",{className:"inline-flex align-middle",children:(0,a.jsx)(n.A,{className:"w-3.5 h-3.5 text-slate-400"})})," button above to see which position is N1, B5, M12, etc."]}),0===eA.length?(0,a.jsx)("p",{className:"text-slate-500 text-sm italic py-1",children:"No moves yet."}):eA.map((e,t)=>{var l,s,n,r,i,o,c;let d="P1"===e.player?e$:e0,u="P1"===e.player?null!=(r=null==(l=k.find(e=>e.value===ec))?void 0:l.fill)?r:"fill-amber-400":null!=(i=null==(s=k.find(e=>e.value===eu))?void 0:s.fill)?i:"fill-cyan-400",m=null!=(o=j[e.from])?o:String(e.from),x=null!=(c=j[e.to])?c:String(e.to),h=(null==(n=e.captured)?void 0:n.length)?" (+".concat(e.captured.length," capture").concat(e.captured.length>
11?"s":"",")"):"";return(0,a.jsxs)("div",{className:"flex items-center gap-2 text-sm py-1 px-2 rounded hover:bg-slate-700/30 min-w-0",children:[(0,a.jsxs)("span",{className:"shrink-0 text-slate-500 tabular-nums w-6",children:[t+1,"."]}),(0,a.jsx)("span",{className:"shrink-0 w-2.5 h-2.5 rounded-full ".concat(u),"aria-hidden":!0}),(0,a.jsx)("span",{className:"text-slate-300 truncate",children:d}),(0,a.jsxs)("span",{className:"text-slate-400 shrink-0",children:[m," → ",x,h&&(0,a.jsx)("span",{className:"text-rose-400/90",children:h})]})]},t)})]})}]:[]],tc=ea?(0,a.jsxs)("div",{className:"rounded-lg border border-slate-600/40 bg-slate-800/30 px-4 py-3 space-y-2 w-full h-full min-h-0",children:[(0,a.jsx)("p",{className:"text-slate-300 text-sm font-medium",children:"What the marks mean"}),(0,a.jsxs)("div",{className:"flex flex-wrap gap-x-4 gap-y-1.5 text-sm text-slate-400",children:[(0,a.jsxs)("span",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"w-5 h-5 rounded-full border-2 border-amber-400 bg-transparent shrink-0","aria-hidden":!0,title:"Board highlight"}),"From"]}),(0,a.jsxs)("span",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"w-5 h-5 rounded-full border-2 border-green-500 bg-transparent shrink-0","aria-hidden":!0,title:"Board highlight"}),"To"]}),(0,a.jsxs)("span",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"w-5 h-5 rounded-full border-2 border-rose-400 bg-transparent shrink-0","aria-hidden":!0,title:"Board highlight"}),"Captured"]})]}),(0,a.jsxs)("p",{className:"text-slate-500 text-sm leading-snug",children:["On the board, the last move is highlighted with these colors. In move history, ",(0,a.jsx)("span",{className:"text-slate-400",children:"From → To"})," and ",(0,a.jsx)("span",{className:"text-rose-400/90",children:"+n capture"})," mean the move and any pieces taken."]})]}):null,td=(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsx)("h3",{className:"text-lg font-semibold text-white",children:"Board reference (node names)"}),(0,a.jsx)("p",{className:"text-slate-400 text-sm",children:"Use this map to see which position is N1, B5, M12, etc. when reading move history."}),(0,a.jsx)("div",{className:"rounded-lg border border-slate-600/50 bg-slate-800/30 p-2 flex justify-center",children:(0,a.jsxs)("svg",{viewBox:"0 0 120 218",className:"w-full max-w-[min(100%,20rem)] aspect-[120/218] text-slate-300","aria-label":"Board with node names",children:[Object.entries(y).flatMap(e=>{let[t,l]=e,s=Number(t),n=g[s];return l.filter(e=>Number(e)>s).map(e=>{let t=Number(e),l=g[t];return(0,a.jsx)("line",{x1:n.x,y1:n.y,x2:l.x,y2:l.y,stroke:"currentColor",strokeWidth:"1",className:"text-slate-500",opacity:.7},"ref-".concat(s,"-").concat(t))})}),g.map((e,t)=>(0,a.jsx)("circle",{cx:e.x,cy:e.y,r:5,fill:"none",stroke:"currentColor",strokeWidth:"1",className:"text-slate-600",opacity:.8},"ref-node-".concat(t))),g.map((e,t)=>(0,a.jsx)("text",{x:e.x,y:e.y,textAnchor:"middle",dominantBaseline:"middle",fill:"currentColor",className:"text-slate-200 font-medium",style:{fontSize:5,pointerEvents:"none"},children:j[t]},"ref-label-".concat(t)))]})}),(0,a.jsxs)("p",{className:"text-slate-500 text-xs",children:[(0,a.jsx)("strong",{className:"text-slate-400",children:"N"})," = top triangle, ",(0,a.jsx)("strong",{className:"text-slate-400",children:"B"})," = middle row, ",(0,a.jsx)("strong",{className:"text-slate-400",children:"M"})," = bottom triangle."]})]});return(0,a.jsx)(d.A,{title:U.name,description:U.description,currentGameId:K,backLink:"/games",backLabel:"All Games",children:(0,a.jsxs)("div",{className:"space-y-6 w-full min-w-0 relative","data-game-container":!0,children:[(0,a.jsxs)("div",{className:"flex flex-col sm:flex-row gap-4 sm:gap-6 items-stretch w-full",children:[(0,a.jsx)("div",{className:"sm:w-1/2 min-w-0",children:(0,a.jsx)(u.default,{items:to})}),tc&&(0,a.jsx)("div",{className:"sm:w-1/2 min-w-0",children:tc})]}),(0,a.jsx)(m.default,{open:eB,onClose:()=>eT(!1),contentClassName:"max-w-2xl w-full","aria-label":"Board reference",children:td}),(0,a.jsx)(x.default,{open:eN,onClose:tn,onConfirm:ts,title:"New game?",description:"Current game will be lost. Start fresh?",confirmLabel:"Start new game",cancelLabel:"Cancel"}),ea?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex flex-col gap-3 min-w-0",children:[(0,a.jsxs)("div",{className:"flex flex-col sm:flex-row sm:flex-wrap sm:items-center sm:justify-between gap-2 sm:gap-4 min-w-0",children:[(0,a.jsxs)("p",{className:"text-slate-400 text-xs sm:text-sm md:text-base min-w-0 shrink-0",children:[(0,a.jsxs)("span",{className:"tabular-nums",children:["Move ",eF]})," \xb7 ",e5?"draw"===e2?"Draw":"Winner: ".concat("P1"===e2?"".concat(e$," (").concat(null!=(F=null==(t=k.find(e=>e.value===ec))?void 0:t.label)?F:"P1",")"):"".concat(e0," (").concat(null!=(O=null==(l=k.find(e=>e.value===eu))?void 0:l.label)?O:"P2",")")):"Turn: ".concat("P1"===X?"".concat(e$," (").concat(null!=(D=null==(r=k.find(e=>e.value===ec))?void 0:r.label)?D:"P1",")"):"".concat(e0," (").concat(null!=(L=null==(b=k.find(e=>e.value===eu))?void 0:b.label)?L:"P2",")")),"ai"===et&&!e5&&" - You are ".concat(e$)]}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2 min-w-0",children:[(0,a.jsx)(v.default,{type:"button",variant:"secondary",size:"sm",onClick:e7,disabled:0===eD.length||"ai"===et&&"P2"===X,className:"shrink-0 min-h-[2.25rem] touch-manipulation",children:"Undo"}),(0,a.jsx)(v.default,{type:"button",variant:"secondary",size:"sm",onClick:te,disabled:e5||"ai"===et&&"P2"===X,className:"shrink-0 min-h-[2.25rem] touch-manipulation",children:"Hint"}),(0,a.jsx)(v.default,{type:"button",variant:"secondary",size:"sm",onClick:ta,className:"shrink-0 min-h-[2.25rem] touch-manipulation whitespace-nowrap",children:"New game"}),(0,a.jsx)(v.default,{type:"button",variant:"ghost",size:"sm",onClick:()=>es(!1),className:"shrink-0 min-h-[2.25rem] touch-manipulation whitespace-nowrap",children:"Change mode"}),(0,a.jsx)(v.default,{type:"button",variant:"ghost",size:"sm",onClick:()=>eZ(e=>!e),className:"min-w-[2.25rem] min-h-[2.25rem] p-2 touch-manipulation","aria-label":eX?"Mute sound":"Turn sound on",title:eX?"Mute sound":"Turn sound on",children:eX?(0,a.jsx)(i,{className:"w-4 h-4 shrink-0","aria-hidden":!0}):(0,a.jsx)(o,{className:"w-4 h-4 shrink-0","aria-hidden":!0})})]})]}),(0,a.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-stretch gap-3 sm:gap-4 roun
1ded-lg border border-slate-600/50 bg-slate-800/30 px-3 py-2.5 sm:px-4 sm:py-2.5 w-full min-w-0","aria-label":"Captures",children:[(0,a.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-center gap-1.5 sm:gap-2 min-w-0 flex-1 sm:min-w-0",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-0.5 min-w-0 shrink-0",children:[(0,a.jsx)("span",{className:"shrink-0 w-3 h-3 rounded-full ".concat(null!=(G=null==(w=k.find(e=>e.value===ec))?void 0:w.fill)?G:"fill-amber-400"),"aria-hidden":!0}),(0,a.jsx)("span",{className:"text-slate-300 text-sm min-w-0 break-words",children:e$}),(0,a.jsx)("span",{className:"text-slate-500 text-sm shrink-0",children:"captured"}),(0,a.jsx)("span",{className:"text-white font-semibold tabular-nums text-sm shrink-0",children:eP})]}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-1 sm:gap-1.5 min-w-0 pl-5 sm:pl-0","aria-label":"".concat(eP," pieces captured by ").concat(e$),children:[Array.from({length:eP},(e,t)=>(0,a.jsx)(I,{color:eu,shape:ep},"p1-".concat(t))),0===eP&&(0,a.jsx)("span",{className:"text-slate-600 text-xs italic",children:"none"})]})]}),(0,a.jsx)("div",{className:"shrink-0 w-full h-px sm:w-px sm:h-6 sm:min-h-0 bg-slate-600","aria-hidden":!0}),(0,a.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-center gap-1.5 sm:gap-2 min-w-0 flex-1 sm:min-w-0",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-0.5 min-w-0 shrink-0",children:[(0,a.jsx)("span",{className:"shrink-0 w-3 h-3 rounded-full ".concat(null!=(V=null==(P=k.find(e=>e.value===eu))?void 0:P.fill)?V:"fill-cyan-400"),"aria-hidden":!0}),(0,a.jsx)("span",{className:"text-slate-300 text-sm min-w-0 break-words",children:e0}),(0,a.jsx)("span",{className:"text-slate-500 text-sm shrink-0",children:"captured"}),(0,a.jsx)("span",{className:"text-white font-semibold tabular-nums text-sm shrink-0",children:eM})]}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-1 sm:gap-1.5 min-w-0 pl-5 sm:pl-0","aria-label":"".concat(eM," pieces captured by ").concat(e0),children:[Array.from({length:eM},(e,t)=>(0,a.jsx)(I,{color:ec,shape:ex},"p2-".concat(t))),0===eM&&(0,a.jsx)("span",{className:"text-slate-600 text-xs italic",children:"none"})]})]})]})]}),(0,a.jsx)(m.default,{open:!!(e5&&e2&&ez),onClose:()=>eq(!1),dismissOnBackdrop:!0,contentClassName:"max-w-md w-full","aria-label":"Game over",children:(0,a.jsxs)("div",{className:"text-center min-w-0 overflow-x-hidden",children:[(0,a.jsx)("p",{className:"text-sm uppercase tracking-wider text-slate-400",children:"Game over"}),(0,a.jsx)("p",{className:"text-xl sm:text-2xl font-bold text-white mt-1",children:"draw"===e2?"It's a draw!":"P1"===e2?"".concat(e$," (").concat(null!=(Y=null==(H=k.find(e=>e.value===ec))?void 0:H.label)?Y:"P1",") wins!"):"".concat(e0," (").concat(null!=(_=null==(R=k.find(e=>e.value===eu))?void 0:R.label)?_:"P2",") wins!")}),(0,a.jsx)("p",{className:"mt-2 text-slate-400 text-sm",children:"draw"===e2?"No legal moves for either player.":"Well played!"}),(0,a.jsxs)("div",{className:"mt-6 flex flex-wrap gap-2 justify-center items-stretch",children:[(0,a.jsx)(v.default,{variant:"primary",size:"sm",className:"whitespace-nowrap min-w-0 sm:min-w-[7rem]",onClick:()=>{tl(),eq(!1)},children:"Restart game"}),(0,a.jsx)(v.default,{variant:"secondary",size:"sm",className:"whitespace-nowrap shrink-0",onClick:()=>{tl(),eq(!1)},children:"Rematch"}),(0,a.jsx)(v.default,{variant:"secondary",size:"sm",className:"whitespace-nowrap shrink-0",onClick:()=>{es(!1),eq(!1)},children:"New game"})]})]})}),(0,a.jsx)("div",{className:"flex justify-center w-full min-w-0 overflow-x-auto",children:(0,a.jsx)("div",{className:"inline-block w-full max-w-[min(100%,28rem)] aspect-[120/218] touch-manipulation",role:"img","aria-label":"Sholo Gutti board",children:(0,a.jsxs)("svg",{viewBox:"0 0 120 218",className:"w-full h-full select-none",preserveAspectRatio:"xMidYMid meet",children:[Object.entries(y).flatMap(e=>{let[t,l]=e,s=Number(t),n=g[s];return l.filter(e=>Number(e)>s).map(e=>{let t=Number(e),l=g[t];return(0,a.jsx)("line",{x1:n.x,y1:n.y,x2:l.x,y2:l.y,stroke:"currentColor",strokeWidth:"1.2",className:"text-slate-500",style:{pointerEvents:"none"}},"".concat(s,"-").concat(t))})}),g.map((e,t)=>(0,a.jsx)("circle",{cx:e.x,cy:e.y,r:5,fill:"none",stroke:"currentColor",strokeWidth:"1",className:"text-slate-600",style:{pointerEvents:"none"}},"node-".concat(t))),eA.length>0&&(()=>{var e;let t=eA[eA.length-1],l=[{i:t.from,fill:"rgba(251,191,36,0.35)",stroke:"rgba(251,191,36,0.7)"},{i:t.to,fill:"rgba(34,197,94,0.35)",stroke:"rgba(34,197,94,0.7)"},...(null!=(e=t.captured)?e:[]).map(e=>({i:e,fill:"rgba(244,63,94,0.3)",stroke:"rgba(244,63,94,0.6)"}))];return(0,a.jsx)("g",{style:{pointerEvents:"none"},children:l.map(e=>{let{i:t,fill:l,stroke:s}=e,n=g[t];return(0,a.jsx)("circle",{cx:n.x,cy:n.y,r:7,fill:l,stroke:s,strokeWidth:"1.5"},"last-".concat(t))})})})(),g.map((e,t)=>{var l,s,n,r,i,o,c,d;if(!J[t]||eY&&t===eY.to)return null;let u={className:"P1"===J[t]?"".concat(null!=(i=null==(l=k.find(e=>e.value===ec))?void 0:l.fill)?i:"fill-amber-400"," ").concat(null!=(o=null==(s=k.find(e=>e.value===ec))?void 0:s.stroke)?o:"stroke-amber-500/80"):"".concat(null!=(c=null==(n=k.find(e=>e.value===eu))?void 0:n.fill)?c:"fill-cyan-400"," ").concat(null!=(d=null==(r=k.find(e=>e.value===eu))?void 0:r.stroke)?d:"stroke-cyan-500/80"),strokeWidth:.8,style:{pointerEvents:"none"}},m="P1"===J[t]?ex:ep;return"round"===m?(0,a.jsx)("circle",{...u,cx:e.x,cy:e.y,r:4},"piece-".concat(t)):"square"===m?(0,a.jsx)("rect",{...u,x:e.x-4,y:e.y-4,width:8,height:8},"piece-".concat(t)):(0,a.jsx)("polygon",{...u,points:"".concat(e.x,",").concat(e.y-4," ").concat(e.x+4,",").concat(e.y," ").concat(e.x,",").concat(e.y+4," ").concat(e.x-4,",").concat(e.y)},"piece-".concat(t))}),eY&&(()=>{var e,t,l,s,n,r,i,o;let c=g[eY.from],d=g[eY.to],u=c.x+(d.x-c.x)*eK,m=c.y+(d.y-c.y)*eK,x={className:"P1"===eY.player?"".concat(null!=(n=null==(e=k.find(e=>e.value===ec))?void 0:e.fill)?n:"fill-amber-400"," ").concat(null!=(r=null==(t=k.find(e=>e.value===ec))?void 0:t.stroke)?r:"stroke-amber-500/80"):"".concat(null!=(i=null==(l=k.find(e=>e.value===eu))?void 0:l.fill)?i:"fill-cyan-400"," ").concat(null!=(o=null==(s=k.find(e=>e.value===eu))?void 0:s.stroke)?o:"stroke-cyan-500/80"),strokeWidth:.8,style:{pointerEvents:"none"}},h="P1"===eY.player?ex:ep;return"round"===h?(0,a.jsx)("circle",{...x,cx:u,cy:m,r:4},"anim-piece"):"square"===h?(0,a.jsx)("rect",{...x,x:u-4,y:m-4,width:8,height:8},"anim-piece"):(0,a.jsx)("polygon",{...x,points:"".concat(u,",").concat(m-4," ").concat(u+4,",").concat(m," ").concat(u,",").concat(m+4," ").concat(u-4,",").concat(m)},"anim-piece")})(),eJ&&(0,a.jsxs)("g",{style:{pointerEvents:"none"},children:[(0,a.jsx)("circle",{cx:g[eJ.from].x,cy:g[eJ.from].y,r:6.5,fill:"none",stroke:"rgb(34, 211, 238)",strokeWidth:"2",strokeDasharray:"4 3",opacity:.9}),(0,a.jsx)("circle",{cx:g[eJ.to].x,cy:g[eJ.to].y,r:6.5,fill:"rgba(34, 211, 238, 0.2)",stroke:"rgb(34, 211, 238)",strokeWidth:"2",strokeDasharray:"4 3",opacity:.9})]}),null!==$&&(0,a.jsx)("g",{style:{pointerEvents:"none"},children:e8.map(e=>(0,a.jsx)("circle",{cx:g[e].x,cy:g[e].y,r:5,fill:"currentColor",fillOpacity:"0.3",className:"text-green-400"},e))}),null!==eW&&(0,a.jsx)("g",{style:{pointerEvents:"none"},children:(0,a.jsx)("circle",{cx:g[eW].x,cy:g[eW].y,r:6,fill:"none",stroke:"rgb(251, 191, 36)",strokeWidth:"1.5",strokeOpacity:"0.95",strokeDasharray:"3 2"})}),g.map((e,t)=>(0,a.jsx)("circle",{cx:e.x,cy:e.y,r:10,fill:"transparent",className:"cursor-pointer hover:fill-white/5",style:{pointerEvents:e5||"ai"===et&&"P2"===X?"none":"auto"},onClick:()=>e9(t),role:"button",tabIndex:e5||"ai"===et&&"P2"===X?-1:0,"aria-label":J[t]?"".concat(J[t]," piece"):e8.includes(t)?"Valid move":"Empty",onFocus:()=>eI(t),onBlur:()=>eI(null),onKeyDown:e=>
1{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),e9(t))}},"hit-".concat(t)))]})})}),null!==en&&(0,a.jsx)("p",{className:"text-sm text-cyan-400 text-center",children:"Continue jumping or click elsewhere to end your turn"})]}):(0,a.jsx)("div",{className:"w-full max-w-md mx-auto px-1 sm:px-0",children:(0,a.jsxs)("div",{className:"rounded-xl border border-slate-600/60 bg-slate-800/40 p-6 space-y-6",children:[(0,a.jsxs)("div",{className:"text-center space-y-1",children:[(0,a.jsx)("h2",{className:"text-lg sm:text-xl font-semibold text-white",children:"Choose how to play"}),(0,a.jsx)("p",{className:"text-slate-400 text-sm",children:"Two players on one device, or play against the computer."})]}),(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"block text-sm font-medium text-slate-300 mb-2",children:"Player names"}),(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-4 items-start",children:[(0,a.jsx)("div",{className:"min-h-[4.5rem] flex flex-col",children:(0,a.jsx)(h.default,{label:"Player 1",type:"text",value:eb,onChange:e=>eg(e.target.value),placeholder:"Player 1",className:"text-slate-800"})}),(0,a.jsx)("div",{className:"min-h-[4.5rem] flex flex-col",children:(0,a.jsx)(h.default,{label:"Player 2",type:"text",value:ej,onChange:e=>ek(e.target.value),placeholder:"Player 2",className:"text-slate-800"})})]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-sm font-medium text-slate-300 mb-2",children:"Who goes first?"}),(0,a.jsx)(p.default,{options:[{value:"P1",label:e$},{value:"P2",label:e0},{value:"random",label:"Random"}],value:ev,onChange:e=>ey(e.target.value),className:"text-slate-800"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"block text-sm font-medium text-slate-300 mb-2",children:"Piece colors"}),(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-4 items-start",children:[(0,a.jsx)("div",{className:"min-h-[4.5rem] flex flex-col",children:(0,a.jsx)(p.default,{label:e$,options:k.map(e=>({value:e.value,label:e.label})),value:ec,onChange:e=>ed(e.target.value),className:"text-slate-800 flex-1 flex flex-col"})}),(0,a.jsx)("div",{className:"min-h-[4.5rem] flex flex-col",children:(0,a.jsx)(p.default,{label:e0,options:k.map(e=>({value:e.value,label:e.label,disabled:e.value===ec})),value:eu,onChange:e=>em(e.target.value),className:"text-slate-800 flex-1 flex flex-col"})})]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"block text-sm font-medium text-slate-300 mb-2",children:"Piece shape"}),(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-4 items-start",children:[(0,a.jsx)("div",{className:"min-h-[4.5rem] flex flex-col",children:(0,a.jsx)(p.default,{label:e$,options:N.map(e=>({value:e.value,label:e.label})),value:ex,onChange:e=>eh(e.target.value),className:"text-slate-800 flex-1 flex flex-col"})}),(0,a.jsx)("div",{className:"min-h-[4.5rem] flex flex-col",children:(0,a.jsx)(p.default,{label:e0,options:N.map(e=>({value:e.value,label:e.label})),value:ep,onChange:e=>ef(e.target.value),className:"text-slate-800 flex-1 flex flex-col"})})]})]}),(0,a.jsx)(f.default,{id:"forced-capture",checked:eG,onChange:e=>eV(e.target.checked),label:"Must capture if possible",description:"When enabled, you must take a capture when one is available."}),(0,a.jsx)(f.default,{id:"sound-enabled",checked:eX,onChange:e=>eZ(e.target.checked),label:"Sound effects",description:"Short sounds on move, capture, and game over."}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-sm font-medium text-slate-300 mb-2",children:"AI difficulty (for Play vs AI)"}),(0,a.jsx)(p.default,{options:[{value:"easy",label:"Easy"},{value:"medium",label:"Medium"},{value:"hard",label:"Hard"}],value:eH,onChange:e=>eR(e.target.value),className:"text-slate-800"})]})]}),(0,a.jsxs)("div",{className:"flex flex-col sm:flex-row gap-3 justify-center pt-2",children:[(0,a.jsx)(v.default,{type:"button",variant:"secondary",size:"lg",onClick:tr,className:"min-w-[10rem]",children:"Two players"}),(0,a.jsx)(v.default,{type:"button",variant:"secondary",size:"lg",onClick:ti,className:"min-w-[10rem]",children:"Play vs AI"})]})]})})]})})}},74575:(e,t,l)=>{l.d(t,{A:()=>a});let a=(0,l(19946).A)("link-2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",ke
1y:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]])},81284:(e,t,l)=>{l.d(t,{A:()=>a});let a=(0,l(19946).A)("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]])},93915:(e,t,l)=>{l.d(t,{default:()=>i});var a=l(95155),s=l(12115),n=l(26723);let r=(0,s.forwardRef)((e,t)=>{let{label:l,error:r,helperText:i,className:o,inputClassName:c,id:d,...u}=e,m=(0,s.useId)(),x=d||m,{input:h}=n.A.components,p=[h.base,r&&h.error,c].filter(Boolean).join(" ");return(0,a.jsxs)("div",{className:o,children:[l&&(0,a.jsx)("label",{htmlFor:x,className:h.label,children:l}),(0,a.jsx)("input",{ref:t,id:x,className:p,"aria-invalid":r?"true":void 0,"aria-describedby":r?"".concat(x,"-error"):i?"".concat(x,"-helper"):void 0,...u}),r&&(0,a.jsx)("p",{id:"".concat(x,"-error"),className:h.errorText,role:"alert",children:r}),!r&&i&&(0,a.jsx)("p",{id:"".concat(x,"-helper"),className:h.helperText,children:i})]})});r.displayName="Input";let i=r}}]);

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.