PageSourceSearch

https://centuryfinance.app/assets/OfferRequestNew-B8oOgpSw.js

js centuryfinance.app collected 2026-10-09 22:02:05 UTC 22,521 bytes, 1 lines download raw bytes

1import{j as e,I as ae,X as ke,b as Se,r as y,c as Fe,B as D,F as Ae,M as $e,v as ie,K as L,s as O}from"./index-BoFVPuOd.js";import{a as le}from"./MainLayout-gBNgWXVy.js";import{L as Q}from"./label-BboA7h2Z.js";import{T as Ee}from"./textarea-ovHWhnPy.js";import{C as Z}from"./check-pKs-MGDA.js";import{P as ue}from"./plus-CjyXsGHX.js";import{i as he,g as De,h as Re,s as oe,O as _e,b as Te,d as Le,j as Oe}from"./offer-request-labels-i7k6oQjx.js";import{E as Pe}from"./jspdf.es.min-BX_q7O7_.js";import{d as Ie}from"./useClients-v0F2XAqp.js";import{D as ce}from"./download-Bk9uDaXM.js";import{A as qe}from"./arrow-left-Co9f9v29.js";import{C as ze}from"./chevron-down-DJXWNMXM.js";import{S as me}from"./send-Bnvn-L1S.js";import"./separator-D6S64BVN.js";import"./sheet-l2ka7kMK.js";import"./index-DCX7V34G.js";import"./index-BTrAQRF-.js";import"./skeleton-CfGy_qNX.js";import"./cf-icon-CEM9NPdw.js";import"./collapsible-D3BurnuB.js";import"./useQuery-BABFfo6s.js";import"./house-DkgcuR6V.js";import"./chart-column-B0JD3Nnr.js";import"./trending-up-d9o-2LNK.js";import"./receipt-DrjEe41K.js";import"./shield-check-DZ02axz7.js";import"./calendar-DDO6mnXP.js";import"./file-check-C8dkl53p.js";import"./users-DbKLMPFp.js";import"./brain-Q4dDRr3T.js";import"./handshake--vgvFCsc.js";import"./gift-BxZk8HXm.js";import"./message-circle-DCfUAv4b.js";import"./calculator-BzlrFGwR.js";import"./briefcase-DZMSzvAR.js";import"./heart-Bg9rHoC6.js";import"./shield-plus-DaEIZ97c.js";import"./globe-Bpy2vP5B.js";import"./wallet-Brr_E7LG.js";import"./heart-handshake-L8Bbhh_q.js";import"./building-2-DUGlc0qn.js";import"./clipboard-list-DYWIuU44.js";import"./calendar-clock-CzHfSyM5.js";import"./folder-open-BLISKIxx.js";import"./target-MMOivYD_.js";import"./trophy-D7Hjo0-8.js";import"./bell-Y00fW2u2.js";import"./book-open-BVstjtnh.js";import"./settings-COomVANW.js";import"./upload-xB_FMAQ8.js";import"./badge-D3W3qvfC.js";import"./popover-DjL1G5-0.js";import"./arrow-right-BiHmjM8X.js";import"./cake-BO-lO6KK.js";import"./zap-DEWKu702.js";import"./flame-DFnEMCIG.js";import"./star-BEl9zg0K.js";import"./award-DZgqoScb.js";import"./zap-off-e2BeaQ7X.js";import"./TypewriterText-CEm97WOL.js";import"./useMutation-BrbB9w2V.js";const W="bg-white/[0.04] border-white/10 text-white placeholder:text-white/30 focus-visible:ring-violet-500/50",X={background:"linear-gradient(135deg,rgba(124,77,255,0.35),rgba(91,43,255,0.2))"},M={background:"rgba(255,255,255,0.03)"},fe=({field:r,value:i,onChange:d,error:l})=>{if(r.type==="info")return e.jsx("div",{className:"md:col-span-2 pt-2",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-[11px] uppercase tracking-widest text-violet-300/80 font-semibold",children:r.label}),e.jsx("span",{className:"h-px flex-1 bg-white/10"})]})});const b=e.jsxs(Q,{className:"text-white/70 text-xs font-medium",children:[r.label,r.required&&e.jsx("span",{className:"text-rose-400 ml-1",children:"*"}),r.suffix&&e.jsxs("span",{className:"text-white/30 ml-1.5",children:["(",r.suffix,")"]})]}),s=()=>{const n=Array.isArray(i)?i:[],c=(j,C,N)=>{const v=n.map((A,x)=>x===j?{...A,[C]:N}:A);d(v)};return e.jsxs("div",{className:"space-y-3",children:[n.map((j,C)=>e.jsxs("div",{className:"rounded-xl border border-white/10 bg-white/[0.02] p-3 relative",children:[e.jsx("button",{type:"button",onClick:()=>d(n.filter((N,v)=>v!==C)),className:"absolute top-2 right-2 text-white/40 hover:text-rose-300",children:e.jsx(ke,{className:"h-4 w-4"})}),e.jsxs("div",{className:"text-[11px] uppercase tracking-wider text-white/40 mb-2",children:[r.itemLabel??"Élément"," ",C+1]}),e.jsx("div",{className:"grid gap-3 md:grid-cols-2",children:r.itemFields?.map(N=>e.jsx(fe,{field:N,value:j[N.name],onChange:v=>c(C,N.name,v)},N.name))})]},C)),e.jsxs("button",{type:"button",onClick:()=>d([...n,{}]),className:"flex items-center gap-1.5 text-sm px-3 py-2 rounded-xl border border-white/10 text-white/70 hover:border-violet-400/50",style:M,children:[e.jsx(ue,{className:"h-3.5 w-3.5"})," Ajouter ",r.itemLabel?.toLowerCase()??"un élément"]})]})},o=()=>{switch(r.type){case"repeat":return s();case"textarea":return e.jsx(Ee,{value:i??"",placeholder:r.placeholder,onChange:n=>d(n.target.value),rows:3,className:`${W} ${l?"border-rose-400/70":""}`});case"select":return e.jsxs("select",{value:i??"",onChange:n=>d(n.target.value),className:`w-full h-10 rounded-md px-3 text-sm text-white bg-white/[0.04] border focus:outline-none focus:ring-2 focus:ring-violet-500/40 ${l?"border-rose-400/70":"border-white/10"}`,children:[e.jsx("option",{value:"",style:{color:"#111"},children:"— Choisir —"}),r.options?.map(n=>e.jsx("option",{value:n.value,style:{color:"#111"},children:n.label},n.value))]});case"radio":return e.jsx("div",{className:"flex flex-wrap gap-2",children:r.options?.map(n=>{const c=i===n.value;return e.jsx("button",{type:"button",onClick:()=>
1d(c?"":n.value),className:`px-3.5 py-2 rounded-xl text-sm border transition-all ${c?"border-violet-400/70 text-white":l?"border-rose-400/50 text-white/60":"border-white/10 text-white/60 hover:border-white/25"}`,style:c?X:M,children:n.label},n.value)})});case"multi":{const n=Array.isArray(i)?i:[];return e.jsx("div",{className:"flex flex-wrap gap-2",children:r.options?.map(c=>{const j=n.includes(c.value);return e.jsxs("button",{type:"button",onClick:()=>d(j?n.filter(C=>C!==c.value):[...n,c.value]),className:`px-3.5 py-2 rounded-xl text-sm border transition-all flex items-center gap-1.5 ${j?"border-violet-400/70 text-white":"border-white/10 text-white/60 hover:border-white/25"}`,style:j?X:M,children:[j&&e.jsx(Z,{className:"h-3.5 w-3.5"}),c.label]},c.value)})})}case"checkbox":return e.jsx("button",{type:"button",onClick:()=>d(!i),className:`px-3.5 py-2 rounded-xl text-sm border ${i?"border-violet-400/70 text-white":"border-white/10 text-white/60"}`,style:i?X:M,children:i?"Oui":"Non"});case"number":return e.jsx(ae,{type:"number",value:i==null?"":String(i),placeholder:r.placeholder,onChange:n=>d(n.target.value===""?"":Number(n.target.value)),className:`${W} ${l?"border-rose-400/70":""}`});default:return e.jsx(ae,{type:r.type==="email"?"email":r.type==="tel"?"tel":r.type==="date"?"date":"text",value:i??"",placeholder:r.placeholder,onChange:n=>d(n.target.value),className:`${W} ${l?"border-rose-400/70":""}`})}},S=r.type==="repeat"||!r.half;return e.jsxs("div",{className:`space-y-1.5 ${S?"md:col-span-2":"md:col-span-1"}`,children:[b,r.hint&&e.jsx("p",{className:"text-white/35 text-[11px] -mt-0.5",children:r.hint}),o()]})},de=[124,77,255],J=[17,17,17],xe=[102,102,102];function pe(r,i){if(i==null||i==="")return"—";if(r.type==="multi"&&Array.isArray(i))return i.map(l=>r.options?.find(b=>b.value===l)?.label??String(l)).join(" · ")||"—";if((r.type==="radio"||r.type==="select")&&r.options)return r.options.find(l=>l.value===i)?.label??String(i);if(r.type==="checkbox")return i?"Oui":"Non";if(r.type==="number"){const l=Number(i);if(!Number.isNaN(l)){const b=l.toLocaleString("fr-CH");return r.suffix?`${b} ${r.suffix}`:b}}if(r.type==="date"){const l=new Date(String(i));if(!Number.isNaN(l.getTime()))return l.toLocaleDateString("fr-CH")}const d=String(i);return r.suffix?`${d} ${r.suffix}`:d}function ee({product:r,payload:i,refCode:d,advisor:l}){const b=De(r),s=new Pe({unit:"mm",format:"a4"}),o=s.internal.pageSize.getWidth(),S=s.internal.pageSize.getHeight(),n=18;let c=0;const j=(x=!1)=>{const u=x?18:40;if(s.setFillColor(...de),s.rect(0,0,o,u,"F"),s.setTextColor(255,255,255),x)s.setFont("helvetica","bold"),s.setFontSize(10),s.text(`CENTURY FINANCE — ${d}`,n,12);else{s.setFont("helvetica","bold"),s.setFontSize(10),s.text("CENTURY FINANCE — DEMANDE D'OFFRE",n,12),s.setFontSize(15);const h=b?.title??"Demande d'offre";s.text(s.splitTextToSize(h,o-n*2-4),n,22),s.setFont("helvetica","normal"),s.setFontSize(9),s.text(`Référence : ${d}`,n,33),s.text(new Date().toLocaleDateString("fr-CH",{day:"2-digit",month:"long",year:"numeric"}),o-n,33,{align:"right"})}c=u+8,s.setTextColor(...J)},C=x=>{c+x>S-18&&(s.addPage(),j(!0))},N=x=>{C(16),s.setFillColor(245,240,255),s.rect(n,c-4,o-n*2,9,"F"),s.setFont("helvetica","bold"),s.setFontSize(11),s.setTextColor(...de),s.text(x,n+3,c+2),c+=11,s.setTextColor(...J)},v=(x,u)=>{const h=s.splitTextToSize(x,68),F=s.splitTextToSize(u,92),$=Math.max(h.length,F.length)*5+2;C($+4),s.setFont("helvetica","normal"),s.setFontSize(9),s.setTextColor(...xe),s.text(h,n+2,c+4),s.setFont("helvetica","bold"),s.setFontSize(10),s.setTextColor(...J),s.text(F,n+76,c+4),c+=$,s.setDrawColor(235,235,240),s.line(n,c,o-n,c),c+=2};j(),b?b.sections.forEach(x=>{const u=x.fields.filter(h=>{if(h.type==="info"||!he(h,i))return!1;const F=i[h.name];return Array.isArray(F)?F.length>0:F!=null&&F!==""});u.length!==0&&(N(x.title),u.forEach(h=>{if(h.type==="repeat"){(i[h.name]??[]).forEach(($,B)=>{const z=(h.itemFields??[]).map(E=>{const R=$?.[E.name];return R==null||R===""?null:`${E.label} : ${pe(E,R)}`}).filter(Boolean);z.length!==0&&v(`${h.itemLabel??"Élément"} ${B+1}`,z.join(" · "))});return}v(h.label,pe(h,i[h.name]))}),c+=4)}
1):(N("Détails"),Object.entries(i).forEach(([x,u])=>{u==null||u===""||v(x,Array.isArray(u)?u.join(", "):String(u))})),(l?.name||l?.email)&&(N("Conseiller référent"),l?.name&&v("Nom",l.name),l?.email&&v("Email",l.email),l?.phone&&v("Téléphone",l.phone));const A=s.getNumberOfPages();for(let x=1;x<=A;x++)s.setPage(x),s.setFont("helvetica","italic"),s.setFontSize(8),s.setTextColor(...xe),s.text("Demande d'offre établie par Century Finance S.A.R.L. — document sans valeur contractuelle",o/2,S-8,{align:"center"}),s.text(`${x} / ${A}`,o-n,S-8,{align:"right"});return s.output("blob")}async function Ue(r){const d=await ee(r).arrayBuffer(),l=new Uint8Array(d);let b="";const s=8192;for(let o=0;o<l.length;o+=s)b+=String.fromCharCode(...l.subarray(o,o+s));return btoa(b)}const _=r=>r==null||r===""||Array.isArray(r)&&r.length===0,P={backgroundColor:"#14142A",borderColor:"#2A2A4A"},q="linear-gradient(135deg,#7C4DFF,#5b2bff)",Wt=()=>{const r=Se(),{data:i}=Ie(),[d,l]=y.useState("entreprise"),[b,s]=y.useState("lpp"),[o,S]=y.useState({}),[n,c]=y.useState(""),[j,C]=y.useState("direct"),[N,v]=y.useState(""),[A,x]=y.useState(!1),[u,h]=y.useState(!1),[F,$]=y.useState(!1),[B,z]=y.useState({}),[E,R]=y.useState(null),H=y.useRef({}),g=Le[b],te=y.useMemo(()=>i?.find(a=>a.id===n)?.email??null,[i,n]),G=t=>t.filter(a=>he(a,o)),T=y.useMemo(()=>g.sections.flatMap(t=>G(t.fields)).filter(t=>t.type!=="info"),[g,o]),V=T.filter(t=>!_(o[t.name])).length,I=T.filter(t=>t.required&&_(o[t.name])),be=t=>{if(t===d)return;l(t);const a=oe(t)[0];s(a.key),S({}),$(!1)},ge=t=>{t!==b&&(s(t),S({}),$(!1))},we=t=>{c(t);const a=i?.find(k=>k.id===t);if(!a)return;const m={prenom:a.prenom,nom:a.nom,email:a.email,telephone:a.telephone,date_naissance:a.date_naissance,adresse:a.adresse_rue,npa:a.adresse_npa,ville:a.adresse_ville,canton:a.adresse_canton},w={...o};g.sections.forEach(k=>k.fields.forEach(f=>{f.fromClient&&!_(m[f.fromClient])&&_(w[f.name])&&(w[f.name]=m[f.fromClient])})),S(w),L.success("Champs pré-remplis depuis le fichier client")},ye=y.useMemo(()=>{const t=[];return g.sections.forEach(a=>G(a.fields).forEach(m=>{const w=o[m.name];if(_(w)||m.type==="info"||m.type==="repeat"||t.length>=10)return;let k;Array.isArray(w)?k=w.map(f=>m.options?.find(p=>p.value===f)?.label??String(f)).join(", "):m.options?k=m.options.find(f=>f.value===w)?.label??String(w):k=String(w),t.push({label:m.label,value:m.suffix?`${k} ${m.suffix}`:k})})),t},[g,o]),se=()=>{const t=ee({product:g.key,payload:o,refCode:"APERCU"});window.open(URL.createObjectURL(t),"_blank")},je=async t=>{const{data:a}=await O.storage.from("offer-requests").createSignedUrl(t,300);a?.signedUrl&&window.open(a.signedUrl,"_blank")},re=async()=>{if(I.length>0){$(!0),L.error(`Champs obligatoires manquants : ${I.map(a=>a.label).join(", ")}`);const t=g.sections.findIndex(a=>a.fields.some(m=>m.name===I[0].name));H.current[t]?.scrollIntoView({behavior:"smooth",block:"center"});return}h(!0);try{const{data:t}=await O.auth.getUser(),a=t.user?.id;if(!a)throw new Error("Session expirée, reconnectez-vous.");const m=Oe(),{data:w}=await O.from("profiles").select("full_name,email").eq("id",a).maybeSingle(),k=ee({product:g.key,payload:o,refCode:m,advisor:{name:w?.full_name,email:w?.email}}),f=`${a}/${m}_${g.key}.pdf`,{error:p}=await O.storage.from("offer-requests").upload(f,k,{contentType:"application/pdf",upsert:!0});p&&console.error("upload pdf error:",p);const{data:K,error:U}=await O.from("offer_requests").insert({user_id:a,client_id:n||null,segment:d,origin:j,product:g.key,ref_code:m,title:g.title,payload:o,pdf_path:p?null:f}).select("id").single();if(U)throw U;const Ne=await Ue({product:g.key,payload:o,refCode:m,advisor:{name:w?.full_name,email:w?.email}}),{data:ve,error:Ce}=await O.functions.invoke("send-offer-request",{body:{request_id:K.id,pdf_base64:Ne,summary:ye,extra_recipients:N.split(/[,;\s]+/).map(Y=>Y.trim()).filter(Y=>Y.includes("@")),client_email:A?te:null}});Ce?L.warning(`Demande enregistrée (${m}) mais l'email n'a pas pu être envoyé.`):ve?.email_status==="sent"?L.success(`Demande ${m} envoyée par email avec le PDF joint.`):L.warning(`Demande ${m} enregistrée — email non envoyé.`),R({ref:m,path:p?null:f}),window.scrollTo({top:0,behavior:"smooth"})}catch(t){console.error(t),L.error(t instanceof Error?t.message:"Impossible d'enregistrer la demande")}finally{h(!1)}},ne=e.jsxs("div",{className:"rounded-3xl border overflow-hidden",style:{borderColor:"#2A2A4A"},children:[e.jsxs("div",{className:"px-6 py-5 flex flex-wrap items-center gap-4",style:{background:"linear-gradient(120deg, rgba(124,77,255,0.35), rgba(91,43,255,0.18) 45%, rgba(255,77,148,0.16))"},children:[e.jsx("img",{src:Fe,alt:"Century Finance",className:"h-9 w-auto"}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("h1",{className:"text-xl md:text-2xl font-bold text-white leading-tight",children:"Nouvelle demande d'offre"}),e.jsx("p",{className:"text-white/60 text-xs mt-0.5",children:"Un seul écran : segment, produit, questionnaire et envoi."})]}),e.jsx("div",{className:"flex-1"}),e.jsxs(D,{variant:"outline",onClick:se,className:"border-white/20 bg-white/5 text-white hover:bg-white/15",children:[e.jsx(ce,{className:"h-4 w-4 mr-1.5"})," Aperçu PDF"]})]}),e.jsxs("div",{className:"px-6 py-4 space-y-3",style:{backgroundColor:"#14142A"},children:[e.jsx("div",{className:"flex flex-wrap gap-2",children:Re.map(t=>{const a=t.key===d;return e.jsxs("button",{type:"button",onClick:()=>be(t.key),className:`px-4 py-2 rounded-xl text-sm border transition-all ${a?"border-violet-400/70 text-white":"border-white/10 text-white/60"}`,style:a?{background:"linear-gradient(135deg,rgba(124,77,255,0.4),rgba(91,43,255,0.22))"}:{background:"rgba(255,255,255,0.03)"},children:[t.emoji," ",t.label]},t.key)})}),e.jsx("div",{className:"flex flex-wrap gap-2",children:oe(d).map(t=>{const a=t.key===b;return e.jsxs("button",{type:"button",onClick:()=>ge(t.key),className:`px-3.5 py-1.5 rounded-full text-xs border transition-all ${a?"border-violet-400/70 text-white":"border-white/10 text-white/55 hover:border-white/25"}`,style:a?{background:"linear-gradient(135deg,rgba(124,77,255,0.35),rgba(91,43,255,0.2))"}:{background:"rgba(255,255,255,0.03)"},children:[t.emoji," ",t.short]},t.key)})}),e.jsx("p",{className:"text-white/40 text-xs",children:g.description})]})]});return E?e.jsx(le,{children:e.jsx("div",{className:"min-h-screen p-6",style:{backgroundColor:"#0D0D14"}
1,children:e.jsxs("div",{className:"max-w-3xl mx-auto space-y-6",children:[ne,e.jsxs("div",{className:"rounded-3xl border p-8 text-center",style:P,children:[e.jsx("div",{className:"h-14 w-14 rounded-2xl mx-auto flex items-center justify-center",style:{background:q},children:e.jsx(Z,{className:"h-7 w-7 text-white"})}),e.jsx("h2",{className:"text-white text-xl font-semibold mt-4",children:"Demande envoyée"}),e.jsxs("p",{className:"text-white/50 text-sm mt-1",children:["Référence ",e.jsx("span",{className:"font-mono text-white/80",children:E.ref})," — le PDF a été transmis par email."]}),e.jsxs("div",{className:"flex flex-wrap justify-center gap-3 mt-6",children:[E.path&&e.jsxs(D,{variant:"outline",onClick:()=>je(E.path),className:"border-white/15 bg-transparent text-white/80 hover:bg-white/10",children:[e.jsx(Ae,{className:"h-4 w-4 mr-1.5"})," Voir le PDF"]}),e.jsxs(D,{onClick:()=>{R(null),S({}),c(""),$(!1)},style:{background:q},className:"text-white",children:[e.jsx(ue,{className:"h-4 w-4 mr-1.5"})," Nouvelle demande"]}),e.jsx(D,{variant:"ghost",onClick:()=>r("/demandes-offre"),className:"text-white/60",children:"Voir la liste"})]})]})]})})}):e.jsx(le,{children:e.jsxs("div",{className:"min-h-screen p-4 md:p-6 pb-28 lg:pb-6",style:{backgroundColor:"#0D0D14"},children:[e.jsxs("div",{className:"max-w-6xl mx-auto",children:[e.jsxs(D,{variant:"ghost",className:"text-white/50 mb-3 -ml-2",onClick:()=>r("/demandes-offre"),children:[e.jsx(qe,{className:"h-4 w-4 mr-1"})," Demandes d'offre"]}),ne,e.jsxs("div",{className:"grid gap-6 lg:grid-cols-[1fr_320px] mt-6 items-start",children:[e.jsx("div",{className:"space-y-4 min-w-0",children:g.sections.map((t,a)=>{const m=G(t.fields),w=m.filter(p=>p.type!=="info"&&!_(o[p.name])).length,k=m.filter(p=>p.type!=="info").length,f=B[`${g.key}-${a}`];return e.jsxs("div",{ref:p=>H.current[a]=p,className:"rounded-2xl border overflow-hidden",style:P,children:[e.jsxs("button",{type:"button",onClick:()=>z(p=>({...p,[`${g.key}-${a}`]:!f})),className:"w-full flex items-center gap-3 px-6 py-4 text-left",children:[e.jsx("span",{className:"h-7 w-7 rounded-lg flex items-center justify-center text-xs font-semibold text-white shrink-0",style:{background:q},children:a+1}),e.jsx("span",{className:"text-white font-semibold flex-1",children:t.title}),e.jsxs("span",{className:"text-white/40 text-xs",children:[w,"/",k]}),e.jsx(ze,{className:`h-4 w-4 text-white/40 transition-transform ${f?"-rotate-90":""}`})]}),!f&&e.jsx("div",{className:"px-6 pb-6 grid gap-5 md:grid-cols-2",children:m.map(p=>e.jsx(fe,{field:p,value:o[p.name],error:F&&p.required&&_(o[p.name]),onChange:K=>S(U=>({...U,[p.name]:K}))},p.name))})]},t.title)})}),e.jsxs("div",{className:"lg:sticky lg:top-6 space-y-4",children:[e.jsxs("div",{className:"rounded-2xl border p-5",style:P,children:[e.jsxs("div",{className:"flex items-baseline justify-between",children:[e.jsx("span",{className:"text-white/70 text-xs font-medium",children:"Complétion"}),e.jsxs("span",{className:"text-white text-sm font-semibold",children:[V,"/",T.length]})]}),e.jsx("div",{className:"mt-2 h-1.5 rounded-full bg-white/10 overflow-hidden",children:e.jsx("div",{className:"h-full transition-all",style:{width:`${T.length?V/T.length*100:0}%`,background:"linear-gradient(90deg,#7C4DFF,#FF4D94)"}}
1)}),e.jsx("div",{className:"mt-4 space-y-1",children:g.sections.map((t,a)=>e.jsxs("button",{type:"button",onClick:()=>H.current[a]?.scrollIntoView({behavior:"smooth",block:"start"}),className:"w-full text-left text-xs text-white/50 hover:text-white px-2 py-1.5 rounded-lg hover:bg-white/5 truncate",children:[a+1,". ",t.title]},t.title))})]}),(i?.length??0)>0&&e.jsxs("div",{className:"rounded-2xl border p-5",style:P,children:[e.jsx(Q,{className:"text-white/70 text-xs font-medium",children:"Rattacher à un client (optionnel)"}),e.jsxs("select",{value:n,onChange:t=>we(t.target.value),className:"w-full h-10 mt-1.5 rounded-md px-3 text-sm text-white bg-white/[0.04] border border-white/10 focus:outline-none focus:ring-2 focus:ring-violet-500/40",children:[e.jsx("option",{value:"",style:{color:"#111"},children:"— Aucun —"}),i?.map(t=>e.jsxs("option",{value:t.id,style:{color:"#111"},children:[t.prenom," ",t.nom,t.email?` — ${t.email}`:""]},t.id))]})]}),e.jsxs("div",{className:"rounded-2xl border p-5",style:P,children:[e.jsx(Q,{className:"text-white/70 text-xs font-medium",children:"Origine de la demande"}),e.jsx("select",{value:j,onChange:t=>C(t.target.value),className:"w-full h-10 mt-1.5 rounded-md px-3 text-sm text-white bg-white/[0.04] border border-white/10 focus:outline-none focus:ring-2 focus:ring-violet-500/40",children:Object.entries(_e).map(([t,a])=>e.jsxs("option",{value:t,style:{color:"#111"},children:[Te[t]," ",a]},t))})]}),e.jsxs("div",{className:"rounded-2xl border p-5",style:P,children:[e.jsxs("div",{className:"text-white font-semibold text-sm flex items-center gap-2",children:[e.jsx($e,{className:"h-4 w-4 text-violet-300"})," Destinataires"]}),e.jsx("p",{className:"text-white/45 text-xs mt-1.5",children:"Le PDF part toujours à votre adresse. Ajoutez l'assistante ou la compagnie si besoin."}),e.jsx("input",{value:N,onChange:t=>v(t.target.value),placeholder:"[email protected]",className:"w-full h-10 mt-3 rounded-md px-3 text-sm text-white bg-white/[0.04] border border-white/10 placeholder:text-white/30 focus:outline-none focus:ring-2 focus:ring-violet-500/40"}),te&&e.jsxs("button",{type:"button",onClick:()=>x(t=>
1!t),className:`mt-3 w-full px-3 py-2 rounded-xl text-xs border flex items-center gap-2 justify-center ${A?"border-violet-400/70 text-white":"border-white/10 text-white/60"}`,style:A?{background:"linear-gradient(135deg,rgba(124,77,255,0.35),rgba(91,43,255,0.2))"}:{background:"rgba(255,255,255,0.03)"},children:[A&&e.jsx(Z,{className:"h-3.5 w-3.5"}),"Copie au client"]})]}),e.jsxs("div",{className:"hidden lg:block",children:[e.jsx(D,{onClick:re,disabled:u,style:{background:q},className:"text-white w-full h-11",children:u?e.jsxs(e.Fragment,{children:[e.jsx(ie,{className:"h-4 w-4 mr-1.5 animate-spin"})," Envoi…"]}):e.jsxs(e.Fragment,{children:[e.jsx(me,{className:"h-4 w-4 mr-1.5"})," Générer et envoyer"]})}),I.length>0&&e.jsxs("p",{className:"text-white/40 text-[11px] mt-2 text-center",children:[I.length," champ(s) obligatoire(s) à compléter"]})]})]})]})]}),e.jsxs("div",{className:"lg:hidden fixed bottom-0 left-0 right-0 p-4 border-t backdrop-blur-xl flex items-center gap-3",style:{backgroundColor:"rgba(13,13,20,0.9)",borderColor:"#2A2A4A"},children:[e.jsxs("div",{className:"text-white/50 text-xs",children:[V,"/",T.length," champs"]}),e.jsx("div",{className:"flex-1"}),e.jsx(D,{variant:"outline",onClick:se,className:"border-white/15 bg-transparent text-white/80",children:e.jsx(ce,{className:"h-4 w-4"})}),e.jsx(D,{onClick:re,disabled:u,style:{background:q},className:"text-white",children:u?e.jsx(ie,{className:"h-4 w-4 animate-spin"}):e.jsxs(e.Fragment,{children:[e.jsx(me,{className:"h-4 w-4 mr-1.5"})," Envoyer"]})})]})]})})};export{Wt 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.