PageSourceSearch

https://selexia.ai/_next/static/chunks/89a94767131704d7.js

js selexia.ai collected 2026-10-05 14:31:34 UTC 13,238 bytes, 1 lines download raw bytes

1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,363308,e=>{"use strict";var t=e.i(843476),a=e.i(271645),r=e.i(659544),s=e.i(846932),i=e.i(88653),l=e.i(975157),n=e.i(217255),c=e.i(520133),o=e.i(948148);function d({plan:e,billingCycle:n,handleSubscribe:d,loadingPlanId:p,isMobile:x,validPromo:m,setValidPromo:h,session:u}){let v=e.price.isOneShot,g=(0,o.useTranslations)("pricing"),b=v||"monthly"===n?e.price.monthly:Math.round(e.price.yearly/12),y=m&&(!m.applicablePlans||0===m.applicablePlans.length||m.applicablePlans.map(e=>e.toLowerCase()).includes(e.id.toLowerCase())),f=Math.round(100*(y?b*(1-m.discountPercent/100):b))/100,[j,w]=(0,a.useState)(""),[N,k]=(0,a.useState)(""),[C,P]=(0,a.useState)(!1),[S,T]=(0,a.useState)(!1),[A,O]=(0,a.useState)(!1),[I,U]=(0,a.useState)(!1),M=async()=>{if(j){k(""),P(!0);try{let t=await fetch("/api/promocodes/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:j,planId:e.id})});if(t.ok){let e=await t.json();h(e)}else{let e=await t.text();k(e||"Invalide")}}catch{k("Erreur")}finally{P(!1)}}};return(0,t.jsxs)("div",{className:(0,l.cn)("relative flex flex-col p-7 sm:p-8 bg-[var(--bg-surface)] rounded-[2.5rem] border transition-all duration-500 h-full",e.popular?"border-[var(--accent-primary)] shadow-2xl shadow-[var(--accent-primary)]/5 z-10":"border-[var(--border-default)] shadow-sm",x?"w-[80vw] snap-center shrink-0":"h-full",!x&&e.popular&&"lg:scale-[1.03]"),children:[e.popular&&(0,t.jsx)("div",{className:"absolute -top-4 left-1/2 -translate-x-1/2 z-20",children:(0,t.jsx)("div",{className:"bg-[var(--accent-primary)] text-[var(--text-inverse)] text-[10px] font-black uppercase tracking-widest px-5 py-1.5 rounded-full shadow-lg whitespace-nowrap",children:g("recommended")})}),(0,t.jsxs)("div",{className:"mb-6 text-center",children:[(0,t.jsx)("h3",{className:"text-2xl font-black text-[var(--text-primary)] mb-2 uppercase tracking-tight",children:e.name}),(0,t.jsx)("p",{className:"text-xs font-bold text-[var(--text-muted)] uppercase tracking-wider leading-relaxed",children:e.description})]}),(0,t.jsxs)("div",{className:"mb-8 text-center",children:[(0,t.jsxs)("div",{className:"flex items-baseline justify-center gap-1",children:[y&&(0,t.jsxs)("span",{className:"text-xl font-bold text-[var(--text-muted)] line-through decoration-red-500 mr-2",children:[b,"€"]}),(0,t.jsxs)("span",{className:"text-5xl font-black text-[var(--accent-primary)] tracking-tight",children:[f,"€"]}),(0,t.jsx)("span",{className:"text-[var(--text-muted)] text-[11px] font-black uppercase tracking-wider opacity-60",children:e.price.duration?`/${e.price.duration}`:"/mois"})]}),(0,t.jsx)("div",{className:"h-5 mt-1",children:(0,t.jsx)(i.AnimatePresence,{mode:"wait",children:"yearly"===n&&e.price.yearly>0&&!e.price.isOneShot?(0,t.jsxs)(s.motion.p,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.9},className:"text-[10px] text-emerald-500 font-black uppercase tracking-widest",children:["-",Math.round((1-e.price.yearly/(12*e.price.monthly))*100),"% ",g("discount")]}):(0,t.jsx)("span",{className:"block h-4"})})})]}),(0,t.jsxs)("div",{className:"space-y-4 flex-1 mb-8",children:[(0,t.jsx)("p",{className:"text-[9px] font-black text-[var(--text-primary)] uppercase tracking-[0.2em] opacity-30",children:g("included")}),(0,t.jsxs)("ul",{className:"space-y-3.5",children:[e.features.slice(0,8).map((e,a)=>(0,t.jsxs)("li",{className:"flex items-start gap-3 text-xs font-bold text-[var(--text-secondary)]",children:[(0,t.jsx)("div",{className:"w-4 h-4 rounded-full bg-[var(--status-success)]/10 flex items-center justify-center shrink-0 mt-0.5",children:(0,t.jsx)("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"4",className:"text-[var(--status-success)]",children:(0,t.jsx)("path",{d:"M20 6L9 17l-5-5"})})}),(0,t.jsx)("span",{className:"leading-tight",children:e})]},a)),e.limitations?.map((e,a)=>(0,t.jsxs)("li",{className:"flex items-start gap-3 text-xs font-bold text-[var(--text-muted)] opacity-40",children:[(0,t.jsx)("div",{className:"w-4 h-4 rounded-full bg-white/5 flex items-center justify-center shrink-0 mt-0.5",children:(0,t.jsx)("svg",{width:"8",he
1ight:"8",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"4",children:(0,t.jsx)("path",{d:"M18 6L6 18M6 6l12 12"})})}),(0,t.jsx)("span",{className:"leading-tight",children:e})]},a))]})]}),(0,t.jsx)("div",{className:"mb-4 space-y-3",children:m?(0,t.jsxs)("div",{className:"flex items-center justify-between bg-green-500/10 border border-green-500/20 rounded-xl px-3 py-2",children:[(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsxs)("span",{className:"text-[10px] font-black text-green-500 uppercase",children:["Code ",m.code]}),(0,t.jsx)("span",{className:"text-[9px] font-bold text-green-500/80",children:y?`-${m.discountPercent}% ${g("promoApplied")}`:g("promoNotApplicable")})]}),(0,t.jsx)("button",{onClick:()=>{h(null),T(!1),w("")},className:"text-green-500 hover:text-green-400",children:(0,t.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("path",{d:"M18 6 6 18"}),(0,t.jsx)("path",{d:"m6 6 12 12"})]})})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("input",{type:"checkbox",id:`promo-toggle-${e.id}`,checked:S,onChange:e=>T(e.target.checked),className:"w-3 h-3 rounded-[4px] border border-[var(--border-default)] bg-[var(--bg-elevated)] accent-[var(--accent-primary)] focus:ring-0 cursor-pointer"}),(0,t.jsx)("label",{htmlFor:`promo-toggle-${e.id}`,className:"text-[10px] font-bold text-[var(--text-secondary)] uppercase tracking-wide cursor-pointer select-none",children:g("promoToggle")})]}),(0,t.jsx)(i.AnimatePresence,{children:S&&(0,t.jsxs)(s.motion.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},className:"overflow-hidden",children:[(0,t.jsxs)("div",{className:"flex gap-2 pt-1",children:[(0,t.jsx)("input",{type:"text",placeholder:g("promoPlaceholder"),className:"bg-[var(--bg-elevated)] border border-[var(--border-default)] rounded-xl px-3 py-2 text-[10px] font-bold uppercase w-full outline-none focus:border-[var(--accent-primary)] focus:ring-1 focus:ring-[var(--accent-primary)] hover:border-[var(--accent-primary)]/50 transition-all duration-200 placeholder:text-[var(--text-muted)]",value:j,onChange:e=>w(e.target.value),onKeyDown:e=>"Enter"===e.key&&M()}),(0,t.jsx)(r.Button,{size:"sm",variant:"secondary",className:"h-full bg-[var(--bg-elevated)] border border-[var(--border-default)] rounded-xl aspect-square p-0 flex items-center justify-center shrink-0",onClick:M,disabled:C,children:C?(0,t.jsx)("div",{className:"w-3 h-3 border-2 border-[var(--text-muted)] border-t-transparent rounded-full animate-spin"}):(0,t.jsx)("span",{className:"text-[9px] font-black",children:"OK"})})]}),N&&(0,t.jsx)("p",{className:"text-[9px] font-bold text-red-500 mt-1 ml-1",children:N})]})})]})}),(0,t.jsxs)("div",{className:"mb-6 flex items-start gap-2",children:[(0,t.jsx)("input",{type:"checkbox",id:`cgv-${e.id}`,checked:A,onChange:e=>O(e.target.checked),className:"mt-0.5 w-3 h-3 rounded-[4px] border border-[var(--border-default)] bg-[var(--bg-elevated)] accent-[var(--accent-primary)] focus:ring-0 cursor-pointer"}),(0,t.jsxs)("label",{htmlFor:`cgv-${e.id}`,className:"text-[9px] font-bold text-[var(--text-muted)] uppercase tracking-wide cursor-pointer select-none leading-tight",children:[g.rich("cgvAccept",{link:e=>(0,t.jsx)(c.Link,{href:"/cgv",className:"text-[var(--text-primary)] underline decoration-dotted hover:text-[var(--accent-primary)]",onClick:e=>e.stopPropagation(),children:g("cgv")})})," ",g("cgvAcceptEnd")]})]}),(0,t.jsx)(r.Button,{variant:"primary",size:"lg",className:(0,l.cn)("w-full h-12 rounded-2xl font-black uppercase tracking-widest text-[11px] transition-all duration-300",A||e.id?.toUpperCase()===u?.user?.planType?.toUpperCase()||u?.user?.isPremium&&"pass"===e.id?"!bg-[var(--accent-secondary)] active:scale-95 shadow-xl shadow-[var(--accent-primary)]/20 hover:shadow-[var(--accent-primary)]/40 hover:-translate-y-0.5":"!bg-[var(--accent-primary)] !text-[var(--text-inverse)] cursor-not-allowed hover:!bg-[var(--accent-primary)]",e.id?.toUpperCase()===u?.user?.planType?.toUpperCase()&&"!bg-emerald-500 !shadow-none !cursor-default hover:!translate-y-0 active:!scale-100"),onClick:()=>{u?.user?.planType,u?.user?.isPremium||(A?(U(!1),d(e,y?m:null)):(U(!0),setTimeout(()=>U(!1),3e3)))},disabled:null!==p||u?.user?.isPremium===!0,children:p===e.id?(0,t.jsx)("div",{className:"w-4 h-4 border-2 border-white/30 border-t-white rounded-full animate-spin"}):u?.user?.planType?.toUpperCase()===e.id?.toUpperCase()&&u?.user?.isPremium?g("currentPlan"):u?.user?.isPremium?g("changePlan"):e.cta}),u?.user?.isPremium&&u?.user?.planType?.toUpperCase()!==e.id?.toUpperCase()&&(0,t.jsx)("p",{className:"text-[9px] font-bold text-[var(--text-muted)] text-center mt-3 uppercase tracking-wide leading-tight",children:g("cancelFirst")}),(0,t.jsx)(i.AnimatePresence,{children:I&&(0,t.jsx)(s.motion.p,{initial:{opacity:0,y:-10}
1,animate:{opacity:1,y:0},exit:{opacity:0},className:"absolute bottom-1.5 left-0 right-0 text-center text-[10px] font-black text-red-500 uppercase tracking-tight",children:g("cgvError")})})]})}function p(){let[e,r]=(0,a.useState)([]),i="monthly",{data:l}=(0,n.useSession)(),p=(0,c.useRouter)(),[x,m]=(0,a.useState)(null),[h,u]=(0,a.useState)(!0),[v,g]=(0,a.useState)(1),b=(0,o.useTranslations)("pricing"),[y,f]=(0,a.useState)(null);(0,a.useEffect)(()=>{!async function(){try{let e=await fetch("/api/pricing"),t=await e.json();Array.isArray(t)&&r(t)}catch(e){console.error(e)}finally{u(!1)}}();let e=localStorage.getItem("selexia_auto_promo");e&&(async()=>{try{let t=await fetch("/api/promocodes/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:e})});if(t.ok){let e=await t.json();f(e)}}catch(e){console.error("Auto promo validation failed:",e)}})()},[]);let j=async(e,t)=>{if(!l)return void p.push(`/register?plan=${e.id}`);m(e.id);try{let a="pass"===e.id?"price_one_shot":"price_monthly",r=await fetch("/api/checkout",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({priceId:a,planId:e.id,promoCode:t?.code||y?.code})});if(!r.ok)throw Error("Erreur checkout");let s=await r.json();window.location.href=s.url}catch(e){m(null)}};return(0,t.jsxs)("section",{className:"py-16 md:py-24 relative overflow-hidden bg-[var(--bg-base)]",children:[(0,t.jsx)("div",{className:"absolute top-1/2 left-0 -translate-y-1/2 -ml-64 w-[600px] h-[600px] bg-orange-500/5 rounded-full blur-[120px] -z-10"}),(0,t.jsxs)("div",{className:"container relative z-10",children:[(0,t.jsx)("div",{className:"text-center mb-16",children:(0,t.jsxs)(s.motion.div,{initial:{opacity:0,scale:.9},whileInView:{opacity:1,scale:1},viewport:{once:!0},children:[(0,t.jsxs)("h2",{className:"text-4xl md:text-6xl font-black text-[var(--text-primary)] mb-6 tracking-tighter uppercase italic",children:[b("title").split("Selexia")[0]," ",(0,t.jsx)("span",{className:"text-[var(--accent-primary)]",children:"Selexia."})]}),(0,t.jsx)("p",{className:"text-sm md:text-base text-[var(--text-secondary)] max-w-2xl mx-auto font-bold uppercase tracking-widest opacity-60",children:b("subtitle")})]})}),(0,t.jsx)("div",{className:"hidden lg:grid grid-cols-3 gap-8 max-w-6xl mx-auto items-stretch h-full pt-10",children:e.map(e=>(0,t.jsx)(d,{plan:e,billingCycle:i,handleSubscribe:j,loadingPlanId:x,validPromo:y,setValidPromo:f,session:l},e.id))}),(0,t.jsxs)("div",{className:"lg:hidden",children:[(0,t.jsx)("div",{onScroll:e=>{let t=Math.round(e.currentTarget.scrollLeft/(.8*e.currentTarget.offsetWidth));t!==v&&g(t)},className:"flex overflow-x-auto pb-8 pt-10 lg:pt-8 px-[10vw] no-scrollbar snap-x snap-mandatory gap-5 overflow-visible",children:e.map((e,a)=>(0,t.jsx)(s.motion.div,{initial:{opacity:.8,scale:.95},whileInView:{opacity:1,scale:e.popular?1.02:1},viewport:{amount:.7},className:"flex-shrink-0 snap-center",children:(0,t.jsx)(d,{plan:e,billingCycle:i,handleSubscribe:j,loadingPlanId:x,isMobile:!0,validPromo:y,setValidPromo:f,session:l})},e.id))}),(0,t.jsx)("div",{className:"flex justify-center items-center gap-2.5 mt-2",children:e.map((e,a)=>(0,t.jsx)(s.motion.div,{animate:{width:a===v?24:6,backgroundColor:a===v?"var(--accent-primary)":"var(--border-default)",opacity:a===v?1:.5},className:"h-1.5 rounded-full transition-all duration-300"},a))})]}),(0,t.jsxs)(s.motion.div,{initial:{opacity:0,y:10},whileInView:{opacity:1,y:0},viewport:{once:!0},className:"mt-8 sm:mt-12 mx-auto max-w-md px-6",children:[(0,t.jsx)("p",{className:"text-center text-[10px] sm:text-xs text-[var(--text-muted)] leading-relaxed font-semibold uppercase tracking-wider opacity-60",children:b("sameAccess")}),(0,t.jsx)("p",{className:"text-center text-[10px] sm:text-xs text-[var(--text-muted)] mt-1 font-medium opacity-40",children:b("cancelAnytime")})]})]})]})}e.s(["PricingSection",()=>p])},342869,e=>{e.n(e.i(363308))}]);

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.