1import{d as Mt,r as v,o as _t,a as h,c as g,u as i,b as c,e as W,t as y,n as H,F as ct,f as Ct,g as Tt,h as St,i as F,w as ut,j,k as At,l as Pt}from"./d74OVHi6.js";import{_ as It}from"./DlAUqK2U.js";const Lt={key:0,class:"text-center"},zt={class:"text-sm text-gray-500 dark:text-gray-400 mb-3"},Bt={class:"text-red-600 dark:text-red-400"},Ot={key:1},Vt={class:"flex items-center justify-between mb-2 text-xs text-gray-500 dark:text-gray-400"},jt={class:"font-mono tabular-nums"},Rt={class:"text-red-600 dark:text-red-400 font-medium"},Nt={class:"flex justify-center mb-2"},$t={key:0},Dt={key:1},Et={key:2,class:"transition-all duration-200"},Ut={key:3,class:"opacity-80 animate-pulse-slow"},Wt={key:4,class:"text-gray-300 dark:text-gray-700 text-xs"},Ft=["width","height"],Kt={key:0,class:"mt-3 text-center"},Yt={key:1,class:"mt-4 text-center"},Gt={class:"text-green-600 dark:text-green-400 font-bold mb-1"},Xt={class:"text-xs text-gray-500 dark:text-gray-400 mb-3"},I=11,m=11,x=0,M=1,L=2,Ht=2,Jt=5,qt=8,Qt=Mt({__name:"LostTourist.client",props:{cityKey:{}},setup(dt){const ft=dt,_=j(()=>window.innerWidth<400?28:window.innerWidth<500?30:32),J={timisoara:[{name:"Catedrala",icon:"âª"},{name:"Opera",icon:"ð"},{name:"Piata Unirii",icon:"ðï¸"},{name:"Parcul Rozelor",icon:"ð¹"},{name:"Bastionul",icon:"ð°"}],bucuresti:[{name:"Ateneul",icon:"ðµ"},{name:"Palatul Parlamentului",icon:"ðï¸"},{name:"Arcul de Triumf",icon:"ðï¸"},{name:"Parcul Herastrau",icon:"ð³"},{name:"Centrul Vechi",icon:"ðï¸"}],cluj:[{name:"Sf. Mihail",icon:"âª"},{name:"Piata Unirii",icon:"ðï¸"},{name:"Cetatuia",icon:"â°ï¸"},{name:"Gradina Botanica",icon:"ðº"},{name:"Parcul Central",icon:"ð³"}],arad:[{name:"Palatul Cultural",icon:"ðï¸"},{name:"Cetatea Aradului",icon:"ð°"},{name:"Parcul Eminescu",icon:"ð³"},{name:"Teatrul Vechi",icon:"ð"},{name:"Catedrala Veche",icon:"âª"}]},R=j(()=>J[ft.cityKey]||J.timisoara),C=v(R.value[Math.floor(Math.random()*R.value.length)]),q=v(),Q=v(!1),z=v(!1),N=v(0),$=v(0),d=v(0),T=v(0),Z=v(0),b=v([]),B=v(!1),O=v(0),D=v(0),K=Pt(new Set),E=v([]);let U=0;const tt=j(()=>O.value>0?Jt:Ht),et=j(()=>{const t=Math.floor(D.value/60),e=D.value%60;return`${t}:${e.toString().padStart(2,"0")}`}),mt=j(()=>{const t=Math.floor(d.value/m),e=d.value%m,o=Math.floor(T.value/m),a=T.value%m-e,n=o-t;return Math.atan2(a,n)*(180/Math.PI)});function u(t,e){return t*m+e}function S(t){return Math.floor(t/m)}function A(t){return t%m}function P(t,e){return t>=0&&t<I&&e>=0&&e<m}function vt(){const t=I*m,e=new Array(t).fill(M),o=new Set;function s(l,f){o.add(u(l,f)),e[u(l,f)]=x;const k=[[-2,0],[2,0],[0,-2],[0,2]];for(let p=k.length-1;p>0;p--){const w=Math.floor(Math.random()*(p+1));[k[p],k[w]]=[k[w],k[p]]}for(const[p,w]of k){const G=l+p,X=f+w;P(G,X)&&!o.has(u(G,X))&&(e[u(l+p/2,f+w/2)]=x,s(G,X))}}s(1,1);const a=u(1,1),n=u(I-2,m-2);e[a]=x,e[n]=x;for(let l=1;l<I-1;l++)for(let f=1;f<m-1;f++)if(e[u(l,f)]===M&&Math.random()<.2){const k=[[l-1,f],[l+1,f],[l,f-1],[l,f+1]].filter(([p,w])=>P(p,w)&&e[u(p,w)]===x);k.length>=2&&k.length<=3&&(e[u(l,f)]=x)}const r=e.map((l,f)=>l===x?f:-1).filter(l=>l!==-1&&l!==a&&l!==n),V=Math.min(10,Math.max(8,Math.floor(r.length*.15))),it=r.sort(()=>Math.random()-.5);for(let l=0;l<V&&l<it.length;l++)e[it[l]]=L;b.value=e,d.value=a,Z.value=a,T.value=n,ht(e)}function ht(t){const e=[];for(let a=1;a<I-1;a++){let n=-1;for(let r=1;r<m;r++)if(t[u(a,r)]===x||t[u(a,r)]===L)n===-1&&(n=r);else{if(n!==-1&&r-n>=4){const V=Math.floor((n+r-1)/2);e.push({pos:u(a,V),dr:0,dc:Math.random()>.5?1:-1})}n=-1}}for(let a=1;a<m-1;a++){let n=-1;for(let r=1;r<I;r++)if(t[u(r,a)]===x||t[u(r,a)]===L)n===-1&&(n=r);else{if(n!==-1&&r-n>=4){const V=Math.floor((n+r-1)/2);e.push({pos:u(V,a),dr:Math.random()>.5?1:-1,dc:0})}n=-1}}const s=e.filter(a=>Math.abs(S(a.pos)-1)+Math.abs(A(a.pos)-1)>3).sort(()=>Math.random()-.5);E.value=s.slice(0,3)}function gt(){for(const t of E.value){const e=S(t.pos),o=A(t.pos),s=e+t.dr,a=o+t.dc;if(P(s,a)&&b.value[u(s,a)]!==M)t.pos=u(s,a);else{t.dr=-t.dr,t.dc=-t.dc;const n=e+t.dr,r=o+t.dc;P(n,r)&&b.value[u(n,r)]!==M&&(t.pos=u(n,r))}}at()}function at(){E.value.some(t=>t.pos===d.value)&&(B.value=!0,d.value=Z.value,setTimeout(()=>{B.value=!1},1500))}function ot(t){return E.value.some(e=>e.pos===t)}function nt(){vt(),Q.value=!0,z.value=!1,N.value=0,$.value=0,O.value=0,D.value=0,B.value=!1,K.clear(),clearInterval(U),U=window.setInterval(()=>{z.value||(D.value++,gt())},1e3),At(()=>q.value?.focus())}function pt(){C.value=R.value[Math.floor(Math.random()*R.value.length)],nt
1()}function Y(t,e){if(z.value||B.value)return;const o=S(d.value),s=A(d.value),a=o+t,n=s+e;if(!P(a,n))return;const r=u(a,n);b.value[r]!==M&&(b.value[r]===L&&($.value++,b.value[r]=x,O.value=qt),d.value=r,N.value++,yt(),O.value>0&&O.value--,at(),r===T.value&&(z.value=!0,clearInterval(U)))}function yt(){const t=S(d.value),e=A(d.value),o=tt.value;for(let s=-o;s<=o;s++)for(let a=-o;a<=o;a++){const n=t+s,r=e+a;P(n,r)&&Math.abs(s)+Math.abs(a)<=o&&K.add(u(n,r))}}function rt(t){if(t===d.value)return!0;const e=S(d.value),o=A(d.value),s=S(t),a=A(t);return Math.abs(e-s)+Math.abs(o-a)<=tt.value}function xt(t){const e=rt(t),o=K.has(t);return t===d.value?"bg-blue-200 dark:bg-blue-800/60":t===T.value&&e?"bg-red-100 dark:bg-red-900/30":!e&&!o?"bg-gray-400 dark:bg-gray-600":!e&&o?"bg-gray-300 dark:bg-gray-650 opacity-60":ot(t)?"bg-amber-50 dark:bg-amber-900/20":b.value[t]===M?"bg-gray-200 dark:bg-gray-750":b.value[t]===L?"bg-yellow-50 dark:bg-yellow-900/10":"bg-white dark:bg-gray-800"}function bt(t){const o={ArrowUp:[-1,0],ArrowDown:[1,0],ArrowLeft:[0,-1],ArrowRight:[0,1]}[t.key];o&&(t.preventDefault(),Y(o[0],o[1]))}let st=0,lt=0;function kt(t){st=t.touches[0]?.clientX??0,lt=t.touches[0]?.clientY??0}function wt(t){const e=(t.changedTouches[0]?.clientX??0)-st,o=(t.changedTouches[0]?.clientY??0)-lt,s=Math.abs(e),a=Math.abs(o);Math.max(s,a)<20||(s>a?Y(0,e>0?1:-1):Y(o>0?1:-1,0))}return _t(()=>{clearInterval(U)}),(t,e)=>(h(),g("div",{class:"lost-tourist-game select-none",onKeydown:bt,tabindex:"0",ref_key:"gameRef",ref:q},[i(Q)?(h(),g("div",Ot,[c("div",Vt,[c("span",null,"Pasi: "+y(i(N)),1),c("span",null,"â "+y(i($)),1),c("span",jt,y(i(et)),1),c("span",Rt,y(i(C).icon)+" "+y(i(C).name),1)]),c("div",Nt,[c("div",{class:"w-6 h-6 text-red-500 transition-transform duration-300",style:H({transform:`rotate(${i(mt)}deg)`})},[...e[4]||(e[4]=[c("svg",{viewBox:"0 0 24 24",fill:"currentColor"},[c("path",{d:"M12 2L8 10h8L12 2z"}),c("path",{d:"M12 22L16 14H8l4 8z",opacity:"0.3"})],-1)])],4)]),c("div",{class:"grid gap-0 mx-auto border border-gray-300 dark:border-gray-600 rounded-lg overflow-hidden",style:H({gridTemplateColumns:`repeat(${m}, 1fr)`,maxWidth:`${m*i(_)}px`}),onTouchstart:ut(kt,["prevent"]),onTouchend:ut(wt,["prevent"])},[(h(!0),g(ct,null,Ct(i(b),(o,s)=>(h(),g("div",{key:s,class:Tt(["flex items-center justify-center transition-colors duration-150",xt(s)]),style:H({width:`${i(_)}px`,height:`${i(_)}px`,fontSize:`${i(_)*.5}px`})},[rt(s)?(h(),g(ct,{key:0},[s===i(d)?(h(),g("span",$t,"ð§âð¦°")):s===i(T)?(h(),g("span",Dt,y(i(C).icon),1)):ot(s)?(h(),g("span",Et,"ð")):o===L?(h(),g("span",Ut,"â")):o===M?(h(),g("span",Wt,[(h(),g("svg",{width:i(_)*.7,height:i(_)*.7,viewBox:"0 0 24 24"},[...e[5]||(e[5]=[St('<rect x="1" y="1" width="22" height="22" rx="2" fill="currentColor" opacity="0.4" data-v-e0257fba></rect><line x1="1" y1="8" x2="23" y2="8" stroke="currentColor" stroke-width="0.5" opacity="0.3" data-v-e0257fba></line><line x1="1" y1="16" x2="23" y2="16" stroke="currentColor" stroke-width="0.5" opacity="0.3" data-v-e0257fba></line><line x1="12" y1="1" x2="12" y2="8" stroke="currentColor" stroke-width="0.5" opacity="0.3" data-v-e0257fba></line><line x1="6" y1="8" x2="6" y2="16" stroke="currentColor" stroke-width="0.5" opacity="0.3" data-v-e0257fba></line><line x1="18" y1="8" x2="18" y2="16" stroke="currentColor" stroke-width="0.5" opacity="0.3" data-v-e0257fba></line><line x1="12" y1="16" x2="12" y2="24" stroke="currentColor" stroke-width="0.5" opacity="0.3" data-v-e0257fba></line>',7)])],8,Ft))])):F("",!0)],64)):F("",!0)],6))),128))],36),i(B)?(h(),g("div",Kt,[...e[6]||(e[6]=[c("p",{class:"text-amber-600 dark:text-amber-400 text-sm font-medium animate-pulse"}," ð Ai fost lovit de tramvai! Inapoi la start... ",-1)])])):F("",!0),i(z)?(h(),g("div",Yt,[c("p",Gt," Felicitari! Ai gasit "+y(i(C).name)+"! ð ",1),c("p",Xt,y(i(N))+" pasi · "+y(i($))+" stele · "+y(i(et)),1),c("div",{class:"flex gap-2 justify-center"},[c("button",{onClick:pt,class:"px-3 py-1.5 bg-red-600 text-white rounded-lg hover:bg-red-700 transition-colors text-sm"}," Joaca din nou ")])])):F("",!0)])):(h(),g("div",Lt,[c("p",zt,[e[0]||(e[0]=W(" Ajuta turistul sa ajunga la ",-1)),c("strong",Bt,y(i(C).name),1),e[1]||(e[1]=W("
1! ",-1))]),e[2]||(e[2]=c("p",{class:"text-xs text-gray-400 dark:text-gray-500 mb-3"},[W(" Foloseste "),c("span",{class:"font-mono bg-gray-100 dark:bg-gray-700 px-1 rounded"},"sagetile"),W(" sau "),c("span",{class:"font-mono bg-gray-100 dark:bg-gray-700 px-1 rounded"},"swipe")],-1)),e[3]||(e[3]=c("p",{class:"text-xs text-gray-400 dark:text-gray-500 mb-4"}," Atentie la ceata si la tramvaie! Colecteaza â ca sa vezi mai departe. ",-1)),c("button",{onClick:nt,class:"px-4 py-2 bg-red-600 text-white rounded-lg hover:bg-red-700 transition-colors text-sm font-medium"}," Incepe jocul ")]))],544))}}),ee=Object.assign(It(Qt,[["__scopeId","data-v-e0257fba"]]),{__name:"ErrorLostTourist"});export{ee as default};
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.