var _0x89c8=["Util","random","bind","prototype","apply","elem","getElementById","extend"," ","split","mousemove mouseover mouseout mousedown mouseup click dblclick focus blur submit change","length","function","addEventListener","target","toLowerCase","tagName","stopPropagation","call","$","rotation","hide","row","col","tx","ty","size","2d","getContext","canvas","createElement","abs","piece","img","edges","x","y","beginPath","moveTo","lineTo","PI","rotate","closePath","width","height","save","applyStyle","lineWidth","translate","draw_path","clip","drawImage","stroke","restore","offset","bezierCurveTo","setTransform","type","pieces","rmove","isPointInPath","Shape","group","draw","hitTest","concat","register","randint","hasOwnProperty","set-parts","innerHTML","","sqrt","option","value","appendChild","*","remove","push","_shapes","focus","shuffled","getAll","check","_curHover","get","add","focused","Events","emit","unshift","drag","contextmenu","redraw","preventDefault","cv","left","keydown","right","isTouchDevice","click","inside","outside","Jigsaw","ce","buffer","clientWidth","documentElement","clientHeight","opts","max_width","maxWidth","max_height","maxHeight","action","redirect-form","redirect","eventBus","ui","defaultPieces","tmp_img","image","ctx","preview","image-preview","previewCtx","parts","onload","original","draw_image","render","onerror","originalSRC","set_image","rotatePieces","stop_clock","show_time","on","shuffle","set_parts","attr","#middle","find","#edge","resize","t","time","p","submit","className","loading","src","min","__pieces","spreadRatio","init_clock","clear","flag","marginTop","style","offsetTop","px","border","black","edge","addId","middle","callee","slice","mixin","current_modal","display","image-error","none","overlay","image-input","FileReader","create","block","match","onloadend","result","readAsDataURL","files","change","ondragenter","ondrop","dnd","dragenter","dragover","drop","dataTransfer","close_lightbox","UI","a","id","game-options","clock","show_preview","show_help","show_filepicker","ini","getTime","uuid","show","marginLeft","congrat","show_modal","time-input","0",":","modal","create-puzzle","help","PartsNumberChanged","RenderRequestEvent","RenderFinishEvent","JigsawRenderedEvent","JigsawSetImageEvent","JigsawShuffleEvent","JigsawShowPreview","JigsawShowHelp","JigsawShowFilepicker","ShowEdgeEvent","ShowMiddleEvent","ShowAllEvent","JigsawCompleteEvent"];
(function(){
window[_0x89c8[0]]= {
randint:function(_0x7044x1){
return ~~(Math[_0x89c8[1]]()* _0x7044x1)
}
}
,_0x89c8[2] in Function|| (Function[_0x89c8[3]][_0x89c8[2]]= function(_0x7044x1){
var _0x7044x2=this;
return function(){
return _0x7044x2[_0x89c8[4]](_0x7044x1,arguments)
}
}
);
var _0x7044x1=Class[_0x89c8[7]]({
init:function(_0x7044x1){
this[_0x89c8[5]]= document[_0x89c8[6]](_0x7044x1)
}
}
),_0x7044x2=_0x89c8[10][_0x89c8[9]](_0x89c8[8]);
for(var _0x7044x3=0;
_0x7044x3< _0x7044x2[_0x89c8[11]];
_0x7044x3++){
var _0x7044x4=_0x7044x2[_0x7044x3];
_0x7044x1[_0x89c8[3]][_0x7044x4]= function(_0x7044x1){
return function(_0x7044x2,_0x7044x3){
typeof _0x7044x2== _0x89c8[12]?this[_0x89c8[5]][_0x89c8[13]](_0x7044x1,_0x7044x2,!1):this[_0x89c8[5]][_0x89c8[13]](_0x7044x1,function(_0x7044x1){
var _0x7044x4=_0x7044x1[_0x89c8[14]];
_0x7044x4[_0x89c8[16]][_0x89c8[15]]()== _0x7044x2&& (_0x7044x1[_0x89c8[17]](),_0x7044x3[_0x89c8[18]](_0x7044x4,_0x7044x1))
}
,!1)
}
}
(_0x7044x4)
};
Util[_0x89c8[19]]= function(){
var _0x7044x2=_0x7044x1();
return function(_0x7044x1){
return _0x7044x2[_0x89c8[5]]= document[_0x89c8[6]](_0x7044x1),_0x7044x2
}
}
()
}
)(),function(){
function _0x7044x3(_0x7044x1,_0x7044x3){
if(_0x7044x1[_0x89c8[20]]% 360|| _0x7044x3[_0x89c8[20]]% 360|| _0x7044x3[_0x89c8[21]]|| _0x7044x1[_0x89c8[21]]|| _0x7044x1[_0x89c8[22]]!= _0x7044x3[_0x89c8[22]]&& _0x7044x1[_0x89c8[23]]!= _0x7044x3[_0x89c8[23]]){
return
};
var _0x7044x4=_0x7044x1[_0x89c8[24]]- _0x7044x3[_0x89c8[24]],_0x7044x5=_0x7044x1[_0x89c8[25]]- _0x7044x3[_0x89c8[25]],_0x7044x6=_0x7044x1[_0x89c8[23]]- _0x7044x3[_0x89c8[23]],_0x7044x7=_0x7044x1[_0x89c8[22]]- _0x7044x3[_0x89c8[22]],_0x7044x8=_0x7044x1[_0x89c8[26]];
if((_0x7044x6== -1&& _0x7044x4< 0&& _0x7044x2(_0x7044x4+ _0x7044x8)< 10|| _0x7044x6== 1&& _0x7044x4>= 0&& _0x7044x2(_0x7044x4- _0x7044x8)< 10)&& _0x7044x5<= 10&& _0x7044x5>= -10){
return [_0x7044x1[_0x89c8[23]]> _0x7044x3[_0x89c8[23]]?-_0x7044x2(_0x7044x4)+ _0x7044x8:_0x7044x2(_0x7044x4)- _0x7044x8,_0x7044x3[_0x89c8[25]]- _0x7044x1[_0x89c8[25]]]
};
if((_0x7044x7== -1&& _0x7044x5< 0&& _0x7044x2(_0x7044x5+ _0x7044x8)< 10|| _0x7044x7== 1&& _0x7044x5>= 0&& _0x7044x2(_0x7044x5- _0x7044x8)< 10)&& _0x7044x4<= 10&& _0x7044x4>= -10){
return [_0x7044x3[_0x89c8[24]]- _0x7044x1[_0x89c8[24]],_0x7044x1[_0x89c8[22]]> _0x7044x3[_0x89c8[22]]?-_0x7044x2(_0x7044x5)+ _0x7044x8:_0x7044x2(_0x7044x5)- _0x7044x8]
}
}
var _0x7044x1=document[_0x89c8[30]](_0x89c8[29])[_0x89c8[28]](_0x89c8[27]),_0x7044x2=Math[_0x89c8[31]],_0x7044x4=Cevent[_0x89c8[61]][_0x89c8[7]]({
type:_0x89c8[32],init:function(_0x7044x1,_0x7044x2,_0x7044x3,_0x7044x4,_0x7044x5){
this._super(_0x7044x1,_0x7044x2);
var _0x7044x6=_0x7044x4/ 2;
this[_0x89c8[33]]= _0x7044x3,this[_0x89c8[26]]= _0x7044x4,this[_0x89c8[34]]= _0x7044x5,this[_0x89c8[24]]= this[_0x89c8[35]]+ _0x7044x6,this[_0x89c8[25]]= this[_0x89c8[36]]+ _0x7044x6,this[_0x89c8[35]]= -_0x7044x6,this[_0x89c8[36]]= -_0x7044x6
}
,draw_path:function(_0x7044x1){
var _0x7044x2=this[_0x89c8[26]],_0x7044x3,_0x7044x4=0;
_0x7044x1[_0x89c8[37]](),_0x7044x1[_0x89c8[38]](this[_0x89c8[35]],this[_0x89c8[36]]);
for(;
_0x7044x4< 4;
_0x7044x4++){
_0x7044x3= this[_0x89c8[34]][_0x7044x4];
if(_0x7044x3){
_0x7044x1[_0x89c8[39]](this[_0x89c8[35]]+ 0.4* _0x7044x2,this[_0x89c8[36]]);
var _0x7044x5=this[_0x7044x3](_0x7044x1,_0x7044x2,this[_0x89c8[35]]+ 0.4* _0x7044x2,this[_0x89c8[36]]);
_0x7044x1[_0x89c8[39]](_0x7044x5+ 0.4* _0x7044x2,this[_0x89c8[36]])
}
else {
_0x7044x1[_0x89c8[39]](this[_0x89c8[35]]+ _0x7044x2,this[_0x89c8[36]])
};
_0x7044x1[_0x89c8[41]](Math[_0x89c8[40]]/ 2)
};
_0x7044x1[_0x89c8[42]]()
}
,render:function(_0x7044x1,_0x7044x2){
var _0x7044x3=document[_0x89c8[30]](_0x89c8[29])[_0x89c8[28]](_0x89c8[27]),_0x7044x4=this[_0x89c8[26]]+ 0.5;
_0x7044x3[_0x89c8[29]][_0x89c8[43]]= _0x7044x4* 2,_0x7044x3[_0x89c8[29]][_0x89c8[44]]= _0x7044x4* 2,_0x7044x3[_0x89c8[45]](),this[_0x89c8[46]](_0x7044x3),_0x7044x3[_0x89c8[47]]= 1.5,_0x7044x3[_0x89c8[48]](_0x7044x4,_0x7044x4),this[_0x89c8[49]](_0x7044x3),_0x7044x3[_0x89c8[50]](),_0x7044x3[_0x89c8[51]](this[_0x89c8[33]],-this[_0x89c8[24]]- _0x7044x1,-this[_0x89c8[25]]- _0x7044x2),this[_0x89c8[52]]&& _0x7044x3[_0x89c8[52]](),_0x7044x3[_0x89c8[53]](),this[_0x89c8[24]]+= this[_0x89c8[54]],this[_0x89c8[33]]= _0x7044x3[_0x89c8[29]]
}
,outside:function(_0x7044x1,_0x7044x2,_0x7044x3,_0x7044x4){
var _0x7044x5=_0x7044x2* 0.2,_0x7044x6=_0x7044x2* 0.3;
return _0x7044x1[_0x89c8[55]](_0x7044x3- _0x7044x5,_0x7044x4- _0x7044x6,_0x7044x3,_0x7044x4- _0x7044x6,_0x7044x3,_0x7044x4-= _0x7044x6),_0x7044x1[_0x89c8[55]](_0x7044x3,_0x7044x4,_0x7044x3,_0x7044x4,_0x7044x3+= _0x7044x5,_0x7044x4),_0x7044x1[_0x89c8[55]](_0x7044x3,_0x7044x4,_0x7044x3+ _0x7044x5,_0x7044x4,_0x7044x3,_0x7044x4+= _0x7044x6),_0x7044x3
}
,inside:function(_0x7044x1,_0x7044x2,_0x7044x3,_0x7044x4){
var _0x7044x5=_0x7044x2* 0.2,_0x7044x6=_0x7044x2* 0.3;
return _0x7044x1[_0x89c8[55]](_0x7044x3- _0x7044x5,_0x7044x4+ _0x7044x6,_0x7044x3,_0x7044x4+ _0x7044x6,_0x7044x3,_0x7044x4+= _0x7044x6),_0x7044x1[_0x89c8[55]](_0x7044x3,_0x7044x4,_0x7044x3,_0x7044x4,_0x7044x3+= _0x7044x5,_0x7044x4),_0x7044x1[_0x89c8[55]](_0x7044x3,_0x7044x4,_0x7044x3+ _0x7044x5,_0x7044x4,_0x7044x3,_0x7044x4-= _0x7044x6),_0x7044x3
}
,draw:function(_0x7044x1){
if(this[_0x89c8[21]]){
return
};
var _0x7044x2=this[_0x89c8[26]]/ 2- 0.5;
this[_0x89c8[56]](_0x7044x1),_0x7044x1[_0x89c8[51]](this[_0x89c8[33]],this[_0x89c8[35]]- _0x7044x2,this[_0x89c8[36]]- _0x7044x2)
}
,check:function(_0x7044x1){
var _0x7044x2;
if(_0x7044x1[_0x89c8[57]]== _0x89c8[32]){
_0x7044x2= _0x7044x3(this,_0x7044x1)
}
else {
var _0x7044x4,_0x7044x5=_0x7044x1[_0x89c8[58]][_0x89c8[11]];
for(_0x7044x4= 0;
_0x7044x4< _0x7044x5;
_0x7044x4++){
if(_0x7044x2= _0x7044x3(this,_0x7044x1[_0x89c8[58]][_0x7044x4])){
break
}
}
};
return _0x7044x2&& this[_0x89c8[59]](_0x7044x2[0],_0x7044x2[1]),_0x7044x2
}
,hitTest:function(_0x7044x2){
if(this[_0x89c8[21]]){
return
};
var _0x7044x3=this[_0x89c8[26]];
return _0x7044x1[_0x89c8[45]](),this[_0x89c8[56]](_0x7044x1),this[_0x89c8[49]](_0x7044x1),_0x7044x1[_0x89c8[53]](),_0x7044x1[_0x89c8[60]](_0x7044x2[_0x89c8[35]],_0x7044x2[_0x89c8[36]])
}
}
),_0x7044x5=Cevent[_0x89c8[61]][_0x89c8[7]]({
type:_0x89c8[62],init:function(){
this[_0x89c8[58]]= [],this._super(0,0)
}
,draw:function(_0x7044x1){
if(this[_0x89c8[21]]){
return
};
var _0x7044x2,_0x7044x3=this[_0x89c8[58]][_0x89c8[11]];
for(_0x7044x2= 0;
_0x7044x2< _0x7044x3;
_0x7044x2++){
this[_0x89c8[58]][_0x7044x2][_0x89c8[63]](_0x7044x1)
}
}
,hitTest:function(_0x7044x1){
var _0x7044x2,_0x7044x3=this[_0x89c8[58]][_0x89c8[11]];
for(_0x7044x2= 0;
_0x7044x2< _0x7044x3;
_0x7044x2++){
if(this[_0x89c8[58]][_0x7044x2][_0x89c8[64]](_0x7044x1)){
return !0
}
}
}
,check:function(_0x7044x1){
var _0x7044x2,_0x7044x4=this[_0x89c8[58]][_0x89c8[11]],_0x7044x5;
if(_0x7044x1[_0x89c8[57]]== _0x89c8[32]){
for(_0x7044x2= 0;
_0x7044x2< _0x7044x4;
_0x7044x2++){
if(_0x7044x5= _0x7044x3(this[_0x89c8[58]][_0x7044x2],_0x7044x1)){
return this[_0x89c8[59]](_0x7044x5[0],_0x7044x5[1]),!0
}
}
}
else {
var _0x7044x6,_0x7044x7=_0x7044x1[_0x89c8[58]][_0x89c8[11]];
for(_0x7044x2= 0;
_0x7044x2< _0x7044x4;
_0x7044x2++){
for(_0x7044x6= 0;
_0x7044x6< _0x7044x7;
_0x7044x6++){
if(_0x7044x5= _0x7044x3(this[_0x89c8[58]][_0x7044x2],_0x7044x1[_0x89c8[58]][_0x7044x6])){
return this[_0x89c8[59]](_0x7044x5[0],_0x7044x5[1]),!0
}
}
}
}
}
,rmove:function(_0x7044x1,_0x7044x2){
var _0x7044x3,_0x7044x4=this[_0x89c8[58]][_0x89c8[11]];
for(_0x7044x3= 0;
_0x7044x3< _0x7044x4;
_0x7044x3++){
this[_0x89c8[58]][_0x7044x3][_0x89c8[59]](_0x7044x1,_0x7044x2)
}
}
,add:function(){
this[_0x89c8[58]]= this[_0x89c8[58]][_0x89c8[65]][_0x89c8[4]](this[_0x89c8[58]],arguments)
}
}
);
Cevent[_0x89c8[66]](_0x89c8[62],_0x7044x5),Cevent[_0x89c8[66]](_0x89c8[32],_0x7044x4)
}
(),function(){
function _0x7044x7(){
return _0x7044x4[Util[_0x89c8[67]](2)]
}
function _0x7044x8(_0x7044x1){
return document[_0x89c8[6]](_0x7044x1)
}
function _0x7044x9(_0x7044x1,_0x7044x2){
var _0x7044x3;
for(_0x7044x3 in _0x7044x2){
_0x7044x2[_0x89c8[68]](_0x7044x3)&& !(_0x7044x3 in _0x7044x1)&& (_0x7044x1[_0x7044x3]= _0x7044x2[_0x7044x3])
};
return _0x7044x1
}
function _0x7044xa(_0x7044x1){
var _0x7044x2=_0x7044x1[_0x89c8[43]],_0x7044x3=_0x7044x1[_0x89c8[44]],_0x7044x4=[],_0x7044x5=_0x7044x8(_0x89c8[69]),_0x7044x6,_0x7044x7,_0x7044x9,_0x7044xa,_0x7044xb;
_0x7044x5[_0x89c8[70]]= _0x89c8[71];
for(var _0x7044xc=10;
_0x7044xc<= 200;
_0x7044xc+= 10){
var _0x7044x7=~~Math[_0x89c8[72]](_0x7044x2* _0x7044x3/ _0x7044xc),_0x7044x9=~~(_0x7044x2/ _0x7044x7),_0x7044xa=~~(_0x7044x3/ _0x7044x7);
while(_0x7044x9* _0x7044xa< _0x7044xc){
_0x7044x7--,_0x7044x9= ~~(_0x7044x2/ _0x7044x7),_0x7044xa= ~~(_0x7044x3/ _0x7044x7)
};
_0x7044xb!= _0x7044x9* _0x7044xa&& (_0x7044xb= _0x7044x9* _0x7044xa,_0x7044x6= document[_0x89c8[30]](_0x89c8[73]),_0x7044x6[_0x89c8[74]]= _0x7044xc,_0x7044x6[_0x89c8[70]]= _0x7044xb+ _0x89c8[8]+ defs_lngp,_0x7044x5[_0x89c8[75]](_0x7044x6))
}
}
function _0x7044xb(_0x7044x1,_0x7044x2,_0x7044x3){
_0x7044x1[_0x89c8[91]](_0x89c8[76],{
end:function(_0x7044x3,_0x7044x4){
if(!_0x7044x3[_0x89c8[81]]){
return
};
var _0x7044x5=_0x7044x3[_0x89c8[82]](_0x89c8[32])[_0x89c8[65]](_0x7044x3[_0x89c8[82]](_0x89c8[62])),_0x7044x6=0,_0x7044x7=_0x7044x5[_0x89c8[11]],_0x7044x8=this;
for(;
_0x7044x6< _0x7044x7;
_0x7044x6++){
if(_0x7044x5[_0x7044x6]=== this){
continue
};
_0x7044x8[_0x89c8[83]](_0x7044x5[_0x7044x6])&& (_0x7044x3[_0x89c8[77]](_0x7044x8),_0x7044x3[_0x89c8[77]](_0x7044x5[_0x7044x6]),_0x7044x3[_0x89c8[84]]= _0x7044x3[_0x89c8[62]]()[_0x89c8[85]](-1),_0x7044x3[_0x89c8[84]][_0x89c8[86]](_0x7044x8[_0x89c8[58]]|| _0x7044x8,_0x7044x5[_0x7044x6][_0x89c8[58]]|| _0x7044x5[_0x7044x6]),_0x7044x8= _0x7044x3[_0x89c8[84]],_0x7044x3[_0x89c8[87]]= null)
};
!_0x7044x1[_0x89c8[82]](_0x89c8[32])[_0x89c8[11]]&& _0x7044x1[_0x89c8[82]](_0x89c8[62])[_0x89c8[11]]== 1 && _0x7044x1[_0x89c8[81]] && (_0x7044x1[_0x89c8[81]]= !1,_0x7044x2[_0x89c8[89]](jigsaw[_0x89c8[88]].JIGSAW_COMPLETE)),_0x7044x8[_0x89c8[57]]== _0x89c8[62]&& (_0x7044x3[_0x89c8[77]](_0x7044x8),_0x7044x3[_0x89c8[79]][_0x89c8[90]](_0x7044x8))
}
}
)[_0x89c8[80]](_0x89c8[76],function(_0x7044x1,_0x7044x2){
_0x7044x1[_0x89c8[77]](this),_0x7044x1[_0x89c8[79]][_0x89c8[78]](this)
}
),_0x7044x1[_0x89c8[95]][_0x89c8[13]](_0x89c8[92],function(_0x7044x2){
_0x7044x3&& _0x7044x1[_0x89c8[87]]&& (_0x7044x1[_0x89c8[87]][_0x89c8[20]]= (_0x7044x1[_0x89c8[87]][_0x89c8[20]]+ 45)% 360,_0x7044x1[_0x89c8[93]]()),_0x7044x2[_0x89c8[94]]()
}
,!1);
if(!_0x7044x3){
return
};
_0x7044x1[_0x89c8[97]](_0x89c8[98],function(){
return this[_0x89c8[87]]&& (this[_0x89c8[87]][_0x89c8[20]]= (this[_0x89c8[87]][_0x89c8[20]]+ 45)% 360),!1
}
)[_0x89c8[97]](_0x89c8[96],function(){
return this[_0x89c8[87]]&& (this[_0x89c8[87]][_0x89c8[20]]= (this[_0x89c8[87]][_0x89c8[20]]- 45)% 360),!1
}
),Cevent[_0x89c8[99]]&& _0x7044x1[_0x89c8[100]](_0x89c8[76],function(_0x7044x2,_0x7044x3){
_0x7044x1[_0x89c8[87]]&& (_0x7044x1[_0x89c8[87]][_0x89c8[20]]= (_0x7044x1[_0x89c8[87]][_0x89c8[20]]+ 45)% 360,_0x7044x1[_0x89c8[93]]())
}
)
}
var _0x7044x1=_0x89c8[101],_0x7044x2=_0x89c8[102],_0x7044x3=null,_0x7044x4=[_0x7044x1,_0x7044x2],_0x7044x5=0,_0x7044x6={
spreadRatio:1,offsetTop:0,maxWidth:705,maxHeight:470,redirect:_0x89c8[71],border:!0,defaultPieces:10,shuffled:!1,rotatePieces:!0
};
jigsaw= {
}
,jigsaw[_0x89c8[103]]= Class[_0x89c8[7]]({
init:function(_0x7044x1){
function _0x7044x4(){
var _0x7044x1=_0x7044x3[_0x89c8[104]][_0x89c8[95]],_0x7044x2=_0x7044x3[_0x89c8[104]][_0x89c8[105]][_0x89c8[29]];
_0x7044x2[_0x89c8[43]]= _0x7044x1[_0x89c8[43]]= document[_0x89c8[107]][_0x89c8[106]],_0x7044x2[_0x89c8[44]]= _0x7044x1[_0x89c8[44]]= document[_0x89c8[107]][_0x89c8[108]]- 45,_0x7044x3[_0x89c8[104]][_0x89c8[93]]()
}
var _0x7044x2= new EventEmitter,_0x7044x3=this;
this[_0x89c8[109]]= _0x7044x1= _0x7044x9(_0x7044x1|| {
}
,_0x7044x6),this[_0x89c8[110]]= _0x7044x1[_0x89c8[111]],this[_0x89c8[112]]= _0x7044x1[_0x89c8[113]],_0x7044x8(_0x89c8[115])[_0x89c8[114]]= _0x7044x1[_0x89c8[116]],this[_0x89c8[117]]= _0x7044x2,this[_0x89c8[104]]= new Cevent(_0x89c8[29],_0x89c8[105]),this[_0x89c8[118]]= new jigsaw.UI(_0x7044x2,_0x7044x1[_0x89c8[119]]|| 10),this[_0x89c8[120]]= new Image,this[_0x89c8[33]]= document[_0x89c8[6]](_0x89c8[121]),this[_0x89c8[122]]= this[_0x89c8[33]][_0x89c8[28]](_0x89c8[27]),this[_0x89c8[123]]= document[_0x89c8[6]](_0x89c8[124]),this[_0x89c8[125]]= this[_0x89c8[123]][_0x89c8[28]](_0x89c8[27]),this[_0x89c8[126]]= _0x7044x1[_0x89c8[119]]|| 10,this[_0x89c8[120]][_0x89c8[127]]= function(){
_0x7044x3[_0x89c8[128]]= this,_0x7044x3[_0x89c8[129]](this),_0x7044xa(_0x7044x3[_0x89c8[33]]),_0x7044x3[_0x89c8[130]]()
}
,this[_0x89c8[120]][_0x89c8[131]]= function(){
_0x7044x3[_0x89c8[133]](_0x7044x3[_0x89c8[132]])
}
,_0x7044xb(this[_0x89c8[104]],_0x7044x2,this[_0x89c8[109]][_0x89c8[134]]),_0x7044x2[_0x89c8[137]](jigsaw[_0x89c8[88]].JIGSAW_COMPLETE,function(){
_0x7044x3[_0x89c8[118]][_0x89c8[135]](),_0x7044x1[_0x89c8[116]]?_0x7044x3[_0x89c8[116]]():_0x7044x3[_0x89c8[118]][_0x89c8[136]]()
}
),_0x7044x1[_0x89c8[81]]&& _0x7044x2[_0x89c8[137]](jigsaw[_0x89c8[88]].RENDER_FINISH,this[_0x89c8[138]][_0x89c8[2]](this)),_0x7044x2[_0x89c8[137]](jigsaw[_0x89c8[88]].PARTS_NUMBER_CHANGED,this[_0x89c8[139]][_0x89c8[2]](this)),_0x7044x2[_0x89c8[137]](jigsaw[_0x89c8[88]].RENDER_REQUEST,this[_0x89c8[130]][_0x89c8[2]](this)),_0x7044x2[_0x89c8[137]](jigsaw[_0x89c8[88]].JIGSAW_SHUFFLE,this[_0x89c8[138]][_0x89c8[2]](this)),_0x7044x2[_0x89c8[137]](jigsaw[_0x89c8[88]].JIGSAW_SET_IMAGE,this[_0x89c8[133]][_0x89c8[2]](this)),_0x7044x2[_0x89c8[137]](jigsaw[_0x89c8[88]].SHOW_EDGE,function(){
_0x7044x3[_0x89c8[104]][_0x89c8[142]](_0x89c8[141])[_0x89c8[140]](_0x89c8[21],!0),_0x7044x3[_0x89c8[104]][_0x89c8[142]](_0x89c8[143])[_0x89c8[140]](_0x89c8[21],!1),_0x7044x3[_0x89c8[104]][_0x89c8[93]]()
}
),_0x7044x2[_0x89c8[137]](jigsaw[_0x89c8[88]].SHOW_MIDDLE,function(){
_0x7044x3[_0x89c8[104]][_0x89c8[142]](_0x89c8[141])[_0x89c8[140]](_0x89c8[21],!1),_0x7044x3[_0x89c8[104]][_0x89c8[142]](_0x89c8[143])[_0x89c8[140]](_0x89c8[21],!0),_0x7044x3[_0x89c8[104]][_0x89c8[93]]()
}
),_0x7044x2[_0x89c8[137]](jigsaw[_0x89c8[88]].SHOW_ALL,function(){
_0x7044x3[_0x89c8[104]][_0x89c8[142]](_0x89c8[76])[_0x89c8[140]](_0x89c8[21],!1),_0x7044x3[_0x89c8[104]][_0x89c8[93]]()
}
),_0x7044x4(),window[_0x89c8[13]](_0x89c8[144],_0x7044x4,!1)
}
,redirect:function(){
_0x7044x8(_0x89c8[145])[_0x89c8[74]]= this[_0x89c8[118]][_0x89c8[146]](),_0x7044x8(_0x89c8[147])[_0x89c8[74]]= this[_0x89c8[126]],_0x7044x8(_0x89c8[115])[_0x89c8[148]]()
}
,set_parts:function(_0x7044x1){
this[_0x89c8[126]]= _0x7044x1
}
,set_image:function(_0x7044x1){
this[_0x89c8[104]][_0x89c8[95]][_0x89c8[149]]= _0x89c8[150],this[_0x89c8[120]][_0x89c8[151]]|| (this[_0x89c8[132]]= _0x7044x1),this[_0x89c8[120]][_0x89c8[151]]= _0x7044x1
}
,draw_image:function(_0x7044x1,_0x7044x2,_0x7044x3){
var _0x7044x4=_0x7044x2|| this[_0x89c8[110]],_0x7044x5=_0x7044x3|| this[_0x89c8[112]],_0x7044x6,_0x7044x7,_0x7044x8=this[_0x89c8[122]];
if(_0x7044x1[_0x89c8[43]]> _0x7044x4|| _0x7044x1[_0x89c8[44]]> _0x7044x5){
var _0x7044x9=Math[_0x89c8[152]](_0x7044x4/ _0x7044x1[_0x89c8[43]],_0x7044x5/ _0x7044x1[_0x89c8[44]]);
_0x7044x6= _0x7044x8[_0x89c8[29]][_0x89c8[43]]= ~~(_0x7044x1[_0x89c8[43]]* _0x7044x9),_0x7044x7= _0x7044x8[_0x89c8[29]][_0x89c8[44]]= ~~(_0x7044x1[_0x89c8[44]]* _0x7044x9),_0x7044x8[_0x89c8[51]](_0x7044x1,0,0,_0x7044x1[_0x89c8[43]],_0x7044x1[_0x89c8[44]],0,0,_0x7044x6,_0x7044x7)
}
else {
_0x7044x8[_0x89c8[29]][_0x89c8[43]]= _0x7044x1[_0x89c8[43]],_0x7044x8[_0x89c8[29]][_0x89c8[44]]= _0x7044x1[_0x89c8[44]],_0x7044x8[_0x89c8[51]](_0x7044x1,0,0)
}
}
,clear:function(){
this[_0x89c8[104]][_0x89c8[79]]= []
}
,shuffle:function(){
var _0x7044x1=this[_0x89c8[104]][_0x89c8[82]](_0x89c8[32]);
if(!_0x7044x1[_0x89c8[11]]){
if(!this[_0x89c8[153]]){
return
};
this[_0x89c8[104]][_0x89c8[79]]= _0x7044x1= this[_0x89c8[153]]
};
var _0x7044x2,_0x7044x3=_0x7044x1[_0x89c8[11]],_0x7044x4,_0x7044x5=_0x7044x1[0][_0x89c8[26]],_0x7044x6=this[_0x89c8[109]][_0x89c8[154]],_0x7044x7=document[_0x89c8[107]][_0x89c8[106]],_0x7044x8=document[_0x89c8[107]][_0x89c8[108]]- 50,_0x7044x9=document[_0x89c8[107]][_0x89c8[106]]* _0x7044x6,_0x7044xa=(document[_0x89c8[107]][_0x89c8[108]]- 50)* _0x7044x6,_0x7044xb=~~((_0x7044x7- _0x7044x9)/ 2),_0x7044xc=~~((_0x7044x8- _0x7044xa)/ 2);
for(_0x7044x2= 0;
_0x7044x2< _0x7044x3;
_0x7044x2++){
_0x7044x4= _0x7044x1[_0x7044x2],_0x7044x4[_0x89c8[24]]= Util[_0x89c8[67]](_0x7044x9)+ _0x7044x4[_0x89c8[24]]% 1+ _0x7044xb,_0x7044x4[_0x89c8[25]]= Util[_0x89c8[67]](_0x7044xa)+ _0x7044x4[_0x89c8[24]]% 1+ _0x7044xc,this[_0x89c8[109]][_0x89c8[134]]&& (_0x7044x4[_0x89c8[20]]= Util[_0x89c8[67]](4)* 90)
};
this[_0x89c8[109]][_0x89c8[81]]&& (this[_0x89c8[104]][_0x89c8[95]][_0x89c8[149]]= _0x89c8[71],this[_0x89c8[118]][_0x89c8[155]]()),this[_0x89c8[104]][_0x89c8[81]]= !0,this[_0x89c8[104]][_0x89c8[93]]()
}
,render:function(){
this[_0x89c8[109]][_0x89c8[81]]?(this[_0x89c8[104]][_0x89c8[95]][_0x89c8[149]]= _0x89c8[150],this[_0x89c8[104]][_0x89c8[156]](),this[_0x89c8[118]][_0x89c8[135]]()):this[_0x89c8[104]][_0x89c8[95]][_0x89c8[149]]= _0x89c8[71],this[_0x89c8[104]][_0x89c8[81]]= !1;
var _0x7044x4,_0x7044x6,_0x7044x8,_0x7044x9,_0x7044xa=[],_0x7044xb=[],_0x7044xc=this[_0x89c8[33]][_0x89c8[43]],_0x7044xd=this[_0x89c8[33]][_0x89c8[44]],_0x7044xe=~~Math[_0x89c8[72]](_0x7044xc* _0x7044xd/ this[_0x89c8[126]]),_0x7044xf=~~(_0x7044xc/ _0x7044xe),_0x7044x10=~~(_0x7044xd/ _0x7044xe),_0x7044x11=0,_0x7044x12=0,_0x7044x13=++_0x7044x5,_0x7044x14;
this[_0x89c8[157]]= _0x7044x13;
while(_0x7044xf* _0x7044x10< this[_0x89c8[126]]){
_0x7044xe--,_0x7044xf= ~~(_0x7044xc/ _0x7044xe),_0x7044x10= ~~(_0x7044xd/ _0x7044xe)
};
_0x7044xe= _0x7044xe% 2?_0x7044xe:_0x7044xe- 1,_0x7044x14= ~~(document[_0x89c8[107]][_0x89c8[106]]/ 2- _0x7044xe* _0x7044xf/ 2),this[_0x89c8[156]]();
var _0x7044x15=~~((_0x7044xc- _0x7044xf* _0x7044xe)/ 2),_0x7044x16=~~((_0x7044xd- _0x7044x10* _0x7044xe)/ 2);
_0x7044x15= _0x7044x15>= 0?_0x7044x15:0,_0x7044x16= _0x7044x16>= 0?_0x7044x16:0,this[_0x89c8[123]][_0x89c8[159]][_0x89c8[158]]= this[_0x89c8[109]][_0x89c8[160]]+ _0x89c8[161],this[_0x89c8[123]][_0x89c8[43]]= _0x7044xe* _0x7044xf,this[_0x89c8[123]][_0x89c8[44]]= _0x7044xe* _0x7044x10,this[_0x89c8[125]][_0x89c8[51]](this[_0x89c8[33]],_0x7044x15,_0x7044x16,_0x7044xe* _0x7044xf,_0x7044xe* _0x7044x10,0,0,_0x7044xe* _0x7044xf,_0x7044xe* _0x7044x10),function(){
if(_0x7044x11< _0x7044xf&& _0x7044x13== this[_0x89c8[157]]){
_0x7044x12< _0x7044x10?(_0x7044x4= _0x7044x12== 0?_0x7044x3:_0x7044x8== _0x7044x1?_0x7044x2:_0x7044x1,_0x7044x6= _0x7044x11== _0x7044xf- 1?_0x7044x3:_0x7044x7(),_0x7044x8= _0x7044x12== _0x7044x10- 1?_0x7044x3:_0x7044x7(),_0x7044x9= _0x7044x11== 0?0:_0x7044xb[_0x7044x12]== _0x7044x1?_0x7044x2:_0x7044x1,this[_0x89c8[104]][_0x89c8[32]](_0x7044xe* _0x7044x11,_0x7044xe* _0x7044x12+ this[_0x89c8[109]][_0x89c8[160]],this[_0x89c8[33]],_0x7044xe,[_0x7044x4,_0x7044x6,_0x7044x8,_0x7044x9])[_0x89c8[140]]({
col:_0x7044x11,row:_0x7044x12,offset:_0x7044x14,stroke:this[_0x89c8[109]][_0x89c8[162]]?_0x89c8[163]:_0x89c8[71]
}
)[_0x89c8[85]](-1)[_0x89c8[130]](_0x7044x15,_0x7044x16- this[_0x89c8[109]][_0x89c8[160]]),this[_0x89c8[109]][_0x89c8[81]]|| this[_0x89c8[104]][_0x89c8[93]](),_0x7044x12== 0|| _0x7044x11== 0|| _0x7044x11== _0x7044xf- 1|| _0x7044x12== _0x7044x10- 1?this[_0x89c8[104]][_0x89c8[165]](_0x89c8[164]):this[_0x89c8[104]][_0x89c8[165]](_0x89c8[166]),_0x7044xa[_0x89c8[78]](_0x7044x6),_0x7044x12++):(_0x7044x11++,_0x7044x12= 0,_0x7044xb= _0x7044xa,_0x7044xa= []),setTimeout(arguments[_0x89c8[167]][_0x89c8[2]](this),20);
return
};
this[_0x89c8[157]]== _0x7044x13&& (this[_0x89c8[153]]= this[_0x89c8[104]][_0x89c8[85]]()[_0x89c8[168]](0),this[_0x89c8[104]][_0x89c8[93]](),this[_0x89c8[117]][_0x89c8[89]](jigsaw[_0x89c8[88]].RENDER_FINISH))
}
[_0x89c8[2]](this)()
}
}
),EventEmitter[_0x89c8[169]](jigsaw.Jigsaw)
}
(),function(){
function _0x7044x3(_0x7044x2,_0x7044x3){
function _0x7044x5(){
return _0x7044x2[_0x89c8[170]]&& (_0x7044x2[_0x89c8[170]][_0x89c8[149]]= _0x89c8[21]),_0x7044x1(_0x89c8[172])[_0x89c8[159]][_0x89c8[171]]= _0x89c8[173],_0x7044x1(_0x89c8[174])[_0x89c8[149]]= _0x89c8[21],_0x7044x1(_0x89c8[175])[_0x89c8[74]]= _0x89c8[71],!1
}
if(window[_0x89c8[176]]&& ( new FileReader)[_0x89c8[127]]=== null){
_0x7044x1(_0x89c8[177])[_0x89c8[159]][_0x89c8[171]]= _0x89c8[178];
function _0x7044x4(_0x7044x2){
var _0x7044x4=_0x7044x2[i];
if(!_0x7044x4[_0x89c8[57]][_0x89c8[179]](/image.*/)){
_0x7044x1(_0x89c8[172])[_0x89c8[159]][_0x89c8[171]]= _0x89c8[178];
return
};
var _0x7044x6= new FileReader;
_0x7044x6[_0x89c8[180]]= function(_0x7044x1){
_0x7044x3[_0x89c8[89]](jigsaw[_0x89c8[88]].JIGSAW_SET_IMAGE,this[_0x89c8[181]]),_0x7044x5()
}
,_0x7044x6[_0x89c8[182]](_0x7044x4)
}
Util.$(_0x89c8[175])[_0x89c8[184]](function(){
_0x7044x4(this[_0x89c8[183]])
}
),_0x89c8[185] in window&& _0x89c8[186] in window&& (_0x7044x1(_0x89c8[187])[_0x89c8[159]][_0x89c8[171]]= _0x89c8[178],document[_0x89c8[13]](_0x89c8[188],function(_0x7044x1){
return _0x7044x1[_0x89c8[17]](),_0x7044x1[_0x89c8[94]](),!1
}
,!1),document[_0x89c8[13]](_0x89c8[189],function(_0x7044x1){
return _0x7044x1[_0x89c8[17]](),_0x7044x1[_0x89c8[94]](),!1
}
,!1),document[_0x89c8[13]](_0x89c8[190],function(_0x7044x1){
_0x7044x1[_0x89c8[17]](),_0x7044x1[_0x89c8[94]]();
var _0x7044x2=_0x7044x1[_0x89c8[191]];
_0x7044x4(_0x7044x2[_0x89c8[183]])
}
,!1))
};
jigsaw[_0x89c8[193]][_0x89c8[192]]= _0x7044x5,Util.$(_0x89c8[174])[_0x89c8[100]](_0x7044x5),Util.$(_0x89c8[69])[_0x89c8[184]](function(){
_0x7044x3[_0x89c8[89]](jigsaw[_0x89c8[88]].PARTS_NUMBER_CHANGED,+this[_0x89c8[74]]),_0x7044x3[_0x89c8[89]](jigsaw[_0x89c8[88]].RENDER_REQUEST)
}
),Util.$(_0x89c8[196])[_0x89c8[100]](_0x89c8[194],function(_0x7044x1){
jigsaw[_0x89c8[88]][this[_0x89c8[195]]]&& (_0x7044x1[_0x89c8[94]](),_0x7044x3[_0x89c8[89]](jigsaw[_0x89c8[88]][this[_0x89c8[195]]]))
}
)
}
var _0x7044x1=function(_0x7044x1){
return document[_0x89c8[6]](_0x7044x1)
}
,_0x7044x2=0;
jigsaw[_0x89c8[193]]= Class[_0x89c8[7]]({
init:function(_0x7044x2,_0x7044x4){
var _0x7044x5=this;
this[_0x89c8[117]]= _0x7044x2,this[_0x89c8[197]]= _0x7044x1(_0x89c8[197]),_0x7044x1(_0x89c8[69])[_0x89c8[74]]= _0x7044x4,_0x7044x3(this,_0x7044x2),_0x7044x2[_0x89c8[137]](jigsaw[_0x89c8[88]].JIGSAW_SHUFFLE,this[_0x89c8[155]][_0x89c8[2]](this)),_0x7044x2[_0x89c8[137]](jigsaw[_0x89c8[88]].SHOW_PREVIEW,this[_0x89c8[198]][_0x89c8[2]](this)),_0x7044x2[_0x89c8[137]](jigsaw[_0x89c8[88]].SHOW_HELP,this[_0x89c8[199]][_0x89c8[2]](this)),_0x7044x2[_0x89c8[137]](jigsaw[_0x89c8[88]].SHOW_FILEPICKER,this[_0x89c8[200]][_0x89c8[2]](this))
}
,stop_clock:function(){
_0x7044x2++
}
,init_clock:function(){
var _0x7044x1=this;
this[_0x89c8[201]]= ( new Date)[_0x89c8[202]](),this[_0x89c8[203]]= _0x7044x2,function(){
_0x7044x1[_0x89c8[203]]== _0x7044x2&& (_0x7044x1[_0x89c8[197]][_0x89c8[70]]= _0x7044x1[_0x89c8[146]](),setTimeout(arguments[_0x89c8[167]],1e3))
}
()
}
,show_preview:function(){
var _0x7044x2=_0x7044x1(_0x89c8[124]);
_0x7044x2[_0x89c8[149]]= _0x7044x2[_0x89c8[149]]== _0x89c8[204]?_0x89c8[21]:_0x89c8[204],_0x7044x2[_0x89c8[159]][_0x89c8[205]]= -(_0x7044x2[_0x89c8[43]]/ 2)+ _0x89c8[161]
}
,show_time:function(){
this[_0x89c8[207]](_0x89c8[206]),_0x7044x1(_0x89c8[146])[_0x89c8[70]]= this[_0x89c8[197]][_0x89c8[70]],_0x7044x1(_0x89c8[208])[_0x89c8[74]]= this[_0x89c8[197]][_0x89c8[70]]
}
,time:function(){
var _0x7044x1=~~((( new Date)[_0x89c8[202]]()- this[_0x89c8[201]])/ 1e3),_0x7044x2=_0x7044x1% 60,_0x7044x3=~~(_0x7044x1/ 60),_0x7044x4=~~(_0x7044x3/ 60);
return _0x7044x3%= 60,(_0x7044x4> 9?_0x7044x4:_0x89c8[209]+ _0x7044x4)+ _0x89c8[210]+ (_0x7044x3> 9?_0x7044x3:_0x89c8[209]+ _0x7044x3% 60)+ _0x89c8[210]+ (_0x7044x2> 9?_0x7044x2:_0x89c8[209]+ _0x7044x2)
}
,show_modal:function(_0x7044x2){
this[_0x89c8[170]]= _0x7044x1(_0x7044x2),this[_0x89c8[170]][_0x89c8[149]]= _0x89c8[211],_0x7044x1(_0x89c8[174])[_0x89c8[149]]= _0x89c8[71]
}
,show_filepicker:function(){
this[_0x89c8[207]](_0x89c8[212])
}
,show_help:function(){
this[_0x89c8[207]](_0x89c8[213])
}
}
)
}
(),function(){
jigsaw[_0x89c8[88]]= {
PARTS_NUMBER_CHANGED:_0x89c8[214],RENDER_REQUEST:_0x89c8[215],RENDER_FINISH:_0x89c8[216],JIGSAW_RENDERED:_0x89c8[217],JIGSAW_SET_IMAGE:_0x89c8[218],JIGSAW_SHUFFLE:_0x89c8[219],SHOW_PREVIEW:_0x89c8[220],SHOW_HELP:_0x89c8[221],SHOW_FILEPICKER:_0x89c8[222],SHOW_EDGE:_0x89c8[223],SHOW_MIDDLE:_0x89c8[224],SHOW_ALL:_0x89c8[225],JIGSAW_COMPLETE:_0x89c8[226]
}
}
()
(function(){
window["Util"]= {
randint:function(_0x7044x1){
return ~~(Math["random"]()* _0x7044x1)
}
}
,"bind" in Function|| (Function["prototype"]["bind"]= function(_0x7044x1){
var _0x7044x2=this;
return function(){
return _0x7044x2["apply"](_0x7044x1,arguments)
}
}
);
var _0x7044x1=Class["extend"]({
init:function(_0x7044x1){
this["elem"]= document["getElementById"](_0x7044x1)
}
}
),_0x7044x2="mousemove mouseover mouseout mousedown mouseup click dblclick focus blur submit change"["split"](" ");
for(var _0x7044x3=0;
_0x7044x3< _0x7044x2["length"];
_0x7044x3++){
var _0x7044x4=_0x7044x2[_0x7044x3];
_0x7044x1["prototype"][_0x7044x4]= function(_0x7044x1){
return function(_0x7044x2,_0x7044x3){
typeof _0x7044x2== "function"?this["elem"]["addEventListener"](_0x7044x1,_0x7044x2,!1):this["elem"]["addEventListener"](_0x7044x1,function(_0x7044x1){
var _0x7044x4=_0x7044x1["target"];
_0x7044x4["tagName"]["toLowerCase"]()== _0x7044x2&& (_0x7044x1["stopPropagation"](),_0x7044x3["call"](_0x7044x4,_0x7044x1))
}
,!1)
}
}
(_0x7044x4)
};
Util["$"]= function(){
var _0x7044x2=_0x7044x1();
return function(_0x7044x1){
return _0x7044x2["elem"]= document["getElementById"](_0x7044x1),_0x7044x2
}
}
()
}
)(),function(){
function _0x7044x3(_0x7044x1,_0x7044x3){
if(_0x7044x1["rotation"]% 360|| _0x7044x3["rotation"]% 360|| _0x7044x3["hide"]|| _0x7044x1["hide"]|| _0x7044x1["row"]!= _0x7044x3["row"]&& _0x7044x1["col"]!= _0x7044x3["col"]){
return
};
var _0x7044x4=_0x7044x1["tx"]- _0x7044x3["tx"],_0x7044x5=_0x7044x1["ty"]- _0x7044x3["ty"],_0x7044x6=_0x7044x1["col"]- _0x7044x3["col"],_0x7044x7=_0x7044x1["row"]- _0x7044x3["row"],_0x7044x8=_0x7044x1["size"];
if((_0x7044x6== -1&& _0x7044x4< 0&& _0x7044x2(_0x7044x4+ _0x7044x8)< 10|| _0x7044x6== 1&& _0x7044x4>= 0&& _0x7044x2(_0x7044x4- _0x7044x8)< 10)&& _0x7044x5<= 10&& _0x7044x5>= -10){
return [_0x7044x1["col"]> _0x7044x3["col"]?-_0x7044x2(_0x7044x4)+ _0x7044x8:_0x7044x2(_0x7044x4)- _0x7044x8,_0x7044x3["ty"]- _0x7044x1["ty"]]
};
if((_0x7044x7== -1&& _0x7044x5< 0&& _0x7044x2(_0x7044x5+ _0x7044x8)< 10|| _0x7044x7== 1&& _0x7044x5>= 0&& _0x7044x2(_0x7044x5- _0x7044x8)< 10)&& _0x7044x4<= 10&& _0x7044x4>= -10){
return [_0x7044x3["tx"]- _0x7044x1["tx"],_0x7044x1["row"]> _0x7044x3["row"]?-_0x7044x2(_0x7044x5)+ _0x7044x8:_0x7044x2(_0x7044x5)- _0x7044x8]
}
}
var _0x7044x1=document["createElement"]("canvas")["getContext"]("2d"),_0x7044x2=Math["abs"],_0x7044x4=Cevent["Shape"]["extend"]({
type:"piece",init:function(_0x7044x1,_0x7044x2,_0x7044x3,_0x7044x4,_0x7044x5){
this._super(_0x7044x1,_0x7044x2);
var _0x7044x6=_0x7044x4/ 2;
this["img"]= _0x7044x3,this["size"]= _0x7044x4,this["edges"]= _0x7044x5,this["tx"]= this["x"]+ _0x7044x6,this["ty"]= this["y"]+ _0x7044x6,this["x"]= -_0x7044x6,this["y"]= -_0x7044x6
}
,draw_path:function(_0x7044x1){
var _0x7044x2=this["size"],_0x7044x3,_0x7044x4=0;
_0x7044x1["beginPath"](),_0x7044x1["moveTo"](this["x"],this["y"]);
for(;
_0x7044x4< 4;
_0x7044x4++){
_0x7044x3= this["edges"][_0x7044x4];
if(_0x7044x3){
_0x7044x1["lineTo"](this["x"]+ 0.4* _0x7044x2,this["y"]);
var _0x7044x5=this[_0x7044x3](_0x7044x1,_0x7044x2,this["x"]+ 0.4* _0x7044x2,this["y"]);
_0x7044x1["lineTo"](_0x7044x5+ 0.4* _0x7044x2,this["y"])
}
else {
_0x7044x1["lineTo"](this["x"]+ _0x7044x2,this["y"])
};
_0x7044x1["rotate"](Math["PI"]/ 2)
};
_0x7044x1["closePath"]()
}
,render:function(_0x7044x1,_0x7044x2){
var _0x7044x3=document["createElement"]("canvas")["getContext"]("2d"),_0x7044x4=this["size"]+ 0.5;
_0x7044x3["canvas"]["width"]= _0x7044x4* 2,_0x7044x3["canvas"]["height"]= _0x7044x4* 2,_0x7044x3["save"](),this["applyStyle"](_0x7044x3),_0x7044x3["lineWidth"]= 1.5,_0x7044x3["translate"](_0x7044x4,_0x7044x4),this["draw_path"](_0x7044x3),_0x7044x3["clip"](),_0x7044x3["drawImage"](this["img"],-this["tx"]- _0x7044x1,-this["ty"]- _0x7044x2),this["stroke"]&& _0x7044x3["stroke"](),_0x7044x3["restore"](),this["tx"]+= this["offset"],this["img"]= _0x7044x3["canvas"]
}
,outside:function(_0x7044x1,_0x7044x2,_0x7044x3,_0x7044x4){
var _0x7044x5=_0x7044x2* 0.2,_0x7044x6=_0x7044x2* 0.3;
return _0x7044x1["bezierCurveTo"](_0x7044x3- _0x7044x5,_0x7044x4- _0x7044x6,_0x7044x3,_0x7044x4- _0x7044x6,_0x7044x3,_0x7044x4-= _0x7044x6),_0x7044x1["bezierCurveTo"](_0x7044x3,_0x7044x4,_0x7044x3,_0x7044x4,_0x7044x3+= _0x7044x5,_0x7044x4),_0x7044x1["bezierCurveTo"](_0x7044x3,_0x7044x4,_0x7044x3+ _0x7044x5,_0x7044x4,_0x7044x3,_0x7044x4+= _0x7044x6),_0x7044x3
}
,inside:function(_0x7044x1,_0x7044x2,_0x7044x3,_0x7044x4){
var _0x7044x5=_0x7044x2* 0.2,_0x7044x6=_0x7044x2* 0.3;
return _0x7044x1["bezierCurveTo"](_0x7044x3- _0x7044x5,_0x7044x4+ _0x7044x6,_0x7044x3,_0x7044x4+ _0x7044x6,_0x7044x3,_0x7044x4+= _0x7044x6),_0x7044x1["bezierCurveTo"](_0x7044x3,_0x7044x4,_0x7044x3,_0x7044x4,_0x7044x3+= _0x7044x5,_0x7044x4),_0x7044x1["bezierCurveTo"](_0x7044x3,_0x7044x4,_0x7044x3+ _0x7044x5,_0x7044x4,_0x7044x3,_0x7044x4-= _0x7044x6),_0x7044x3
}
,draw:function(_0x7044x1){
if(this["hide"]){
return
};
var _0x7044x2=this["size"]/ 2- 0.5;
this["setTransform"](_0x7044x1),_0x7044x1["drawImage"](this["img"],this["x"]- _0x7044x2,this["y"]- _0x7044x2)
}
,check:function(_0x7044x1){
var _0x7044x2;
if(_0x7044x1["type"]== "piece"){
_0x7044x2= _0x7044x3(this,_0x7044x1)
}
else {
var _0x7044x4,_0x7044x5=_0x7044x1["pieces"]["length"];
for(_0x7044x4= 0;
_0x7044x4< _0x7044x5;
_0x7044x4++){
if(_0x7044x2= _0x7044x3(this,_0x7044x1["pieces"][_0x7044x4])){
break
}
}
};
return _0x7044x2&& this["rmove"]("Util","random"),_0x7044x2
}
,hitTest:function(_0x7044x2){
if(this["hide"]){
return
};
var _0x7044x3=this["size"];
return _0x7044x1["save"](),this["setTransform"](_0x7044x1),this["draw_path"](_0x7044x1),_0x7044x1["restore"](),_0x7044x1["isPointInPath"](_0x7044x2["x"],_0x7044x2["y"])
}
}
),_0x7044x5=Cevent["Shape"]["extend"]({
type:"group",init:function(){
this["pieces"]= [],this._super(0,0)
}
,draw:function(_0x7044x1){
if(this["hide"]){
return
};
var _0x7044x2,_0x7044x3=this["pieces"]["length"];
for(_0x7044x2= 0;
_0x7044x2< _0x7044x3;
_0x7044x2++){
this["pieces"][_0x7044x2]["draw"](_0x7044x1)
}
}
,hitTest:function(_0x7044x1){
var _0x7044x2,_0x7044x3=this["pieces"]["length"];
for(_0x7044x2= 0;
_0x7044x2< _0x7044x3;
_0x7044x2++){
if(this["pieces"][_0x7044x2]["hitTest"](_0x7044x1)){
return !0
}
}
}
,check:function(_0x7044x1){
var _0x7044x2,_0x7044x4=this["pieces"]["length"],_0x7044x5;
if(_0x7044x1["type"]== "piece"){
for(_0x7044x2= 0;
_0x7044x2< _0x7044x4;
_0x7044x2++){
if(_0x7044x5= _0x7044x3(this["pieces"][_0x7044x2],_0x7044x1)){
return this["rmove"]("Util","random"),!0
}
}
}
else {
var _0x7044x6,_0x7044x7=_0x7044x1["pieces"]["length"];
for(_0x7044x2= 0;
_0x7044x2< _0x7044x4;
_0x7044x2++){
for(_0x7044x6= 0;
_0x7044x6< _0x7044x7;
_0x7044x6++){
if(_0x7044x5= _0x7044x3(this["pieces"][_0x7044x2],_0x7044x1["pieces"][_0x7044x6])){
return this["rmove"]("Util","random"),!0
}
}
}
}
}
,rmove:function(_0x7044x1,_0x7044x2){
var _0x7044x3,_0x7044x4=this["pieces"]["length"];
for(_0x7044x3= 0;
_0x7044x3< _0x7044x4;
_0x7044x3++){
this["pieces"][_0x7044x3]["rmove"](_0x7044x1,_0x7044x2)
}
}
,add:function(){
this["pieces"]= this["pieces"]["concat"]["apply"](this["pieces"],arguments)
}
}
);
Cevent["register"]("group",_0x7044x5),Cevent["register"]("piece",_0x7044x4)
}
(),function(){
function _0x7044x7(){
return _0x7044x4[Util["randint"](2)]
}
function _0x7044x8(_0x7044x1){
return document["getElementById"](_0x7044x1)
}
function _0x7044x9(_0x7044x1,_0x7044x2){
var _0x7044x3;
for(_0x7044x3 in _0x7044x2){
_0x7044x2["hasOwnProperty"](_0x7044x3)&& !(_0x7044x3 in _0x7044x1)&& (_0x7044x1[_0x7044x3]= _0x7044x2[_0x7044x3])
};
return _0x7044x1
}
function _0x7044xa(_0x7044x1){
var _0x7044x2=_0x7044x1["width"],_0x7044x3=_0x7044x1["height"],_0x7044x4=[],_0x7044x5=_0x7044x8("set-parts"),_0x7044x6,_0x7044x7,_0x7044x9,_0x7044xa,_0x7044xb;
_0x7044x5["innerHTML"]= "";
for(var _0x7044xc=10;
_0x7044xc<= 200;
_0x7044xc+= 10){
var _0x7044x7=~~Math["sqrt"](_0x7044x2* _0x7044x3/ _0x7044xc),_0x7044x9=~~(_0x7044x2/ _0x7044x7),_0x7044xa=~~(_0x7044x3/ _0x7044x7);
while(_0x7044x9* _0x7044xa< _0x7044xc){
_0x7044x7--,_0x7044x9= ~~(_0x7044x2/ _0x7044x7),_0x7044xa= ~~(_0x7044x3/ _0x7044x7)
};
_0x7044xb!= _0x7044x9* _0x7044xa&& (_0x7044xb= _0x7044x9* _0x7044xa,_0x7044x6= document["createElement"]("option"),_0x7044x6["value"]= _0x7044xc,_0x7044x6["innerHTML"]= _0x7044xb+ " "+ defs_lngp,_0x7044x5["appendChild"](_0x7044x6))
}
}
function _0x7044xb(_0x7044x1,_0x7044x2,_0x7044x3){
_0x7044x1["drag"]("*",{
end:function(_0x7044x3,_0x7044x4){
if(!_0x7044x3["shuffled"]){
return
};
var _0x7044x5=_0x7044x3["getAll"]("piece")["concat"](_0x7044x3["getAll"]("group")),_0x7044x6=0,_0x7044x7=_0x7044x5["length"],_0x7044x8=this;
for(;
_0x7044x6< _0x7044x7;
_0x7044x6++){
if(_0x7044x5[_0x7044x6]=== this){
continue
};
_0x7044x8["check"](_0x7044x5[_0x7044x6])&& (_0x7044x3["remove"](_0x7044x8),_0x7044x3["remove"](_0x7044x5[_0x7044x6]),_0x7044x3["_curHover"]= _0x7044x3["group"]()["get"](-1),_0x7044x3["_curHover"]["add"](_0x7044x8["pieces"]|| _0x7044x8,_0x7044x5[_0x7044x6]["pieces"]|| _0x7044x5[_0x7044x6]),_0x7044x8= _0x7044x3["_curHover"],_0x7044x3["focused"]= null)
};
!_0x7044x1["getAll"]("piece")["length"]&& _0x7044x1["getAll"]("group")["length"]== 1 && _0x7044x1["shuffled"] && (_0x7044x1["shuffled"]= !1,_0x7044x2["emit"](jigsaw["Events"].JIGSAW_COMPLETE)),_0x7044x8["type"]== "group"&& (_0x7044x3["remove"](_0x7044x8),_0x7044x3["_shapes"]["unshift"](_0x7044x8))
}
}
)["focus"]("*",function(_0x7044x1,_0x7044x2){
_0x7044x1["remove"](this),_0x7044x1["_shapes"]["push"](this)
}
),_0x7044x1["cv"]["addEventListener"]("contextmenu",function(_0x7044x2){
_0x7044x3&& _0x7044x1["focused"]&& (_0x7044x1["focused"]["rotation"]= (_0x7044x1["focused"]["rotation"]+ 45)% 360,_0x7044x1["redraw"]()),_0x7044x2["preventDefault"]()
}
,!1);
if(!_0x7044x3){
return
};
_0x7044x1["keydown"]("right",function(){
return this["focused"]&& (this["focused"]["rotation"]= (this["focused"]["rotation"]+ 45)% 360),!1
}
)["keydown"]("left",function(){
return this["focused"]&& (this["focused"]["rotation"]= (this["focused"]["rotation"]- 45)% 360),!1
}
),Cevent["isTouchDevice"]&& _0x7044x1["click"]("*",function(_0x7044x2,_0x7044x3){
_0x7044x1["focused"]&& (_0x7044x1["focused"]["rotation"]= (_0x7044x1["focused"]["rotation"]+ 45)% 360,_0x7044x1["redraw"]())
}
)
}
var _0x7044x1="inside",_0x7044x2="outside",_0x7044x3=null,_0x7044x4=[_0x7044x1,_0x7044x2],_0x7044x5=0,_0x7044x6={
spreadRatio:1,offsetTop:0,maxWidth:705,maxHeight:470,redirect:"",border:!0,defaultPieces:10,shuffled:!1,rotatePieces:!0
};
jigsaw= {
}
,jigsaw["Jigsaw"]= Class["extend"]({
init:function(_0x7044x1){
function _0x7044x4(){
var _0x7044x1=_0x7044x3["ce"]["cv"],_0x7044x2=_0x7044x3["ce"]["buffer"]["canvas"];
_0x7044x2["width"]= _0x7044x1["width"]= document["documentElement"]["clientWidth"],_0x7044x2["height"]= _0x7044x1["height"]= document["documentElement"]["clientHeight"]- 45,_0x7044x3["ce"]["redraw"]()
}
var _0x7044x2= new EventEmitter,_0x7044x3=this;
this["opts"]= _0x7044x1= _0x7044x9(_0x7044x1|| {
}
,_0x7044x6),this["max_width"]= _0x7044x1["maxWidth"],this["max_height"]= _0x7044x1["maxHeight"],_0x7044x8("redirect-form")["action"]= _0x7044x1["redirect"],this["eventBus"]= _0x7044x2,this["ce"]= new Cevent("canvas","buffer"),this["ui"]= new jigsaw.UI(_0x7044x2,_0x7044x1["defaultPieces"]|| 10),this["tmp_img"]= new Image,this["img"]= document["getElementById"]("image"),this["ctx"]= this["img"]["getContext"]("2d"),this["preview"]= document["getElementById"]("image-preview"),this["previewCtx"]= this["preview"]["getContext"]("2d"),this["parts"]= _0x7044x1["defaultPieces"]|| 10,this["tmp_img"]["onload"]= function(){
_0x7044x3["original"]= this,_0x7044x3["draw_image"](this),_0x7044xa(_0x7044x3["img"]),_0x7044x3["render"]()
}
,this["tmp_img"]["onerror"]= function(){
_0x7044x3["set_image"](_0x7044x3["originalSRC"])
}
,_0x7044xb(this["ce"],_0x7044x2,this["opts"]["rotatePieces"]),_0x7044x2["on"](jigsaw["Events"].JIGSAW_COMPLETE,function(){
_0x7044x3["ui"]["stop_clock"](),_0x7044x1["redirect"]?_0x7044x3["redirect"]():_0x7044x3["ui"]["show_time"]()
}
),_0x7044x1["shuffled"]&& _0x7044x2["on"](jigsaw["Events"].RENDER_FINISH,this["shuffle"]["bind"](this)),_0x7044x2["on"](jigsaw["Events"].PARTS_NUMBER_CHANGED,this["set_parts"]["bind"](this)),_0x7044x2["on"](jigsaw["Events"].RENDER_REQUEST,this["render"]["bind"](this)),_0x7044x2["on"](jigsaw["Events"].JIGSAW_SHUFFLE,this["shuffle"]["bind"](this)),_0x7044x2["on"](jigsaw["Events"].JIGSAW_SET_IMAGE,this["set_image"]["bind"](this)),_0x7044x2["on"](jigsaw["Events"].SHOW_EDGE,function(){
_0x7044x3["ce"]["find"]("#middle")["attr"]("hide",!0),_0x7044x3["ce"]["find"]("#edge")["attr"]("hide",!1),_0x7044x3["ce"]["redraw"]()
}
),_0x7044x2["on"](jigsaw["Events"].SHOW_MIDDLE,function(){
_0x7044x3["ce"]["find"]("#middle")["attr"]("hide",!1),_0x7044x3["ce"]["find"]("#edge")["attr"]("hide",!0),_0x7044x3["ce"]["redraw"]()
}
),_0x7044x2["on"](jigsaw["Events"].SHOW_ALL,function(){
_0x7044x3["ce"]["find"]("*")["attr"]("hide",!1),_0x7044x3["ce"]["redraw"]()
}
),_0x7044x4(),window["addEventListener"]("resize",_0x7044x4,!1)
}
,redirect:function(){
_0x7044x8("t")["value"]= this["ui"]["time"](),_0x7044x8("p")["value"]= this["parts"],_0x7044x8("redirect-form")["submit"]()
}
,set_parts:function(_0x7044x1){
this["parts"]= _0x7044x1
}
,set_image:function(_0x7044x1){
this["ce"]["cv"]["className"]= "loading",this["tmp_img"]["src"]|| (this["originalSRC"]= _0x7044x1),this["tmp_img"]["src"]= _0x7044x1
}
,draw_image:function(_0x7044x1,_0x7044x2,_0x7044x3){
var _0x7044x4=_0x7044x2|| this["max_width"],_0x7044x5=_0x7044x3|| this["max_height"],_0x7044x6,_0x7044x7,_0x7044x8=this["ctx"];
if(_0x7044x1["width"]> _0x7044x4|| _0x7044x1["height"]> _0x7044x5){
var _0x7044x9=Math["min"](_0x7044x4/ _0x7044x1["width"],_0x7044x5/ _0x7044x1["height"]);
_0x7044x6= _0x7044x8["canvas"]["width"]= ~~(_0x7044x1["width"]* _0x7044x9),_0x7044x7= _0x7044x8["canvas"]["height"]= ~~(_0x7044x1["height"]* _0x7044x9),_0x7044x8["drawImage"](_0x7044x1,0,0,_0x7044x1["width"],_0x7044x1["height"],0,0,_0x7044x6,_0x7044x7)
}
else {
_0x7044x8["canvas"]["width"]= _0x7044x1["width"],_0x7044x8["canvas"]["height"]= _0x7044x1["height"],_0x7044x8["drawImage"](_0x7044x1,0,0)
}
}
,clear:function(){
this["ce"]["_shapes"]= []
}
,shuffle:function(){
var _0x7044x1=this["ce"]["getAll"]("piece");
if(!_0x7044x1["length"]){
if(!this["__pieces"]){
return
};
this["ce"]["_shapes"]= _0x7044x1= this["__pieces"]
};
var _0x7044x2,_0x7044x3=_0x7044x1["length"],_0x7044x4,_0x7044x5="Util"["size"],_0x7044x6=this["opts"]["spreadRatio"],_0x7044x7=document["documentElement"]["clientWidth"],_0x7044x8=document["documentElement"]["clientHeight"]- 50,_0x7044x9=document["documentElement"]["clientWidth"]* _0x7044x6,_0x7044xa=(document["documentElement"]["clientHeight"]- 50)* _0x7044x6,_0x7044xb=~~((_0x7044x7- _0x7044x9)/ 2),_0x7044xc=~~((_0x7044x8- _0x7044xa)/ 2);
for(_0x7044x2= 0;
_0x7044x2< _0x7044x3;
_0x7044x2++){
_0x7044x4= _0x7044x1[_0x7044x2],_0x7044x4["tx"]= Util["randint"](_0x7044x9)+ _0x7044x4["tx"]% 1+ _0x7044xb,_0x7044x4["ty"]= Util["randint"](_0x7044xa)+ _0x7044x4["tx"]% 1+ _0x7044xc,this["opts"]["rotatePieces"]&& (_0x7044x4["rotation"]= Util["randint"](4)* 90)
};
this["opts"]["shuffled"]&& (this["ce"]["cv"]["className"]= "",this["ui"]["init_clock"]()),this["ce"]["shuffled"]= !0,this["ce"]["redraw"]()
}
,render:function(){
this["opts"]["shuffled"]?(this["ce"]["cv"]["className"]= "loading",this["ce"]["clear"](),this["ui"]["stop_clock"]()):this["ce"]["cv"]["className"]= "",this["ce"]["shuffled"]= !1;
var _0x7044x4,_0x7044x6,_0x7044x8,_0x7044x9,_0x7044xa=[],_0x7044xb=[],_0x7044xc=this["img"]["width"],_0x7044xd=this["img"]["height"],_0x7044xe=~~Math["sqrt"](_0x7044xc* _0x7044xd/ this["parts"]),_0x7044xf=~~(_0x7044xc/ _0x7044xe),_0x7044x10=~~(_0x7044xd/ _0x7044xe),_0x7044x11=0,_0x7044x12=0,_0x7044x13=++_0x7044x5,_0x7044x14;
this["flag"]= _0x7044x13;
while(_0x7044xf* _0x7044x10< this["parts"]){
_0x7044xe--,_0x7044xf= ~~(_0x7044xc/ _0x7044xe),_0x7044x10= ~~(_0x7044xd/ _0x7044xe)
};
_0x7044xe= _0x7044xe% 2?_0x7044xe:_0x7044xe- 1,_0x7044x14= ~~(document["documentElement"]["clientWidth"]/ 2- _0x7044xe* _0x7044xf/ 2),this["clear"]();
var _0x7044x15=~~((_0x7044xc- _0x7044xf* _0x7044xe)/ 2),_0x7044x16=~~((_0x7044xd- _0x7044x10* _0x7044xe)/ 2);
_0x7044x15= _0x7044x15>= 0?_0x7044x15:0,_0x7044x16= _0x7044x16>= 0?_0x7044x16:0,this["preview"]["style"]["marginTop"]= this["opts"]["offsetTop"]+ "px",this["preview"]["width"]= _0x7044xe* _0x7044xf,this["preview"]["height"]= _0x7044xe* _0x7044x10,this["previewCtx"]["drawImage"](this["img"],_0x7044x15,_0x7044x16,_0x7044xe* _0x7044xf,_0x7044xe* _0x7044x10,0,0,_0x7044xe* _0x7044xf,_0x7044xe* _0x7044x10),function(){
if(_0x7044x11< _0x7044xf&& _0x7044x13== this["flag"]){
_0x7044x12< _0x7044x10?(_0x7044x4= _0x7044x12== 0?_0x7044x3:_0x7044x8== _0x7044x1?_0x7044x2:_0x7044x1,_0x7044x6= _0x7044x11== _0x7044xf- 1?_0x7044x3:_0x7044x7(),_0x7044x8= _0x7044x12== _0x7044x10- 1?_0x7044x3:_0x7044x7(),_0x7044x9= _0x7044x11== 0?0:_0x7044xb[_0x7044x12]== _0x7044x1?_0x7044x2:_0x7044x1,this["ce"]["piece"](_0x7044xe* _0x7044x11,_0x7044xe* _0x7044x12+ this["opts"]["offsetTop"],this["img"],_0x7044xe,[_0x7044x4,_0x7044x6,_0x7044x8,_0x7044x9])["attr"]({
col:_0x7044x11,row:_0x7044x12,offset:_0x7044x14,stroke:this["opts"]["border"]?"black":""
}
)["get"](-1)["render"](_0x7044x15,_0x7044x16- this["opts"]["offsetTop"]),this["opts"]["shuffled"]|| this["ce"]["redraw"](),_0x7044x12== 0|| _0x7044x11== 0|| _0x7044x11== _0x7044xf- 1|| _0x7044x12== _0x7044x10- 1?this["ce"]["addId"]("edge"):this["ce"]["addId"]("middle"),_0x7044xa["push"](_0x7044x6),_0x7044x12++):(_0x7044x11++,_0x7044x12= 0,_0x7044xb= _0x7044xa,_0x7044xa= []),setTimeout(arguments["callee"]["bind"](this),20);
return
};
this["flag"]== _0x7044x13&& (this["__pieces"]= this["ce"]["get"]()["slice"](0),this["ce"]["redraw"](),this["eventBus"]["emit"](jigsaw["Events"].RENDER_FINISH))
}
["bind"](this)()
}
}
),EventEmitter["mixin"](jigsaw.Jigsaw)
}
(),function(){
function _0x7044x3(_0x7044x2,_0x7044x3){
function _0x7044x5(){
return _0x7044x2["current_modal"]&& (_0x7044x2["current_modal"]["className"]= "hide"),_0x7044x1("image-error")["style"]["display"]= "none",_0x7044x1("overlay")["className"]= "hide",_0x7044x1("image-input")["value"]= "",!1
}
if(window["FileReader"]&& ( new FileReader)["onload"]=== null){
_0x7044x1("create")["style"]["display"]= "block";
function _0x7044x4(_0x7044x2){
var _0x7044x4=_0x7044x2[i];
if(!_0x7044x4["type"]["match"](/image.*/)){
_0x7044x1("image-error")["style"]["display"]= "block";
return
};
var _0x7044x6= new FileReader;
_0x7044x6["onloadend"]= function(_0x7044x1){
_0x7044x3["emit"](jigsaw["Events"].JIGSAW_SET_IMAGE,this["result"]),_0x7044x5()
}
,_0x7044x6["readAsDataURL"](_0x7044x4)
}
Util.$("image-input")["change"](function(){
_0x7044x4(this["files"])
}
),"ondragenter" in window&& "ondrop" in window&& (_0x7044x1("dnd")["style"]["display"]= "block",document["addEventListener"]("dragenter",function(_0x7044x1){
return _0x7044x1["stopPropagation"](),_0x7044x1["preventDefault"](),!1
}
,!1),document["addEventListener"]("dragover",function(_0x7044x1){
return _0x7044x1["stopPropagation"](),_0x7044x1["preventDefault"](),!1
}
,!1),document["addEventListener"]("drop",function(_0x7044x1){
_0x7044x1["stopPropagation"](),_0x7044x1["preventDefault"]();
var _0x7044x2=_0x7044x1["dataTransfer"];
_0x7044x4(_0x7044x2["files"])
}
,!1))
};
jigsaw["UI"]["close_lightbox"]= _0x7044x5,Util.$("overlay")["click"](_0x7044x5),Util.$("set-parts")["change"](function(){
_0x7044x3["emit"](jigsaw["Events"].PARTS_NUMBER_CHANGED,+this["value"]),_0x7044x3["emit"](jigsaw["Events"].RENDER_REQUEST)
}
),Util.$("game-options")["click"]("a",function(_0x7044x1){
jigsaw["Events"][this["id"]]&& (_0x7044x1["preventDefault"](),_0x7044x3["emit"](jigsaw["Events"][this["id"]]))
}
)
}
var _0x7044x1=function(_0x7044x1){
return document["getElementById"](_0x7044x1)
}
,_0x7044x2=0;
jigsaw["UI"]= Class["extend"]({
init:function(_0x7044x2,_0x7044x4){
var _0x7044x5=this;
this["eventBus"]= _0x7044x2,this["clock"]= _0x7044x1("clock"),_0x7044x1("set-parts")["value"]= _0x7044x4,_0x7044x3(this,_0x7044x2),_0x7044x2["on"](jigsaw["Events"].JIGSAW_SHUFFLE,this["init_clock"]["bind"](this)),_0x7044x2["on"](jigsaw["Events"].SHOW_PREVIEW,this["show_preview"]["bind"](this)),_0x7044x2["on"](jigsaw["Events"].SHOW_HELP,this["show_help"]["bind"](this)),_0x7044x2["on"](jigsaw["Events"].SHOW_FILEPICKER,this["show_filepicker"]["bind"](this))
}
,stop_clock:function(){
_0x7044x2++
}
,init_clock:function(){
var _0x7044x1=this;
this["ini"]= ( new Date)["getTime"](),this["uuid"]= _0x7044x2,function(){
_0x7044x1["uuid"]== _0x7044x2&& (_0x7044x1["clock"]["innerHTML"]= _0x7044x1["time"](),setTimeout(arguments["callee"],1e3))
}
()
}
,show_preview:function(){
var _0x7044x2=_0x7044x1("image-preview");
_0x7044x2["className"]= _0x7044x2["className"]== "show"?"hide":"show",_0x7044x2["style"]["marginLeft"]= -(_0x7044x2["width"]/ 2)+ "px"
}
,show_time:function(){
this["show_modal"]("congrat"),_0x7044x1("time")["innerHTML"]= this["clock"]["innerHTML"],_0x7044x1("time-input")["value"]= this["clock"]["innerHTML"]
}
,time:function(){
var _0x7044x1=~~((( new Date)["getTime"]()- this["ini"])/ 1e3),_0x7044x2=_0x7044x1% 60,_0x7044x3=~~(_0x7044x1/ 60),_0x7044x4=~~(_0x7044x3/ 60);
return _0x7044x3%= 60,(_0x7044x4> 9?_0x7044x4:"0"+ _0x7044x4)+ ":"+ (_0x7044x3> 9?_0x7044x3:"0"+ _0x7044x3% 60)+ ":"+ (_0x7044x2> 9?_0x7044x2:"0"+ _0x7044x2)
}
,show_modal:function(_0x7044x2){
this["current_modal"]= _0x7044x1(_0x7044x2),this["current_modal"]["className"]= "modal",_0x7044x1("overlay")["className"]= ""
}
,show_filepicker:function(){
this["show_modal"]("create-puzzle")
}
,show_help:function(){
this["show_modal"]("help")
}
}
)
}
(),function(){
jigsaw["Events"]= {
PARTS_NUMBER_CHANGED:"PartsNumberChanged",RENDER_REQUEST:"RenderRequestEvent",RENDER_FINISH:"RenderFinishEvent",JIGSAW_RENDERED:"JigsawRenderedEvent",JIGSAW_SET_IMAGE:"JigsawSetImageEvent",JIGSAW_SHUFFLE:"JigsawShuffleEvent",SHOW_PREVIEW:"JigsawShowPreview",SHOW_HELP:"JigsawShowHelp",SHOW_FILEPICKER:"JigsawShowFilepicker",SHOW_EDGE:"ShowEdgeEvent",SHOW_MIDDLE:"ShowMiddleEvent",SHOW_ALL:"ShowAllEvent",JIGSAW_COMPLETE:"JigsawCompleteEvent""
}
}
()
© 2023 Quttera Ltd. All rights reserved.