(()=>{"use strict";var t=function(){function t(t,e,n){this.family=t,this.value=e,this.red=n,this.loadded=!1,this.imgSrc="",this.imgFront=new Image,this.imgBack=new Image,this.img=new Image,this.setImgSrc()}return t.prototype.getFamily=function(){return this.family},t.prototype.getValue=function(){return this.value},t.prototype.isRed=function(){return this.red},t.prototype.drawTile=function(t,e,n,i){t.drawImage(this.imgFront,e,n,75*i,100*i),t.drawImage(this.img,e,n,75*i,100*i)},t.prototype.isLessThan=function(t){return this.family0&&r[r.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!r||a[1]>r[0]&&a[1]0&&r[r.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!r||a[1]>r[0]&&a[1]0;){var n=Math.floor(Math.random()*this.tiles.length);t=[this.tiles[0],this.tiles[n]],this.tiles[n]=t[0],this.tiles[0]=t[1],e.push(this.tiles.shift())}this.tiles=e},n.prototype.getRandomHand=function(){var t=new e;this.shuffle();for(var n=0;n<13;n++)t.push(this.pop());return t},n.prototype.cleanup=function(){this.tiles.forEach((function(t){return t.cleanup()})),this.tiles=[]},n.prototype.preload=function(){return t=this,e=void 0,i=function(){var t;return function(t,e){var n,i,r,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]},s=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(l){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(o=0)),o;)try{if(n=1,i&&(r=2&a[0]?i.return:a[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,a[1])).done)return r;switch(i=0,r&&(a=[2&a[0],r.value]),a[0]){case 0:case 1:r=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,i=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!((r=(r=o.trys).length>0&&r[r.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!r||a[1]>r[0]&&a[1]0&&r[r.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!r||a[1]>r[0]&&a[1]=u&&(l=t,x()),requestAnimationFrame(I)},o.addEventListener("mousemove",(function(t){var e=o.getBoundingClientRect(),n=t.clientX-e.left-c,i=t.clientY-e.top,r=Math.floor(n/(80*p));b=n-80*r*p<=75&&r>=0&&r<14&&i>=800&&i<=800+100*p?r:void 0})),requestAnimationFrame(I),window.cleanup=function(){d.cleanup(),y.forEach((function(t){return t.cleanup()})),y=[],m.cleanup(),w.cleanup(),t.clearRect(0,0,o.width,o.height),a.clearRect(0,0,e.width,e.height),b=void 0},[3,4];case 3:console.error("Impossible d'obtenir le contexte du canvas."),k.label=4;case 4:return[3,6];case 5:console.error("Canvas introuvable dans le DOM."),k.label=6;case 6:return[2]}}))}))}()})();