1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-m1QZEBYa.js","assets/react-vendor-BeP0eRcC.js","assets/firebase-vendor-BejHqAc8.js","assets/ui-vendor-Brw8SATt.js","assets/index-BCWHaBH4.css"])))=>i.map(i=>d[i]); 2var e=(e,t,s)=>new Promise((r,i)=>{var l=e=>{try{o(s.next(e))}catch(t){i(t)}},a=e=>{try{o(s.throw(e))}catch(t){i(t)}},o=e=>e.done?r(e.value):Promise.resolve(e.value).then(l,a);o((s=s.apply(e,t)).next())});import{a as t,u as s,j as r,g as i,c as l,d as a,r as o,_ as n,e as c,h as d,i as x,k as m}from"./index-m1QZEBYa.js";import{f as u,r as h,u as g,L as p}from"./react-vendor-BeP0eRcC.js";import{r as b}from"./stripeService-DdlgmLZg.js";import{e as f,J as j,N as y,O as v,y as N,Q as w,V as k,W as S,Y as C,k as P}from"./ui-vendor-Brw8SATt.js";import"./firebase-vendor-BejHqAc8.js";const z=new Map;function I(t,s){return e(this,null,function*(){return function(e){const t=!e||""===e.trim();return t}(t)?function(e){const t=Date.now(),s=z.get(e);return s?t-s.firstAttempt>6e4?(z.set(e,{count:1,firstAttempt:t}),!0):!(s.count>=3||(s.count++,0)):(z.set(e,{count:1,firstAttempt:t}),!0)}(s)?{isValid:!0}:{isValid:!1,reason:"Troppi tentativi. Attendi 1 minuto prima di riprovare."}:{isValid:!1,reason:"Rilevata attività sospetta. Se sei un utente reale, riprova tra qualche minuto."}})}"undefined"!=typeof window&&setInterval(function(){const e=Date.now(),t=[];z.forEach((s,r)=>{e-s.firstAttempt>12e4&&t.push(r)}),t.forEach(e=>z.delete(e)),t.length},3e5);const T="ciao_runner_registration_progress",F=()=>{const{t:F}=t("auth"),[R]=u(),E="true"===R.get("premium"),[L,A]=h.useState(0),[_,O]=h.useState("forward"),[D,M]=h.useState(E),V=D?4:3,[W,q]=h.useState(""),[B,G]=h.useState(""),[U,J]=h.useState(""),[H,Q]=h.useState(""),[Y,$]=h.useState(()=>(R.get("ref")||"").toUpperCase()),[K,X]=h.useState(!1),[Z,ee]=h.useState(""),[te,se]=h.useState(!1),[re,ie]=h.useState(!0),[le,ae]=h.useState(""),[oe,ne]=h.useState(""),[ce,de]=h.useState(null),[xe,me]=h.useState({}),[ue,he]=h.useState(!1),[ge,pe]=h.useState(!1),[be,fe]=h.useState(!1),[je,ye]=h.useState(null),[ve,Ne]=h.useState(null),[we,ke]=h.useState(null),[Se,Ce]=h.useState(!1),[Pe,ze]=h.useState(!1),[Ie,Te]=h.useState(!1),[Fe,Re]=h.useState("yearly"),[Ee,Le]=h.useState(null),[Ae,_e]=h.useState(!1),[Oe,De]=h.useState(""),[Me,Ve]=h.useState([]),[We,qe]=h.useState(!1),[Be,Ge]=h.useState(null),[Ue,Je]=h.useState(""),[He,Qe]=h.useState([]),[Ye,$e]=h.useState(""),[Ke,Xe]=h.useState(!1),{register:Ze,currentUser:et}=(h.useRef(null),s()),tt=g();h.useEffect(()=>{const e=localStorage.getItem(T);if(e)try{const t=JSON.parse(e),s=t.timestamp||0;if((Date.now()-s)/36e5<24){q(t.name||""),G(t.email||""),ie(void 0===t.useGeolocation||t.useGeolocation),ae(t.address||""),M(t.isPremiumRegistration||!1),t.selectedPlan&&["yearly","top"].includes(t.selectedPlan)&&Re(t.selectedPlan),Je(t.discoverySource||""),$((R.get("ref")||"").toUpperCase()||t.referredBy||"");let e=t.currentStep||0;e>=4?e=3:e>2&&(e=2),A(e),ze(!0),setTimeout(()=>ze(!1),5e3)}else localStorage.removeItem(T)}catch(t){localStorage.removeItem(T)}},[]),h.useEffect(()=>{e(void 0,null,function*(){try{const e=(yield i()).filter(e=>!0===e.isFriendshipEvent);Qe(e)}catch(e){}})},[]),h.useEffect(()=>{if(!W&&!B&&!le&&0===L)return;const e={name:W,email:B,currentStep:4===L?3:L,useGeolocation:re,address:le,isPremiumRegistration:D,selectedPlan:Fe,discoverySource:Ue,referredBy:Y,timestamp:Date.now()};localStorage.setItem(T,JSON.stringify(e))},[W,B,L,re,le,D,Fe,Ue,Y]);const st=()=>{localStorage.removeItem(T)};h.useEffect(()=>{re||(ne(""),de(null),ye(null),ke(null))},[re]);const rt=()=>e(void 0,null,function*(){he(!0),ye(null),ke(null);try{const e=yield c();if(Ne(e),"denied"===e){const e=d();return ye(e.message),ke(e),void he(!1)}const t=yield x();if(t.usedFallback&&t.error){if(ye(t.error.message),"PERMISSION_DENIED"===t.error.type){const e=d();ke(e)}}else ye(null),ke(null);de(t.coordinates);const s=yield m(t.coordinates.lat,t.coordinates.lng);s&&s.address&&(ne(s.address),me({country:s.country,region:s.region,province:s.province}))}catch(e){ye("Errore imprevisto durante la geolocalizzazione")}finally{he(!1)}});h.useEffect(()=>{const t=setTimeout(()=>e(void 0,null,function*(){if(Oe.trim().length>=2){const e=yield l(Oe);Ve(e),qe(!0)}else Ve([]),qe(!1)}),300);return()=>clearTimeout(t)},[Oe]);const it=()=>{if(ee(""),1===L){if(!W.trim())return ee(F("register.validation.nameRequired"));if(!B.trim())return ee(F("register.validation.emailRequired"));
2if(!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(B))return ee(F("register.validation.emailInvalid"))}if(2===L){if(!U)return ee(F("register.validation.passwordRequired"));if(U.length<6)return ee(F("register.validation.passwordMinLength"));if(U!==H)return ee(F("register.validation.passwordMismatch"))}O("forward"),A(L+1)};return r.jsx("div",{className:"bg-gradient-to-br from-rose-500 via-fuchsia-500 to-blue-600 min-h-screen py-12",children:r.jsxs("div",{className:"container mx-auto px-4",children:[Pe&&r.jsx("div",{className:"fixed top-4 right-4 bg-green-500 text-white px-6 py-3 rounded-lg shadow-lg z-50 animate-fadeIn",style:{animation:"slideInRight 0.3s ease-out"},children:r.jsxs("div",{className:"flex items-start space-x-2",children:[r.jsx(f,{size:20,className:"mt-0.5 flex-shrink-0"}),r.jsxs("div",{children:[r.jsx("p",{className:"font-medium",children:F("register.progressRestored")}),2===L&&r.jsx("p",{className:"text-sm mt-1 opacity-90",children:F("register.progressRestoredNote")})]})]})}),r.jsxs("div",{className:"max-w-md mx-auto bg-white rounded-2xl shadow-lg overflow-hidden",children:[r.jsxs("div",{className:"p-6 bg-gradient-to-r from-rose-500 to-blue-600",children:[r.jsx("h2",{className:"text-2xl font-bold text-white text-center",children:F("register.title")}),L>0&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"mt-4 flex items-center justify-center space-x-2",children:Array.from({length:V},(e,t)=>t+1).map(e=>r.jsxs("div",{className:"flex items-center",children:[r.jsx("div",{className:"w-8 h-8 rounded-full flex items-center justify-center text-sm font-bold transition-all "+(e===L?"bg-white text-rose-500 scale-110":e<L?"bg-rose-300 text-white":"bg-rose-400/50 text-white"),children:e}),e<V&&r.jsx("div",{className:"w-8 h-1 mx-1 transition-all "+(e<L?"bg-white":"bg-rose-400/50")})]},e))}),r.jsxs("p",{className:"text-white text-center text-sm mt-2",children:[1===L&&"Dati personali",2===L&&"Sicurezza",3===L&&"Posizione",4===L&&"Abbonamento Premium"]})]}),0===L&&r.jsx("p",{className:"text-white text-center text-sm mt-4",children:F("register.steps.choosePlan")})]}),r.jsxs("div",{className:"p-6",children:[Z&&r.jsx("div",{className:"bg-red-100 border-2 border-red-500 text-red-800 px-4 py-4 rounded-lg mb-4 shadow-lg animate-pulse",role:"alert",children:r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsx(j,{className:"w-6 h-6 text-red-500 flex-shrink-0 mt-0.5"}),r.jsx("span",{className:"block font-medium text-sm",children:Z})]})}),r.jsxs("form",{onSubmit:3===L?t=>e(void 0,null,function*(){if(t.preventDefault(),re&&!ce)return ee(F("register.validation.locationRequired")),void window.scrollTo({top:0,behavior:"smooth"});if(!re&&!Be)return ee(F("register.validation.cityRequired")),void window.scrollTo({top:0,behavior:"smooth"});if(!Ie)return ee(F("register.validation.privacyRequired")),void window.scrollTo({top:0,behavior:"smooth"});try{ee(""),se(!0),Xe(!0);const e=yield a(),t=function(){const e=document.createElement("canvas"),t=e.getContext("2d"),s=[navigator.userAgent,navigator.language,(new Date).getTimezoneOffset().toString(),screen.width+"x"+screen.height,screen.colorDepth,t?e.toDataURL():"no-canvas"].join("|");let r=0;for(let i=0;i<s.length;i++)r=(r<<5)-r+s.charCodeAt(i),r&=r;return r.toString(36)}(),s=e||t,r=yield I(Ye,s);if(Xe(!1),!r.isValid)return ee(r.reason||F("register.validation.antibotFailed")),se(!1),void window.scrollTo({top:0,behavior:"smooth"});r.appCheckToken;const i=re?oe:null==Be?void 0:Be.displayName,l=re&&ce?ce:Be?{lat:Be.lat,lng:Be.lng}:void 0;let n={};if(l)if(re&&xe.country)n=xe;else{const e=yield o(l.lat,l.lng);n={country:e.country,region:e.region,province:e.province}}yield Ze(W,B,U,!1,i||void 0,l,n.country,n.region,n.province,Y||void 0,Ue||void 0),function(e){z.delete(e)}(s),localStorage.setItem("just_registered_timestamp",Date.now().toString()),yield new Promise(e=>setTimeout(e,1e3)),D?(O("forward"),A(4)):(st(),tt("/profile")),se(!1)}catch(s){if("auth/email-already-in-use"===s.code)try{const{signInWithEmailAndPassword:t}=yield n(()=>e(void 0,null,function*(){const{signInWithEmailAndPassword:e}=yield import("./firebase-vendor-BejHqAc8.js").then(e=>e.V);return{signInWithEmailAndPassword:e}}),[]),{auth:s}=yield n(()=>e(void 0,null,function*(){const{auth:e}=yield import("./index-m1QZEBYa.js").then(e=>e.a7);return{auth:e}}),__vite__mapDeps([0,1,2,3,4]));return yield t(s,B,U),yield new Promise(e=>setTimeout(e,1e3)),D?(O("forward"),A(4),ee("")):(st(),tt("/profile")),void se(!1)}catch(r){return"auth/wrong-password"===r.code||"auth/invalid-credential"===r.code?ee(F("register.validation.emailAlreadyRegisteredWrongPassword")):ee(F("register.validation.accountAlreadyExists")),se(!1),void window.scrollTo({top:0,behavior:"smooth"})}ee(s.message||F("register.errors.registration")),se(!1)}}):e=>{e.preventDefault(),it()},children:[0===L&&r.jsxs("div",{className:"space-y-4 animate-fadeIn",children:[r.jsxs("div",{className:"text-center mb-4",children:[r.jsx("p",{className:"text-gray-600",children:F("register.planSelection.subtitle")}),r.jsx("div",{className:"inline-block mt-2 bg-red-500 text-white px-4 py-1 rounded-full font-bold text-xs",children:"ð¥ OFFERTA LIMITATA: Risparmia fino al 50%!"})]}),r.jsx("div",{onClick:()=>{M(!1),Re("yearly")},className:"border-2 rounded-xl p-4 cursor-pointer transition-all "+(D?"border-gray-200 hover:border-blue-300 hover:shadow-md":"border-blue-500 bg-blue-50 shadow-lg"),children:r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("div",{className:"w-5 h-5 rounded-full border-2 flex items-center justify-center shrink-0 "+(D?"border-gray-300":"border-blue-500 bg-blue-500"),children:!D&&r.jsx(f,{className:"w-3 h-3 text-white"})}),r.jsxs("div",{children:[r.jsx("h4",{className:"text-base font-bold text-gray-800",children:"Free"}),r.jsx("p",{className:"text-xs text-gray-500",children:"Mappa · Profilo · Punti CR"})]})]}),r.jsxs("div",{className:"text-right",children:[r.jsx("p",{className:"text-2xl font-bold text-gray-700",children:"â¬0"}),r.jsx("p",{className:"text-xs text-gray-400",children:"per sempre"})]})]})}),r.jsxs("div",{className:"border-2 rounded-xl p-4 transition-all relative "+(D&&"yearly"===Fe?"border-blue-500 bg-blue-50 shadow-lg":"border-gray-200 hover:border-blue-300 hover:shadow-md"),children:[r.jsx("div",{className:"absolute -top-2.5 right-3 bg-red-500 text-white text-xs font-bold px-2 py-0.5 rounded-full",children:"ð¥ 50% OFF"}),r.jsxs("div",{className:"flex items-center gap-3 cursor-pointer mb-3",onClick:()=>{M(!0),"top"===Fe&&Re("yearly")},children:[r.jsx("div",{className:"w-5 h-5 rounded-full border-2 flex items-center justify-center shrink-0 "+(D&&"yearly"===Fe?"border-blue-500 bg-blue-500":"border-gray-300"),children:D&&"yearly"===Fe&&r.jsx(f,{className:"w-3 h-3 text-white"})}),r.jsxs("div",{children:[r.jsx("h4",{className:"text-base font-bold text-gray-800",children:"Premium"}),r.jsx("p",{className:"text-xs text-gray-500",children:"Sconti illimitati · Creazione eventi · Feed"})]})]}),r.jsxs("div",{className:"ml-8 cursor-pointer",onClick:()=>{M(!0),Re("yearly")},children:[r.jsx("span",{className:"text-xl font-bold text-blue-600",children:"â¬9,90"}),r.jsx("span",{className:"text-sm text-gray-500",children:"/anno"}),r.jsx("span",{className:"text-xs text-gray-400 line-through ml-2",children:"â¬19,90"})]})]}),r.jsxs("div",{onClick:()=>{M(!0),Re("top")},className:"border-2 rounded-xl p-4 cursor-pointer transition-all relative "+(D&&"top"===Fe?"border-purple-500 bg-purple-50 shadow-lg":"border-gray-200 hover:border-purple-300 hover:shadow-md"),children:[r.jsx("div",{className:"absolute -top-2.5 right-3 bg-gradient-to-r from-purple-600 to-pink-600 text-white text-xs font-bold px-2 py-0.5 rounded-full",children:"â MIGLIORE"}),r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("div",{className:"w-5 h-5 rounded-full border-2 flex items-center justify-center shrink-0 "+(D&&"top"===Fe?"border-purple-500 bg-purple-500":"border-gray-300"),children:D&&"top"===Fe&&r.jsx(f,{className:"w-3 h-3 text-white"})}),r.jsxs("div",{children:[r.jsx("h4",{className:"text-base font-bold text-gray-800",children:"Premium TOP"}),r.jsxs("ul",{className:"mt-1 space-y-0.5",children:[r.jsxs("li",{className:"flex items-center text-xs text-gray-600",children:[r.jsx(f,{className:"w-3 h-3 text-purple-500 mr-1.5 shrink-0"}),"Promozione eventi illimitata · Newsletter"]}),r.jsxs("li",{className:"flex items-center text-xs text-gray-600 font-semibold",children:[r.jsx(f,{className:"w-3 h-3 text-purple-500 mr-1.5 shrink-0"}),"ð½ Pettorale a 300pt · ð Spedizione gratuita Iovedodicorsa.com"]}),r.jsxs("li",{className:"flex items-center text-xs text-gray-600",children:[r.jsx(f,{className:"w-3 h-3 text-purple-500 mr-1.5 shrink-0"}),"100 pt CR bonus/anno"]})]})]})]}),r.jsxs("div",{className:"text-right shrink-0 ml-3",children:[r.jsx("p",{className:"text-2xl font-bold text-purple-600",children:"â¬29,90"}),r.jsx("p",{className:"text-xs text-gray-500",children:"/anno"}),r.jsx("p",{className:"text-xs text-gray-400 line-through",children:"â¬49,90"})]})]})]}),r.jsx("p",{className:"text-xs text-gray-500 text-center mt-2",children:F("register.planSelection.upgradeNote")})]}),1===L&&r.jsxs("div",{className:"space-y-4 animate-fadeIn",style:{animation:"forward"===_?"slideInRight 0.3s ease-out":"slideInLeft 0.3s ease-out"},children:[r.jsxs("div",{children:[r.jsx("label",{htmlFor:"name",className:"block text-gray-700 text-sm font-bold mb-2",children:F("register.fields.name.label")}),r.jsx("input",{id:"name",type:"text",value:W,onChange:e=>q(e.target.value),className:"shadow appearance-none border rounded-lg w-full py-3 px-4 text-gray-700 leading-tight focus:outline-none focus:ring-2 focus:ring-rose-500",placeholder:F("register.fields.name.placeholder"),autoFocus:!0})]}),r.jsxs("div",{children:[r.jsx("label",{htmlFor:"email",className:"block text-gray-700 text-sm font-bold mb-2",children:F("register.fields.email.label")}),r.jsx("input",{id:"email",type:"email",value:B,onChange:e=>G(e.target.value),className:"shadow appearance-none border rounded-lg w-full py-3 px-4 text-gray-700 leading-tight focus:outline-none focus:ring-2 focus:ring-rose-500",placeholder:F("register.fields.email.placeholder")})]}),r.jsxs("div",{children:[r.jsx("label",{htmlFor:"referralCode",className:"block text-gray-700 text-sm font-bold mb-2",children:F("register.referralField.label")}),r.jsx("input",{id:"referralCode",type:"text",value:Y,onChange:e=>$(e.target.value.toUpperCase()),className:"shadow appearance-none border rounded-lg w-full py-3 px-4 text-gray-700 leading-tight focus:outline-none focus:ring-2 focus:ring-rose-500",placeholder:F("register.referralField.placeholder"),maxLength:15}),r.jsx("p",{className:"text-xs text-gray-500 mt-1",children:F("register.referralField.hint")})]}),r.jsxs("div",{children:[r.jsx("label",{htmlFor:"discoverySource",className:"block text-gray-700 text-sm font-bold mb-2",children:"Come ci hai conosciuto? (opzionale)"}),r.jsxs("select",{id:"discoverySource",value:Ue,onChange:e=>Je(e.target.value),className:"shadow appearance-none border rounded-lg w-full py-3 px-4 text-gray-700 leading-tight focus:outline-none focus:ring-2 focus:ring-rose-500",children:[r.jsx("option",{value:"",children:"-- Seleziona --"}),r.jsx("option",{value:"social",children:"Social Media (Instagram, Facebook, ecc.)"}),r.jsx("option",{value:"passaparola",children:"Passaparola"}),r.jsx("option",{value:"google",children:"Ricerca Google"}),r.jsx("option",{value:"altro",children:"Altro"}),He.length>0&&r.jsx("optgroup",{label:"Eventi Amici",children:He.map(e=>r.jsx("option",{value:e.title,children:e.title},e.id))})]}),r.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Aiutaci a capire come hai scoperto CiaoRunner!"})]}),r.jsxs("div",{style:{position:"absolute",left:"-9999px",opacity:0,pointerEvents:"none"}
2,"aria-hidden":"true",tabIndex:-1,children:[r.jsx("label",{htmlFor:"website_url",children:"Website URL (leave blank)"}),r.jsx("input",{type:"text",id:"website_url",name:"website_url",value:Ye,onChange:e=>$e(e.target.value),autoComplete:"off",tabIndex:-1})]})]}),2===L&&r.jsxs("div",{className:"space-y-4",style:{animation:"forward"===_?"slideInRight 0.3s ease-out":"slideInLeft 0.3s ease-out"},children:[r.jsxs("div",{children:[r.jsx("label",{htmlFor:"password",className:"block text-gray-700 text-sm font-bold mb-2",children:F("register.fields.password.label")}),r.jsxs("div",{className:"relative",children:[r.jsx("input",{id:"password",type:ge?"text":"password",value:U,onChange:e=>J(e.target.value),className:"shadow appearance-none border rounded-lg w-full py-3 px-4 pr-10 text-gray-700 leading-tight focus:outline-none focus:ring-2 focus:ring-rose-500",placeholder:F("register.fields.password.placeholder"),autoFocus:!0}),r.jsx("button",{type:"button",onClick:()=>pe(!ge),className:"absolute inset-y-0 right-0 pr-3 flex items-center text-gray-500 hover:text-gray-700",children:ge?r.jsx(y,{size:20}):r.jsx(v,{size:20})})]})]}),r.jsxs("div",{children:[r.jsx("label",{htmlFor:"confirmPassword",className:"block text-gray-700 text-sm font-bold mb-2",children:F("register.fields.confirmPassword.label")}),r.jsxs("div",{className:"relative",children:[r.jsx("input",{id:"confirmPassword",type:be?"text":"password",value:H,onChange:e=>Q(e.target.value),className:"shadow appearance-none border rounded-lg w-full py-3 px-4 pr-10 text-gray-700 leading-tight focus:outline-none focus:ring-2 focus:ring-rose-500",placeholder:F("register.fields.confirmPassword.placeholder")}),r.jsx("button",{type:"button",onClick:()=>fe(!be),className:"absolute inset-y-0 right-0 pr-3 flex items-center text-gray-500 hover:text-gray-700",children:be?r.jsx(y,{size:20}):r.jsx(v,{size:20})})]})]}),r.jsx("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-3",children:r.jsx("p",{className:"text-xs text-blue-700",children:r.jsx("strong",{children:F("register.fields.passwordTip")})})})]}),3===L&&r.jsxs("div",{className:"space-y-4",style:{animation:"forward"===_?"slideInRight 0.3s ease-out":"slideInLeft 0.3s ease-out"},children:[r.jsxs("div",{children:[r.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-3",children:F("register.fields.locationMethod")}),r.jsxs("div",{className:"bg-gray-50 p-4 rounded-lg space-y-4",children:[r.jsxs("div",{className:"flex flex-col space-y-3",children:[r.jsxs("div",{className:"flex items-center",children:[r.jsx("input",{id:"geoOption",type:"radio",name:"locationType",checked:re,onChange:()=>ie(!0),className:"h-4 w-4 text-rose-500 focus:ring-rose-500 border-gray-300"}),r.jsx("label",{htmlFor:"geoOption",className:"ml-3 block text-sm text-gray-700 font-medium",children:F("register.fields.useGeolocation")})]}),r.jsxs("div",{className:"flex items-center",children:[r.jsx("input",{id:"addressOption",type:"radio",name:"locationType",checked:!re,onChange:()=>ie(!1),className:"h-4 w-4 text-rose-500 focus:ring-rose-500 border-gray-300"}),r.jsx("label",{htmlFor:"addressOption",className:"ml-3 block text-sm text-gray-700 font-medium",children:F("register.fields.useManualAddress")})]})]}),re?r.jsxs("div",{className:"space-y-3 pt-2",children:[!ce&&!ue&&!je&&r.jsxs("div",{className:"space-y-3",children:[r.jsxs("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-3",children:[r.jsxs("p",{className:"text-sm text-blue-800 font-medium mb-2",children:["ð ",F("register.geolocation.infoTitle")]}),r.jsxs("div",{className:"space-y-2",children:[r.jsxs("div",{className:"flex items-start",children:[r.jsx(f,{size:14,className:"text-green-600 mr-2 mt-0.5 flex-shrink-0"}),r.jsx("p",{className:"text-xs text-blue-700",children:F("register.geolocation.infoSteps.clickButton")})]}),r.jsxs("div",{className:"flex items-start",children:[r.jsx(f,{size:14,className:"text-green-600 mr-2 mt-0.5 flex-shrink-0"}),r.jsx("p",{className:"text-xs text-blue-700",children:F("register.geolocation.infoSteps.allowPermission")})]})]})]}),r.jsxs("div",{className:"bg-gray-50 border border-gray-200 rounded-lg",children:[r.jsxs("button",{type:"button",onClick:()=>Ce(!Se),className:"w-full flex items-center justify-between p-3 text-left hover:bg-gray-100 transition-colors rounded-lg",children:[r.jsxs("div",{className:"flex items-center",children:[r.jsx(w,{size:18,className:"text-blue-600 mr-2"}),r.jsx("span",{className:"text-sm font-medium text-gray-700",children:F("register.geolocation.instructions.title")})]}),Se?r.jsx(k,{size:18,className:"text-gray-500"}):r.jsx(S,{size:18,className:"text-gray-500"})]}),Se&&r.jsxs("div",{className:"px-3 pb-3 space-y-3 border-t border-gray-200 pt-3",children:[r.jsxs("div",{className:"bg-white p-3 rounded-lg border border-gray-100",children:[r.jsxs("p",{className:"text-sm font-medium text-gray-800 mb
2-2",children:["ð¥ ",F("register.geolocation.instructions.chrome.title")]}),r.jsxs("ol",{className:"text-xs text-gray-600 list-decimal list-inside space-y-1",children:[r.jsx("li",{children:F("register.geolocation.instructions.chrome.steps.0")}),r.jsx("li",{children:F("register.geolocation.instructions.chrome.steps.1")}),r.jsx("li",{children:F("register.geolocation.instructions.chrome.steps.2")})]})]}),r.jsxs("div",{className:"bg-white p-3 rounded-lg border border-gray-100",children:[r.jsxs("p",{className:"text-sm font-medium text-gray-800 mb-2",children:["ð ",F("register.geolocation.instructions.safari.title")]}),r.jsxs("ol",{className:"text-xs text-gray-600 list-decimal list-inside space-y-1",children:[r.jsx("li",{children:F("register.geolocation.instructions.safari.steps.0")}),r.jsx("li",{children:F("register.geolocation.instructions.safari.steps.1")}),r.jsx("li",{children:F("register.geolocation.instructions.safari.steps.2")})]})]}),r.jsxs("div",{className:"bg-white p-3 rounded-lg border border-gray-100",children:[r.jsxs("p",{className:"text-sm font-medium text-gray-800 mb-2",children:["ð± ",F("register.geolocation.instructions.mobile.title")]}),r.jsxs("ol",{className:"text-xs text-gray-600 list-decimal list-inside space-y-1",children:[r.jsx("li",{children:F("register.geolocation.instructions.mobile.steps.0")}),r.jsx("li",{children:F("register.geolocation.instructions.mobile.steps.1")}),r.jsx("li",{children:F("register.geolocation.instructions.mobile.steps.2")}),r.jsx("li",{children:F("register.geolocation.instructions.mobile.steps.3")}),r.jsx("li",{children:F("register.geolocation.instructions.mobile.steps.4")})]})]}),r.jsxs("div",{className:"bg-white p-3 rounded-lg border border-gray-100",children:[r.jsxs("p",{className:"text-sm font-medium text-gray-800 mb-2",children:["ð¦ ",F("register.geolocation.instructions.firefox.title")]}),r.jsxs("ol",{className:"text-xs text-gray-600 list-decimal list-inside space-y-1",children:[r.jsx("li",{children:F("register.geolocation.instructions.firefox.steps.0")}),r.jsx("li",{children:F("register.geolocation.instructions.firefox.steps.1")}),r.jsx("li",{children:F("register.geolocation.instructions.firefox.steps.2")})]})]}),r.jsx("div",{className:"bg-blue-50 p-2 rounded-lg",children:r.jsxs("p",{className:"text-xs text-blue-700",children:[r.jsx("strong",{children:F("register.geolocation.instructions.note")})," ",F("register.geolocation.instructions.noteText")]})})]})]})]}),!ce&&!ue&&!je&&r.jsxs("button",{type:"button",onClick:rt,className:"w-full bg-rose-500 hover:bg-rose-600 text-white py-3 px-4 rounded-lg flex items-center justify-center transition-colors font-medium",children:[r.jsx(N,{size:20,className:"mr-2"}),F("register.geolocation.detectMyLocation")]}),ue&&r.jsxs("div",{className:"flex items-center justify-center space-x-2 text-sm text-gray-600 py-4",children:[r.jsx("div",{className:"animate-spin rounded-full h-5 w-5 border-b-2 border-rose-500"}),r.jsx("span",{children:F("register.geolocation.detectingLocation")})]}),je&&r.jsxs("div",{className:"p-4 bg-red-50 border border-red-200 rounded-lg space-y-3",children:[r.jsx("p",{className:"text-sm text-red-700 font-medium",children:we?we.title:F("register.geolocation.errorTitle")}),r.jsx("p",{className:"text-xs text-red-600",children:je}),we&&r.jsxs("div",{children:[r.jsx("p",{className:"text-xs text-red-700 font-medium mb-2",children:F("register.geolocation.howToFix")}),r.jsx("ol",{className:"text-xs text-red-600 list-decimal list-inside space-y-1 pl-2",children:we.steps.map((e,t)=>e?r.jsx("li",{children:e},t):r.jsx("div",{className:"h-1"},t))})]}),r.jsxs("button",{type:"button",onClick:rt,className:"w-full bg-rose-500 hover:bg-rose-600 text-white py-2 px-4 rounded-lg flex items-center justify-center transition-colors text-sm font-medium",children:[r.jsx(N,{size:16,className:"mr-2"}),F("register.geolocation.retryDetectingLocation")]})]}),ce&&r.jsxs("div",{className:"space-y-3",children:[r.jsxs("div",{className:"p-3 bg-green-50 rounded-lg border border-green-200",children:[r.jsxs("div",{className:"flex items-start mb-2",children:[r.jsx(f,{size:18,className:"text-green-600 mr-2 mt-0.5 flex-shrink-0"}),r.jsx("p",{className:"text-sm text-green-700 font-medium",children:F("register.geolocation.successTitle")})]}),oe&&r.jsx("p",{className:"text-sm text-gray-700 ml-6",children:oe}),r.jsxs("div",{className:"flex items-center text-xs text-gray-500 mt-2 ml-6",children:[r.jsx(N,{size:14,className:"mr-1"}),r.jsxs("span",{children:["Lat: ",ce.lat.toFixed(4),", Lng: ",ce.lng.toFixed(4)]})]})]}),r.jsxs("button",{type:"button",onClick:rt,className:"w-full bg-gray-100 hover:bg-gray-200 text-gray-700 py-2 px-4 roun
2ded-lg flex items-center justify-center transition-colors text-sm",children:[r.jsx(N,{size:16,className:"mr-2"}),F("register.geolocation.retryDetectingLocation")]}),r.jsx("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-3",children:r.jsxs("div",{className:"flex items-start",children:[r.jsx("svg",{className:"w-5 h-5 text-blue-500 mr-2 mt-0.5 flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),r.jsxs("p",{className:"text-xs text-blue-800",children:[r.jsx("strong",{children:F("register.manualCity.privacyLabel")})," ",F("register.manualCity.privacyText")]})]})})]})]}):r.jsxs("div",{className:"space-y-3 pt-2",children:[r.jsxs("div",{className:"relative",children:[r.jsx("div",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none",children:r.jsx(N,{size:18,className:"text-gray-400"})}),r.jsx("input",{id:"manualCity",type:"text",value:Oe,onChange:e=>De(e.target.value),onFocus:()=>Oe.length>=2&&qe(!0),className:"shadow appearance-none border rounded-lg w-full py-3 pl-10 pr-4 text-gray-700 leading-tight focus:outline-none focus:ring-2 focus:ring-rose-500",placeholder:F("register.manualCity.searchPlaceholder"),autoFocus:!0}),We&&Me.length>0&&r.jsx("div",{className:"absolute z-10 w-full mt-1 bg-white border border-gray-300 rounded-lg shadow-lg max-h-60 overflow-y-auto",children:Me.map((e,t)=>r.jsx("div",{onClick:()=>(e=>{Ge(e),De(e.name),qe(!1),Ve([])})(e),className:"px-4 py-3 hover:bg-rose-50 cursor-pointer border-b border-gray-100 last:border-b-0",children:r.jsxs("div",{className:"flex items-start",children:[r.jsx(N,{size:16,className:"text-rose-500 mr-2 mt-0.5 flex-shrink-0"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-medium text-gray-800",children:e.name}),r.jsx("p",{className:"text-xs text-gray-500",children:e.displayName})]})]})},t))})]}),Be&&r.jsx("div",{className:"p-3 bg-green-50 rounded-lg border border-green-200",children:r.jsxs("div",{className:"flex items-start",children:[r.jsx(f,{size:18,className:"text-green-600 mr-2 mt-0.5 flex-shrink-0"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm text-green-700 font-medium",children:F("register.manualCity.selectedLabel")}),r.jsx("p",{className:"text-sm text-gray-700",children:Be.displayName}),r.jsxs("div",{className:"flex items-center text-xs text-gray-500 mt-1",children:[r.jsx(N,{size:12,className:"mr-1"}),r.jsxs("span",{children:["Lat: ",Be.lat.toFixed(4),", Lng: ",Be.lng.toFixed(4)]})]})]})]})}),r.jsx("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-3",children:r.jsxs("div",{className:"flex items-start",children:[r.jsx("svg",{className:"w-5 h-5 text-blue-500 mr-2 mt-0.5 flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),r.jsxs("p",{className:"text-xs text-blue-800",children:[r.jsx("strong",{children:F("register.manualCity.privacyLabel")})," ",F("register.manualCity.privacyText")]})]})})]})]})]}),r.jsx("div",{className:"mt-6 bg-gray-50 p-4 rounded-lg border border-gray-200",children:r.jsxs("div",{className:"flex items-start",children:[r.jsx("input",{id:"privacyAccept",type:"checkbox",checked:Ie,onChange:e=>Te(e.target.checked),className:"h-4 w-4 text-rose-500 focus:ring-rose-500 border-gray-300 rounded mt-1"}),r.jsxs("label",{htmlFor:"privacyAccept",className:"ml-3 text-sm text-gray-700",children:[F("register.privacyPolicy.acceptanceTextStart")," ",r.jsx("a",{href:"/privacy-policy",target:"_blank",rel:"noopener noreferrer",className:"text-rose-500 hover:text-rose-600 font-semibold underline",children:F("register.privacyPolicy.privacyPolicyLinkText")})," "," ",F("register.privacyPolicy.acceptanceTextEnd")]})]})})]}),4===L&&D&&!et&&r.jsx("div",{className:"space-y-6 animate-fadeIn",children:r.jsxs("div",{className:"text-center",children:[r.jsx(j,{className:"w-16 h-16 mx-auto text-red-500 mb-4"}
2),r.jsx("h3",{className:"text-2xl font-bold text-gray-800 mb-2",children:F("register.premiumCheckout.notCompleted")}),r.jsx("p",{className:"text-gray-600 mb-6",children:F("register.premiumCheckout.notCompletedText")}),r.jsx("button",{type:"button",onClick:()=>{st(),A(0),ee("")},className:"bg-gradient-to-r from-rose-500 to-blue-600 hover:from-rose-600 hover:to-blue-700 text-white font-bold py-3 px-6 rounded-full",children:F("register.premiumCheckout.restart")})]})}),4===L&&D&&et&&r.jsxs("div",{className:"space-y-6 animate-fadeIn",style:{animation:"slideInRight 0.3s ease-out"},children:[r.jsxs("div",{className:"text-center",children:[r.jsx(C,{className:"w-16 h-16 mx-auto text-amber-500 mb-4"}),r.jsx("h3",{className:"text-2xl font-bold text-gray-800 mb-2",children:"Completa il tuo abbonamento Premium"}),r.jsx("p",{className:"text-gray-600 mb-6",children:"Scegli il piano che preferisci e procedi al pagamento sicuro con Stripe"})]}),r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"border-2 rounded-xl p-5 transition-all relative "+("yearly"===Fe?"border-blue-500 bg-blue-50 shadow-lg":"border-gray-200"),children:[r.jsx("div",{className:"absolute -top-2.5 right-3 bg-red-500 text-white text-xs font-bold px-2 py-0.5 rounded-full",children:"ð¥ 50% OFF"}),r.jsxs("div",{className:"flex items-center gap-3 cursor-pointer mb-4",onClick:()=>{"top"===Fe&&Re("yearly")},children:[r.jsx("div",{className:"w-6 h-6 rounded-full border-2 flex items-center justify-center shrink-0 "+("yearly"===Fe?"border-blue-500 bg-blue-500":"border-gray-300"),children:"yearly"===Fe&&r.jsx(f,{className:"w-4 h-4 text-white"})}),r.jsxs("div",{children:[r.jsx("h4",{className:"text-lg font-bold text-gray-800",children:"Premium"}),r.jsx("p",{className:"text-sm text-gray-600",children:"Sconti illimitati · Creazione eventi · Feed · Badge"})]})]}),r.jsxs("div",{className:"ml-9 cursor-pointer",onClick:()=>Re("yearly"),children:[r.jsx("span",{className:"text-2xl font-bold text-blue-600",children:"â¬9,90"}),r.jsx("span",{className:"text-sm text-gray-500",children:"/anno"}),r.jsx("span",{className:"text-xs text-gray-400 line-through ml-2",children:"â¬19,90"})]})]}),r.jsxs("div",{onClick:()=>Re("top"),className:"border-2 rounded-xl p-5 cursor-pointer transition-all relative "+("top"===Fe?"border-purple-500 bg-purple-50 shadow-lg":"border-gray-200 hover:border-purple-300 hover:shadow-md"),children:[r.jsx("div",{className:"absolute -top-2.5 right-3 bg-gradient-to-r from-purple-600 to-pink-600 text-white text-xs font-bold px-2 py-0.5 rounded-full",children:"â MIGLIORE"}),r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("div",{className:"w-6 h-6 rounded-full border-2 flex items-center justify-center shrink-0 "+("top"===Fe?"border-purple-500 bg-purple-500":"border-gray-300"),children:"top"===Fe&&r.jsx(f,{className:"w-4 h-4 text-white"})}),r.jsxs("div",{children:[r.jsx("h4",{className:"text-lg font-bold text-gray-800",children:"Premium TOP"}),r.jsxs("ul",{className:"mt-1 space-y-0.5",children:[r.jsx("li",{className:"text-sm text-gray-600",children:"Promozione eventi illimitata · Newsletter"}),r.jsx("li",{className:"text-sm font-semibold text-gray-700",children:"ð½ Pettorale a 300pt · ð Spediz. gratuita Iovedodicorsa.com"}),r.jsx("li",{className:"text-sm text-gray-600",children:"100 pt CR bonus/anno"})]})]})]}),r.jsxs("div",{className:"text-right shrink-0 ml-4",children:[r.jsx("p",{className:"text-3xl font-bold text-purple-600",children:"â¬29,90"}),r.jsx("p",{className:"text-sm text-gray-500",children:"/anno"}),r.jsx("p",{className:"text-xs text-gray-400 line-through",children:"â¬49,90"})]})]})]})]}),r.jsx("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-4",children:r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsx("svg",{className:"w-6 h-6 text-blue-500 mt-0.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"})}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-semibold text-blue-900",children:F("register.premiumCheckout.securityTitle")}),r.jsx("p",{className:"text-xs text-blue-700 mt-1",children:F("register.premiumCheckout.securityText")})]})]})})]}),r.jsxs("div",{className:"flex items-center justify-between gap-3 mt-6",children:[L>0&&4!==L&&r.jsx("button",{type:"button",onClick:()=>{L>0&&(ee(""),O("backward"),A(L-1))},className:"flex-1 bg-gray-200 hover:bg-gray-300 text-gray-700 font-bold py-3 px-4 roun
2ded-full focus:outline-none focus:shadow-outline transition-colors",children:F("register.buttons.back")}),0===L?r.jsxs("button",{type:"button",onClick:it,className:"w-full bg-gradient-to-r from-rose-500 to-blue-600 hover:from-rose-600 hover:to-blue-700 text-white font-bold py-3 px-4 rounded-full focus:outline-none focus:shadow-outline transition-colors",children:[F("register.planSelection.continueWith")," ",D?"top"===Fe?"Premium TOP":"Premium":"Free"]}):4===L&&D?r.jsxs("button",{type:"button",onClick:()=>e(void 0,null,function*(){try{_e(!0),ee("");const{auth:t}=yield n(()=>e(void 0,null,function*(){const{auth:e}=yield import("./index-m1QZEBYa.js").then(e=>e.a7);return{auth:e}}),__vite__mapDeps([0,1,2,3,4])),s=t.currentUser;if(!s)throw new Error(F("register.messages.sessionNotFound"));const r=s.uid,i=(yield s.getIdToken(!0),yield b(r,Fe));i.success||(ee(i.error||"Errore durante il checkout"),_e(!1))}catch(t){ee(t.message||"Errore durante il checkout"),_e(!1)}}),className:"w-full bg-gradient-to-r from-amber-400 to-amber-600 hover:from-amber-500 hover:to-amber-700 text-white font-bold py-4 px-6 rounded-full focus:outline-none focus:shadow-outline transition-all transform hover:scale-105 flex items-center justify-center gap-2",disabled:Ae,children:[r.jsx(C,{className:"w-5 h-5"}),F(Ae?"register.buttons.redirecting":"register.buttons.proceedToPayment")]}):3===L?r.jsx("button",{type:"submit",className:"flex-1 bg-gradient-to-r from-rose-500 to-blue-600 hover:from-rose-600 hover:to-blue-700 text-white font-bold py-3 px-4 rounded-full focus:outline-none focus:shadow-outline transition-colors flex items-center justify-center gap-2",disabled:te,children:Ke?r.jsxs(r.Fragment,{children:[r.jsx(P,{size:18,className:"animate-pulse"}),"Verifica sicurezza..."]}):F(te?"register.buttons.registering":"register.buttons.completeRegistration")}):L<3?r.jsx("button",{type:"button",onClick:it,className:"flex-1 bg-gradient-to-r from-rose-500 to-blue-600 hover:from-rose-600 hover:to-blue-700 text-white font-bold py-3 px-4 rounded-full focus:outline-none focus:shadow-outline transition-colors",children:F("register.buttons.next")}):null]})]}),(W||B||le)&&r.jsx("div",{className:"mt-4 text-center",children:r.jsx("button",{type:"button",onClick:()=>{window.confirm("Vuoi ricominciare la registrazione da capo? I dati inseriti verranno persi.")&&(st(),q(""),G(""),J(""),Q(""),ae(""),ne(""),de(null),A(1),ee(""))},className:"text-xs text-gray-500 hover:text-gray-700 underline",children:F("register.buttons.startOver")})}),r.jsx("div",{className:"mt-6 text-center",children:r.jsxs("p",{className:"text-sm text-gray-600",children:[F("register.messages.haveAccount")," ",r.jsx(p,{to:"/login",className:"text-rose-500 hover:text-rose-600 font-medium",children:F("register.messages.login")})]})})]})]})]})})};export{F 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.