+
+
+ `,n.querySelectorAll("[data-promo]").forEach(e=>{e.addEventListener("click",()=>{var f;const a=e.dataset.promo;if(x&&a){T.cmd("move",{from:x.from,to:x.to,promotion:a});const h=document.querySelector(`[data-square="${x.to}"]`);if(h){const i=h.getBoundingClientRect(),p=(f=document.getElementById("vfx-canvas"))==null?void 0:f.getBoundingClientRect();p&&(C==null||C.promotionBurst(i.left-p.left+i.width/2,i.top-p.top+i.height/2))}x=null,k="",y=[],z()}})}),(r=n.querySelector("[data-cancel-promo]"))==null||r.addEventListener("click",()=>{x=null,z()});return}if(l.phase==="over"){l.winner!==null&&(l.winner,l.me);const o=l.winner===null;let e="",a="";o?(e=l.result_reason==="stalemate"?b("پات — مساوی!","Stalemate — Draw!"):b("بازی مساوی شد","Draw!"),a=b("هیچکدام از طرفین برنده نشد","No side achieved victory")):(e=`${(t=l.players[l.winner])==null?void 0:t.name} ${b("برنده شد! 🏆","Wins! 🏆")}`,a=l.result_reason==="checkmate"?b("با کیش و مات حریف","By checkmate"):l.result_reason==="abandoned"?b("به دلیل ترک حریف","By abandonment"):""),n.innerHTML=`
+
+ `;return}n.innerHTML=""}}function it(n){var o;if(!l||l.phase!=="play"||x)return;const s=l.me;if(s==null||l.turn!==s)return;const r=(o=l.players[s])==null?void 0:o.color;if(!r)return;const t=l.board.find(e=>e.square===n);if(k){if(k===n){k="",y=[],z();return}if(t!=null&&t.color&&t.color===r){k=n;try{y=A(n,l.board,r)}catch{y=[]}z();return}const e=l.board.find(f=>f.square===k),a=r==="b"?"1":"8";if((e==null?void 0:e.type)==="p"&&n[1]===a){x={from:k,to:n},k="",y=[],z();return}T.cmd("move",{from:k,to:n}),k="",y=[],z()}else if(t&&t.color===r){k=n;try{y=A(n,l.board,r)}catch{y=[]}z()}}
diff --git a/client/assets/index-D5ThqQkE.js b/client/assets/index-D5ThqQkE.js
deleted file mode 100644
index c8a998f..0000000
--- a/client/assets/index-D5ThqQkE.js
+++ /dev/null
@@ -1,10 +0,0 @@
-(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const t of document.querySelectorAll('link[rel="modulepreload"]'))d(t);new MutationObserver(t=>{for(const n of t)if(n.type==="childList")for(const s of n.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&d(s)}).observe(document,{childList:!0,subtree:!0});function a(t){const n={};return t.integrity&&(n.integrity=t.integrity),t.referrerPolicy&&(n.referrerPolicy=t.referrerPolicy),t.crossOrigin==="use-credentials"?n.credentials="include":t.crossOrigin==="anonymous"?n.credentials="omit":n.credentials="same-origin",n}function d(t){if(t.ep)return;t.ep=!0;const n=a(t);fetch(t.href,n)}})();function I(o){const r=new URLSearchParams(location.search).get("host")??"*",a=t=>window.parent.postMessage({m3:1,...t},r);let d=0;return window.addEventListener("message",t=>{var s,l,u;if(t.source!==window.parent||r!=="*"&&t.origin!==r)return;const n=t.data;if(!(!n||n.m3!==1))switch(n.type){case"init":o.onInit(n),a({type:"ready"});break;case"state":o.onState(n.env);break;case"ack":(s=o.onAck)==null||s.call(o,n);break;case"view_changed":(l=o.onViewChanged)==null||l.call(o,n.view);break;case"cmd_failed":(u=o.onCmdFailed)==null||u.call(o,n.req_id,n.code);break}}),a({type:"loaded"}),{cmd(t,n={}){const s=++d;return a({type:"cmd",cmd_type:t,payload:n,req_id:s}),s},toast(t,n,s="info"){a({type:"toast",text_fa:t,text_en:n,kind:s})}}}let e=null,w=null;const i=(o,r)=>(w==null?void 0:w.locale)==="en"?r:o,k=I({onInit(o){w=o,document.documentElement.lang=o.locale,document.documentElement.dir=o.dir,p()},onState(o){o.t==="snap"&&(e=o.body,e.turn!==e.me&&(c="",m=null),p())},onAck(o){o.status==="rejected"&&k.toast("حرکت پذیرفته نشد","Move not accepted","warn")}});function p(){var q,h,C,L;const o=document.getElementById("app");if(!e){o.innerHTML=`${i("در حال بارگذاری…","Loading…")}
`;return}const r=e.me,a=r!=null?(q=e.players[r])==null?void 0:q.color:null,d=a==="b",t={};for(const f of e.board)t[f.square]=f;const n=d?[7,6,5,4,3,2,1,0]:[0,1,2,3,4,5,6,7],s=d?[0,1,2,3,4,5,6,7]:[7,6,5,4,3,2,1,0],l=e.phase==="play"&&e.turn===r,u=s.map(f=>n.map(_=>{const g=String.fromCharCode(97+_)+(f+1),y=t[g]||{type:null,color:null},P=y.color?`${M(y.type,y.color)} `:"",O=l&&!!a&&y.color===a,E=c===g,H=c?l:O;return`${P} `}).join("")).join(""),b=c?`${i("مبدا","From")}: ${c} — ${i("یک خانه مقصد را بزنید (برای لغو، دوباره همان خانه)","click a target square (click it again to cancel)")}
`:"",$=m?`${m.from} → ${m.to}: ${i("ارتقا به","Promote to")}
- ${["q","r","b","n"].map(f=>`${M(f,a)} `).join("")}
- ${i("لغو","Cancel")}
`:"",v=e.phase==="over"?e.result_reason==="abandoned"?i("بازی رها شد","Abandoned"):e.winner===null?e.result_reason==="stalemate"?i("پات — مساوی!","Stalemate — draw!"):i("مساوی!","Draw!"):e.result_reason==="checkmate"?`${(h=e.players[e.winner])==null?void 0:h.name} ${i("مات کرد! 🏆","wins by checkmate 🏆")}`:`${(C=e.players[e.winner])==null?void 0:C.name} ${i("برنده شد 🏆","wins 🏆")}`:(e.turn===r?i("نوبت شماست","Your turn"):`${i("نوبت","Turn")}: ${(L=e.players[e.turn])==null?void 0:L.name}`)+(e.check?` · ${i("کیش!","Check!")}`:"");o.innerHTML=`
- ${v}
- ${e.moves_played!==void 0?`حرکتها: ${e.moves_played}`:""}
- ${u}
- ${b}
- ${$}
- ${i("سفید حرکت میکند","White moves")}
- `}function M(o,r){return o?r==="b"?{k:"♚",q:"♛",r:"♜",b:"♝",n:"♞",p:"♟"}[o]??"":{k:"♔",q:"♕",r:"♖",b:"♗",n:"♘",p:"♙"}[o]??"":""}let c="",m=null;document.addEventListener("click",o=>{var n,s;const r=o.target,a=r.closest("[data-promo]");if(a&&m){k.cmd("move",{from:m.from,to:m.to,promotion:a.dataset.promo}),m=null,c="",p();return}if(r.closest("[data-cancel-promo]")){m=null,p();return}const d=r.closest("[data-from]");if(!d)return;const t=d.dataset.from;if(!m)if(c){if(c===t){c="",p();return}const l=((e==null?void 0:e.board)||[]).find(v=>v.square===t),u=(e==null?void 0:e.me)!==null&&(e==null?void 0:e.me)!==void 0?(n=e==null?void 0:e.players[e.me])==null?void 0:n.color:null;if(l!=null&&l.color&&u&&l.color===u){c=t,p();return}const b=((e==null?void 0:e.board)||[]).find(v=>v.square===c),$=u==="b"?"1":"8";if((b==null?void 0:b.type)==="p"&&t[1]===$){m={from:c,to:t},c="",p();return}k.cmd("move",{from:c,to:t}),c="",p()}else{const l=((e==null?void 0:e.board)||[]).find($=>$.square===t),u=(e==null?void 0:e.me)!==null&&(e==null?void 0:e.me)!==void 0?(s=e==null?void 0:e.players[e.me])==null?void 0:s.color:null;!!u&&(l==null?void 0:l.color)===u&&(e==null?void 0:e.phase)==="play"&&(e==null?void 0:e.turn)===(e==null?void 0:e.me)&&(c=t,p())}});p();
diff --git a/client/index.html b/client/index.html
index 3942e47..b83f4b2 100644
--- a/client/index.html
+++ b/client/index.html
@@ -4,8 +4,8 @@
Chess — 3miz
-
-
+
+
…