PageSourceSearch

https://maxskills.io/assets/FormationPurchase-CDSEPxJo.js

js maxskills.io collected 2026-09-24 15:04:00 UTC 28,115 bytes, 1 lines download raw bytes

1import{a6 as ye,u as Ne,y as ve,ab as ke,a as Ce,r as o,c as T,d as _e,j as e,L as $,w as D,q as G,p as Fe,ac as Q,R as Pe,E as J,ad as Se,m as Te,n as $e,B as De,a4 as h,ae as W,X,C as H,af as Y,ag as Me,k as Ae,U as Z,a0 as Re,$ as Ve,ah as qe,ai as ze,t as d,s as j,aj as Ee}from"./index-BJijipAU.js";import{r as Ie}from"./locale-CY-vkBv4.js";import{C as ee}from"./circle-alert-Cq4_nmop.js";import"./i18n-DlcS6BNz.js";import"./index-paNpr7jU.js";const Le="https://s3.eu-central-003.backblazeb2.com/maxskills-dev";function se(l){return l?l.startsWith("http")||l.startsWith("/")?l:`${Le}/${l}`:""}function Qe(){const{slug:l}=ye(),{t:m,i18n:te}=Ne("lms"),re=te.language,g=ve(),{isIos:M}=ke(),ae=Ce();o.useEffect(()=>{M&&l&&g(`/formations/${l}`,{replace:!0})},[M,l,g]);const[p,k]=o.useState(null),[u,A]=o.useState([]),[R,ie]=o.useState(""),[ne,le]=o.useState(!1),[oe,V]=o.useState(null),[q,de]=o.useState(!1),[w,C]=o.useState(""),[z,E]=o.useState(!1),[i,I]=o.useState(null),{data:r,isLoading:ce}=T({queryKey:["formation",l],queryFn:()=>j.get(`/api/v1/formations/${l}`).then(s=>s.data.data??s.data),enabled:!!l}),{data:c=[],isLoading:xe}=T({queryKey:["payment-methods-active"],queryFn:()=>j.get("/api/payment-methods/active").then(s=>s.data.data??s.data)}),{data:me}=T({queryKey:["enrollment-status",r?.id],queryFn:()=>j.get(`/api/v1/my/enrollment-status/${r.id}`).then(s=>s.data),enabled:!!r?.id}),y=me?.enrollment,pe=y?.status==="pending"&&y?.access_type==="full",he=y?.status==="suspended"&&y?.access_type==="full",L=r?r.price_promo??r.price_standard:null,_=L?parseFloat(L):0,ue=i?i.discountAmount:0,F=Math.max(0,_-ue),b=F.toFixed(2),be=o.useMemo(()=>c.filter(s=>s.is_online),[c]),U=o.useMemo(()=>c.filter(s=>!s.is_online),[c]);o.useEffect(()=>{if(c.length>0&&p===null){const s=c.find(t=>t.is_online);k(s?s.id:c[0].id)}},[c,p]);const P=async s=>{const t=w.trim().toUpperCase();if(!t){d.error("Veuillez saisir un code promo");return}E(!0);try{const n=(await j.post("/api/promo-codes/validate",{code:t,formation_id:r?.id,order_amount:_})).data;n.valid?(I({code:n.code,discountPercent:n.discount_type==="percentage"?n.discount_value:void 0,discountAmount:parseFloat(n.discount_amount)}),d.success(`Code promo ${n.code} appliqué ! (-${parseFloat(n.discount_amount).toFixed(2)} DT)`),C("")):d.error(n.message||"Code promo invalide.")}catch(a){const n=a?.response?.data?.message||"Code promo invalide ou expiré.";d.error(n)}finally{E(!1)}},B=()=>{I(null),d.info("Code promo retiré")},S=_e({mutationFn:async()=>{const s=new FormData;s.append("formation_id",r.id),s.append("payment_method_id",String(p)),F>0&&s.append("amount",String(F));let t=R;if(i){s.append("promo_code",i.code);const a=`[Code Promo: ${i.code} - Réduction: ${i.discountAmount.toFixed(2)} DT]`;t=t?`${t} | ${a}`:a}return t&&s.append("notes",t),u.forEach(a=>{s.append("proofs[]",a)}),j.post("/api/v1/enrollment-requests",s,{headers:{"Content-Type":"multipart/form-data"}})},onSuccess:async s=>{if(ae.invalidateQueries({queryKey:["enrollment-status",r?.id]}),x?.is_online){const t=s?.data?.pending_installment_id;if(t)try{const{form_url:a}=await Ee("installment",t);window.location.href=a;return}catch(a){d.error(a?.response?.data?.message??m("purchase.online_failed",{defaultValue:"Le paiement en ligne est indisponible. Réessayez depuis « Mes paiements »."})),g("/my/payments");return}}d.success(m("purchase.request_sent",{defaultValue:"Votre demande a été envoyée avec succès !"})),g(`/formations/${l}`)},onError:s=>{s?.response?.status===409?d.error(m("formations.demo_already",{defaultValue:"Vous êtes déjà inscrit à cette formation."})):d.error(m("common.error",{defaultValue:"Une erreur est survenue lors de l'enregistrement."}))}}),x=o.useMemo(()=>c.find(s=>s.id===p),[c,p]),fe=x&&!x.is_online;function ge(s){const t=Array.from(s.target.files||[]),a=["image/jpeg","image/png","image/jpg","application/pdf"],n=t.filter(v=>a.includes(v.type)&&v.size<=10*1024*1024);if(n.length+u.length>3){d.error(m("purchase.max_proofs",{defaultValue:"Vous pouvez ajouter jusqu'à 3 justificatifs au maximum."}));return}A(v=>[...v,...n]),s.target.value=""}function je(s){A(t=>t.filter((a,n)=>n!==s))}const we=(s,t)=>{navigator.clipboard.writeText(s),V(t),d.success(`${t} copié !`),setTimeout(()=>V(null),2e3)};if(ce)return e.jsxs("div",{className:"flex flex-col items-center justify-center min-h-screen bg-[#000216] text-white",children:[e.jsx($,{className:"h-10 w-10 animate-spin text-primary mb-4"}),e.jsx("p",{className:"text-sm text-gray-400 font-medium",children:"Chargement du paiement sécurisé..."})]});if(!r)return e.jsxs("div",{className:"flex flex-col items-center justify-center min-h-screen bg-[#000216] text-white p-6 text-center",children:[e.jsx(ee,{className:"h-12 w-12 text-red-400 mb-3"}),e.jsx("h2",{className:"text-xl font-bold mb-1",children:"Formation introuvable"}),e.jsx("p",{className:"text-sm text-gray-400 mb-6",children:"La formation demandée n'existe pas ou a été désactivée."}),e.jsx(D,{to:"/formations",className:"px-5 py-2.5 rounded-xl bg-white/10 hover:bg-white/20 text-sm font-semibold transition-colors",children:"Retour au catalogue"})]});const f=Ie(r.title,re),K=r.price_promo??r.price_standard,O=r.price_promo&&r.price_promo<r.price_standard,N=r.cover_images?.[0]??r.thumbnail_img;return pe?e.jsx("div",{className:"min-h-screen bg-[#000216] text-white flex items-center justify-center px-6 py-12",children:e.jsxs("div",{className:"max-w-md w-full bg-[#111422] border border-white/10 rounded-3xl p-8 text-center shadow-2xl space-y-6",children:[e.jsx("div",{className:"w-16 h-16 rounded-2xl bg-emerald-500/15 border border-emerald-500/30 text-emerald-400 flex items-center justify-center mx-auto 
1shadow-lg shadow-emerald-500/10",children:e.jsx(G,{className:"h-9 w-9"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold mb-2",children:"Demande en cours d'examen"}),e.jsxs("p",{className:"text-sm text-gray-400",children:["Votre inscription pour ",e.jsx("strong",{className:"text-white",children:f})," a bien été transmise à l'administration."]})]}),e.jsxs("div",{className:"p-4 rounded-2xl bg-white/[0.03] border border-white/5 flex items-center justify-center gap-2.5 text-primary text-sm font-semibold",children:[e.jsx(Fe,{className:"h-4 w-4"}),e.jsx("span",{children:"Validation sous 2 à 24 heures"})]}),e.jsxs(D,{to:`/formations/${l}`,className:"w-full inline-flex items-center justify-center gap-2 py-3.5 rounded-xl bg-white/10 hover:bg-white/15 text-white font-semibold text-sm transition-all",children:[e.jsx(Q,{className:"h-4 w-4"}),e.jsx("span",{children:"Retour à la formation"})]})]})}):he&&!ne?e.jsx("div",{className:"min-h-screen bg-[#000216] text-white flex items-center justify-center px-6 py-12",children:e.jsxs("div",{className:"max-w-md w-full bg-[#111422] border border-red-500/20 rounded-3xl p-8 text-center shadow-2xl space-y-6",children:[e.jsx("div",{className:"w-16 h-16 rounded-2xl bg-red-500/15 border border-red-500/30 text-red-400 flex items-center justify-center mx-auto shadow-lg shadow-red-500/10",children:e.jsx(ee,{className:"h-9 w-9"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold mb-2 text-red-400",children:m("purchase.declined_title",{defaultValue:"Paiement refusé"})}),e.jsx("p",{className:"text-sm text-gray-400",children:m("purchase.declined_desc",{defaultValue:"Votre justificatif ou votre paiement n'a pas pu être validé."})})]}),e.jsxs("div",{className:"space-y-2.5 pt-2",children:[e.jsxs("button",{onClick:()=>le(!0),className:"w-full py-3.5 rounded-xl bg-red-600 hover:bg-red-500 text-white font-bold text-sm transition-all flex items-center justify-center gap-2 shadow-lg shadow-red-600/20",children:[e.jsx(Pe,{className:"h-4 w-4"}),e.jsx("span",{children:"Soumettre un nouveau paiement"})]}),e.jsx("button",{onClick:()=>g("/my/payments"),className:"w-full py-3 rounded-xl border border-white/10 text-gray-300 text-xs font-semibold hover:bg-white/5 transition-colors",children:m("purchase.view_my_payments",{defaultValue:"Consulter mes paiements"})})]})]})}):e.jsxs("div",{className:"min-h-full w-full m-0 p-0 bg-[#000216] text-white selection:bg-primary/30 flex flex-col font-sans",children:[e.jsxs("header",{className:"sticky top-0 left-0 right-0 w-full h-16 z-40 bg-[#000216]/95 backdrop-blur-md border-b border-white/[0.08] px-4 sm:px-8 flex items-center justify-between shrink-0",children:[e.jsxs(D,{to:`/formations/${l}`,className:"inline-flex items-center gap-2 text-gray-300 hover:text-white transition-colors text-xs sm:text-sm font-semibold group",children:[e.jsx("div",{className:"p-1.5 rounded-lg bg-white/5 border border-white/10 group-hover:bg-white/10 transition-colors",children:e.jsx(Q,{className:"h-3.5 w-3.5"})}),e.jsx("span",{children:"Retour à la formation"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("img",{src:"/logo.png",alt:"MaxSkills",className:"h-6 w-auto opacity-90"}),e.jsx("span",{className:"text-xs font-bold text-gray-400 uppercase tracking-widest border-l border-white/10 pl-2",children:"Checkout"})]}),e.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-emerald-400 font-semibold bg-emerald-500/10 px-3 py-1 rounded-full border border-emerald-500/20",children:[e.jsx(J,{className:"w-3.5 h-3.5"}),e.jsx("span",{className:"hidden sm:inline",children:"Paiement Sécurisé SSL"})]})]}),e.jsxs("div",{className:"w-full flex-1 flex flex-col",children:[e.jsxs("div",{className:"lg:hidden border-b border-white/5 bg-[#0e1120] p-4",children:[e.jsxs("button",{type:"button",onClick:()=>de(s=>!s),className:"w-full flex items-center justify-between text-xs font-semibold text-gray-300 cursor-pointer",children:[e.jsxs("div",{className:"flex items-center gap-2 text-primary",children:[e.jsx(Se,{className:"w-4 h-4"}),e.jsx("span",{children:"Récapitulatif de la commande"}),q?e.jsx(Te,{className:"w-4 h-4"}):e.jsx($e,{className:"w-4 h-4"})]}),e.jsxs("span",{className:"text-sm font-extrabold text-white",children:[b," DT"]})]}),q&&e.jsxs("div",{className:"mt-4 pt-4 border-t border-white/5 space-y-4",children:[e.jsxs("div",{className:"flex gap-3 items-center",children:[N&&e.jsx("img",{src:se(N),alt:f,className:"w-12 h-16 object-cover rounded-xl border border-white/10 shrink-0"}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("h3",{className:"font-bold text-xs text-white line-clamp-2",children:f}),e.jsxs("div",{className:"flex items-center gap-2 mt-0.5",children:[e.jsxs("span",{className:"text-xs text-primary font-bold",children:[b," DT"]}),i&&e.jsxs("span",{className:"text-[10px] text-emerald-400 bg-emerald-500/10 px-1.5 py-0.5 rounded",children:["-",
1i.discountAmount.toFixed(2)," DT (",i.code,")"]})]})]})]}),i?e.jsxs("div",{className:"flex items-center justify-between p-2 rounded-xl bg-emerald-500/10 text-xs",children:[e.jsxs("span",{className:"text-emerald-400 font-bold",children:[i.code," appliqué"]}),e.jsx("button",{type:"button",onClick:B,className:"text-red-400 text-xs",children:"Retirer"})]}):e.jsxs("div",{className:"flex gap-2",children:[e.jsx("input",{type:"text",value:w,onChange:s=>C(s.target.value.toUpperCase()),placeholder:"Code Promo",className:"flex-1 bg-[#111422] border border-white/10 rounded-xl px-3 py-2 text-xs text-white uppercase font-bold"}),e.jsx("button",{type:"button",onClick:()=>P(),className:"px-3 py-2 rounded-xl bg-primary text-white text-xs font-bold",children:"Appliquer"})]})]})]}),e.jsxs("main",{className:"w-full flex-1 grid grid-cols-1 lg:grid-cols-12 min-h-[calc(100vh-64px)]",children:[e.jsx("div",{className:"hidden lg:flex lg:col-span-5 border-r border-white/[0.08] bg-[#000216] p-8 xl:p-12 flex-col justify-start relative",children:e.jsxs("div",{className:"max-w-md ml-auto w-full space-y-6",children:[e.jsxs("div",{className:"p-5 rounded-3xl bg-[#111422] border border-white/[0.08] shadow-xl flex gap-4 items-center",children:[N&&e.jsx("img",{src:se(N),alt:f,className:"w-20 h-28 object-cover rounded-2xl shadow-lg border border-white/10 shrink-0"}),e.jsxs("div",{className:"min-w-0 space-y-1.5",children:[e.jsx(De,{variant:"outline",className:"bg-primary/10 text-primary border-primary/30 text-[10px] font-bold uppercase tracking-wider py-0.5",children:"Formation Certifiante"}),e.jsx("h2",{className:"text-base font-extrabold text-white leading-tight line-clamp-2",children:f}),e.jsxs("div",{className:"flex items-baseline gap-2 pt-1",children:[e.jsx("span",{className:"text-2xl font-black text-primary tracking-tight",children:K?`${K} DT`:m("formations.free",{defaultValue:"Gratuit"})}),O&&e.jsxs("span",{className:"text-xs text-gray-500 line-through",children:[r.price_standard," DT"]}),O&&e.jsxs("span",{className:"text-[10px] font-bold px-1.5 py-0.5 rounded bg-emerald-500/15 text-emerald-400 border border-emerald-500/30",children:["Économisez ",r.price_standard-(r.price_promo||0)," DT"]})]})]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{className:"text-xs font-bold uppercase tracking-widest text-gray-400",children:"Ce qui est inclus dans votre accès :"}),e.jsxs("div",{className:"space-y-2.5 text-xs text-gray-300",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"p-1 rounded-full bg-emerald-500/15 text-emerald-400 border border-emerald-500/30 shrink-0",children:e.jsx(h,{className:"w-3 h-3"})}),e.jsx("span",{children:"Accès complet et illimité à l'ensemble des vidéos"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"p-1 rounded-full bg-emerald-500/15 text-emerald-400 border border-emerald-500/30 shrink-0",children:e.jsx(h,{className:"w-3 h-3"})}),e.jsx("span",{children:"Certificat de réussite professionnel vérifiable"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"p-1 rounded-full bg-emerald-500/15 text-emerald-400 border border-emerald-500/30 shrink-0",children:e.jsx(h,{className:"w-3 h-3"})}),e.jsx("span",{children:"Fichiers sources, templates et ressources téléchargeables"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"p-1 rounded-full bg-emerald-500/15 text-emerald-400 border border-emerald-500/30 shrink-0",children:e.jsx(h,{className:"w-3 h-3"})}),e.jsx("span",{children:"Mises à jour des cours et accès communautaire"})]})]})]}),e.jsxs("div",{className:"p-4 rounded-3xl bg-[#111422] border border-white/[0.08] space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between text-xs font-bold text-gray-300",children:[e.jsxs("span",{className:"flex items-center gap-1.5 uppercase tracking-wider text-[11px]",children:[e.jsx(W,{className:"w-3.5 h-3.5 text-primary"}),e.jsx("span",{children:"Code Promo"})]}),i&&e.jsx("span",{className:"text-[10px] text-emerald-400 font-extrabold uppercase bg-emerald-500/10 px-2 py-0.5 rounded-full border border-emerald-500/20",children:"Actif"})]}),i?e.jsxs("div",{className:"flex items-center justify-between p-3 rounded-2xl bg-emerald-500/10 border border-emerald-500/20 text-xs",children:[e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx("div",{className:"p-1 rounded-lg bg-emerald-500/20 text-emerald-400",children:e.jsx(h,{className:"w-3.5 h-3.5 stroke-[3]"})}),e.jsxs("div",{children:[e.jsx("span",{className:"font-extrabold text-white tracking-wider font-mono",children:i.code}),e.jsxs("span",{className:"text-[11px] text-emerald-400 block font-medium",children:[i.discountPercent?`-${i.discountPercent}%`:`-${i.discountAmount.toFixed(2)} DT`," de réduction"]})]})]}),e.jsx("button",{type:"button",onClick:B,className:"p-1.5 rounded-xl hover:bg-red-500/15 text-gray-400 hover:text-red-400 transition-colors cursor-pointer",title:"Retirer le code",children:e.jsx(X,{className:"w-3.5 h-3.5"})})]}):e.jsxs("div",{className:"flex gap-2",children:[e.jsx("div",{className:"relative flex-1",children:e.jsx("input",{type:"text",value:w,onChange:s=>C(s.target.value.toUpperCase()),onKeyDown:s=>{s.key==="Enter"&&(s.preventDefault(),P())},placeholder:"Ex: MAX20",className:"w-full bg-[#070913] border border-white/10 rounded-2xl px-3.5 py-2.5 text-xs text-white uppercase font-bold focus:outline-none focus:border-primary placeholder:text-gray-600 transition-colors"})}),e.jsx("button",{type:"button",onClick:()=>P(),disabled:!w.trim()||z,className:"px-4 py-2.5 rounded-2xl bg-primary hover:bg-primary/90 text-white font-bold text-xs transition-all disabled:opacity-40 disabled:cursor-not-allowed cursor-pointer flex items-center gap-1.5 shrink-0",children:z?e.jsx($,{className:"w-3.5 h-3.5 animate-spin"}):e.jsx("span",{children:"Appliquer"})})]})]}),e.jsxs("div",{className:"p-5 rounded-3xl bg-[#111422] border border-white/[0.08] space-y-3",children:[e.jsxs("div",{className:"flex justify-between text-xs text-gray-400",children:[e.jsx("span",{children:"Prix de la formation"}),e.jsxs("span",{className:"text-white font-medium",children:[_.toFixed(2)," DT"]})]}),i&&e.jsxs("div",{className:"flex justify-between text-xs text-emerald-400 font-semibold",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(W,{className:"w-3 h-3"}),e.jsxs("span",{children:["Réduction (",i.code,")"]})]}
1),e.jsxs("span",{children:["-",i.discountAmount.toFixed(2)," DT"]})]}),e.jsxs("div",{className:"pt-3 border-t border-white/10 flex justify-between items-baseline",children:[e.jsx("span",{className:"text-sm font-bold text-white",children:"Total à régler aujourd'hui"}),e.jsxs("span",{className:"text-2xl font-black text-primary tracking-tight",children:[b," DT"]})]})]})]})}),e.jsxs("div",{className:"lg:col-span-7 p-6 sm:p-10 xl:p-14 space-y-8 bg-[#000216] flex flex-col justify-between",children:[e.jsxs("div",{className:"space-y-8 max-w-xl mr-auto w-full",children:[e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("label",{className:"text-xs font-bold uppercase tracking-wider text-gray-300 flex items-center gap-2",children:[e.jsx(H,{className:"w-4 h-4 text-primary"}),e.jsx("span",{children:"Sélectionnez votre moyen de paiement"})]}),e.jsxs("span",{className:"text-[11px] text-gray-400 font-bold",children:["Total : ",b," DT"]})]}),xe?e.jsx("div",{className:"p-5 rounded-2xl border border-white/10 bg-[#111422] animate-pulse h-20"}):be.map(s=>{const t=p===s.id;return e.jsxs("button",{type:"button",onClick:()=>k(s.id),className:`w-full flex items-center justify-between p-4 sm:p-5 rounded-2xl border text-left transition-all cursor-pointer relative ${t?"bg-[#161a2e] border-primary shadow-xl shadow-primary/15 ring-1 ring-primary/40 text-white":"bg-[#111422] border-white/10 text-gray-400 hover:text-white hover:bg-white/[0.04] hover:border-white/20"}`,children:[e.jsxs("div",{className:"flex items-center gap-3.5 min-w-0",children:[e.jsx("div",{className:`w-11 h-11 rounded-2xl flex items-center justify-center shrink-0 border transition-colors ${t?"bg-primary/20 border-primary/40 text-primary shadow-inner":"bg-white/5 border-white/10 text-gray-400"}`,children:s.icon_url?e.jsx("img",{src:s.icon_url,alt:s.name,className:"w-6 h-6 object-contain",onError:a=>{a.currentTarget.style.display="none"}}):e.jsx(H,{className:"w-6 h-6 text-primary"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("span",{className:"font-extrabold text-sm sm:text-base text-white truncate",children:s.name}),e.jsx("span",{className:"px-2 py-0.5 rounded-full text-[10px] font-black uppercase bg-gradient-to-r from-amber-500 to-primary text-black shadow-sm",children:"Instantané & Recommandé"})]}),e.jsx("p",{className:"text-xs text-gray-400 truncate mt-0.5",children:"Carte bancaire / e-Dinar avec activation immédiate sans attente"})]})]}),e.jsx("div",{className:"shrink-0 pl-3",children:e.jsx("div",{className:`w-5 h-5 rounded-full border flex items-center justify-center transition-colors ${t?"border-primary bg-primary text-white":"border-white/20 bg-white/5"}`,children:t&&e.jsx(h,{className:"w-3 h-3 stroke-[3]"})})})]},s.id)}),U.length>0&&e.jsxs("div",{className:"space-y-2.5 pt-2",children:[e.jsxs("div",{className:"text-[11px] font-semibold text-gray-400 uppercase tracking-wider flex items-center gap-2",children:[e.jsx("span",{className:"h-px bg-white/10 flex-1"}),e.jsx("span",{children:"Ou par virement / versement bancaire"}),e.jsx("span",{className:"h-px bg-white/10 flex-1"})]}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:U.map(s=>{const t=p===s.id;return e.jsxs("button",{type:"button",onClick:()=>k(s.id),className:`flex items-start gap-3 p-3.5 rounded-2xl border text-left transition-all cursor-pointer relative ${t?"bg-[#161a2e] border-primary shadow-lg shadow-primary/10 ring-1 ring-primary/40 text-white":"bg-[#111422] border-white/10 text-gray-400 hover:text-white hover:bg-white/[0.04] hover:border-white/20"}`,children:[e.jsx("div",{className:`w-9 h-9 rounded-xl flex items-center justify-center shrink-0 border transition-colors ${t?"bg-primary/20 border-primary/40 text-primary":"bg-white/5 border-white/10 text-gray-400"}`,children:s.icon_url?e.jsx("img",{src:s.icon_url,alt:s.name,className:"w-4 h-4 object-contain",onError:a=>{a.currentTarget.style.display="none"}}):s.type==="bank transfer"?e.jsx(Y,{className:"w-4 h-4 text-blue-400"}):e.jsx(Me,{className:"w-4 h-4 text-emerald-400"})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center justify-between gap-1",children:[e.jsx("span",{className:"font-bold text-xs text-white truncate",children:s.name}),e.jsx("div",{className:`w-4 h-4 rounded-full border flex items-center justify-center shrink-0 ${t?"border-primary bg-primary text-white":"border-white/20 bg-white/5"}`,children:t&&e.jsx(h,{className:"w-2.5 h-2.5 stroke-[3]"})})]}),e.jsx("span",{className:"text-[10px] text-gray-400 block mt-0.5 capitalize",children:s.type==="bank transfer"?"Virement bancaire":s.type||"Paiement agence"})]})]},s.id)})})]})]}),x?.details&&typeof x.details=="object"&&e.jsxs("div",{className:"p-4 sm:p-5 rounded-3xl bg-[#111422] border border-blue-500/20 space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("h3",{className:"text-xs font-bold text-blue-400 uppercase tracking-wider flex items-center gap-1.5",children:[e.jsx(Y,{className:"w-4 h-4"}),e.jsx("span",{children:"Coordonnées bancaires pour le virement"})]}),e.jsx("span",{className:"text-[11px] text-gray-500",children:"1-clic pour copier"})]}),e.jsx("div",{className:"space-y-2",children:Object.entries(x.details).map(([s,t])=>{const a=String(t),n=oe===s;return e.jsxs("div",{className:"flex items-center justify-between p-2.5 rounded-xl bg-white/[0.03] border border-white/5 hover:border-white/10 transition-colors",children:[e.jsxs("div",{className:"min-w-0 pr-2",children:[e.jsx("span",{className:"text-[10px] text-gray-400 uppercase font-semibold block",children:s.replace(/_/g," ")}),e.jsx("span",{className:"text-xs font-mono font-bold text-white truncate block",children:a})]}),e.jsx("button",{type:"button",onClick:()=>we(a,s),className:"p-1.5 rounded-lg bg-white/5 hover:bg-white/10 text-gray-300 hover:text-white transition-colors shrink-0 cursor-pointer",title:"Copier",children:n?e.jsx(h,{className:"w-3.5 h-3.5 text-emerald-400"}):e.jsx(Ae,{className:"w-3.5 h-3.5"})})]},s)})})]}),x?.instructions&&e.jsxs("div",{className:"p-4 rounded-2xl bg-white/[0.02] border border-white/10 text-xs text-gray-300 space-y-1 leading-relaxed",children:[e.jsx("span",{className:"font-bold text-primary block",children:"Instructions :"}),e.jsx("p",{className:"whitespace-pre-line text-gray-400",children:x.instructions})]}),fe&&p&&e.jsxs("div",{className:"space-y-3",children:[e.jsxs("label",{className:"text-xs font-bold uppercase tracking-wider text-gray-300 flex items-center gap-2",children:[e.jsx(Z,{className:"w-4 h-4 text-primary"}),e.jsx("span",{children:"Justificatif de paiement (Reçu / Capture)"})]}),u.length>0&&e.jsx("div",{className:"space-y-2",children:u.map((s,t)=>e.jsxs("div",{className:"flex items-center justify-between p-3 rounded-2xl bg-white/[0.03] border border-white/10",children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[s.type==="application/pdf"?e.jsx(Re,{className:"h-5 w-5 text-red-400 shrink-0"}):e.jsx(Ve,{className:"h-5 w-5 text-blue-400 shrink-0"}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("span",{className:"text-xs font-medium text-white truncate block",children:s.name}),e.jsxs("span",{className:"text-[10px] text-gray-500",children:[(s.size/1024).toFixed(0)," KB"]}
1)]})]}),e.jsx("button",{type:"button",onClick:()=>je(t),className:"p-1.5 rounded-lg text-gray-400 hover:text-red-400 hover:bg-red-500/10 transition-colors cursor-pointer",children:e.jsx(X,{className:"h-4 w-4"})})]},t))}),u.length<3&&e.jsxs("label",{className:"flex flex-col items-center justify-center p-6 rounded-3xl border-2 border-dashed border-white/10 hover:border-primary/50 bg-[#111422]/50 hover:bg-primary/[0.02] cursor-pointer transition-all text-center group",children:[e.jsx("div",{className:"p-3 rounded-2xl bg-white/5 group-hover:bg-primary/10 text-gray-400 group-hover:text-primary transition-colors mb-2",children:e.jsx(Z,{className:"h-5 w-5"})}),e.jsxs("span",{className:"text-xs font-bold text-white group-hover:text-primary transition-colors",children:["Cliquez pour ajouter un reçu (",u.length,"/3)"]}),e.jsx("span",{className:"text-[10px] text-gray-500 mt-0.5",children:"JPG, PNG ou PDF (max 10 Mo)"}),e.jsx("input",{type:"file",className:"hidden",accept:".jpg,.jpeg,.png,.pdf",onChange:ge,multiple:!0})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-xs font-semibold text-gray-400",children:"Note ou référence (facultatif)"}),e.jsx("textarea",{rows:2,value:R,onChange:s=>ie(s.target.value),placeholder:"Ex: Référence de transaction, nom de l'expéditeur...",className:"w-full bg-[#111422] border border-white/10 rounded-2xl px-4 py-3 text-white text-xs resize-none focus:outline-none focus:border-primary focus:ring-1 focus:ring-primary/40 placeholder:text-gray-600 transition-all"})]}),e.jsxs("div",{className:"pt-2 space-y-3",children:[e.jsx("button",{type:"button",onClick:()=>S.mutate(),disabled:!p||S.isPending,className:"w-full py-4 rounded-2xl bg-primary hover:bg-primary/90 text-white font-extrabold text-sm sm:text-base transition-all shadow-xl shadow-primary/25 hover:shadow-primary/40 disabled:opacity-40 disabled:cursor-not-allowed flex items-center justify-center gap-2.5 cursor-pointer transform active:scale-[0.99]",children:S.isPending?e.jsxs(e.Fragment,{children:[e.jsx($,{className:"h-5 w-5 animate-spin"}),e.jsx("span",{children:"Traitement en cours..."})]}):x?.is_online?e.jsxs(e.Fragment,{children:[e.jsx(J,{className:"h-4 w-4"}),e.jsxs("span",{children:["Payer ",b," DT maintenant"]})]}):e.jsxs(e.Fragment,{children:[e.jsx(G,{className:"h-4 w-4"}),e.jsxs("span",{children:["Confirmer mon inscription (",b," DT)"]})]})}),e.jsxs("div",{className:"flex items-center justify-center gap-2 text-center text-[11px] text-gray-500",children:[e.jsx(qe,{className:"w-3.5 h-3.5 text-emerald-400"}),e.jsx("span",{children:x?.is_online?"Redirection sécurisée vers la passerelle de paiement certifiée.":"Votre demande sera validée par l'administration dès vérification du reçu."})]})]})]}),e.jsxs("a",{href:`https://wa.me/21629499214?text=${encodeURIComponent(`Bonjour MaxSkills, j'ai besoin d'aide concernant le paiement de la formation : ${f}`)}`,target:"_blank",rel:"noopener noreferrer",className:"max-w-xl mr-auto w-full pt-8 border-t border-white/[0.06] text-center text-xs text-gray-400 hover:text-emerald-400 transition-colors flex items-center justify-center gap-2 group cursor-pointer",children:[e.jsx(ze,{className:"w-3.5 h-3.5 text-emerald-400 group-hover:scale-110 transition-transform"}),e.jsxs("span",{children:["Besoin d'aide avec votre paiement ? ",e.jsx("span",{className:"underline underline-offset-2 text-white group-hover:text-emerald-400 font-semibold",children:"Contactez notre support 24/7 sur MaxSkills"}),"."]})]})]})]})]})]})}export{Qe 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.