1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/OnboardingLocationMap-mcnP1pIa.js","assets/index-BxmgPWYo.js","assets/mapbox-Dsi-_OTH.js","assets/index-FNe7b-po.css"])))=>i.map(i=>d[i]); 2import{c as U,ba as bs,b as N,j as t,u as le,dm as De,J as pe,a$ as hs,a6 as vs,bX as js,q,t as Ae,aC as ke,lu as Et,s as Ns,o as Rt,lv as ys,lw as vt,lx as Ss,aU as _s,l as Q,aA as Ye,I as Te,dt as ks,bQ as de,B as ze,a2 as Le,aq as Cs,bO as ws,i8 as Ps,ly as Ls,lz as Os,lA as Es,lB as jt,lC as Rs,g1 as As,lD as Bs,lE as Is,jC as Ms,X as Fs,A as Nt,jD as Ts,jE as Ds,lF as zs,lG as $s,g2 as Vs,g6 as Ks,lH as Us,lI as Gs,lJ as Hs,eT as qs,jb as Ws,jc as Zs,jd as Qs,jg as Js,j6 as Xs,hT as Ys,hU as el,hV as tl,j9 as sl,hP as ll,hQ as nl,jm as al,jj as il,h4 as rl,h5 as ol,bP as cl,bR as Re,bS as dl,lK as fl,lL as ul,lM as ml,lN as pl,iz as gl,iA as yt,lO as xl,lP as bl,lQ as hl,lR as vl,lS as jl,lT as Nl,cF as yl,fR as Sl,fT as _l,bT as Xe,jf as kl,ji as Cl,je as St,jh as _t,ja as wl,jn as Pl,gf as Ll}from"./index-BxmgPWYo.js";import{a as Ol,W as El,u as Rl,i as Al,F as Bl,R as Il,L as kt,v as Ct,g as wt}from"./useIdentityVerification-WDDezg0i.js";import{a as Ml}from"./nativeCameraPermission-DovdGr7L.js";import{u as Fl,S as Tl}from"./SelfieCaptureModal-C5VeUWT1.js";import{P as Dl}from"./PhoneInput-B7tj9xUp.js";import{a as zl,b as $l,T as Vl}from"./TennisLevelIcon-Ce63XuuJ.js";import{u as Kl}from"./useSocialClubs-Blo5B8ud.js";import{u as Ul}from"./useClosedClubIds-P7MgCUc-.js";import{u as Gl}from"./useClubMemberCounts-zcw-A-9I.js";import{C as Hl}from"./ClubDetailScreen-hvX4Oqmi.js";import{f as ql,u as Wl}from"./useFollowSuggestions-C2LDHTSQ.js";import{P as Zl}from"./locationFallback-CX10koMC.js";import{s as Pt,a as Ql,d as Jl}from"./declaredSports-BNC3f_7u.js";import"./mapbox-Dsi-_OTH.js";import"./gridHabit-CDz5LPJA.js";import"./sportMomentsRepo-Cup9RV7d.js";import"./useClubChannelConfig-jIxx0OHf.js";import"./clubPermissions-BEq0HohA.js";import"./MessageReactionPicker-C9OqaH__.js";import"./useStickToBottom-DOYA9zM4.js";import"./linkify-Dbzwy91T.js";import"./useLongPress-DKCWuXxm.js";import"./MessageActionSheet-Ijygp52t.js";import"./TrashIcon-C3tS08GD.js";import"./clubChannelUnreadStore-DJuze8nC.js";import"./clubName-BYvDuE9s.js";import"./tshirtCollab.types-BHykgCQq.js";import"./geocode-BDQwQJta.js";import"./useImageFilePicker-hP5DM38s.js";import"./useClubChannelUnread-Dy3VVIBi.js";import"./useDragScroll-C4lzaMBb.js";import"./clubSouvenirsRepo-vklY6Dsw.js";import"./useSpotClub-BI6Tc8AA.js";import"./index-DPEbU8CP.js";import"./clubRecurringEventsRepo-B6VnKlKX.js";import"./ClubEventCard-NeYTFlJx.js";import"./clubDeletedEvent-Bcu9d7As.js";function Xl(s,e,r){const i=U.c(16),{clubs:l,loading:c}=Kl(s??void 0,e,s!=null),{closedIds:n,loading:a}=Ul(s!=null);let d;e:{if(!s||a){let p;i[0]===Symbol.for("react.memo_cache_sentinel")?(p=[],i[0]=p):p=i[0],d=p;break e}let g;if(i[1]!==n||i[2]!==l||i[3]!==s||i[4]!==r){let p;i[6]!==n?(p=h=>!n.has(h.id),i[6]=n,i[7]=p):p=i[7];let b;i[8]!==s?(b=h=>({...h,distanceKm:bs(s.lat,s.lng,h.lat,h.lng)}),i[8]=s,i[9]=b):b=i[9];let v;i[10]!==r?(v=h=>h.distanceKm<=r,i[10]=r,i[11]=v):v=i[11],g=l.filter(p).map(b).filter(v).sort(Yl),i[1]=n,i[2]=l,i[3]=s,i[4]=r,i[5]=g}else g=i[5];d=g}const f=d,u=f.length>0,o=c||a;let m;return i[12]!==f||i[13]!==u||i[14]!==o?(m={clubs:f,hasNearby:u,loading:o},i[12]=f,i[13]=u,i[14]=o,i[15]=m):m=i[15],m}function Yl(s,e){return s.distanceKm-e.distanceKm}function en(s){const e=U.c(15),{currentUser:r,dateOfBirth:i,declared:l,onApply:c}=s;let n;e[0]!==i?(n={dateOfBirth:i},e[0]=i,e[1]=n):n=e[1];const a=Ml(n,"running"),[d,f]=N.useState(!1);if(!a)return null;let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=()=>f(!0),e[2]=u):u=e[2];const o=u;let m;e[3]===Symbol.for("react.memo_cache_sentinel")?(m=()=>f(!1),e[3]=m):m=e[3];const g=m;let p;e[4]!==c?(p=j=>{c(j),f(!1)},e[4]=c,e[5]=p):p=e[5];const b=p;let v;e[6]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx(El,{onOpen:o}),e[6]=v):v=e[6];let h;e[7]!==r||e[8]!==i||e[9]!==l||e[10]!==b||e[11]!==d?(h=d&&t.jsx(Ol,{currentUser:{...r,...l,dateOfBirth:i},sport:"running",onClose:g,onSaved:b}
2),e[7]=r,e[8]=i,e[9]=l,e[10]=b,e[11]=d,e[12]=h):h=e[12];let x;return e[13]!==h?(x=t.jsxs(t.Fragment,{children:[v,h]}),e[13]=h,e[14]=x):x=e[14],x}const Lt=20;function tn(s){const e=U.c(35),{clubs:r,currentUserId:i,onOpenClub:l}=s,{t:c}=le(),[n,a]=N.useState(!1);let d;e[0]!==r||e[1]!==n?(d=n?r:r.slice(0,Lt),e[0]=r,e[1]=n,e[2]=d):d=e[2];const f=d,u=r.length-Lt;let o;e[3]!==f?(o=f.map(sn),e[3]=f,e[4]=o):o=e[4];const m=Gl(o);let g;e[5]!==c?(g=c("onboardingClub.title"),e[5]=c,e[6]=g):g=e[6];let p;e[7]!==g?(p=t.jsx("h2",{className:"text-xl font-bold",children:g}),e[7]=g,e[8]=p):p=e[8];let b;e[9]!==c?(b=c("onboardingClub.subtitle"),e[9]=c,e[10]=b):b=e[10];let v;e[11]!==b?(v=t.jsx("p",{className:"mt-1 text-sm text-muted-foreground text-balance",children:b}),e[11]=b,e[12]=v):v=e[12];let h;e[13]!==p||e[14]!==v?(h=t.jsxs("div",{className:"text-center",children:[p,v]}),e[13]=p,e[14]=v,e[15]=h):h=e[15];let x;if(e[16]!==i||e[17]!==m||e[18]!==l||e[19]!==f){let S;e[21]!==i||e[22]!==m||e[23]!==l?(S=C=>t.jsx(ln,{club:C,currentUserId:i,memberCount:m[C.id],onOpen:()=>l(C)},C.id),e[21]=i,e[22]=m,e[23]=l,e[24]=S):S=e[24],x=f.map(S),e[16]=i,e[17]=m,e[18]=l,e[19]=f,e[20]=x}else x=e[20];let j;e[25]!==x?(j=t.jsx("div",{className:"flex flex-col gap-3",children:x}),e[25]=x,e[26]=j):j=e[26];let L;e[27]!==n||e[28]!==u||e[29]!==c?(L=!n&&u>0&&t.jsx("button",{type:"button",onClick:()=>a(!0),className:"mx-auto text-sm font-semibold text-primary hover:underline",children:c("onboardingClub.seeMore",{count:u,defaultValue:`Voir plus (+${u})`})}),e[27]=n,e[28]=u,e[29]=c,e[30]=L):L=e[30];let k;return e[31]!==L||e[32]!==h||e[33]!==j?(k=t.jsxs("div",{className:"flex flex-col gap-4 py-2",children:[h,j,L]}),e[31]=L,e[32]=h,e[33]=j,e[34]=k):k=e[34],k}function sn(s){return s.id}function ln(s){const e=U.c(39),{club:r,currentUserId:i,memberCount:l,onOpen:c}=s,{t:n}=le(),{join:a,joining:d,joined:f}=Fl(r.id,i,"onboarding");let u;e[0]!==r.distanceKm||e[1]!==n?(u=r.distanceKm<1?n("onboardingClub.distanceClose"):n("onboardingClub.distanceKm",{km:Math.round(r.distanceKm)}),e[0]=r.distanceKm,e[1]=n,e[2]=u):u=e[2];const o=u,m=`En savoir plus sur ${r.name}`;let g;e[3]!==r.name||e[4]!==n||e[5]!==m?(g=n("onboardingClub.openClub",{name:r.name,defaultValue:m}),e[3]=r.name,e[4]=n,e[5]=m,e[6]=g):g=e[6];let p;e[7]!==r.logoUrl?(p=r.logoUrl?t.jsx("img",{src:r.logoUrl,alt:"",className:"h-10 w-10 shrink-0 rounded-lg object-cover"}):t.jsx("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-primary/15 text-primary",children:t.jsx(De,{name:"medal",className:"w-5 h-5"})}),e[7]=r.logoUrl,e[8]=p):p=e[8];let b;e[9]!==r.name?(b=t.jsx("p",{className:"truncate text-sm font-semibold",children:r.name}),e[9]=r.name,e[10]=b):b=e[10];let v;e[11]!==l||e[12]!==n?(v=l!=null&&l>0&&t.jsx("p",{className:"truncate text-xs font-semibold text-primary",children:n("onboardingClub.memberCount",{count:l,defaultValue:`${l} membres`})}),e[11]=l,e[12]=n,e[13]=v):v=e[13];let h;e[14]!==r.city||e[15]!==o?(h=t.jsxs("p",{className:"truncate text-xs text-muted-foreground",children:[r.city," · ",o]}),e[14]=r.city,e[15]=o,e[16]=h):h=e[16];let x;e[17]!==b||e[18]!==v||e[19]!==h?(x=t.jsxs("div",{className:"min-w-0 flex-1",children:[b,v,h]}),e[17]=b,e[18]=v,e[19]=h,e[20]=x):x=e[20];let j;e[21]!==c||e[22]!==g||e[23]!==p||e[24]!==x?(j=t.jsxs("button",{type:"button",onClick:c,"aria-label":g,className:"flex min-w-0 flex-1 items-center gap-3 text-left",children:[p,x]}),e[21]=c,e[22]=g,e[23]=p,e[24]=x,e[25]=j):j=e[25];const L=f?"outline":"default",k=d||f;let S;e[26]!==a?(S=()=>{a()},e[26]=a,e[27]=S):S=e[27];let C;e[28]!==f||e[29]!==n?(C=n(f?"onboardingClub.joined":"onboardingClub.join"),e[28]=f,e[29]=n,e[30]=C):C=e[30];let w;e[31]!==L||e[32]!==k||e[33]!==S||e[34]!==C?(w=t.jsx(pe,{type:"button",size:"sm",variant:L,disabled:k,onClick:S,className:"shrink-0",children:C}),e[31]=L,e[32]=k,e[33]=S,e[34]=C,e[35]=w):w=e[35];let E;return e[36]!==w||e[37]!==j?(E=t.jsxs("div",{className:"flex items-center gap-3 rounded-xl border border-border p-3",children:[j,w]}),e[36]=w,e[37]=j,e[38]=E):E=e[38],E}function nn(s){const e=U.c(22),{suggestions:r,currentUserId:i,sessionLabelPlural
2:l}=s,{t:c}=le();if(r.length===0)return null;let n;e[0]!==c?(n=c("onboardingBuddiz.title"),e[0]=c,e[1]=n):n=e[1];let a;e[2]!==n?(a=t.jsx("h2",{className:"text-xl font-bold",children:n}),e[2]=n,e[3]=a):a=e[3];let d;e[4]!==l||e[5]!==c?(d=c("onboardingBuddiz.subtitle",{sessionLabelPlural:l}),e[4]=l,e[5]=c,e[6]=d):d=e[6];let f;e[7]!==d?(f=t.jsx("p",{className:"mt-1 text-sm text-muted-foreground text-balance",children:d}),e[7]=d,e[8]=f):f=e[8];let u;e[9]!==a||e[10]!==f?(u=t.jsxs("div",{className:"text-center",children:[a,f]}),e[9]=a,e[10]=f,e[11]=u):u=e[11];let o;if(e[12]!==i||e[13]!==r){let p;e[15]!==i?(p=b=>t.jsx(on,{person:b,currentUserId:i},b.id),e[15]=i,e[16]=p):p=e[16],o=r.map(p),e[12]=i,e[13]=r,e[14]=o}else o=e[14];let m;e[17]!==o?(m=t.jsx("div",{className:"flex flex-col gap-3",children:o}),e[17]=o,e[18]=m):m=e[18];let g;return e[19]!==u||e[20]!==m?(g=t.jsxs("div",{"data-testid":"onboarding-buddiz-step",className:"flex flex-col gap-4 py-2",children:[u,m]}),e[19]=u,e[20]=m,e[21]=g):g=e[21],g}const an={follow:{visible:"socialFeed.followSuggestions.follow",a11y:"onboardingBuddiz.a11y.follow"},followBack:{visible:"socialFeed.followSuggestions.followBack",a11y:"onboardingBuddiz.a11y.followBack"},following:{visible:"member.following",a11y:"onboardingBuddiz.a11y.following"},pending:{visible:"member.pending",a11y:"onboardingBuddiz.a11y.pending"}};function rn(s,e){return s==="following"||s==="pending"?s:e?"followBack":"follow"}function on({person:s,currentUserId:e}){const{t:r,i18n:i}=le(),l=hs()?.followStateOf?.(s.id)??"none",[c,n]=N.useState("none"),a=l!=="none"?l:c,[d,f]=N.useState(!1),u=N.useRef(!1),o=async()=>{if(!(u.current||a!=="none")){u.current=!0,f(!0);try{const p=await js(e,s.id);p==null||p==="none"?q.error(r("eventOrganizer.follow.errorToast")):(n(p),Ae("member_followed",{surface:"onboarding",reason:s.reason,status:p}))}catch{q.error(r("eventOrganizer.follow.errorToast"))}finally{u.current=!1,f(!1)}}},m=a!=="none",g=an[rn(a,s.followsMe)];return t.jsxs("div",{className:"flex items-center gap-3 rounded-xl border border-border p-3",children:[t.jsx(vs,{name:s.firstName,photoUrl:s.photoUrl??void 0,emoji:s.emoji??void 0,size:40,verified:s.verified}),t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsx("p",{className:"truncate text-sm font-semibold",children:s.firstName}),t.jsx("p",{className:"truncate text-xs text-muted-foreground",children:ql(s,i.language,r)})]}),t.jsx(pe,{type:"button",size:"sm",variant:m?"outline":"default",disabled:d||m,onClick:()=>{o()},"aria-label":r(g.a11y,{name:s.firstName}),className:"shrink-0",children:r(g.visible)})]})}function cn(s,e,r){const i=U.c(12),l=r===void 0?!1:r,{enabled:c}=ke("onboarding_replay_enabled");let n,a;i[0]!==s||i[1]!==c?(n=()=>{c&&(s==="certif"?Et():Ns())},a=[c,s],i[0]=s,i[1]=c,i[2]=n,i[3]=a):(n=i[2],a=i[3]),N.useEffect(n,a);let d,f;i[4]!==c?(d=()=>{if(c)return dn},f=[c],i[4]=c,i[5]=d,i[6]=f):(d=i[5],f=i[6]),N.useEffect(d,f);const u=N.useRef(null);let o,m;i[7]!==s||i[8]!==l||i[9]!==e?(o=()=>{u.current!==s&&(u.current=s,Ae("onboarding_step_viewed",{step:s,sport:e,photo_required:l}))},m=[s,e,l],i[7]=s,i[8]=l,i[9]=e,i[10]=o,i[11]=m):(o=i[10],m=i[11]),N.useEffect(o,m)}function dn(){return Et()}const fn=4e4;function un(s){const e=U.c(4),{active:r,uploadFailed:i}=s,[l,c]=N.useState(!1);let n,a;return e[0]!==r||e[1]!==l?(n=()=>{if(!r||l)return;const d=setTimeout(()=>c(!0),fn);return()=>clearTimeout(d)},a=[r,l],e[0]=r,e[1]=l,e[2]=n,e[3]=a):(n=e[2],a=e[3]),N.useEffect(n,a),r&&(i||l)}const mn=[{value:"no_good_photo",labelKey:"onboarding.skipSurvey.noGoodPhoto"},{value:"privacy",labelKey:"onboarding.skipSurvey.privacy"},{value:"later",labelKey:"onboarding.skipSurvey.later"},{value:"no_point",labelKey:"onboarding.skipSurvey.noPoint"},{value:"other",labelKey:"onboarding.skipSurvey.other"}];function pn(s){const e=U.c(29),{onSelect:r,onDismiss:i}=s,{t:l}=le();Rt(!0,i);let c;e[0]!==i?(c=t.jsx("div",{className:"absolute inset-0 bg-black/60",onClick:i}),e[0]=i,e[1]=c):c=e[1];let n;e[2]===Symbol.for("react.memo_cache_sentinel")?(n={paddingBottom:"max(1.5rem, env(safe-area-inset-bottom))"},e[2]=n):n=e[2];let a;
2e[3]!==l?(a=l("onboarding.skipSurvey.title"),e[3]=l,e[4]=a):a=e[4];let d;e[5]!==a?(d=t.jsx("h3",{className:"mb-1 text-lg font-bold",children:a}),e[5]=a,e[6]=d):d=e[6];let f;e[7]!==l?(f=l("onboarding.skipSurvey.subtitle"),e[7]=l,e[8]=f):f=e[8];let u;e[9]!==f?(u=t.jsx("p",{className:"mb-4 text-sm text-muted-foreground",children:f}),e[9]=f,e[10]=u):u=e[10];let o;e[11]!==r||e[12]!==l?(o=mn.map(h=>t.jsx("button",{onClick:()=>r(h.value),className:"w-full rounded-xl border border-border px-4 py-3 text-left text-sm transition-colors hover:border-primary hover:bg-primary/5",children:l(h.labelKey)},h.value)),e[11]=r,e[12]=l,e[13]=o):o=e[13];let m;e[14]!==o?(m=t.jsx("div",{className:"flex flex-col gap-2",children:o}),e[14]=o,e[15]=m):m=e[15];let g;e[16]!==l?(g=l("onboarding.skipSurvey.dismiss"),e[16]=l,e[17]=g):g=e[17];let p;e[18]!==i||e[19]!==g?(p=t.jsx("button",{onClick:i,className:"mt-3 w-full text-center text-xs text-muted-foreground",children:g}),e[18]=i,e[19]=g,e[20]=p):p=e[20];let b;e[21]!==p||e[22]!==d||e[23]!==u||e[24]!==m?(b=t.jsxs("div",{"data-testid":"onboarding-skip-survey-sheet",className:"relative w-full max-w-md rounded-t-2xl bg-background p-6 sm:rounded-2xl",style:n,children:[d,u,m,p]}),e[21]=p,e[22]=d,e[23]=u,e[24]=m,e[25]=b):b=e[25];let v;return e[26]!==c||e[27]!==b?(v=t.jsxs("div",{"data-testid":"onboarding-skip-survey",className:"fixed inset-0 z-[60] flex items-end justify-center sm:items-center",children:[c,b]}),e[26]=c,e[27]=b,e[28]=v):v=e[28],v}const gn=10,xn=12,At=13;function bn(s){return Number.isFinite(s)&&s>=xn}function Bt(s,e){return Number.isFinite(s)&&Number.isFinite(e)&&Math.abs(s)<=90&&Math.abs(e)<=180}function Ot(s){return Math.round(s*100)/100||0}function hn(s){const{lat:e,lng:r}=s;return e==null||r==null||!Bt(e,r)||e===0&&r===0?null:{lat:e,lng:r,city:s.city?.trim()||null}}function vn(s){return s?{lat:s.lat,lng:s.lng,zoom:At}:{...Zl,zoom:gn}}const jn=300,Nn=5,yn=1e4;function Sn(){const s=navigator.geolocation;return!s||typeof s.getCurrentPosition!="function"?Promise.resolve(null):new Promise(e=>{s.getCurrentPosition(r=>e({lat:r.coords.latitude,lng:r.coords.longitude}),()=>e(null),{enableHighAccuracy:!0,timeout:yn,maximumAge:6e4})})}async function _n({lat:s,lng:e}){try{return(await _s(s,e))?.city??null}catch{return null}}function kn(s,e,r){return s?"locating":e?"resolving":r?"picked":"empty"}function Cn({value:s,onChange:e}){const[r]=N.useState(()=>vn(s)),[i]=N.useState(()=>s===null),{position:l,source:c}=ys(void 0,i,null,{gpsOnly:!0}),[n,a]=N.useState(null),[d,f]=N.useState(!1),[u,o]=N.useState(!1),[m,g]=N.useState(!1),[p,b]=N.useState(""),[v,h]=N.useState([]),[x,j]=N.useState(!1),[L,k]=N.useState(!1),S=N.useRef(0),C=N.useRef(0),w=N.useRef(0),E=N.useRef(!1),M=N.useRef(!1);N.useEffect(()=>()=>{S.current+=1,C.current+=1},[]);const F=()=>(E.current=!0,S.current+=1,o(!1),g(!1),S.current),A=({lat:P,lng:T})=>{w.current+=1,a({lat:P,lng:T,zoom:At,id:w.current})},B=(P,T)=>{P===S.current&&(o(!1),e(T))},R=async(P,T)=>{e(null),o(!0);const $=await _n(T);B(P,{...T,city:$})};N.useEffect(()=>{if(!l||c!=="gps"||E.current)return;E.current=!0,S.current+=1;const P=S.current;A(l),R(P,l)},[l,c]);const D=P=>{const T=F();if(!bn(P.zoom)||!Bt(P.lat,P.lng)){e(null);return}R(T,{lat:P.lat,lng:P.lng})},_=async()=>{if(M.current)return;const P=F(),T=s;e(null),M.current=!0,f(!0);const $=await Sn();if(M.current=!1,f(!1),P===S.current){if(!$){e(T),g(!0);return}A($),await R(P,$)}},z=P=>{b(P),C.current+=1,P.trim().length<vt&&(h([]),k(!1),j(!1))},I=P=>{const T=F();C.current+=1,b(""),h([]),k(!1),j(!1);const $={lat:P.lat,lng:P.lng};if(A($),P.city){B(T,{...$,city:P.city});return}R(T,$)};return N.useEffect(()=>{const P=p.trim();if(P.length<vt)return;const T=C.current,$=setTimeout(async()=>{j(!0);const G=await Ss(P,Nn).catch(()=>[]);T===C.current&&(h(G),k(G.length===0),j(!1))},jn);return()=>clearTimeout($)},[p]),{initialView:r,flyTarget:n,status:kn(d,u,s!==null),cityLabel:s?.city??null,query:p,suggestions:v,searching:x,noResult:L,locateFailed:m,handleMapSettle:D,handleLocate:_,handleQueryChange:z,handleSelectPlace:I}}const wn=N.lazy(()=>Ye(()=>import("./OnboardingLocationMap-mcnP1pIa.js"),__vite__mapDeps([0,1,2,3])).then(s=>({default:s.OnboardingLocationMap})));function Pn(s){const e=U.c(76),{value:r,onChange:i,sessionLabelPlural
2:l,cityMissing:c}=s,{t:n}=le();let a;e[0]!==i||e[1]!==r?(a={value:r,onChange:i},e[0]=i,e[1]=r,e[2]=a):a=e[2];const{initialView:d,flyTarget:f,status:u,cityLabel:o,query:m,suggestions:g,searching:p,noResult:b,locateFailed:v,handleMapSettle:h,handleLocate:x,handleQueryChange:j,handleSelectPlace:L}=Cn(a);let k;e[3]!==j?(k=se=>{j(se.target.value)},e[3]=j,e[4]=k):k=e[4];const S=k;let C;e[5]!==x?(C=()=>{x()},e[5]=x,e[6]=C):C=e[6];const w=C;let E;e[7]!==n?(E=n("onboarding.location.title"),e[7]=n,e[8]=E):E=e[8];let M;e[9]===Symbol.for("react.memo_cache_sentinel")?(M=t.jsx("span",{className:"text-destructive ml-0.5",children:"*"}),e[9]=M):M=e[9];let F;e[10]!==E?(F=t.jsxs("p",{className:"text-sm font-semibold mb-1",children:[E,M]}),e[10]=E,e[11]=F):F=e[11];let A;e[12]!==l||e[13]!==n?(A=n("onboarding.location.subtitle",{sessionLabelPlural:l}),e[12]=l,e[13]=n,e[14]=A):A=e[14];let B;e[15]!==A?(B=t.jsx("p",{className:"text-xs text-muted-foreground mb-4",children:A}),e[15]=A,e[16]=B):B=e[16];let R;e[17]===Symbol.for("react.memo_cache_sentinel")?(R=t.jsx("div",{className:"h-full w-full animate-pulse bg-muted"}),e[17]=R):R=e[17];let D;e[18]!==f||e[19]!==h||e[20]!==d?(D=t.jsx(N.Suspense,{fallback:R,children:t.jsx(wn,{initialView:d,flyTarget:f,onUserSettle:h})}),e[18]=f,e[19]=h,e[20]=d,e[21]=D):D=e[21];let _;e[22]!==o||e[23]!==u?(_=t.jsx(Ln,{status:u,cityLabel:o}),e[22]=o,e[23]=u,e[24]=_):_=e[24];const z=u==="locating";let I;e[25]!==n?(I=n("cityAutocomplete.locateMe"),e[25]=n,e[26]=I):I=e[26];let P;e[27]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"h-5 w-5","aria-hidden":"true",children:[t.jsx("circle",{cx:"12",cy:"12",r:"7"}),t.jsx("circle",{cx:"12",cy:"12",r:"2.5",fill:"currentColor"}),t.jsx("path",{d:"M12 2v3"}),t.jsx("path",{d:"M12 19v3"}),t.jsx("path",{d:"M2 12h3"}),t.jsx("path",{d:"M19 12h3"})]}),e[27]=P):P=e[27];let T;e[28]!==w||e[29]!==z||e[30]!==I?(T=t.jsx("button",{type:"button",onClick:w,disabled:z,"aria-label":I,className:"absolute top-3 right-3 flex h-11 w-11 items-center justify-center rounded-full bg-foreground text-background shadow-lg transition-opacity disabled:opacity-60",children:P}),e[28]=w,e[29]=z,e[30]=I,e[31]=T):T=e[31];let $;e[32]!==D||e[33]!==_||e[34]!==T?($=t.jsxs("div",{className:"relative w-full h-[min(18rem,40vh)] rounded-xl overflow-hidden border border-border bg-muted",children:[D,_,T]}),e[32]=D,e[33]=_,e[34]=T,e[35]=$):$=e[35];let G;e[36]!==n?(G=n("onboarding.location.searchPlaceholder"),e[36]=n,e[37]=G):G=e[37];let J;e[38]!==n?(J=n("onboarding.location.searchLabel"),e[38]=n,e[39]=J):J=e[39];const ie=p&&"pr-9";let ne;e[40]!==ie?(ne=Q(ie),e[40]=ie,e[41]=ne):ne=e[41];let X;e[42]!==S||e[43]!==m||e[44]!==G||e[45]!==J||e[46]!==ne?(X=t.jsx(Te,{type:"search",enterKeyHint:"search",value:m,onChange:S,placeholder:G,"aria-label":J,...ks,className:ne}),e[42]=S,e[43]=m,e[44]=G,e[45]=J,e[46]=ne,e[47]=X):X=e[47];let Y;e[48]!==p?(Y=p&&t.jsx("span",{"aria-hidden":"true",className:"absolute right-3 top-1/2 h-4 w-4 -translate-y-1/2 animate-spin rounded-full border-2 border-primary border-t-transparent"}),e[48]=p,e[49]=Y):Y=e[49];let oe;e[50]!==X||e[51]!==Y?(oe=t.jsxs("div",{className:"relative",children:[X,Y]}),e[50]=X,e[51]=Y,e[52]=oe):oe=e[52];let ee;e[53]!==L||e[54]!==g?(ee=g.length>0&&t.jsx("ul",{className:"mt-2 overflow-hidden rounded-md border border-border bg-card",children:g.map((se,ue)=>t.jsx("li",{children:t.jsx(En,{place:se,onSelect:L})},`${se.lat},${se.lng},${ue}`))}),e[53]=L,e[54]=g,e[55]=ee):ee=e[55];let te;e[56]!==b||e[57]!==n?(te=b&&t.jsx("p",{className:"mt-2 text-xs text-muted-foreground",children:n("onboarding.location.noResult")}),e[56]=b,e[57]=n,e[58]=te):te=e[58];let ae;e[59]!==v||e[60]!==n?(ae=v&&t.jsx("p",{role:"alert",className:"mt-2 text-xs text-destructive",children:n("onboarding.location.locateFailed")}),e[59]=v,e[60]=n,e[61]=ae):ae=e[61];let W;e[62]!==c||e[63]!==n?(W=c&&t.jsx("p",{role:"alert",className:"mt-2 text-xs text-destructive",children:n("onboarding.location.cityMissing")}),e[62]=c,e[63]=n,e[64]=W):W=e[64];let H;e[65]!==oe||e[66]!==ee||e[67]!==te||e[68]!==ae||e[69]!==W?(H=t.jsxs("div",{className:"mt-4",children:[oe,ee,te,ae,W]}),e[65]=oe,e[66]=ee,e[67]=te,e[68]=ae,e[69]=W,e[70]=H):H=e[70];let Z;return e[71]!==$||e[72]!==H||e[73]!==F||e[74]!==B?(Z=t.jsxs(de,{className:"p-5",children:[F,B,$,H]}),e[71]=$,e[72]=H,e[73]=F,e[74]=B,e[75]=Z):Z=e[75],Z}function Ln(s){const e=U.c(9),{status:r,cityLabel:i}=s;let l;e[0]!==i||e[1]!==r?(l=t.jsx(On,{status:r,cityLabel:i}),e[0]=i,e[1]=r,e[2]=l):l=e[2];let c;e[3]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx("span",{"aria-hidden":"true",className:"absolute left-1/2 top-full -translate-x-1/2 border-x-[6px] border-t-[6px] border-x-trans
2parent border-t-foreground"}),e[3]=c):c=e[3];let n;e[4]!==l?(n=t.jsxs("div",{role:"status","aria-live":"polite",className:"relative mb-1.5 flex max-w-[14rem] items-center gap-1.5 rounded-lg bg-foreground px-3 py-1.5 text-sm font-medium text-background shadow-lg",children:[l,c]}),e[4]=l,e[5]=n):n=e[5];let a;e[6]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:"h-8 w-8 text-primary drop-shadow","aria-hidden":"true",children:[t.jsx("path",{d:"M20 10c0 6-8 12-8 12s-8-6-8-12a8 8 0 0 1 16 0Z"}),t.jsx("circle",{cx:"12",cy:"10",r:"3",fill:"white"})]}),e[6]=a):a=e[6];let d;return e[7]!==n?(d=t.jsxs("div",{className:"pointer-events-none absolute left-1/2 top-1/2 flex -translate-x-1/2 -translate-y-full flex-col items-center",children:[n,a]}),e[7]=n,e[8]=d):d=e[8],d}function On(s){const e=U.c(19),{status:r,cityLabel:i}=s,{t:l}=le();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx("span",{className:"h-3.5 w-3.5 shrink-0 animate-spin rounded-full border-2 border-background border-t-transparent"}),e[0]=c):c=e[0];const n=c;switch(r){case"locating":{let a;e[1]!==l?(a=l("onboarding.location.locating"),e[1]=l,e[2]=a):a=e[2];let d;return e[3]!==a?(d=t.jsxs(t.Fragment,{children:[n,t.jsx("span",{children:a})]}),e[3]=a,e[4]=d):d=e[4],d}case"resolving":{let a;e[5]!==l?(a=l("onboarding.location.resolving"),e[5]=l,e[6]=a):a=e[6];let d;return e[7]!==a?(d=t.jsxs(t.Fragment,{children:[n,t.jsx("span",{children:a})]}),e[7]=a,e[8]=d):d=e[8],d}case"picked":{let a;e[9]!==i||e[10]!==l?(a=i??l("onboarding.location.pinnedNoCity"),e[9]=i,e[10]=l,e[11]=a):a=e[11];let d;return e[12]!==a?(d=t.jsx("span",{className:"truncate",children:a}),e[12]=a,e[13]=d):d=e[13],d}case"empty":{let a;e[14]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(ze,{name:"alert-triangle",className:"h-4 w-4 shrink-0"}),e[14]=a):a=e[14];let d;e[15]!==l?(d=l("onboarding.location.zoomIn"),e[15]=l,e[16]=d):d=e[16];let f;return e[17]!==d?(f=t.jsxs(t.Fragment,{children:[a,t.jsx("span",{children:d})]}),e[17]=d,e[18]=f):f=e[18],f}}}function En(s){const e=U.c(11),{place:r,onSelect:i}=s;let l;e[0]!==i||e[1]!==r?(l=()=>i(r),e[0]=i,e[1]=r,e[2]=l):l=e[2];const c=l;let n;e[3]!==r.label?(n=t.jsx("span",{className:"font-medium",children:r.label}),e[3]=r.label,e[4]=n):n=e[4];let a;e[5]!==r.detail?(a=r.detail&&t.jsx("span",{className:"text-xs text-muted-foreground",children:r.detail}),e[5]=r.detail,e[6]=a):a=e[6];let d;return e[7]!==c||e[8]!==n||e[9]!==a?(d=t.jsxs("button",{type:"button",onMouseDown:Rn,onClick:c,className:"flex w-full flex-col items-start px-3 py-2 text-left text-sm transition-colors hover:bg-muted",children:[n,a]}),e[7]=c,e[8]=n,e[9]=a,e[10]=d):d=e[10],d}function Rn(s){s.preventDefault()}function An(){const s=U.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsxs("svg",{"aria-hidden":"true",className:"mt-0.5 shrink-0 w-5 h-5 text-primary",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[t.jsx("path",{d:"M20 10c0 6-8 12-8 12s-8-6-8-12a8 8 0 0 1 16 0Z"}),t.jsx("circle",{cx:"12",cy:"10",r:"3"})]}),s[0]=e):e=s[0],e}function Bn(){const s=U.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsxs("svg",{"aria-hidden":"true",className:"mt-0.5 shrink-0 w-5 h-5 text-primary",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[t.jsx("path",{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10Z"}),t.jsx("path",{d:"m9 12 2 2 4-4"})]}),s[0]=e):e=s[0],e}function In(){const s=U.c(26),{t:e}=le();let r;s[0]!==e?(r=e("onboarding.privacy.point1.title"),s[0]=e,s[1]=r):r=s[1];let i;s[2]!==e?(i=e("onboarding.privacy.point1.body"),s[2]=e,s[3]=i):i=s[3];let l;s[4]!==r||s[5]!==i?(l={Icon:An,title:r,body:i},s[4]=r,s[5]=i,s[6]=l):l=s[6];let c;s[7]!==e?(c=e("onboarding.privacy.point3.title"),s[7]=e,s[8]=c):c=s[8];let n;s[9]!==e?(n=e("onboarding.privacy.point3.body"),s[9]=e,s[10]=n):n=s[10];let a;s[11]!==c||s[12]!==n?(a={Icon:Bn,title:c,body:n},s[11]=c,s[12]=n,s[13]=a):a=s[13];let d;s[14]!==l||s[15]!==a?(d=[l,a],s[14]=l,s[15]=a,s[16]=d):d=s[16];const f=d;let u;s[17]!==e?(u=e("onboarding.privacy.reassureTitle"),s[17]=e,s[18]=u):u=s[18];let o;s[19]!==u?(o=t.jsx("p",{className:"text-sm font-semibold mb-3",children:u}),s[19]=u,s[20]=o):o=s[20];let m;s[21]!==f?(m=t.jsx("div",{className:"flex flex-col gap-3",children:f.map(Mn)}),s[21]=f,s[22]=m):m=s[22];let g;return s[23]!==o||s[24]!==m?(g=t.jsxs(de,{className:"p-4","data-testid":"onboarding-privacy-panel",children:[o,m]}),s[23]=o,s[24]=m,s[25]=g):g=s[25],g}function Mn(s){return t.jsxs("div",{className:"flex items-start gap-3",children:[t.jsx(s.Icon,{}),t.jsxs("div",{children:[t.jsx("p",{className:"text-sm font-medium leading-none",children:s.title}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:s.body})]})]},s.title)}function It(s){return s==="female"?"ðââï¸":s==="male"?"ðââï¸":"ð"}function Fn(s,e,r){const{avatarSet:i,avatarResetKind:l}=Le(s).modes;return l==="none"||i.includes(e)?e:l==="genderDefault"?It(r):i[0]}function Tn(s){const e=U.c(28),{sports:r,selected:i,onToggle:l}=s,{t:c}=le();if(r.length===0)return null;let n;e[0]!==c?(n=c("onboardingOtherSports.title"),e[0]=c,e[1]=n):n=e[1];let a;e[2]!==n?(a=t.jsx("h2",{className:"text-xl font-bold",children:n}),e[2]=n,e[3]=a):a=e[3];let d;e[4]!==c?(d=c("onboardingOtherSports.subtitle"),e[4]=c,e[5]=d):d=e[5];let f;e[6]!==d?(f=t.jsx("p",{className:"mt-1 text-sm text-muted-foreground text-balance",children:d}),e[6]=d,e[7]=f):f=e[7];let u;e[8]!==a||e[9]!==f?(u=t.jsxs("div",{className:"text-center",children:[a,f]}),e[8]=a,e[9]=f,e[10]=u):u=e[10];let o;if(e[11]!==l||e[12]!==i||e[13]!==r){let v;e[15]!==l||e[16]!==i?(v=h=>{const x=i.includes(h.id);return t.jsx("button",{type:"button",role:"checkbox","aria-checked":x,onClick:()=>l(h.id),className:"w-[calc((100%-0.75rem)/2)]",children:t.jsxs(de,{className:Q("h-full py-4 px-2 cursor-pointer transition-colors","flex flex-col items-center justify-center gap-2 text-center",x?"border-primary bg-primary/10":"hover:border-primary hover:bg-primary/5"),children:[t.jsx(Cs,{sport:h.id,size:28}),t.jsx("p",{className:"font-semibold text-foreground text-sm leading-tight",children:h.label})]})},h.id)},e[15]=l,e[16]=i,e[17]=v):v=e[17],o=r.map(v),e[11]=l,e[12]=i,e[13]=r,e[14]=o}else o=e[14];let m;e[18]!==o?(m=t.jsx("div",{className:"flex flex-wrap justify-center gap-3",children:o}),e[18]=o,e[19]=m):m=e[19];let g;e[20]!==c?(g=c("onboardingOtherSports.hint"),e[20]=c,e[21]=g):g=e[21];let p;e[22]!==g?(p=t.jsx("p",{className:"text-center text-xs text-muted-foreground text-balance",children:g}),e[22]=g,e[23]=p):p=e[23];let b;return e[24]!==u||e[25]!==m||e[26]!==p?(b=t.jsxs("div",{"data-testid":"onboarding-other-sports-step",className:"flex flex-col gap-4 py-2",children:[u,m,p]}),e[24]=u,e[25]=m,e[26]=p,e[27]=b):b=e[27],b}function Ta({currentUser:s,sport:e="padel",onCancel:r,onFinished:i}){const{t:l}=le(),c=e==="running",n=Le(e),{profile:a,session:d,updateProfile:f,refetchProfile:u}=ws(),o=Ps(s.id),[m,g]=N.useState(!1),[p,b]=N.useState(!1),{submitFaceVerdict:v}=Rl(),{enabled:h}=ke("identity_verification"),x=s.onboardingCompletedSports??[],j=x.length>0,{enabled:L}=ke("onboarding_phone_step"),{enabled:k}=ke("onboarding_club_step"),{enabled:S}=ke("onboarding_other_sports_step"),{enabled:C}=ke("onboarding_sport_skip_all"),{enabled:w}=ke("onboarding_photo_required"),{enabled:E}=ke("onboarding_privacy_reassurance"),M=a?.lat!=null&&a?.lng!=null?{lat:a.lat,lng:a.lng}
2:null,{hasNearby:F,clubs:A}=Xl(k&&!j?M:null,e,30),B=!j,R=[a?.level,a?.running_level,a?.foot5_level,a?.tennis_level].map(y=>y??"").join("|"),{suggestions:D}=Wl(B?s.id:null,M?.lat??null,M?.lng??null,30,[e],R),[_,z]=N.useState(0),[I]=N.useState(()=>Ls()),[P,T]=N.useState(!1),$=Os(d?.user?.email).filter(y=>y.id!==e),G=S&&!j&&!I&&$.length>0,[J,ie]=N.useState(()=>(a?.declared_sports??[]).filter(y=>$.some(V=>V.id===y))),ne=y=>{ie(V=>V.includes(y)?V.filter(ce=>ce!==y):[...V,y])},X=Le(e).modes.onboardingSteps,Y={hasExistingProfile:j,phoneStepEnabled:L,withCertifStep:h&&!j,withClubStepEnabled:F&&!j,withOtherSportsStepEnabled:G},oe=Es(jt(X,{...Y,withBuddizStepEnabled:!1,withOtherSportsStepEnabled:!1})).indexOf("buddiz"),ee=B&&D.length>0,[te,ae]=N.useState(!1);_<oe&&te!==ee&&ae(ee);const W=jt(X,{...Y,withBuddizStepEnabled:te}),[H,Z]=N.useState("pitch"),se=W[_],[ue,K]=N.useState(se);ue!==se&&(K(se),Z("pitch"));const[me,Ce]=N.useState(()=>Fn(e,s.avatar,s.gender??null)),[fe,he]=N.useState(s.avatarUrl??null),[ye,Se]=N.useState(!1),[ve,_e]=N.useState(!1),[je,ge]=N.useState(null),[Mt,$e]=N.useState(!1),[Ft,Tt]=N.useState(!1),[et,Dt]=N.useState(s.phone??""),[tt,zt]=N.useState(s.preferredSide??null),[st,$t]=N.useState(s.skillBadges??[]),[we,Vt]=N.useState(()=>Al(s.firstName??"",d?.user?.email)?"":s.firstName??""),[Pe,Kt]=N.useState(s.lastName??""),[Oe,Ut]=N.useState(s.dateOfBirth??""),[Ne,Gt]=N.useState(()=>hn(s)),Ve=Ne?.city?.trim()||s.city?.trim()||null,[Be,Ht]=N.useState(null),[Ie,qt]=N.useState(s.gender??null),[lt,Wt]=N.useState([]),[nt,Zt]=N.useState([]),[at,Qt]=N.useState(null),[Ke,it]=N.useState(null),[Ue,rt]=N.useState(null),[Ge,ot]=N.useState(null),[He,ct]=N.useState(null),[dt,Jt]=N.useState(null),[ft,Xt]=N.useState(null),[be,re]=N.useState(!1),qe=Rs(),{pickSelfie:Yt,pickFromGallery:es}=As(),{uploadAvatar:ts,removeAvatar:ss,uploading:Me,stage:ls}=Bs(s.id),O=W[_],ut=_===W.length-1,ns=(I||C)&&!j&&fl(O),mt=o.isSubscribed||m,Fe=O==="notifications"&&o.isSupported&&!mt,as=O==="notifications"&&!Fe;N.useEffect(()=>{Fe&&Is(s.id)},[Fe,s.id]),cn(O,e,w);const We=Ms({avatarUrl:fe,avatarIsMonogram:s.avatarIsMonogram}),[pt,is]=N.useState(null),rs=pt!==null&&pt===fe,Ze=w&&!We&&!ve,os=un({active:O==="avatar"&&Ze,uploadFailed:ye}),gt=async()=>{re(!0);const y=s.onboardingCompletedSports??[],V=y.includes(e)?y:[...y,e],ce=a?.declared_sports??[],xe=Jl(ce,e),{error:Ee}=await f({onboarding_completed_sports:V,...xe.length!==ce.length?{declared_sports:xe}:{}});if(Ee){q.error(l("onboarding.saveError")),re(!1);return}if(Ae("onboarding_completed",{sport:e,is_first_sport:y.length===0,photo_required:w,has_photo:We,photo_gate_bypassed:ve,sport_skip_offered:(I||C)&&!j,sport_steps_skipped:P}),bl(),y.length===0&&(hl("CompleteRegistration",{content_name:"onboarding",sport:e}),vl("CompleteRegistration",{sport:e}),jl(),Nl()),y.length===0){const ps=yl(s),{title:gs,body:xs}=Sl.newUserRegistered(ps);_l({type:"new_user_registered",title:gs,body:xs,url:`/?profile=${s.id}`})}re(!1),i?.({isFirstSport:y.length===0})},Qe=async y=>{if(!be){if(re(!0),O==="profile"){if(!we.trim()){q.error(l("onboarding.profile.firstNameRequired")),re(!1);return}if(we.trim().length<2){q.error(l("onboarding.profile.firstNameMin")),re(!1);return}if(!Pe.trim()){q.error(l("onboarding.profile.lastNameRequired")),re(!1);return}if(Pe.trim().length<2){q.error(l("onboarding.profile.lastNameMin")),re(!1);return}const V=Ct(we);if(!V.valid){q.error(wt()[V.reason]),re(!1);return}const ce=Ct(Pe);
2if(!ce.valid){q.error(wt()[ce.reason]),re(!1);return}if(we.trim().toLowerCase()===Pe.trim().toLowerCase()){q.error(l("onboarding.profile.namesMustDiffer")),re(!1);return}if(!s.dateOfBirth){if(!Oe){q.error(l("onboarding.profile.dateOfBirthRequired")),re(!1);return}if(!gl(Oe)){q.error(l("onboarding.profile.dateOfBirthInvalid")),re(!1);return}}if(!Ie){q.error(l("onboarding.profile.genderRequired")),re(!1);return}const{error:xe}=await f({first_name:yt(we.trim()),last_name:yt(Pe.trim()),...!s.dateOfBirth&&{date_of_birth:Oe},gender:Ie});if(xe){q.error(l("onboarding.saveError")),re(!1);return}if(c&&!fe){const Ee=It(Ie);Ce(Ee)}}else if(O==="location"){if(!Ne||!Ve){re(!1);return}const{error:V}=await f({lat:Ot(Ne.lat),lng:Ot(Ne.lng),...Ne.city&&{city:Ne.city}});if(V){q.error(l("onboarding.saveError")),re(!1);return}}else if(O==="avatar")await f({avatar:me,avatar_url:fe}),!w&&!fe&&!Ft&&(Tt(!0),$e(!0));else if(O==="phone")await f({phone:et||null});else if(O==="game")await f({preferred_side:tt,...Be!=null?{level:Be}:{}});else if(O==="running_profile")await f({running_level:at,running_pace_min:Ke,running_pace_max:Ue,running_distance_min:Ge,running_distance_max:He});else if(O==="surfaces")await f({preferred_surfaces:lt});else if(O!=="hiking_profile"){if(O==="hiking_surfaces")await f({preferred_hiking_surfaces:nt});else if(O==="foot5_profile")await f({foot5_level:dt});else if(O==="tennis_profile")await f({tennis_level:ft});else if(O==="badges"){const V=a?.skill_badges??[],ce=Object.keys(Le(e).modes.skillBadgeSet.badges),xe=V.filter(Ee=>!ce.includes(Ee));await f({skill_badges:[...xe,...st]})}else if(O==="other_sports"){const V=Pt(J,x);if(!Ql(V,a?.declared_sports??[])){const{error:ce}=await f({declared_sports:V});ce&&q.error(l("onboardingOtherSports.saveError"))}Ae("onboarding_other_sports",{sport:e,declared_count:V.length,offered_count:$.length})}else if(O==="notifications"){const V=[...new Set([e,...G?Pt(a?.declared_sports??[],x):[]])];(await Promise.all(V.map(xe=>xl({userId:s.id,sport:xe,enabled:y,source:"onboarding"})))).some(xe=>xe.error)&&q.error(l("onboarding.notifications.alertsError"))}}re(!1),ut?await gt():z(_+1)}},cs=async()=>{T(!0),q.success(l("onboarding.sportSkip.done"),{id:"onboarding-sport-skip"});const y=ul(W,_);if(y>=W.length){await gt();return}z(y)},ds=async()=>{if(p)return;b(!0);const{error:y}=await o.subscribe("onboarding");b(!1),y?q.error(l(y==="Permission denied"?"onboarding.notifications.permissionDenied":"onboarding.notifications.activateError")):g(!0),await Qe(!0)},xt=()=>Qe(!0),fs=y=>{y.runningPaceMin!==void 0&&it(y.runningPaceMin),y.runningPaceMax!==void 0&&rt(y.runningPaceMax),y.runningDistanceMin!==void 0&&ot(y.runningDistanceMin),y.runningDistanceMax!==void 0&&ct(y.runningDistanceMax)},bt=()=>Qe(!1),us=async y=>{const{url:V,error:ce,reframed:xe}=await ts(y);ce?(q.error(ce),Se(!0)):V&&(he(V),q.success(l(xe?"photoAvatar.photoReframed":"onboarding.avatar.photoUpdated")))},ms=async()=>{const{error:y}=await ss();if(y){q.error(y);return}he(null),q.success(l("onboarding.avatar.photoRemoved"))},ht=()=>{be||Me||z(y=>Math.max(0,y-1))};Rt(je!=null||H==="capture"||_>0,()=>{if(je){ge(null);return}if(H==="capture"){Z("pitch");return}ht()});const Je=_>0&&t.jsx(pe,{variant:"outline",className:"shrink-0 px-4","aria-label":l("common.back"),onClick:ht,disabled:be||Me,children:t.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:t.jsx("polyline",{points:"15 18 9 12 15 6"})})});return je?t.jsx("div",{className:"fixed inset-0 bg-background",children:t.jsx(Hl,{club:je,currentUserId:s.id,userPosition:M,onBack:()=>ge(null)})}):t.jsxs("div",{className:"fixed inset-0 bg-background flex flex-col overflow-hidden",children:[t.jsxs("div",{className:"shrink-0 px-6 text-center relative",style:{paddingTop:"calc(1rem + env(safe-area-inset-top))"},children:[r&&j&&t.jsx("button",{type:"button",onClick:r,className:"absolute left-4 text-xs font-semibold text-muted-foreground hover:text-foreground bg-transparent border-0 cursor-pointer",style:{to
2p:"calc(1rem + env(safe-area-inset-top))"},children:l("common.cancel",{defaultValue:"Annuler"})}),t.jsx(Fs,{className:Q("mx-auto transition-all",_===0&&!qe?"h-14 mb-3":"h-8 mb-2")}),_===0&&!qe&&t.jsxs(t.Fragment,{children:[t.jsx("h1",{className:"text-xl font-bold text-foreground",children:j?l("onboarding.welcomeReturning",{appName:Nt.appName,sportLabel:Le(e).label}):l("onboarding.welcomeNew",{appName:Nt.appName})}),t.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:l(j?"onboarding.subtitleReturning":"onboarding.subtitleNew")})]})]}),t.jsx("div",{className:"flex justify-center gap-2 py-3 shrink-0",children:W.map((y,V)=>t.jsx("div",{className:Q("h-2 rounded-full transition-all",V===_?"w-8 bg-primary":V<_?"w-2 bg-primary/60":"w-2 bg-border")},V))}),t.jsx("div",{"data-testid":"onboarding-step-scroll",className:"flex-1 px-4 pb-4 overflow-y-auto flex flex-col",children:t.jsxs("div",{className:Q("w-full flex flex-col",!qe&&O!=="running_profile"&&O!=="hiking_profile"&&O!=="badges"&&O!=="club"&&O!=="buddiz"&&"my-auto"),children:[O==="profile"&&t.jsx(Dn,{firstName:we,lastName:Pe,dateOfBirth:Oe,dateOfBirthLocked:!!s.dateOfBirth,gender:Ie,onFirstNameChange:Vt,onLastNameChange:Kt,onDateOfBirthChange:Ut,onGenderChange:qt}),O==="profile"&&E&&t.jsx("div",{className:"mt-4",children:t.jsx(In,{})}),O==="location"&&t.jsx(Pn,{value:Ne,onChange:Gt,cityMissing:Ne!=null&&Ve==null,sessionLabelPlural:n.sessionLabelPlural}),O==="avatar"&&t.jsx($n,{avatarUrl:fe,currentUser:{...s,avatar:me,avatarUrl:fe},avatarUploading:Me,avatarStage:ls,gateBlocking:Ze,escapeAvailable:os,onEscape:()=>_e(!0),pickSelfie:Yt,pickFromGallery:es,onPhotoUpload:us,onPhotoRemove:ms}),O==="certif"&&H==="pitch"&&t.jsx(Un,{hasAvatarPhoto:We,photoRejected:rs,onCertify:()=>{Ts({surface:"onboarding"}),Z("capture")},onAddPhoto:()=>{const y=W.indexOf("avatar");y>=0&&z(y)},onSkip:()=>z(_+1)}),O==="certif"&&H==="capture"&&t.jsx(Bl,{referenceAvatarUrl:fe??"",onVerdict:async y=>{if(y.kind==="match"){const{success:V}=await v(y);if(V){try{await u()}catch{}Z("pitch"),z(_+1);return}q.error(l("onboarding.certif.errorBackend",{defaultValue:"La certification n'a pas abouti. Réessaie ou continue sans pour l'instant."}))}else{Ds({reason:y.kind,surface:"onboarding",distance:y.kind==="no_match"?y.distance:void 0,stats:y.kind==="no_face"?y.stats:void 0}),y.kind==="no_face_in_avatar"&&is(fe);const V=y.kind==="no_face"?"onboarding.certif.errorNoFace":y.kind==="no_match"?"onboarding.certif.errorNoMatch":y.kind==="no_face_in_avatar"?"onboarding.certif.errorNoFaceInAvatar":y.kind==="permission_denied"?"onboarding.certif.errorPermission":"onboarding.certif.errorGeneric",ce=y.kind==="no_face"?"On n'a pas détecté de visage. Réessaie en bonne lumière, face caméra.":y.kind==="no_match"?"Le visage ne correspond pas à ta photo de profil.":y.kind==="no_face_in_avatar"?"Aucun visage détecté sur ta photo de profil. Change-la et réessaie.":y.kind==="permission_denied"?"Autorise l'accès à la caméra pour te certifier.":"Une erreur est survenue. Réessaie ou continue sans pour l'instant.";q.error(l(V,{defaultValue:ce}))}Z("pitch")},onCancel:()=>Z("pitch")}),O==="phone"&&t.jsx(Vn,{phone:et,onPhoneChange:Dt,sessionLabelPlural:n.sessionLabelPlural}),O==="game"&&t.jsx(Kn,{preferredSide:tt,level:Be,onSideChange:zt,onLevelChange:Ht}),O==="running_profile"&&t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsx(en,{currentUser:s,dateOfBirth:s.dateOfBirth??(Oe||null),declared:{runningPaceMin:Ke,runningPaceMax:Ue,runningDistanceMin:Ge,runningDistanceMax:He},onApply:fs}),t.jsx(qn,{level:at,paceMin:Ke,paceMax:Ue,distanceMin:Ge,distanceMax:He,onLevelChange:Qt,onPaceChange:(y,V)=>{it(y),rt(V)},onDistanceChange:(y,V)=>{ot(y),ct(V)}})]}),O==="surfaces"&&t.jsx(Zn,{selected:lt,onSelectionChange:Wt}),O==="hiking_profile"&&t.jsx(Yn,{}),O==="hiking_surfaces"&&t.jsx(ea,{selected:nt,onSelectionChange:Zt}),O==="foot5_profile"&&t.jsx(Qn,{level:dt,onLevelChange:Jt}),O==="tennis_profile"&&t.jsx(Jn,{level:ft,onLevelChange:Xt}),O==="badges"&&t.jsx(Gn,{selected:st,onSelectionChange:$t,sport:e}),O==="club"&&t.jsx(tn,{clubs:A,currentUserId:s.id,onOpenClub:ge}),O==="buddiz"&&t.jsx(nn,{suggestions:D,currentUserId:s.id,sessionLabelPlural
2:n.sessionLabelPlural}),O==="other_sports"&&t.jsx(Tn,{sports:$,selected:J,onToggle:ne}),O==="notifications"&&t.jsx(Hn,{isSupported:o.isSupported,enabled:mt,sessionLabel:n.sessionLabel})]})},O),O==="certif"&&H==="pitch"&&Je&&t.jsx("div",{className:"shrink-0 p-4 flex gap-3",style:{paddingBottom:"calc(1rem + env(safe-area-inset-bottom))"},children:Je}),O!=="certif"&&t.jsxs("div",{className:"shrink-0 p-4 flex gap-3",style:{paddingBottom:"calc(1rem + env(safe-area-inset-bottom))"},children:[Je,Fe?t.jsxs("div",{className:"flex flex-1 flex-col gap-2",children:[t.jsx(pe,{className:"w-full",onClick:ds,disabled:be||p,"data-umami-event":"onboarding-step",children:l(p?"onboarding.notifications.activating":"onboarding.notifications.activate")}),t.jsx(pe,{variant:"ghost",className:"w-full text-muted-foreground",onClick:bt,disabled:be||p,"data-umami-event":"onboarding-step",children:l("onboarding.notifications.later")})]}):as?t.jsxs("div",{className:"flex flex-1 flex-col gap-2",children:[t.jsx(pe,{className:"w-full",onClick:xt,disabled:be,"data-umami-event":"onboarding-step",children:l("onboarding.notifications.alertYes")}),t.jsx(pe,{variant:"ghost",className:"w-full text-muted-foreground",onClick:bt,disabled:be,"data-umami-event":"onboarding-step",children:l("onboarding.notifications.later")})]}):t.jsxs("div",{className:"flex flex-1 flex-col gap-2",children:[t.jsx(pe,{className:"w-full",onClick:xt,disabled:be||Me||O==="avatar"&&Ze||O==="game"&&Be==null||O==="location"&&(Ne==null||Ve==null),"data-umami-event":"onboarding-step",children:be?t.jsx("div",{className:"h-5 w-5 border-2 border-primary-foreground border-t-transparent rounded-full animate-spin"}):l(ut?"onboarding.finish":"onboarding.next")}),ns&&t.jsx(pe,{variant:"ghost",className:"w-full text-muted-foreground",onClick:cs,disabled:be,"data-umami-event":"onboarding-sport-skip",children:l("onboarding.sportSkip.cta")})]})]}),Mt&&t.jsx(pn,{onSelect:y=>{Ae("onboarding_survey_response",{step:"avatar",reason:y}),$e(!1)},onDismiss:()=>$e(!1)})]})}function Dn(s){const e=U.c(115),{firstName:r,lastName:i,dateOfBirth:l,dateOfBirthLocked:c,gender:n,onFirstNameChange:a,onLastNameChange:d,onDateOfBirthChange:f,onGenderChange:u}=s,{t:o}=le(),m=zn;let g;e[0]!==o?(g=o("onboarding.profile.female"),e[0]=o,e[1]=g):g=e[1];let p;e[2]!==g?(p={value:"female",label:g},e[2]=g,e[3]=p):p=e[3];let b;e[4]!==o?(b=o("onboarding.profile.male"),e[4]=o,e[5]=b):b=e[5];let v;e[6]!==b?(v={value:"male",label:b},e[6]=b,e[7]=v):v=e[7];let h;e[8]!==o?(h=o("onboarding.profile.other"),e[8]=o,e[9]=h):h=e[9];let x;e[10]!==h?(x={value:"other",label:h},e[10]=h,e[11]=x):x=e[11];let j;e[12]!==p||e[13]!==v||e[14]!==x?(j=[p,v,x],e[12]=p,e[13]=v,e[14]=x,e[15]=j):j=e[15];const L=j;let k;e[16]!==o?(k=o("onboarding.profile.title"),e[16]=o,e[17]=k):k=e[17];let S;e[18]!==k?(S=t.jsx("p",{className:"text-sm font-semibold mb-1",children:k}),e[18]=k,e[19]=S):S=e[19];let C;e[20]!==o?(C=o("onboarding.profile.subtitle"),e[20]=o,e[21]=C):C=e[21];let w;e[22]!==C?(w=t.jsx("p",{className:"text-xs text-muted-foreground mb-4",children:C}),e[22]=C,e[23]=w):w=e[23];let E;e[24]!==o?(E=o("onboarding.profile.firstName"),e[24]=o,e[25]=E):E=e[25];let M;e[26]===Symbol.for("react.memo_cache_sentinel")?(M=t.jsx("span",{className:"text-destructive ml-0.5",children:"*"}),e[26]=M):M=e[26];let F;e[27]!==E?(F=t.jsxs("label",{className:"block text-xs font-semibold text-muted-foreground uppercase tracking-wide mb-1.5",children:[E,M]}),e[27]=E,e[28]=F):F=e[28];let A;e[29]!==o?(A=o("onboarding.profile.firstName"),e[29]=o,e[30]=A):A=e[30];let B;e[31]!==a?(B=ge=>a(ge.target.value),e[31]=a,e[32]=B):B=e[32];let R;e[33]!==r||e[34]!==A||e[35]!==B?(R=t.jsx(Te,{type:"text",enterKeyHint:"done",placeholder:A,value:r,onChange:B,onKeyDown:m}),e[33]=r,e[34]=A,e[35]=B,e[36]=R):R=e[36];let D;e[37]!==F||e[38]!==R?(D=t.jsxs("div",{children:[F,R]}),e[37]=F,e[38]=R,e[39]=D):D=e[39];let _;e[40]!==o?(_=o("onboarding.profile.lastName"),e[40]=o,e[41]=_):_=e[41];let z;e[42]===Symbol.for("react.memo_cache_sentinel")?(z=t.jsx("span",{className:"text-destructive ml-0.5",children:"*"}),e[42]=z):z=e[42];let I;e[43]!==_?(I=t.jsxs("label",{className:"block text-xs font-semibold text-muted-foreground uppercase tracking-wide mb-1.5",children:[_,z]}),e[43]=_,e[44]=I):I=e[44];let P;e[45]!==o?(P=o("onboarding.profile.lastName"),e[45]=o,e[46]=P):P=e[46];let T;e[47]!==d?(T=ge=>d(ge.target.value),e[47]=d,e[48]=T):T=e[48];let $;e[49]!==i||e[50]!==P||e[51]!==T?($=t.jsx(Te,{type:"text",enterKeyHint:"done",placeholder:P,value:i,onChange:T,onKeyDown:m}),e[49]=i,e[50]=P,e[51]=T,e[52]=$):$=e[52];let G;e[53]!==I||e[54]!==$?(G=t.jsxs("div",{children:[I,$]}),e[53]=I,e[54]=$,e[55]=G):G=e[55];let J;e[56]!==D||e[57]!==G?(J=t.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[D,G]}),e[56]=D,e[57]=G,e[58]=J):J=e[58];let ie;e[59]!==o?(ie=o("onboarding.profile.nameVisibleNote"),e[59]=o,e[60]=ie):ie=e[60];let ne;e[61]!==ie?(ne=t.jsx("p",{className:"text-xs text-muted-foreground",children:ie}),e[61]=ie,e[62]=ne):ne=e[62];let X;e[63]!==J||e[64]!==ne?(X=t.jsxs("div",{className:"flex flex-col gap-1.5",children:[J,ne]}),e[63]=J,e[64]=ne,e[65]=X):X=e[65];let Y;e[66]!==o?(Y=o("onboarding.profile.dateOfBirth"),e[66]=o,e[67]=Y):Y=e[67];let oe;e[68]===Symbol.for("react.memo_cache_sentinel")?(oe=t.jsx("span",{className:"text-destructive ml-0.5",children:"*"}),e[68]=oe):oe=e[68];let ee;e[69]!==Y?(ee=t.jsxs("label",{className:"block text-xs font-semibold text-muted-foreground uppercase tracking-wide mb-1.5",children:[Y,oe]}),e[69]=Y,e[70]=ee):ee=e[70];let te;e[71]!==f?(te=ge=>f(ge.target.value),e[71]=f,e[72]=te):te=e[72];let ae;e[73]===Symbol.for("react.memo_cache_sentinel")?(ae=new Date().toISOString().slice(0,10),e[73]=ae):ae=e[73];const W=c&&"opacity-60 cursor-not-allowed";let H;e[74]!==W?(H=Q(W),e[74]=W,e[75]=H):H=e[75];let Z;e[76]!==l||e[77]!==c||e[78]!==te||e[79]!==H?(Z=t.jsx(Te,{type:"date",value:l,onCh
2ange:te,min:"1900-01-01",max:ae,disabled:c,className:H}),e[76]=l,e[77]=c,e[78]=te,e[79]=H,e[80]=Z):Z=e[80];let se;e[81]!==c||e[82]!==o?(se=o(c?"onboarding.profile.dateOfBirthLocked":"onboarding.profile.dateOfBirthNote"),e[81]=c,e[82]=o,e[83]=se):se=e[83];let ue;e[84]!==se?(ue=t.jsx("p",{className:"text-xs text-muted-foreground mt-1.5",children:se}),e[84]=se,e[85]=ue):ue=e[85];let K;e[86]!==ee||e[87]!==Z||e[88]!==ue?(K=t.jsxs("div",{children:[ee,Z,ue]}),e[86]=ee,e[87]=Z,e[88]=ue,e[89]=K):K=e[89];let me;e[90]!==o?(me=o("onboarding.profile.gender"),e[90]=o,e[91]=me):me=e[91];let Ce;e[92]===Symbol.for("react.memo_cache_sentinel")?(Ce=t.jsx("span",{className:"text-destructive ml-0.5",children:"*"}),e[92]=Ce):Ce=e[92];let fe;e[93]!==me?(fe=t.jsxs("label",{className:"block text-xs font-semibold text-muted-foreground uppercase tracking-wide mb-1.5",children:[me,Ce]}),e[93]=me,e[94]=fe):fe=e[94];let he;e[95]!==n||e[96]!==L||e[97]!==u?(he=t.jsx("div",{className:"grid grid-cols-3 gap-2",children:L.map(ge=>t.jsx("button",{type:"button",className:Q("flex items-center justify-center px-3 py-2.5 rounded-xl border text-sm font-medium transition-all cursor-pointer",n===ge.value?"border-primary bg-primary/10":"border-border bg-card hover:border-primary/50"),onClick:()=>u(ge.value),children:t.jsx("span",{children:ge.label})},ge.value))}),e[95]=n,e[96]=L,e[97]=u,e[98]=he):he=e[98];let ye;e[99]!==o?(ye=o("onboarding.profile.genderNote"),e[99]=o,e[100]=ye):ye=e[100];let Se;e[101]!==ye?(Se=t.jsx("p",{className:"text-xs text-muted-foreground mt-1.5",children:ye}),e[101]=ye,e[102]=Se):Se=e[102];let ve;e[103]!==fe||e[104]!==he||e[105]!==Se?(ve=t.jsxs("div",{children:[fe,he,Se]}),e[103]=fe,e[104]=he,e[105]=Se,e[106]=ve):ve=e[106];let _e;e[107]!==X||e[108]!==K||e[109]!==ve?(_e=t.jsxs("div",{className:"flex flex-col gap-4",children:[X,K,ve]}),e[107]=X,e[108]=K,e[109]=ve,e[110]=_e):_e=e[110];let je;return e[111]!==w||e[112]!==_e||e[113]!==S?(je=t.jsxs(de,{className:"p-5",children:[S,w,_e]}),e[111]=w,e[112]=_e,e[113]=S,e[114]=je):je=e[114],je}function zn(s){s.key==="Enter"&&s.currentTarget.blur()}function $n({avatarUrl:s,currentUser:e,avatarUploading:r,avatarStage:i,gateBlocking:l,pickSelfie:c,pickFromGallery:n,onPhotoUpload:a,onPhotoRemove:d,escapeAvailable:f,onEscape:u}){const{t:o}=le(),[m,g]=N.useState(null),[p,b]=N.useState(!1),{checking:v,nudgeOpen:h,guardPhoto:x,useAnyway:j,chooseAnother:L}=zs("onboarding"),k=$s(),S=ml(v,i),C=Vs(),w=async(R,D)=>{try{const{file:_,permissionDenied:z}=await R();if(z){const{toast:I}=await Ye(async()=>{const{toast:P}=await import("./index-BxmgPWYo.js").then(T=>T.p7);return{toast:P}},__vite__mapDeps([1,2,3]));I.error(o(D));return}_&&g(URL.createObjectURL(_))}catch{const{toast:_}=await Ye(async()=>{const{toast:z}=await import("./index-BxmgPWYo.js").then(I=>I.p7);return{toast:z}},__vite__mapDeps([1,2,3]));_.error(o("onboarding.avatar.galleryError"))}},E=()=>{if(pl())return w(c,"onboarding.avatar.cameraPermissionDenied");b(!0)},M=R=>{b(!1),g(URL.createObjectURL(R))},F=()=>w(n,"onboarding.avatar.photoPermissionDenied"),A=async R=>{m&&URL.revokeObjectURL(m),g(null),k.show(R),await x(R,()=>a(R))},B=()=>{m&&URL.revokeObjectURL(m),g(null)};return m?t.jsx(Ks,{imageUrl:m,onCrop:A,onCancel:B}):t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsxs(de,{className:"p-5",children:[t.jsx("p",{className:"text-sm font-semibold mb-1",children:o("onboarding.avatar.photoTitle")}),t.jsx("p",{className:"text-xs text-muted-foreground mb-4",children:o("onboarding.avatar.photoSubtitle")}),t.jsx("div",{className:"flex flex-col items-center gap-2 mb-4",children:S&&k.url?t.jsx(Us,{previewUrl:k.url,stage:S}):t.jsxs(t.Fragment,{children:[t.jsx(Gs,{user:e,size:96,onPhotoClick:E}),s&&t.jsx("p",{className:"text-xs text-green-600 font-medium",children:o("onboarding.avatar.photoAdded")})]})}),t.jsxs("div",{className:"flex flex-col gap-2",children:[C&&t.jsx(pe,{className:"w-full",onClick:E,disabled:r||v,children:o(r||v?"onboarding.avatar.uploading":"onboarding.avatar.takeSelfie")}),t.jsx(pe,{variant:C?"outline":"default",className:"w-full",onClick:F,disabled:r||v,children:o("onboarding.avatar.choosePhoto")}),s&&t.jsx(pe,{variant:"ghost",size:"sm",className:"w-full text-xs text-muted-foreground",onClick:d,disabled:r||v,children:o("onboarding.avatar.removePhoto")})]}),l&&t.jsx("p",{"data-testid":"onboarding-photo-required",className:"text-xs font-medium text-primary mt-3 text-center",children:o("onboarding.avatar.photoRequired")}),l&&f&&t.jsx(pe,{variant:"ghost",size:"sm","data-testid":"onboarding-photo-escape",className:"w-full mt-2 text-xs text-muted-foreground",onClick:u,children:o("onboarding.avatar.cannotAddPhoto")}),t.jsx("p",{className:"text-xs text-muted-foreground mt-3 text-center",children:o("onboarding.avatar.photoFormats")})]}),p&&t.jsx(Tl,{onCapture:M,onCancel:()=>b(!1)}),h&&t.jsx(Hs,{onUseAnyway:j,onChooseAnother:()=>
2{L(),k.clear(),F()},onDismiss:()=>{L(),k.clear()}})]})}function Vn(s){const e=U.c(25),{phone:r,onPhoneChange:i,sessionLabelPlural:l}=s,{t:c}=le();let n;e[0]!==c?(n=c("onboarding.phone.title"),e[0]=c,e[1]=n):n=e[1];let a;e[2]!==n?(a=t.jsx("p",{className:"text-sm font-semibold mb-1",children:n}),e[2]=n,e[3]=a):a=e[3];let d;e[4]!==l||e[5]!==c?(d=c("onboarding.phone.subtitle",{sessionLabelPlural:l}),e[4]=l,e[5]=c,e[6]=d):d=e[6];let f;e[7]!==d?(f=t.jsx("p",{className:"text-xs text-muted-foreground mb-4",children:d}),e[7]=d,e[8]=f):f=e[8];let u;e[9]!==c?(u=c("onboarding.phone.placeholder"),e[9]=c,e[10]=u):u=e[10];let o;e[11]!==i||e[12]!==r||e[13]!==u?(o=t.jsx(Dl,{value:r,onChange:i,placeholder:u}),e[11]=i,e[12]=r,e[13]=u,e[14]=o):o=e[14];let m;e[15]!==l||e[16]!==c?(m=c("onboarding.phone.visibilityNote",{sessionLabelPlural:l}),e[15]=l,e[16]=c,e[17]=m):m=e[17];let g;e[18]!==m?(g=t.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:m}),e[18]=m,e[19]=g):g=e[19];let p;return e[20]!==a||e[21]!==f||e[22]!==o||e[23]!==g?(p=t.jsxs(de,{className:"p-5",children:[a,f,o,g]}),e[20]=a,e[21]=f,e[22]=o,e[23]=g,e[24]=p):p=e[24],p}function Kn(s){const e=U.c(64),{preferredSide:r,level:i,onSideChange:l,onLevelChange:c}=s,{t:n}=le();let a;e[0]!==n?(a=n("onboarding.game.noPreference"),e[0]=n,e[1]=a):a=e[1];let d;e[2]!==a?(d={value:null,label:a,icon:""},e[2]=a,e[3]=d):d=e[3];let f;e[4]!==n?(f=n("onboarding.game.left"),e[4]=n,e[5]=f):f=e[5];let u;e[6]!==f?(u={value:"left",label:f,icon:"â"},e[6]=f,e[7]=u):u=e[7];let o;e[8]!==n?(o=n("onboarding.game.right"),e[8]=n,e[9]=o):o=e[9];let m;e[10]!==o?(m={value:"right",label:o,icon:"â¶"},e[10]=o,e[11]=m):m=e[11];let g;e[12]!==n?(g=n("onboarding.game.bothSides"),e[12]=n,e[13]=g):g=e[13];let p;e[14]!==g?(p={value:"both",label:g,icon:"â"},e[14]=g,e[15]=p):p=e[15];let b;e[16]!==d||e[17]!==u||e[18]!==m||e[19]!==p?(b=[d,u,m,p],e[16]=d,e[17]=u,e[18]=m,e[19]=p,e[20]=b):b=e[20];const v=b;let h;e[21]!==n?(h=n("onboarding.game.title"),e[21]=n,e[22]=h):h=e[22];let x;e[23]!==h?(x=t.jsx("p",{className:"text-sm font-semibold mb-1",children:h}),e[23]=h,e[24]=x):x=e[24];let j;e[25]!==n?(j=n("onboarding.game.subtitle"),e[25]=n,e[26]=j):j=e[26];let L;e[27]!==j?(L=t.jsx("p",{className:"text-xs text-muted-foreground mb-4",children:j}),e[27]=j,e[28]=L):L=e[28];let k;e[29]!==n?(k=n("onboarding.game.level"),e[29]=n,e[30]=k):k=e[30];let S;e[31]!==k?(S=t.jsx("label",{className:"block text-xs font-semibold text-muted-foreground uppercase tracking-wide mb-1.5",children:k}),e[31]=k,e[32]=S):S=e[32];let C;e[33]===Symbol.for("react.memo_cache_sentinel")?(C=[1,2,3,4,5,6,7,8,9,10],e[33]=C):C=e[33];let w;e[34]!==i||e[35]!==c?(w=t.jsx("div",{className:"flex gap-1 flex-wrap",children:C.map(I=>t.jsx("button",{type:"button",className:Q("w-8 h-8 rounded-full text-xs font-bold transition-all",i===I?"bg-primary text-primary-foreground":"bg-input border border-border text-muted-foreground hover:border-primary/50"),onClick:()=>c(I),children:I},I))}),e[34]=i,e[35]=c,e[36]=w):w=e[36];let E;e[37]!==i||e[38]!==n?(E=i==null?n("onboarding.game.levelPrompt"):qs[i],e[37]=i,e[38]=n,e[39]=E):E=e[39];let M;e[40]!==E?(M=t.jsx("p",{className:"text-xs text-muted-foreground mt-1.5","data-testid":"onboarding-level-hint",children:E}),e[40]=E,e[41]=M):M=e[41];let F;e[42]!==S||e[43]!==w||e[44]!==M?(F=t.jsxs("div",{children:[S,w,M]}),e[42]=S,e[43]=w,e[44]=M,e[45]=F):F=e[45];let A;e[46]!==n?(A=n("onboarding.game.preferredSide"),e[46]=n,e[47]=A):A=e[47];let B;e[48]!==A?(B=t.jsx("label",{className:"block text-xs font-semibold text-muted-foreground uppercase tracking-wide mb-1.5",children:A}),e[48]=A,e[49]=B):B=e[49];let R;e[50]!==l||e[51]!==r||e[52]!==v?(R=t.jsx("div",{className:"flex flex-col gap-2",children:v.map(I=>t.jsxs("button",{className:Q("px-4 py-3 rounded-xl border text-sm font-medium cursor-pointer transition-all flex items-center gap-2",r===I.value?"bg-primary border-primary text-primary-foreground":"bg-card border-border text-foreground hover:border-primary/50"),onClick:()=>
2l(I.value),children:[I.icon&&t.jsx("span",{className:"text-lg",children:I.icon}),I.label]},I.value??"none"))}),e[50]=l,e[51]=r,e[52]=v,e[53]=R):R=e[53];let D;e[54]!==B||e[55]!==R?(D=t.jsxs("div",{children:[B,R]}),e[54]=B,e[55]=R,e[56]=D):D=e[56];let _;e[57]!==F||e[58]!==D?(_=t.jsxs("div",{className:"flex flex-col gap-4",children:[F,D]}),e[57]=F,e[58]=D,e[59]=_):_=e[59];let z;return e[60]!==x||e[61]!==L||e[62]!==_?(z=t.jsxs(de,{className:"p-5",children:[x,L,_]}),e[60]=x,e[61]=L,e[62]=_,e[63]=z):z=e[63],z}function Un(s){const e=U.c(58),{hasAvatarPhoto:r,photoRejected:i,onCertify:l,onAddPhoto:c,onSkip:n}=s,{t:a}=le();let d;e[0]!==i||e[1]!==a?(d=i?a("onboarding.certif.photoHasNoFace",{defaultValue:"On ne voit pas de visage sur ta photo de profil. Choisis-en une où on te reconnaît, de face."}):a("onboarding.certif.requiresPhoto",{defaultValue:"Ajoute une photo de profil à l'étape précédente pour pouvoir te certifier."}),e[0]=i,e[1]=a,e[2]=d):d=e[2];const f=d;let u;e[3]!==i||e[4]!==a?(u=i?a("onboarding.certif.changePhoto",{defaultValue:"Changer ma photo"}):a("onboarding.certif.addPhoto",{defaultValue:"Ajouter ma photo"}),e[3]=i,e[4]=a,e[5]=u):u=e[5];const o=u;let m;e[6]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx("div",{className:"w-12 h-12 rounded-full bg-primary/15 flex items-center justify-center text-primary",children:t.jsx("svg",{width:"26",height:"26",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:t.jsx("path",{d:"M12 2 9.91 4.5 6.6 4l-.55 3.3L3 9.27l1.5 3-1.5 3L6.05 16.7 6.6 20l3.31-.5L12 22l2.09-2.5L17.4 20l.55-3.3L21 14.73l-1.5-3 1.5-3-2.95-1.97L17.4 4l-3.31.5Zm-1.4 13.4-3-3 1.4-1.4 1.6 1.58 4.6-4.58 1.4 1.4Z"})})}),e[6]=m):m=e[6];let g;e[7]!==a?(g=a("onboarding.certif.title",{defaultValue:"Certifie ton profil"}),e[7]=a,e[8]=g):g=e[8];let p;e[9]!==g?(p=t.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[m,t.jsx("h2",{className:"text-lg font-bold leading-tight",children:g})]}),e[9]=g,e[10]=p):p=e[10];let b;e[11]!==a?(b=a("onboarding.certif.subtitle",{defaultValue:"En 5 secondes, prouve que tu es bien la personne sur ta photo. Les buddiz certifiés inspirent plus confiance et sont rejoints 2à plus vite."}),e[11]=a,e[12]=b):b=e[12];let v;e[13]!==b?(v=t.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:b}),e[13]=b,e[14]=v):v=e[14];let h;e[15]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx(Xe,{className:"w-4 h-4 shrink-0 text-primary mt-0.5"}),e[15]=h):h=e[15];let x;e[16]!==a?(x=a("onboarding.certif.point1",{defaultValue:"Analyse 100 % sur ton appareil - la vidéo ne quitte jamais ton téléphone"}),e[16]=a,e[17]=x):x=e[17];let j;e[18]!==x?(j=t.jsxs("li",{className:"flex items-start gap-2",children:[h,t.jsx("span",{children:x})]}),e[18]=x,e[19]=j):j=e[19];let L;e[20]===Symbol.for("react.memo_cache_sentinel")?(L=t.jsx(Xe,{className:"w-4 h-4 shrink-0 text-primary mt-0.5"}),e[20]=L):L=e[20];let k;e[21]!==a?(k=a("onboarding.certif.point2",{defaultValue:"Badge vert visible sur ton avatar partout dans l'app"}),e[21]=a,e[22]=k):k=e[22];let S;e[23]!==k?(S=t.jsxs("li",{className:"flex items-start gap-2",children:[L,t.jsx("span",{children:k})]}),e[23]=k,e[24]=S):S=e[24];let C;e[25]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx(Xe,{className:"w-4 h-4 shrink-0 text-primary mt-0.5"}),e[25]=C):C=e[25];let w;e[26]!==a?(w=a("onboarding.certif.point3",{defaultValue:"Tu peux retirer ta certification quand tu veux"}),e[26]=a,e[27]=w):w=e[27];let E;e[28]!==w?(E=t.jsxs("li",{className:"flex items-start gap-2",children:[C,t.jsx("span",{children:w})]}),e[28]=w,e[29]=E):E=e[29];let M;e[30]!==j||e[31]!==S||e[32]!==E?(M=t.jsxs("ul",{className:"text-sm flex flex-col gap-2 mb-5",children:[j,S,E]}),e[30]=j,e[31]=S,e[32]=E,e[33]=M):M=e[33];const F=!r;let A;e[34]!==a?(A=a("onboarding.certif.cta",{defaultValue:"Certifier mon profil"}),e[34]=a,e[35]=A):A=e[35];let B;e[36]!==l||e[37]!==F||e[38]!==A?(B=t.jsx(pe,{type:"button",className:"w-full mb-3",onClick:l,disabled:F,children:A}),e[36]=l,e[37]=F,e[38]=A,e[39]=B):B=e[39];let R;e[40]!==r||e[41]!==c||e[42]!==o||e[43]!==f||e[44]!==i?(R=(!r||i)&&t.jsxs(t.Fragment,{children:[t.jsx("p",{className:"text-xs text-muted-foreground text-center mb-2",children:f}),t.jsx(pe,{type:"button",variant:"outline","data-testid":"certif-add-photo",className:"w-full mb-3",onClick:c,children:o})]}),e[40]=r,e[41]=c,e[42]=o,e[43]=f,e[44]=i,e[45]=R):R=e[45];let D;e[46]!==a?(D=a("onboarding.certif.skip",{defaultValue:"Plus tard"}),e[46]=a,e[47]=D):D=e[47];let _;e[48]!==n||e[49]!==D?(_=t.jsx("button",{type:"button",onClick:n,className:"w-full text-sm text-muted-foreground hover:text-foreground transition-colors py-1",children:D}),e[48]=n,e[49]=D,e[50]=_):_=e[50];let z;return e[51]!==M||e[52]!==B||e[53]!==R||e[54]!==_||e[55]!==p||e[56]!==v?(z=t.jsxs(de,{className:"p-5",children:[p,v,M,B,R,_]}),e[51]=M,e[52]=B,e[53]=R,e[54]=_,e[55]=p,e[56]=v,e[57]=z):z=e[57],z}function Gn(s){const e=U.c(24),{selected:r,onSelectionChange:i,sport:l}=s,c=l===void 0?"padel":l,{t:n}=le();let a,d,f,u;if(e[0]!==i||e[1]!==r||e[2]!==c||e[3]!==n){const g=Le(c??"padel").modes.skillBadgeSet,p=cl(g),b=g.categoryKeys,v=j=>{r.includes(j)?i(r.filter(L=>L!==j)):r.length<Re?i([...r,j]):q.error(n("onboarding.badges.maxReached",{max:Re}))};let h;e[8]!==n?(h=n("onboarding.badges.title"),e[8]=n,e[9]=h):h=e[9],e[10]!==h?(f=t.jsx("p",{className:"text-sm font-semibold mb-1 px-1",children:h}),e[10]=h,e[11]=f):f=e[11];let x;
2e[12]!==n?(x=n("onboarding.badges.subtitle",{max:Re}),e[12]=n,e[13]=x):x=e[13],e[14]!==r.length||e[15]!==x?(u=t.jsxs("p",{className:"text-xs text-muted-foreground mb-3 px-1",children:[x," ·"," ",r.length,"/",Re]}),e[14]=r.length,e[15]=x,e[16]=u):u=e[16],a="space-y-3",d=Object.entries(p).map(j=>{const[L,k]=j;return t.jsxs("div",{children:[t.jsx("h4",{className:"text-xs font-semibold text-primary mb-1.5 px-1 uppercase tracking-wide",children:n(b[L])}),t.jsx("div",{className:"grid grid-cols-2 gap-2",children:k.map(S=>{const C=r.includes(S.id),w=!C&&r.length>=Re;return t.jsxs("button",{className:Q("flex items-center gap-2 px-3 py-2 rounded-xl border text-left transition-all",C?"border-primary bg-primary/10":w?"border-border bg-card/50 opacity-40 cursor-not-allowed":"border-border bg-card hover:border-primary/50 cursor-pointer"),onClick:()=>!w&&v(S.id),children:[t.jsx(ze,{name:S.icon,className:Q("w-4 h-4 shrink-0",dl(S.category))}),t.jsxs("div",{className:"min-w-0",children:[t.jsx("span",{className:"text-[12px] font-medium block leading-tight",children:n(S.labelKey)}),S.descriptionKey&&t.jsx("span",{className:"text-[10px] text-muted-foreground block leading-tight mt-0.5",children:n(S.descriptionKey)})]})]},S.id)})})]},L)}),e[0]=i,e[1]=r,e[2]=c,e[3]=n,e[4]=a,e[5]=d,e[6]=f,e[7]=u}else a=e[4],d=e[5],f=e[6],u=e[7];let o;e[17]!==a||e[18]!==d?(o=t.jsx("div",{className:a,children:d}),e[17]=a,e[18]=d,e[19]=o):o=e[19];let m;return e[20]!==f||e[21]!==u||e[22]!==o?(m=t.jsxs("div",{children:[f,u,o]}),e[20]=f,e[21]=u,e[22]=o,e[23]=m):m=e[23],m}function Hn(s){const e=U.c(21),{isSupported:r,enabled:i,sessionLabel:l}=s,{t:c}=le(),n=r&&!i;let a;e[0]!==l||e[1]!==c?(a=c("onboarding.notifications.title",{sessionLabel:l}),e[0]=l,e[1]=c,e[2]=a):a=e[2];let d;e[3]!==a?(d=t.jsx("p",{className:"text-sm font-semibold mb-1",children:a}),e[3]=a,e[4]=d):d=e[4];const f=n?"onboarding.notifications.subtitle":"onboarding.notifications.alertSubtitle";let u;e[5]!==l||e[6]!==c||e[7]!==f?(u=c(f,{sessionLabel:l}),e[5]=l,e[6]=c,e[7]=f,e[8]=u):u=e[8];let o;e[9]!==u?(o=t.jsx("p",{className:"text-xs text-muted-foreground mb-4",children:u}),e[9]=u,e[10]=o):o=e[10];let m;e[11]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx("span",{className:"flex items-center justify-center",children:t.jsx(De,{name:"bell",className:"w-12 h-12 text-muted-foreground"})}),e[11]=m):m=e[11];let g;e[12]!==r||e[13]!==c?(g=!r&&t.jsx("p",{className:"text-sm text-muted-foreground text-center",children:c("onboarding.notifications.notSupported")}),e[12]=r,e[13]=c,e[14]=g):g=e[14];let p;e[15]!==g?(p=t.jsxs("div",{className:"flex flex-col items-center gap-4 py-4",children:[m,g]}),e[15]=g,e[16]=p):p=e[16];let b;return e[17]!==d||e[18]!==o||e[19]!==p?(b=t.jsxs(de,{className:"p-5",children:[d,o,p]}),e[17]=d,e[18]=o,e[19]=p,e[20]=b):b=e[20],b}function qn(s){const e=U.c(102),{level:r,paceMin:i,paceMax:l,distanceMin:c,distanceMax:n,onLevelChange:a,onPaceChange:d,onDistanceChange:f}=s;let u;e[0]!==l||e[1]!==i?(u=K=>i!=null&&l!=null&&i<=K.min&&l>=K.max,e[0]=l,e[1]=i,e[2]=u):u=e[2];const o=u;let m;e[3]!==n||e[4]!==c?(m=K=>c!=null&&n!=null&&c<=K.min&&n>=K.max,e[3]=n,e[4]=c,e[5]=m):m=e[5];const g=m;let p;e[6]!==l||e[7]!==i?(p=kl(i,l),e[6]=l,e[7]=i,e[8]=p):p=e[8];const b=p;let v;e[9]!==n||e[10]!==c?(v=Cl(c,n),e[9]=n,e[10]=c,e[11]=v):v=e[11];const h=v,{t:x}=le();let j;e[12]!==x?(j=x("onboarding.running.levelTitle"),e[12]=x,e[13]=j):j=e[13];let L;e[14]!==j?(L=t.jsx("p",{className:"text-sm font-semibold mb-1",children:j}),e[14]=j,e[15]=L):L=e[15];let k;e[16]!==x?(k=x("onboarding.running.levelSubtitle"),e[16]=x,e[17]=k):k=e[17];let S;e[18]!==k?(S=t.jsx("p",{className:"text-xs text-muted-foreground mb-4",children:k}),e[18]=k,e[19]=S):S=e[19];let C;e[20]!==r||e[21]!==a||e[22]!==x?(C=Ws.map(K=>t.jsxs("button",{className:Q("flex items-center gap-3 px-4 py-3 rounded-lg border text-left cursor-pointer transition-all",r===K.value?"bg-primary border-primary text-primary-foreground":"bg-card border-border hover:border-primary/50"),onClick:()=>a(K.value),children:[t.jsx(Il,{level:K.value,className:Q("w-5 h-5 shrink-0",r===K.value&&"text-primary-foreground")}),t.jsxs("div",{children:[t.jsx("p",{className:Q("text-sm font-medium",r!==K.value&&"text-foreground"),children:x(K.labelKey)}),t.jsx("p",{className:Q("text-xs",r===K.value?"text-primary-foreground
2/70":"text-muted-foreground"),children:x(K.descriptionKey)})]})]},K.value)),e[20]=r,e[21]=a,e[22]=x,e[23]=C):C=e[23];let w;e[24]!==C?(w=t.jsx("div",{className:"flex flex-col gap-2",children:C}),e[24]=C,e[25]=w):w=e[25];let E;e[26]!==w||e[27]!==L||e[28]!==S?(E=t.jsxs(de,{className:"p-5",children:[L,S,w]}),e[26]=w,e[27]=L,e[28]=S,e[29]=E):E=e[29];let M;e[30]!==x?(M=x("onboarding.running.paceTitle"),e[30]=x,e[31]=M):M=e[31];let F;e[32]!==M?(F=t.jsx("p",{className:"text-sm font-semibold mb-1",children:M}),e[32]=M,e[33]=F):F=e[33];let A;e[34]!==x?(A=x("onboarding.running.paceSubtitle"),e[34]=x,e[35]=A):A=e[35];let B;e[36]!==A?(B=t.jsx("p",{className:"text-xs text-muted-foreground mb-4",children:A}),e[36]=A,e[37]=B):B=e[37];let R;e[38]!==o||e[39]!==d||e[40]!==l||e[41]!==i?(R=Zs.map(K=>t.jsx("button",{className:Q("px-3 py-1.5 rounded-full border text-xs font-medium cursor-pointer transition-all",o(K)?"bg-primary border-primary text-primary-foreground":"bg-card border-border text-muted-foreground hover:border-primary/50"),onClick:()=>{const me=Qs(i,l,K);d(me.min,me.max)},children:K.label},K.label)),e[38]=o,e[39]=d,e[40]=l,e[41]=i,e[42]=R):R=e[42];const D=b?"bg-primary border-primary text-primary-foreground":"bg-card border-border text-muted-foreground hover:border-primary/50";let _;e[43]!==D?(_=Q("px-3 py-1.5 rounded-full border text-xs font-medium cursor-pointer transition-all",D),e[43]=D,e[44]=_):_=e[44];let z;e[45]!==d?(z=()=>d(St.min,St.max),e[45]=d,e[46]=z):z=e[46];let I;e[47]!==x?(I=x("onboarding.running.paceBeginner"),e[47]=x,e[48]=I):I=e[48];let P;e[49]!==_||e[50]!==z||e[51]!==I?(P=t.jsx("button",{className:_,onClick:z,children:I}),e[49]=_,e[50]=z,e[51]=I,e[52]=P):P=e[52];let T;e[53]!==R||e[54]!==P?(T=t.jsxs("div",{className:"flex gap-1.5 flex-wrap",children:[R,P]}),e[53]=R,e[54]=P,e[55]=T):T=e[55];let $;e[56]!==b||e[57]!==x?($=b&&t.jsxs("p",{className:"text-xs text-muted-foreground italic mt-3",children:[t.jsx(kt,{className:"inline-block w-3.5 h-3.5 align-[-0.15em] mr-1"}),x("onboarding.running.paceBeginnerNotice")]}),e[56]=b,e[57]=x,e[58]=$):$=e[58];let G;e[59]!==F||e[60]!==B||e[61]!==T||e[62]!==$?(G=t.jsxs(de,{className:"p-5",children:[F,B,T,$]}),e[59]=F,e[60]=B,e[61]=T,e[62]=$,e[63]=G):G=e[63];let J;e[64]!==x?(J=x("onboarding.running.distanceTitle"),e[64]=x,e[65]=J):J=e[65];let ie;e[66]!==J?(ie=t.jsx("p",{className:"text-sm font-semibold mb-1",children:J}),e[66]=J,e[67]=ie):ie=e[67];let ne;e[68]!==x?(ne=x("onboarding.running.distanceSubtitle"),e[68]=x,e[69]=ne):ne=e[69];let X;e[70]!==ne?(X=t.jsx("p",{className:"text-xs text-muted-foreground mb-4",children:ne}),e[70]=ne,e[71]=X):X=e[71];let Y;e[72]!==n||e[73]!==c||e[74]!==g||e[75]!==f?(Y=Js.map(K=>t.jsx("button",{className:Q("px-3 py-1.5 rounded-full border text-xs font-medium cursor-pointer transition-all",g(K)?"bg-primary border-primary text-primary-foreground":"bg-card border-border text-muted-foreground hover:border-primary/50"),onClick:()=>{const me=Xs(c,n,K);f(me.min,me.max)},children:K.label},K.label)),e[72]=n,e[73]=c,e[74]=g,e[75]=f,e[76]=Y):Y=e[76];const oe=h?"bg-primary border-primary text-primary-foreground":"bg-card border-border text-muted-foreground hover:border-primary/50";let ee;e[77]!==oe?(ee=Q("px-3 py-1.5 rounded-full border text-xs font-medium cursor-pointer transition-all",oe),e[77]=oe,e[78]=ee):ee=e[78];let te;e[79]!==f?(te=()=>f(_t.min,_t.max),e[79]=f,e[80]=te):te=e[80];let ae;e[81]!==x?(ae=x("onboarding.running.distanceBeginner"),e[81]=x,e[82]=ae):ae=e[82];let W;e[83]!==ee||e[84]!==te||e[85]!==ae?(W=t.jsx("button",{className:ee,onClick:te,children:ae}),e[83]=ee,e[84]=te,e[85]=ae,e[86]=W):W=e[86];let H;e[87]!==Y||e[88]!==W?(H=t.jsxs("div",{className:"flex gap-1.5 flex-wrap",children:[Y,W]}),e[87]=Y,e[88]=W,e[89]=H):H=e[89];let Z;e[90]!==h||e[91]!==x?(Z=h&&t.jsxs("p",{className:"text-xs text-muted-foreground italic mt-3",children:[t.jsx(kt,{className:"inline-block w-3.5 h-3.5 align-[-0.15em] mr-1"}),x("onboarding.running.distanceBeginnerNotice")]}),e[90]=h,e[91]=x,e[92]=Z):Z=e[92];let se;e[93]!==ie||e[94]!==X||e[95]!==H||e[96]!==Z?(se=t.jsxs(de,{className:"p-5",children:[ie,X,H,Z]}),e[93]=ie,e[94]=X,e[95]=H,e[96]=Z,e[97]=se):se=e[97];let ue;return e[98]!==E||e[99]!==G||e[100]!==se?(ue=t.jsxs("div",{className:"flex flex-col gap-4",children:[E,G,se]}),e[98]=E,e[99]=G,e[100]=se,e[101]=ue):ue=e[101],ue}const Wn=[...Ys];function Zn(s){const e=U.c(27),{selected:r,onSelectionChange:i}=s,{t:l}=le();let c;e[0]!==i||e[1]!==r?(c=v=>{i(wl(r,v))},e[0]=i,e[1]=r,e[2]=c):c=e[2];const n=c;let a;
2e[3]!==l?(a=l("onboarding.surfaces.title"),e[3]=l,e[4]=a):a=e[4];let d;e[5]!==a?(d=t.jsx("p",{className:"text-sm font-semibold mb-1",children:a}),e[5]=a,e[6]=d):d=e[6];let f;e[7]!==l?(f=l("onboarding.surfaces.runningSubtitle"),e[7]=l,e[8]=f):f=e[8];let u;e[9]!==f?(u=t.jsx("p",{className:"text-xs text-muted-foreground mb-5",children:f}),e[9]=f,e[10]=u):u=e[10];let o;e[11]!==r||e[12]!==l||e[13]!==n?(o=Wn.map(v=>{const h=r.includes(v);return t.jsxs("button",{type:"button",className:Q("flex items-start gap-2 px-3 py-2.5 rounded-lg border text-left cursor-pointer transition-all",h?"bg-primary border-primary text-primary-foreground":"bg-card border-border text-muted-foreground hover:border-primary/50"),onClick:()=>n(v),children:[t.jsx(ze,{name:el[v],className:"w-4 h-4 shrink-0 mt-0.5"}),t.jsxs("span",{className:"flex flex-col gap-0.5 min-w-0",children:[t.jsx("span",{className:"text-sm font-medium leading-tight",children:l(tl[v])}),t.jsx("span",{className:Q("text-[11px] leading-snug",h?"text-primary-foreground/75":"text-muted-foreground/80"),children:l(sl[v])})]})]},v)}),e[11]=r,e[12]=l,e[13]=n,e[14]=o):o=e[14];let m;e[15]!==o?(m=t.jsx("div",{className:"grid grid-cols-2 gap-2",children:o}),e[15]=o,e[16]=m):m=e[16];let g;e[17]!==r||e[18]!==l?(g=r.length===0?l("onboarding.surfaces.selectHint"):r.includes("mixed")?l("onboarding.surfaces.openToAll"):l("onboarding.surfaces.selectedCount",{count:r.length}),e[17]=r,e[18]=l,e[19]=g):g=e[19];let p;e[20]!==g?(p=t.jsx("p",{className:"text-xs text-muted-foreground mt-3",children:g}),e[20]=g,e[21]=p):p=e[21];let b;return e[22]!==d||e[23]!==u||e[24]!==m||e[25]!==p?(b=t.jsxs(de,{className:"p-5",children:[d,u,m,p]}),e[22]=d,e[23]=u,e[24]=m,e[25]=p,e[26]=b):b=e[26],b}function Qn(s){const e=U.c(18),{level:r,onLevelChange:i}=s,{t:l}=le();let c;e[0]!==l?(c=l("onboarding.foot5.levelTitle"),e[0]=l,e[1]=c):c=e[1];let n;e[2]!==c?(n=t.jsx("p",{className:"text-sm font-semibold mb-1",children:c}),e[2]=c,e[3]=n):n=e[3];let a;e[4]!==l?(a=l("onboarding.foot5.levelSubtitle"),e[4]=l,e[5]=a):a=e[5];let d;e[6]!==a?(d=t.jsx("p",{className:"text-xs text-muted-foreground mb-5",children:a}),e[6]=a,e[7]=d):d=e[7];let f;e[8]!==r||e[9]!==i||e[10]!==l?(f=il.map(m=>t.jsxs("button",{className:Q("flex items-center gap-3 px-4 py-3 rounded-lg border text-left cursor-pointer transition-all",r===m.value?`border-primary bg-primary/10 ${ol[m.value]}`:"bg-card border-border text-muted-foreground hover:border-primary/50"),onClick:()=>i(m.value),children:[t.jsx(rl,{level:m.value,className:"w-5 h-5 shrink-0"}),t.jsxs("div",{children:[t.jsx("span",{className:"text-sm font-semibold",children:l(m.labelKey)}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:l(m.descriptionKey)})]})]},m.value)),e[8]=r,e[9]=i,e[10]=l,e[11]=f):f=e[11];let u;e[12]!==f?(u=t.jsx("div",{className:"flex flex-col gap-2",children:f}),e[12]=f,e[13]=u):u=e[13];let o;return e[14]!==n||e[15]!==d||e[16]!==u?(o=t.jsxs(de,{className:"p-5",children:[n,d,u]}),e[14]=n,e[15]=d,e[16]=u,e[17]=o):o=e[17],o}function Jn(s){const e=U.c(18),{level:r,onLevelChange:i}=s,{t:l}=le();let c;e[0]!==l?(c=l("onboarding.tennis.levelTitle"),e[0]=l,e[1]=c):c=e[1];let n;e[2]!==c?(n=t.jsx("p",{className:"text-sm font-semibold mb-1",children:c}),e[2]=c,e[3]=n):n=e[3];let a;e[4]!==l?(a=l("onboarding.tennis.levelSubtitle"),e[4]=l,e[5]=a):a=e[5];let d;e[6]!==a?(d=t.jsx("p",{className:"text-xs text-muted-foreground mb-5",children:a}),e[6]=a,e[7]=d):d=e[7];let f;e[8]!==r||e[9]!==i||e[10]!==l?(f=zl.map(m=>t.jsxs("button",{className:Q("flex items-center gap-3 px-4 py-3 rounded-lg border text-left cursor-pointer transition-all",r===m.value?`border-primary bg-primary/10 ${Vl[m.value]}`:"bg-card border-border text-muted-foreground hover:border-primary/50"),onClick:()=>i(m.value),children:[t.jsx($l,{level:m.value,className:"w-5 h-5 shrink-0"}),t.jsxs("div",{children:[t.jsx("span",{className:"text-sm font-semibold",children:l(m.labelKey)}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:l(m.descriptionKey)})]})]},m.value)),e[8]=r,e[9]=i,e[10]=l,e[11]=f):f=e[11];let u;e[12]!==f?(u=t.jsx("div",{className:"flex flex-col gap-2",children:f}),e[12]=f,e[13]=u):u=e[13];let o;return e[14]!==n||e[15]!==d||e[16]!==u?(o=t.jsxs(de,{className:"p-5",children:[n,d,u]}),e[14]=n,e[15]=d,e[16]=u,e[17]=o):o=e[17],o}const Xn=["sentier","chemin","route","foret","mixte"];function Yn(){const s=U.c(37),{t:e}=le();let r;s[0]!==e?(r=e("onboarding.hiking.welcomeTitle"),s[0]=e,s[1]=r):r=s[1];let i;s[2]!==r?(i=t.jsx("p",{className:"text-sm font-semibold mb-1",children:r}),s[2]=r,s[3]=i):i=s[3];let l;s[4]!==e?(l=e("onboarding.hiking.welcomeSubtitle"),s[4]=e,s[5]=l):l=s[5];let c;s[6]!==l?(c=t.jsx("p",{className:"text-xs text-muted-foreground mb-5",children:l}),s[6]=l,s[7]=c):c=s[7];let n;s[8]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(Pl,{className:"w-5 h-5 shrink-0 text-primary"}),s[8]=n):n=s[8];let a;s[9]!==e?(a=e("onboarding.hiking.feature1"),s[9]=e,s[10]=a):a=s[10];let d;s[11]!==a?(d=t.jsxs("div",{className:"flex items-center gap-3",children:[n,t.jsx("span",{children:a})]}),s[11]=a,s[12]=d):d=s[12];let f;s[13]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(Ll,{className:"w-5 h-5 shrink-0 text-primary"}),s[13]=f):f=s[13];let u;
2s[14]!==e?(u=e("onboarding.hiking.feature2"),s[14]=e,s[15]=u):u=s[15];let o;s[16]!==u?(o=t.jsxs("div",{className:"flex items-center gap-3",children:[f,t.jsx("span",{children:u})]}),s[16]=u,s[17]=o):o=s[17];let m;s[18]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(De,{name:"map-pin",className:"w-5 h-5 shrink-0 text-primary"}),s[18]=m):m=s[18];let g;s[19]!==e?(g=e("onboarding.hiking.feature3"),s[19]=e,s[20]=g):g=s[20];let p;s[21]!==g?(p=t.jsxs("div",{className:"flex items-center gap-3",children:[m,t.jsx("span",{children:g})]}),s[21]=g,s[22]=p):p=s[22];let b;s[23]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx(De,{name:"bar-chart",className:"w-5 h-5 shrink-0 text-primary"}),s[23]=b):b=s[23];let v;s[24]!==e?(v=e("onboarding.hiking.feature4"),s[24]=e,s[25]=v):v=s[25];let h;s[26]!==v?(h=t.jsxs("div",{className:"flex items-center gap-3",children:[b,t.jsx("span",{children:v})]}),s[26]=v,s[27]=h):h=s[27];let x;s[28]!==p||s[29]!==h||s[30]!==d||s[31]!==o?(x=t.jsxs("div",{className:"flex flex-col gap-3 text-sm text-muted-foreground",children:[d,o,p,h]}),s[28]=p,s[29]=h,s[30]=d,s[31]=o,s[32]=x):x=s[32];let j;return s[33]!==i||s[34]!==x||s[35]!==c?(j=t.jsxs(de,{className:"p-5 max-w-md mx-auto",children:[i,c,x]}),s[33]=i,s[34]=x,s[35]=c,s[36]=j):j=s[36],j}function ea(s){const e=U.c(24),{selected:r,onSelectionChange:i}=s,{t:l}=le();let c;e[0]!==l?(c=l("onboarding.surfaces.title"),e[0]=l,e[1]=c):c=e[1];let n;e[2]!==c?(n=t.jsx("p",{className:"text-sm font-semibold mb-1",children:c}),e[2]=c,e[3]=n):n=e[3];let a;e[4]!==l?(a=l("onboarding.surfaces.hikingSubtitle"),e[4]=l,e[5]=a):a=e[5];let d;e[6]!==a?(d=t.jsx("p",{className:"text-xs text-muted-foreground mb-5",children:a}),e[6]=a,e[7]=d):d=e[7];let f;e[8]!==i||e[9]!==r||e[10]!==l?(f=Xn.map(p=>t.jsxs("button",{className:Q("flex items-center gap-2 px-3 py-3 rounded-lg border text-sm font-medium cursor-pointer transition-all",r.includes(p)?"bg-primary border-primary text-primary-foreground":"bg-card border-border text-muted-foreground hover:border-primary/50"),onClick:()=>i(al(r,p)),children:[t.jsx(ze,{name:ll[p],className:"w-4 h-4 shrink-0"}),l(nl[p])]},p)),e[8]=i,e[9]=r,e[10]=l,e[11]=f):f=e[11];let u;e[12]!==f?(u=t.jsx("div",{className:"grid grid-cols-2 gap-2",children:f}),e[12]=f,e[13]=u):u=e[13];let o;e[14]!==r||e[15]!==l?(o=r.length===0?l("onboarding.surfaces.selectHint"):r.includes("mixte")?l("onboarding.surfaces.openToAll"):l("onboarding.surfaces.selectedCount",{count:r.length}),e[14]=r,e[15]=l,e[16]=o):o=e[16];let m;e[17]!==o?(m=t.jsx("p",{className:"text-xs text-muted-foreground mt-3",children:o}),e[17]=o,e[18]=m):m=e[18];let g;return e[19]!==n||e[20]!==d||e[21]!==u||e[22]!==m?(g=t.jsxs(de,{className:"p-5",children:[n,d,u,m]}),e[19]=n,e[20]=d,e[21]=u,e[22]=m,e[23]=g):g=e[23],g}export{Ta as OnboardingScreen,Ta 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.