PageSourceSearch

https://physio-7.ch/assets/mon-inscription._token-C16HXt3N.js

js physio-7.ch collected 2026-10-07 16:42:36 UTC 11,014 bytes, 1 lines download raw bytes

1import{X as j,Y as y,ba as I,r as m,j as e,B,t as Z}from"./index-BUS1-xlA.js";import{u as _}from"./useQuery-Cm6SAUZw.js";import{u as P}from"./useServerFn-hgPyQp3M.js";import{E as K,a as $,g as U,b as W}from"./stripe-B0oX_dSn.js";import{S as g}from"./SiteLayout-BoysJcLW.js";import{C as b}from"./card-C_v_Xu6f.js";import{C as q}from"./checkbox-DzDSzbCl.js";import{b as Q}from"./i18n-formations-DMH26RVL.js";import{L as Y}from"./loader-circle-DDPlJJwr.js";import"./Footer-PDkIrn7j.js";import"./badge-CxROsvNA.js";import"./trash-2-Zv8okZgq.js";import"./plus-CRI4zUzS.js";import"./external-link-DlMGCLED.js";import"./mail-BK3qYRn2.js";import"./check-Dw3ElhGy.js";const G=j({method:"POST"}).handler(y("c57edf58282fb071e5a9fc66c96721e538bee869da6f0d7d021c9890f5e0afcb")),H=j({method:"POST"}).handler(y("af7361e2b0747dcdb99eb70a47d53a54974b3cefc03d53bd44cf40943422750d"));j({method:"POST"}).handler(y("82f78b647bd26173e67477b0213ba161164809b9487fdcc8bf128c49dcc117ab"));const c=l=>`CHF ${l.toFixed(2)}`,L=["fr","de","en"],V={fr:"fr-CH",de:"de-CH",en:"en-GB"},X={fr:{loading:"Chargement…",notFound:"Lien introuvable",invalid:"Lien invalide.",write:"Écrivez à",title:"Mon inscription",status:"Statut de l'inscription",ordered:"Options déjà commandées",addedAfter:"(ajoutée après inscription)",none:"Aucune option pour le moment.",add:"Ajouter une option",noMore:"Aucune option supplémentaire disponible.",until:"Commandes possibles jusqu'au",total:"Total",pay:"Payer par carte",due:"Montant dû",paid:"Montant reçu",remaining:"Reste à payer",dueDate:"Échéance de la facture",method:"Mode de paiement",card:"Carte",bvr:"Facture (QR-facture)",cancelledReason:"Cette inscription a été annulée.",notConfirmed:"Cette inscription n'est pas encore confirmée.",closedReason:"Les commandes sont closes 5 jours avant la formation.",st:{paid:["Payée","Votre paiement a été reçu. Votre inscription est confirmée."],pending_invoice:["En attente de paiement","Votre place est réservée. Nous attendons le paiement de la facture."],pending:["Paiement en cours","Le paiement par carte n'a pas encore été finalisé."],processing:["Paiement en cours","Le paiement par carte est en cours de traitement."],cancelled:["Annulée","Cette inscription a été annulée."],expired:["Expirée","La facture n'a pas été réglée dans le délai ; l'inscription a expiré."],failed:["Paiement échoué","Le paiement n'a pas abouti."]}},de:{loading:"Wird geladen…",notFound:"Link nicht gefunden",invalid:"Ungültiger Link.",write:"Schreiben Sie an",title:"Meine Anmeldung",status:"Status der Anmeldung",ordered:"Bereits bestellte Optionen",addedAfter:"(nach der Anmeldung hinzugefügt)",none:"Noch keine Optionen.",add:"Option hinzufügen",noMore:"Keine weiteren Optionen verfügbar.",until:"Bestellungen möglich bis",total:"Total",pay:"Mit Karte bezahlen",due:"Geschuldeter Betrag",paid:"Erhaltener Betrag",remaining:"Noch zu bezahlen",dueDate:"Fälligkeit der Rechnung",method:"Zahlungsart",card:"Karte",bvr:"Rechnung (QR-Rechnung)",cancelledReason:"Diese Anmeldung wurde storniert.",notConfirmed:"Diese Anmeldung ist noch nicht bestätigt.",closedReason:"Bestellungen sind 5 Tage vor der Weiterbildung geschlossen.",st:{paid:["Bezahlt","Ihre Zahlung ist eingegangen. Ihre Anmeldung ist bestätigt."],pending_invoice:["Zahlung ausstehend","Ihr Platz ist reserviert. Wir erwarten die Zahlung der Rechnung."],pending:["Zahlung läuft","Die Kartenzahlung wurde noch nicht abgeschlossen."],processing:["Zahlung läuft","Die Kartenzahlung wird verarbeitet."],cancelled:["Storniert","Diese Anmeldung wurde storniert."],expired:["Abgelaufen","Die Rechnung wurde nicht fristgerecht bezahlt; die Anmeldung ist abgelaufen."],failed:["Zahlung fehlgeschlagen","Die Zahlung ist nicht zustande gekommen."]}},en:{loading:"Loading…",notFound:"Link not found",invalid:"Invalid link.",write:"Write to",title:"My registration",status:"Registration status",ordered:"Options already ordered",addedAfter:"(added after registration)",none:"No options yet.",add:"Add an option",noMore:"No additional options available.",until:"Orders possible until",total:"Total",pay:"Pay by card",due:"Amount due",paid:"Amount received",remaining:"Remaining to pay",dueDate:"Invoice due date",method:"Payment method",card:"Card",bvr:"Invoice (QR bill)",cancelledReason:"This registration has been cancelled.",notConfirmed:"This registration is not yet confirmed.",closedReason:"Orders close 5 days before the course.",st:{paid:["Paid","Your payment has been received. Your registration is confirmed."],pending_invoice:["Awaiting payment","Your place is reserved. We are awaiting payment of the invoice."],pending:["Payment in progress","The card payment has not been completed yet."],processing:["Payment in progress","The card payment is being processed."],cancelled:["Cancelled","This registration has been cancelled."],expired:["Expired","The invoice was not paid in time; the registration has expired."],failed:["Payment failed","The payment did not go through."]}}},J={paid:"bg-primary/10 text-primary border-primary/30",pending_invoice:"bg-accent text-accent-foreground border-border",cancelled:"bg-destructive/10 text-destructive border-destructive/30",expired:"bg-destructive/10 text-destructive border-destructive/30",failed:"bg-destructive/10 text-destructive border-destructive/30"};function xe(){const{token:l}=I.useParams(),D=P(G),R=P(H),[u,T]=m.useState([]),[v,k]=m.useState(null),[N,C]=m.useState(!1),[s,w]=m.useState("fr");m.useEffect(()=>{const t=new URLSearchParams(window.location.search).get("lang"),i=window.localStorage.getItem("mon-inscription-lang"),r=window.navigator.language.slice(0,2),d=[t,i,r].find(f=>L.includes(f));d&&w(d)},[]);const F=t=>
1{w(t),window.localStorage.setItem("mon-inscription-lang",t)},a=X[s],h=t=>new Date(t).toLocaleDateString(V[s]),x=(t,i,r)=>s==="fr"?{name:i,description:r}:Q(t,i,r,s),S=e.jsx("div",{className:"flex justify-end gap-1 text-sm",role:"group","aria-label":"Langue",children:L.map(t=>e.jsx("button",{type:"button",onClick:()=>F(t),"aria-pressed":s===t,className:`px-2 py-1 rounded ${s===t?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground"}`,children:t.toUpperCase()},t))}),{data:o,isLoading:O}=_({queryKey:["inscription-portal",l],queryFn:()=>D({data:{token:l}})});async function E(){C(!0);try{const t=await R({data:{token:l,optionIds:u,environment:W(),returnUrl:`${window.location.origin}/inscription/retour`}});if("error"in t){Z.error(t.error);return}k(t.clientSecret)}finally{C(!1)}}if(O)return e.jsx(g,{children:e.jsx("section",{className:"container mx-auto px-4 py-24 max-w-2xl text-center text-muted-foreground",children:a.loading})});if(!o||"error"in o)return e.jsx(g,{children:e.jsxs("section",{className:"container mx-auto px-4 py-24 max-w-2xl text-center",children:[S,e.jsx("h1",{className:"text-2xl font-bold mb-3",children:a.notFound}),e.jsxs("p",{className:"text-muted-foreground",children:[o&&"error"in o?o.error:a.invalid," ",a.write," ",e.jsx("a",{className:"underline",href:"mailto:[email protected]",children:"[email protected]"}),"."]})]})});const n=o.portal,M=n.optionsDisponibles.filter(t=>u.includes(t.id)).reduce((t,i)=>t+i.prix,0),p=a.st[n.statut],A=Math.max(0,(n.montantDu??0)-(n.montantPaye??0)),z=n.closed?n.statut==="cancelled"?a.cancelledReason:["paid","pending_invoice"].includes(n.statut)?a.closedReason:a.notConfirmed:null;return v?e.jsx(g,{children:e.jsx("section",{className:"container mx-auto px-4 py-16 max-w-3xl",children:e.jsx(K,{stripe:U(),options:{fetchClientSecret:async()=>v},children:e.jsx($,{})})})}):e.jsx(g,{children:e.jsxs("section",{className:"container mx-auto px-4 py-16 max-w-3xl space-y-6",children:[S,e.jsxs("div",{children:[e.jsx("h1",{className:"text-3xl font-extrabold mb-2",children:a.title}),e.jsxs("p",{className:"text-muted-foreground",children:[n.prenom," ",n.nom," — ",n.formation,n.dateDebut?` (${h(n.dateDebut)})`:"",n.centre?` — ${n.centre}`:""]})]}),e.jsxs(b,{className:"p-5 space-y-3",children:[e.jsx("h2",{className:"font-semibold",children:a.status}),e.jsxs("div",{children:[e.jsx("span",{className:`inline-block rounded-full border px-3 py-1 text-sm font-medium ${J[n.statut]??"bg-muted text-foreground border-border"}`,children:p?p[0]:n.statut}),p&&e.jsx("p",{className:"text-sm text-muted-foreground mt-2",children:p[1]})]}),e.jsxs("dl",{className:"grid grid-cols-2 gap-x-4 gap-y-1 text-sm",children:[n.modePaiement&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{className:"text-muted-foreground",children:a.method}),e.jsx("dd",{children:n.modePaiement==="bvr"?a.bvr:a.card})]}),n.montantDu!=null&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{className:"text-muted-foreground",children:a.due}),e.jsx("dd",{children:c(n.montantDu)})]}),e.jsx("dt",{className:"text-muted-foreground",children:a.paid}),e.jsx("dd",{children:c(n.montantPaye??0)}),A>0&&!["cancelled","expired","failed"].includes(n.statut)&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{className:"text-muted-foreground",children:a.remaining}),e.jsx("dd",{className:"font-medium",children:c(A)})]}),n.statut==="pending_invoice"&&n.echeance&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{className:"text-muted-foreground",children:a.dueDate}),e.jsx("dd",{children:h(n.echeance)})]})]})]}),e.jsxs(b,{className:"p-5",children:[e.jsx("h2",{className:"font-semibold mb-2",children:a.ordered}),n.optionsCommandees.length?e.jsx("ul",{className:"text-sm space-y-1",children:n.optionsCommandees.map(t=>e.jsxs("li",{children:[x(t.code,t.nom,null).name," — ",c(t.prix),t.ajouteeApres&&e.jsxs("span",{className:"text-muted-foreground",children:[" ",a.addedAfter]})]},t.id))}):e.jsx("p",{className:"text-sm text-muted-foreground",children:a.none})]}),e.jsxs(b,{className:"p-5 space-y-4",children:[e.jsx("h2",{className:"font-semibold",children:a.add}),n.closed?e.jsx("p",{className:"text-sm text-muted-foreground",children:z}):n.optionsDisponibles.length===0?e.jsx("p",{className:"text-sm text-muted-foreground",children:a.noMore}):e.jsxs(e.Fragment,{children:[n.deadline&&e.jsxs("p",{className:"text-xs text-muted-foreground",children:[a.until," ",h(n.deadline),"."]}),e.jsx("div",{className:"space-y-3",children:n.optionsDisponibles.map(t=>e.jsxs("label",{className:"flex items-start gap-3 text-sm",children:[e.jsx(q,{checked:u.includes(t.id),onCheckedChange:i=>T(r=>i?[...r.filter(d=>!t.groupe||n.optionsDisponibles.find(f=>f.id===d)?.groupe!==t.groupe),t.id]:r.filter(d=>d!==t.id))}),e.jsxs("span",{children:[e.jsx("span",{className:"font-medium",children:x(t.code,t.nom,t.description).name})," — ",c(t.prix),t.description&&e.jsx("span",{className:"block text-muted-foreground",children:x(t.code,t.nom,t.description).description})]})]},t.id))}),e.jsxs("div",{className:"flex items-center justify-between border-t pt-4",children:[e.jsxs("span",{className:"font-semibold",children:[a.total," : ",c(M)]}),e.jsx(B,{disabled:!u.length||N,onClick:E,children:N?e.jsx(Y,{className:"h-4 w-4 animate-spin"}):a.pay})]})]})]})]})})}export{xe as component};

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.