1import{n as A,r as a,j as e,a9 as B,e as p,B as y,I as h,f as R}from"./index-BNGXKjJb.js";import{L as o}from"./label-ehC12Xt8.js";import{C as b}from"./card-ZW3TLzfr.js";import{T as k}from"./textarea-BewEExMt.js";import{L as q}from"./LangToggle-9_8cM4X6.js";import{u as J}from"./use-lang-DilruX2P.js";import{A as V}from"./arrow-left-B5H9nXD_.js";import{C as O}from"./circle-check-BhH4xUSJ.js";import"./languages-bNHV_XKL.js";const E=[{value:"acces",fr:"Accès à mes données",ar:"Ø§ÙØ§Ø·Ùاع عÙÙ Ø¨ÙØ§ÙاتÙ"},{value:"rectification",fr:"Rectification de mes données",ar:"تصØÙØ Ø¨ÙØ§ÙاتÙ"},{value:"effacement",fr:"Effacement de mes données",ar:"ØØ°Ù Ø¨ÙØ§ÙاتÙ"},{value:"opposition",fr:"Opposition au traitement",ar:"Ø§ÙØ§Ø¹ØªØ±Ø§Ø¶ عÙ٠اÙÙ
Ø¹Ø§ÙØ¬Ø©"},{value:"retrait_consentement",fr:"Retrait de mon consentement",ar:"Ø³ØØ¨ Ù
ÙØ§ÙÙØªÙ"}];function G(){const{lang:C,t:s}=J(),[r]=A(),f=r.get("type")??"",[i,S]=a.useState(E.some(t=>t.value===f)?f:""),[l,w]=a.useState(r.get("nom")??""),[c,I]=a.useState(r.get("email")??""),[d,z]=a.useState(r.get("telephone")??""),[g,D]=a.useState(r.get("message")??""),[j,v]=a.useState(!1),[m,T]=a.useState(null),[N,u]=a.useState(""),L=async t=>{if(t.preventDefault(),!(!i||!l||!c&&!d)){v(!0),u("");try{const x=await fetch("https://zsqvzfyxuofytmuxrkgq.supabase.co/functions/v1/droits-request",{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InpzcXZ6Znl4dW9meXRtdXhya2dxIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NzU4OTgxNzcsImV4cCI6MjA5MTQ3NDE3N30.V9Jf_AsUL1xnuY-82apKpEfXEHTvkZ_S6c1Dks2QN7A"},body:JSON.stringify({type_droit:i,nom:l,email:c||void 0,telephone:d||void 0,message:g||void 0})}),n=await x.json();if(!x.ok||n.error){x.status===429?u(s("Trop de demandes. Réessayez dans 24h.","Ø·ÙØ¨Ø§Øª ÙØ«Ùرة. ØØ§ÙÙÙØ§ بعد 24 ساعة.")):u(n.error||s("Erreur lors de l'envoi","خطأ ÙÙ Ø§ÙØ¥Ø±Ø³Ø§Ù"));return}T({reference:n.reference,accuseSent:n.accuse_sent,oppositionApplied:n.opposition_applied})}catch{u(s("Erreur réseau. Réessayez.","خطأ ÙÙ Ø§ÙØ´Ø¨ÙØ©. ØØ§ÙÙÙØ§ Ù
رة أخرÙ."))}finally{v(!1)}}};return e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsx("header",{className:"bg-[#2D8B4E] text-white",children:e.jsxs("div",{className:"max-w-3xl mx-auto px-4 py-5 flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(B,{className:"h-6 w-6"}),e.jsx("h1",{className:"text-lg font-bold",children:s("Exercer mes droits","Ù
Ù
ارسة ØÙÙÙÙ")})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(q,{}),e.jsxs(p,{to:"/",className:"text-white/80 hover:text-white text-sm flex items-center gap-1",children:[e.jsx(V,{className:"h-4 w-4"}),s("Accueil","Ø§ÙØ±Ø¦ÙØ³ÙØ©")]})]})]})}),e.jsx("main",{className:"max-w-3xl mx-auto px-4 py-8",children:m?e.jsxs(b,{className:"p-8 text-center space-y-4",children:[e.jsx(O,{className:"h-16 w-16 text-[#2D8B4E] mx-auto"}),e.jsx("h2",{className:"text-xl font-bold",children:s("Votre demande a été enregistrée","تÙ
تسجÙÙ Ø·ÙØ¨ÙÙ
")}),e.jsxs("p",{className:"text-muted-foreground",children:[s("Référence","اÙÙ
رجع")," :"," ",e.jsx("code",{className:"font-mono font-bold text-[#2D8B4E]",children:m.reference})]}),e.jsx("p",{className:"text-sm text-muted-foreground max-w-md mx-auto",children:s("Conservez cette référence. Votre demande a été transmise au référent protection des données. Vous recevrez une réponse dans un délai maximum d'un mois.","Ø§ØØªÙØ¸ÙØ§ Ø¨ÙØ°Ø§ اÙÙ
رجع. تÙ
تØÙÙÙ Ø·ÙØ¨ÙÙ
Ø¥ÙÙ Ù
سؤÙÙ ØÙ
Ø§ÙØ© Ø§ÙØ¨ÙØ§ÙØ§Øª. ستصÙÙÙ
Ø§ÙØ¥Ø¬Ø§Ø¨Ø© ÙÙ Ø£Ø¬Ù Ø£ÙØµØ§Ù Ø´ÙØ±.")}),m.accuseSent&&e.jsx("p",{className:"text-xs text-muted-foreground",children:s("Un accusé de réception vous a été envoyé par email.","تÙ
إرسا٠إشعار Ø§Ø³ØªÙØ§Ù
ÙÙÙ
عبر Ø§ÙØ¨Ø±Ùد Ø§ÙØ¥ÙÙØªØ±ÙÙÙ.")}),m.oppositionApplied&&e.jsx("p",{className:"text-xs text-muted-foreground bg-green-50 dark:bg-green-950 rounded-lg p-3",children:s("Votre numéro a été inscrit sur la liste d'opposition : vous ne recevrez plus de messages de mobilisation.","تÙ
تسجÙ٠رÙÙ
ÙÙ
ÙÙ ÙØ§Ø¦Ù
Ø© Ø§ÙØ§Ø¹ØªØ±Ø§Ø¶: ÙÙ ØªØªÙØµÙÙØ§ Ø¨Ø±Ø³Ø§Ø¦Ù Ø§ÙØªØ¹Ø¨Ø¦Ø© بعد Ø§ÙØ¢Ù.")}),e.jsx(y,{asChild:!0,variant:"outline",children:e.jsx(p,{to:"/",children:s("Retour à l'accueil","Ø§ÙØ¹Ùدة Ø¥ÙÙ Ø§ÙØ±Ø¦ÙØ³ÙØ©")})})]}):e.jsxs(b,{className:"p-6 md:p-8 space-y-6",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("h2",{className:"text-xl font-bold",children:s("Demande d'exercice de droits","Ø·ÙØ¨ Ù
Ù
ارسة Ø§ÙØÙÙÙ")}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s("Conformément à la loi 09-08, vous pouvez exercer vos droits d'accès, de rectification, d'effacement et d'opposition sur les données vous concernant. Aucune pièce d'identité n'est demandée à ce stade.","ÙÙÙØ§Ù ÙÙÙØ§ÙÙÙ 09-08Ø ÙÙ
ÙÙÙÙ
Ù
Ù
ارسة ØÙÙÙ Ø§ÙØ§Ø·Ùاع ÙØ§ÙتصØÙØ ÙØ§ÙØØ°Ù ÙØ§Ùاعتراض عÙÙ Ø¨ÙØ§ÙاتÙÙ
. ÙØ§ ÙØ·Ùب Ø£Ù ÙØ«ÙÙØ© ÙÙÙØ© ÙÙ ÙØ°Ù اÙÙ
رØÙØ©.")})]}),e.jsxs("form",{onSubmit:L,className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(o,{children:s("Type de demande *","ÙÙØ¹ Ø§ÙØ·Ùب *")}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2",children:E.map(t=>e.jsx("button",{type:"button",onClick:()=>S(t.value),className:`text-left p-3 rounded-lg border transition-colors ${i===t.value?"border-[#2D8B4E] bg-green-50 dark:bg-green-950 text-[#2D8B4E] font-semibold":"border-border hover:border-[#2D8B4E]/50"}`,children:C==="ar"?t.ar:t.fr},t.value))})]}),e.jsxs("div",{children:[e.jsx(o,{htmlFor:"nom",children:s("Nom complet *","Ø§ÙØ§Ø³Ù
اÙÙØ§Ù
Ù *")}
1),e.jsx(h,{id:"nom",value:l,onChange:t=>w(t.target.value),required:!0,maxLength:100,placeholder:s("Votre nom","اسÙ
ÙÙ
")})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx(o,{htmlFor:"email",children:s("Email","Ø§ÙØ¨Ø±Ùد Ø§ÙØ¥ÙÙØªØ±ÙÙÙ")}),e.jsx(h,{id:"email",type:"email",value:c,onChange:t=>I(t.target.value),placeholder:"[email protected]"})]}),e.jsxs("div",{children:[e.jsx(o,{htmlFor:"tel",children:s("Téléphone","اÙÙØ§ØªÙ")}),e.jsx(h,{id:"tel",value:d,onChange:t=>z(t.target.value),placeholder:"+212 6â¦"})]})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s("Au moins un moyen de contact est requis.","ÙÙØ²Ù
ÙØ³ÙÙØ© Ø§ØªØµØ§Ù ÙØ§ØØ¯Ø© عÙÙ Ø§ÙØ£ÙÙ.")}),e.jsxs("div",{children:[e.jsx(o,{htmlFor:"msg",children:s("Message (optionnel)","Ø±Ø³Ø§ÙØ© (Ø§Ø®ØªÙØ§Ø±Ù)")}),e.jsx(k,{id:"msg",value:g,onChange:t=>D(t.target.value),maxLength:2e3,rows:4,placeholder:s("Précisez votre demandeâ¦","ÙØ¶ØÙا Ø·ÙØ¨ÙÙ
â¦")})]}),N&&e.jsx("p",{className:"text-sm text-destructive",children:N}),e.jsxs(y,{type:"submit",disabled:j||!i||!l||!c&&!d,className:"w-full bg-[#2D8B4E] hover:bg-[#247540] text-white",children:[j&&e.jsx(R,{className:"h-4 w-4 mr-2 animate-spin"}),s("Envoyer ma demande","Ø¥Ø±Ø³Ø§Ù Ø·ÙØ¨Ù")]})]}),e.jsxs("div",{className:"text-xs text-muted-foreground border-t pt-4 space-y-1",children:[e.jsx("p",{children:s("Vos données sont traitées conformément à la loi 09-08. Pour toute question : [email protected]","Ù
Ø¹Ø§ÙØ¬Ø© Ø¨ÙØ§ÙاتÙÙ
ÙÙ٠اÙÙØ§ÙÙÙ 09-08. ÙØ£Ù سؤاÙ: [email protected]")}),e.jsx(p,{to:"/cndp",className:"text-[#2D8B4E] hover:underline",children:s("Consulter notre politique de protection des données","Ø§ÙØ§Ø·Ùاع عÙÙ Ø³ÙØ§Ø³Ø© ØÙ
Ø§ÙØ© Ø§ÙØ¨ÙØ§ÙØ§Øª")})]})]})})]})}export{G 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.