PageSourceSearch

https://app.bitemap.fish/assets/RegisterRoute-d-dK6OZI.js

js bitemap.fish collected 2026-10-02 01:54:06 UTC 19,449 bytes, 1 lines download raw bytes

1import{w as P,r as a,j as e,x as J,y as q,z,u as Y,t as Z}from"./index-PS4qAFY_.js";import{s as X,R as $,v as Q,r as ee,c as D}from"./register-CLOKixXz.js";import"./oidc-Csyat_B_.js";import"./maplibre-DOsx2iBk.js";const te=["BETA2026","START1M"];function se(){const r=globalThis.crypto;return r?.randomUUID?r.randomUUID():"ri-"+Math.random().toString(16).slice(2)+Date.now().toString(16)}function re(r){return r==="free"||r==="pro"||r==="pro_ai"}function U(r){return{id:r.id??se(),intent:r.intent,plan:r.plan,interval:r.interval,price_key:r.price_key,promo_code:r.promo_code,createdAt:new Date().toISOString()}}function ie(r){const g=new URLSearchParams(r),x=g.get("plan");if(!x||!re(x))return null;const n=g.get("interval"),t=g.get("promo");if(x==="free")return{intent:"register_free",plan:"free"};const o=n?`${x}_${n==="year"?"yearly":"monthly"}`:void 0;return{intent:"register_subscribe",plan:x,interval:n==="year"?"year":"month",price_key:o,promo_code:t&&te.includes(t)?t:void 0}}const G={month:{priceKey:"pro_monthly",display:"9,99 €",sub:"/ Monat",saving:void 0},year:{priceKey:"pro_yearly",display:"99 €",sub:"/ Jahr",saving:"2 Monate gratis"}};function ne({onRegister:r,onLogin:g,initialSearch:x}){const{t:n}=P("registration"),t=x??(typeof window<"u"?window.location.search:""),o=a.useMemo(()=>ie(t),[t]),j=o?.interval==="year"?"year":"month",[h,i]=a.useState(j),[p,w]=a.useState(null),[k,s]=a.useState(null),_=!!o?.promo_code&&h==="month",d=async v=>{if(!p){s(null),w(v);try{const u=G[h],S=U(v==="free"?{intent:"register_free",plan:"free"}:{intent:"register_subscribe",plan:"pro",interval:h,price_key:u.priceKey,promo_code:_?o?.promo_code:void 0});await r(S)}catch(u){const S=u instanceof Error?u.message:n("somethingWentWrong");s(S),w(null)}}},m=async()=>{if(!p){s(null),w("login");try{await g()}catch(v){const u=v instanceof Error?v.message:n("somethingWentWrong");s(u),w(null)}}},f=o?.plan==="pro",y=G[h];return e.jsx("div",{className:"register-flow","data-testid":"register-flow",children:e.jsxs("div",{className:"register-flow__inner",children:[e.jsxs("header",{className:"register-flow__header",children:[e.jsx("img",{src:"/bitemap-fish-wordmark.png",alt:"BiteMap.Fish",className:"register-flow__logo"}),e.jsx("span",{className:"register-flow__tagline",children:"Engineered for Fishing. Built to Perform."}),e.jsx("h1",{className:"register-flow__title",children:n("planPickerTitle")}),e.jsx("p",{className:"register-flow__lead",children:n(_?"planPickerLeadPromo":"planPickerLead")})]}),k&&e.jsx("div",{className:"register-flow__error",role:"alert",children:k}),e.jsxs("div",{className:"register-flow__interval-toggle",role:"group","aria-label":"Abrechnungszeitraum",children:[e.jsx("button",{type:"button",className:`register-flow__interval-btn${h==="month"?" register-flow__interval-btn--active":""}`,onClick:()=>i("month"),disabled:!!p,"data-testid":"interval-monthly",children:n("monthly")}),e.jsxs("button",{type:"button",className:`register-flow__interval-btn${h==="year"?" register-flow__interval-btn--active":""}`,onClick:()=>i("year"),disabled:!!p,"data-testid":"interval-yearly",children:[n("yearly"),e.jsx("span",{className:"register-flow__interval-badge",children:n("yearlyBadge")})]})]}),e.jsxs("div",{className:"register-flow__grid",children:[e.jsxs("article",{className:`register-flow__card register-flow__card--pro${f?" register-flow__card--highlight":""}`,"data-testid":"plan-card-pro",children:[e.jsx("div",{className:"register-flow__card-badge",children:n("mostChosen")}),e.jsx("div",{className:"register-flow__card-name",children:"Pro"}),e.jsx("div",{className:"register-flow__card-price",children:h==="month"?e.jsxs(e.Fragment,{children:[e.jsx("s",{className:"register-flow__price-strike",children:y.display}),e.jsxs("span",{children:[" ",y.sub]}),e.jsx("span",{className:"register-flow__beta-offer","data-testid":"pro-beta-offer",children:n("proBetaOffer")})]}):e.jsxs(e.Fragment,{children:[y.display,e.jsxs("span",{children:[" ",y.sub]}),y.saving&&e.jsx("span",{className:"register-flow__card-saving","data-testid":"pro-yearly-saving",children:y.saving})]})}),e.jsx("p",{className:"register-flow__card-desc",children:"Für alle, die ihre Sessions systematisch auswerten."}),e.jsxs("ul",{className:"register-flow__card-features",children:[e.jsx("li",{children:"Alles aus Free"}),e.jsxs("li",{className:"register-flow__feat-highlight",children:["🛰️ ",e.jsx("strong",{children:"Transformer BiteVision"})," — Seegrund ohne Wasser, ~12,5 cm/Pixel"]}),e.jsx("li",{children:"BiteAgent (KI-Assistent)"}),e.jsx("li",{children:"BiteGuru Bissprognose"}),e.jsx("li",{children:"Köder-Intelligenz"}),e.jsx("li",{children:"Wetter & Solunar"}),e.jsx("li",{children:"Dynamische Tiefenkarten (voller Zoom)"}),e.jsx("li",{children:"Automatische Session-Analyse"}),e.jsx("li",{children:"GPX-Import (1.0 / 1.1) inkl. Echolot-Extensions"}),e.jsx("li",{children:"Unbegrenzte Fänge · 5 Fotos/Fang · 1 000 Spots"})]}),_&&e.jsxs("div",{className:"register-flow__card-beta","data-testid":"pro-beta-hint",children:[e.jsxs("strong",{children:[o?.promo_code,":"]})," 1 Monat kostenlos testen. Jederzeit kündbar."]}),e.jsx("button",{type:"button",className:"btn btn--primary btn--full",onClick:()=>d("pro"),disabled:!!p,"data-testid":"plan-cta-pro",children:p==="pro"?e.jsx("span",{className:"register-flow__spinner","aria-hidden":"true"}):n(h==="year"?"startProYearly":"startPro")})]}),e.jsxs("article",{className:"register-flow__card","data-testid":"plan-card-free",children:[e.jsx("div",{className:"register-flow__card-name",children:"Free"}),e.jsxs("div",{className:"register-flow__card-price",children:["0 €",e.jsx("span",{children:" / für immer"})]}),e.jsx("p",{className:"register-flow__card-desc",children:"Alles Wichtige für den Einstieg. Dauerhaft kostenlos."}),e.jsxs("ul",{className:"register-flow__card-features",children:[e.jsx("li",{children:"Catch-Logging mit Foto"}),e.jsx("li",{children:"Sessions & GPS-Tracks"}),e.jsx("li",{children:"Spots & Waypoints"}),e.jsx("li",{children:"Baiting-Log"}),e.jsx("li",{children:"Catch-Heatmap"}),e.jsx("li",{children:"Karte & Satellit"}),e.jsx("li",{children:"50 Spots"})]}),e.jsx("button",{type:"button",className:"btn btn--ghost btn--full",onClick:()=>d("free"),disabled:!!p,"data-testid":"plan-cta-free",children:p==="free"?e.jsx("span",{className:"register-flow__spinner","aria-hidden":"true"}):n("startFree")})]})]}),e.jsxs("footer",{className:"register-flow__footer",children:[n("alreadyHaveAccount")," ",e.jsx("button",{type:"button",className:"register-flow__footer-link",onClick:m,disabled:!!p,"data-testid":"register-login-link",children:n("verify")==="Bestätigen"?"Einloggen":n("toLogin")})]})]})})}function ae({plan:r,priceKey:g,onBack:x,onStarted:n}){const{t}=P("registration"),{t:o}
1=P("common"),[j,h]=a.useState(""),[i,p]=a.useState(""),[w,k]=a.useState(""),[s,_]=a.useState(!1),[d,m]=a.useState(!1),[f,y]=a.useState(!1),[v,u]=a.useState(null),S=r==="pro"||r==="pro_ai",{appLocale:I}=J(),E=q(I),T=()=>{const l=j.trim();return!l||!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(l)?t("invalidEmail"):S&&!g?t("missingPriceKey"):s?d?null:t("privacyRequired"):t("termsRequired")},A=async()=>{if(f)return;const l=T();if(l){u(l);return}u(null),y(!0);const B=new AbortController,M=setTimeout(()=>B.abort(),15e3);try{const N=await X({email:j.trim().toLowerCase(),first_name:i.trim()||void 0,last_name:w.trim()||void 0,plan_key:r,price_key:S?g:void 0,locale:I,acknowledgement:{terms_accepted:!0,terms_version:z.terms,privacy_notice_acknowledged:!0,privacy_policy_version:z.privacy,locale:I,source:"register_email_step"}});clearTimeout(M),n(N)}catch(N){if(clearTimeout(M),y(!1),N instanceof $)switch(N.code){case"already_active":u(t("alreadyActive"));break;case"rate_limited":u(t("rateLimited"));break;default:u(N.message||t("somethingWentWrong"))}else N instanceof Error&&N.name==="AbortError"?u(t("connectionTimeout")):u(t("noConnection"))}},F=t(r==="free"?"startFree":r==="pro_ai"?"startProAi":"startPro"),L=t(r==="free"?"codeHint":"codePaidHint");return e.jsx("div",{className:"register-flow","data-testid":"register-email-step",children:e.jsxs("div",{className:"register-flow__inner register-flow__inner--narrow",children:[e.jsxs("header",{className:"register-flow__header",children:[e.jsx("h1",{className:"register-flow__title",children:F}),e.jsx("p",{className:"register-flow__lead",children:L})]}),v&&e.jsx("div",{className:"register-flow__error",role:"alert",children:v}),e.jsxs("form",{onSubmit:l=>{l.preventDefault(),A()},className:"register-flow__form",children:[e.jsxs("div",{children:[e.jsx("label",{className:"bm-label",htmlFor:"register-email",children:t("email")}),e.jsx("input",{id:"register-email",className:"bm-input",type:"email",autoComplete:"email",required:!0,disabled:f,value:j,onChange:l=>h(l.target.value),"data-testid":"register-email-input"})]}),e.jsxs("div",{className:"register-flow__row",children:[e.jsxs("div",{children:[e.jsx("label",{className:"bm-label",htmlFor:"register-first-name",children:t("firstName")}),e.jsx("input",{id:"register-first-name",className:"bm-input",type:"text",autoComplete:"given-name",disabled:f,value:i,onChange:l=>p(l.target.value)})]}),e.jsxs("div",{children:[e.jsx("label",{className:"bm-label",htmlFor:"register-last-name",children:t("lastName")}),e.jsx("input",{id:"register-last-name",className:"bm-input",type:"text",autoComplete:"family-name",disabled:f,value:w,onChange:l=>k(l.target.value)})]})]}),e.jsxs("div",{className:"register-flow__legal","data-testid":"register-legal-block",children:[e.jsxs("p",{className:"register-flow__legal-hint",children:[t("privacyNotice")," ",e.jsx("a",{href:E.privacy,target:"_blank",rel:"noopener noreferrer",children:o("privacy")}),"."]}),e.jsxs("label",{className:`register-flow__consent${s?" register-flow__consent--checked":""}`,"data-testid":"register-terms-checkbox",children:[e.jsx("input",{type:"checkbox",className:"register-flow__consent-input",checked:s,onChange:l=>_(l.target.checked),disabled:f}),e.jsx("span",{className:"register-flow__consent-box","aria-hidden":"true",children:e.jsx("svg",{viewBox:"0 0 16 16",width:"14",height:"14",focusable:"false",children:e.jsx("path",{d:"M3 8.5l3.2 3.2L13 5",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round"})})}),e.jsxs("span",{className:"register-flow__consent-label",children:[e.jsx("span",{className:"register-flow__consent-title",children:o("terms")}),e.jsxs("span",{className:"register-flow__consent-desc",children:[t("termsAcceptText")," ",e.jsx("a",{href:E.terms,target:"_blank",rel:"noopener noreferrer",onClick:l=>l.stopPropagation(),children:o("terms")}),"."]})]})]}),e.jsxs("label",{className:`register-flow__consent${d?" register-flow__consent--checked":""}`,"data-testid":"register-privacy-checkbox",children:[e.jsx("input",{type:"checkbox",className:"register-flow__consent-input",checked:d,onChange:l=>m(l.target.checked),disabled:f}),e.jsx("span",{className:"register-flow__consent-box","aria-hidden":"true",children:e.jsx("svg",{viewBox:"0 0 16 16",width:"14",height:"14",focusable:"false",children:e.jsx("path",{d:"M3 8.5l3.2 3.2L13 5",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round"})})}),e.jsxs("span",{className:"register-flow__consent-label",children:[e.jsx("span",{className:"register-flow__consent-title",children:o("privacy")}),e.jsxs("span",{className:"register-flow__consent-desc",children:[t("privacyReadText")," ",e.jsx("a",{href:E.privacy,target:"_blank",rel:"noopener noreferrer",onClick:l=>l.stopPropagation(),children:o("privacy")})," ",t("privacyReadTextSuffix"),"."]}
1)]})]})]}),e.jsxs("div",{className:"register-flow__actions",children:[e.jsx("button",{type:"button",className:"btn btn--ghost",onClick:x,disabled:f,"data-testid":"register-email-back",children:o("back")}),e.jsx("button",{type:"submit",className:"btn btn--primary btn--full",disabled:f||!s||!d,"data-testid":"register-email-submit",children:f?e.jsx("span",{className:"register-flow__spinner","aria-hidden":"true"}):t("sendCode")})]})]})]})})}function le({flowId:r,emailMasked:g,planKey:x,codeExpiresIn:n,canResend:t,onVerified:o,onBack:j,onExpired:h}){const{t:i}=P("registration"),{t:p}=P("common"),[w,k]=a.useState(""),[s,_]=a.useState(!1),[d,m]=a.useState(null),[f,y]=a.useState(null),[v,u]=a.useState(0),[S,I]=a.useState(t),[E,T]=a.useState(!1),[A,F]=a.useState(n),L=a.useRef(null),l=a.useRef(null);a.useEffect(()=>{L.current?.focus()},[]),a.useEffect(()=>{if(A<=0){h();return}const c=setInterval(()=>{F(b=>b<=1?(clearInterval(c),h(),0):b-1)},1e3);return()=>clearInterval(c)},[]);const B=a.useCallback(c=>{u(c),I(!1),l.current&&clearInterval(l.current),l.current=setInterval(()=>{u(b=>b<=1?(clearInterval(l.current),I(!0),0):b-1)},1e3)},[]),M=c=>{const b=c.replace(/\D/g,"").slice(0,6);k(b),m(null),b.length===6&&N(b)},N=async(c=w)=>{if(s||c.length!==6)return;m(null),_(!0);const b=new AbortController,W=setTimeout(()=>b.abort(),2e4);try{const R=await Q({flow_id:r,code:c});clearTimeout(W),o(R)}catch(R){if(clearTimeout(W),_(!1),k(""),L.current?.focus(),R instanceof $)switch(R.code){case"wrong_code":{const K=R.attemptsRemaining;y(K??null),m(K!=null?i("wrongCodeWithAttempts",{count:K}):i("wrongCode"));break}case"too_many_attempts":m(i("tooManyAttempts"));break;case"code_expired":h();break;case"rate_limited":m(i("rateLimited"));break;default:m(R.message||i("somethingWentWrong"))}else R instanceof Error&&R.name==="AbortError"?m(i("connectionTimeout")):m(i("noConnection"))}},V=async()=>{if(!(E||!S)){T(!0),m(null);try{const c=await ee(r);F(c.code_expires_in),B(60),k(""),L.current?.focus()}catch(c){c instanceof $&&c.code==="resend_cooldown"?B(60):m(i("resendFailed")),T(!1)}}},H=c=>{const b=Math.floor(c/60),W=c%60;return`${b}:${W.toString().padStart(2,"0")}`},O=x==="pro"||x==="pro_ai";return e.jsx("div",{className:"register-flow","data-testid":"register-verify-step",children:e.jsxs("div",{className:"register-flow__inner register-flow__inner--narrow",children:[e.jsxs("header",{className:"register-flow__header",children:[e.jsx("h1",{className:"register-flow__title",children:i("verifyTitle")}),e.jsxs("p",{className:"register-flow__lead",children:[i("verifyLead",{email:g}),O?` ${i("verifyLeadPaid")}`:` ${i("verifyLeadFree")}`]})]}),d&&e.jsx("div",{className:"register-flow__error",role:"alert","data-testid":"verify-error",children:d}),e.jsxs("form",{onSubmit:c=>{c.preventDefault(),N()},className:"register-flow__form",children:[e.jsxs("div",{children:[e.jsx("label",{className:"bm-label",htmlFor:"verify-code",children:i("codeLabel")}),e.jsx("input",{id:"verify-code",ref:L,className:"bm-input",type:"text",inputMode:"numeric",pattern:"\\d{6}",maxLength:6,autoComplete:"one-time-code",disabled:s,value:w,onChange:c=>M(c.target.value),placeholder:"000000",style:{letterSpacing:"0.3em",fontSize:"1.5rem",textAlign:"center"},"data-testid":"verify-code-input"})]}),e.jsxs("div",{className:"register-flow__meta",style:{display:"flex",justifyContent:"space-between",fontSize:13,color:"var(--c-dim)"},children:[e.jsx("span",{children:A>0?i("codeExpiresIn",{time:H(A)}):i("codeExpiredStatus")}),f!=null&&e.jsx("span",{children:i("attemptsRemaining",{count:f})})]}),e.jsxs("div",{className:"register-flow__actions",children:[e.jsx("button",{type:"button",className:"btn btn--ghost",onClick:j,disabled:s,"data-testid":"verify-back",children:p("back")}),e.jsx("button",{type:"submit",className:"btn btn--primary btn--full",disabled:s||w.length!==6,"data-testid":"verify-submit",children:s?e.jsx("span",{className:"register-flow__spinner","aria-hidden":"true"}):i(O?"toPayment":"verify")})]})]}),e.jsx("div",{style:{textAlign:"center",marginTop:16},children:S?e.jsx("button",{type:"button",className:"register-flow__footer-link",onClick:V,disabled:E,"data-testid":"verify-resend",children:i(E?"sending":"resendCode")}):e.jsx("span",{style:{fontSize:13,color:"var(--c-dim)"},children:v>0?i("resendCooldown",{count:v}):i("resendNotPossible")})}),e.jsx("p",{className:"register-flow__note",style:{marginTop:12,fontSize:12,opacity:.6},children:i("checkSpam")})]})})}function oe({email:r,onGoToLogin:g}){return e.jsx("div",{className:"register-flow","data-testid":"register-success-check-email",children:e.jsxs("div",{className:"register-flow__inner register-flow__inner--narrow",children:[e.jsxs("header",{className:"register-flow__header",children:[e.jsx("h1",{className:"register-flow__title",children:"Fast fertig"}),e.jsxs("p",{className:"register-flow__lead",children:["Wir haben dir eine E-Mail an ",e.jsx("strong",{children:r})," geschickt. Bitte öffne den Link, setze dein Passwort und logge dich danach ein."]})]}),e.jsx("div",{className:"register-flow__actions",children:e.jsx("button",{type:"button",className:"btn btn--primary btn--full",onClick:g,"data-testid":"register-success-login",children:"Zum Login"})}),e.jsx("p",{className:"register-flow__note",style:{marginTop:16,fontSize:12,opacity:.7},children:"Keine Mail erhalten? Prüfe deinen Spam-Ordner. Wenn nichts ankommt, kannst du hier zurück und es mit einer anderen Adresse versuchen."})]})})}const C="bitemap_reg_flow";function ue(){const{isAuthenticated:r,isLoading:g,login:x}
1=Y(),n=Z(),[t,o]=a.useState({kind:"plan"}),j=a.useRef(!1);if(a.useEffect(()=>{if(g)return;if(r){n("/",{replace:!0});return}if(j.current)return;j.current=!0;const s=sessionStorage.getItem(C);if(s)try{const _=JSON.parse(s);if(!_.flowId)return;D(_.flowId).then(d=>{switch(d.status){case"email_pending":o({kind:"verify",flow:_});break;case"checkout_started":d.checkout_url&&(window.location.href=d.checkout_url);break;case"invite_sent":sessionStorage.removeItem(C),o({kind:"success_free",email:_.emailMasked});break;case"failed":case"expired":sessionStorage.removeItem(C);break;default:d.checkout_url&&(window.location.href=d.checkout_url)}}).catch(()=>{sessionStorage.removeItem(C)})}catch{sessionStorage.removeItem(C)}},[g,r,n]),g)return e.jsx("div",{className:"app-loading",children:e.jsx("div",{className:"spinner"})});const h=async s=>{if(s.intent==="register_free"){o({kind:"email",plan:"free",intent:s});return}s.intent==="register_subscribe"&&o({kind:"email",plan:s.plan==="pro_ai"?"pro_ai":"pro",priceKey:s.price_key,intent:s})},i=async()=>{await x({returnTo:"/"})},p=(s,_,d)=>{const m={flowId:s.flow_id,emailMasked:s.email_masked,planKey:_,priceKey:d,codeExpiresIn:s.code_expires_in,canResend:!0};if(sessionStorage.setItem(C,JSON.stringify(m)),s.status!=="email_pending"){D(s.flow_id).then(f=>{f.checkout_url&&(window.location.href=f.checkout_url)}).catch(()=>{});return}o({kind:"verify",flow:m})},w=s=>{if(sessionStorage.removeItem(C),s.checkout_url){window.location.href=s.checkout_url;return}if(s.status==="invite_sent"||s.status==="provisioning"){n(`/register/success?flow_id=${s.flow_id}`,{replace:!0});return}n(`/register/success?flow_id=${s.flow_id}`,{replace:!0})},k=()=>{sessionStorage.removeItem(C),o({kind:"plan"})};return t.kind==="plan"?e.jsx(ne,{onRegister:h,onLogin:i}):t.kind==="email"?e.jsx(ae,{plan:t.plan,priceKey:t.priceKey,promoCode:t.intent.promo_code,onBack:()=>o({kind:"plan"}),onStarted:s=>p(s,t.plan,t.priceKey)}):t.kind==="verify"?e.jsx(le,{flowId:t.flow.flowId,emailMasked:t.flow.emailMasked,planKey:t.flow.planKey,codeExpiresIn:t.flow.codeExpiresIn,canResend:t.flow.canResend,onVerified:w,onBack:()=>{sessionStorage.removeItem(C),o({kind:"plan"})},onExpired:k}):e.jsx(oe,{email:t.email,onGoToLogin:i})}export{ue as RegisterRoute};

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.