PageSourceSearch

https://www.connect-events.fr/_next/static/chunks/pages/profile/my-settings-90d3a52816e3eb7f.js

js connect-events.fr collected 2026-10-02 00:03:11 UTC 11,465 bytes, 2 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6814],{12401:(e,s,t)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/profile/my-settings",function(){return t(55490)}])},19548:(e,s,t)=>{"use strict";t.d(s,{bL:()=>N,zi:()=>y});var l=t(55729),n=t(25269),r=t(40041),i=t(99829),a=t(16697),c=t(38719),o=t(24347),d=t(19639),u=t(6029),p="Switch",[f,m]=(0,i.A)(p),[x,h]=f(p),j=l.forwardRef((e,s)=>{let{__scopeSwitch:t,name:i,checked:c,defaultChecked:o,required:f,disabled:m,value:h="on",onCheckedChange:j,form:b,...v}=e,[N,y]=l.useState(null),k=(0,r.s)(s,e=>y(e)),C=l.useRef(!1),E=!N||b||!!N.closest("form"),[P,S]=(0,a.i)({prop:c,defaultProp:o??!1,onChange:j,caller:p});return(0,u.jsxs)(x,{scope:t,checked:P,disabled:m,children:[(0,u.jsx)(d.sG.button,{type:"button",role:"switch","aria-checked":P,"aria-required":f,"data-state":g(P),"data-disabled":m?"":void 0,disabled:m,value:h,...v,ref:k,onClick:(0,n.mK)(e.onClick,e=>{S(e=>!e),E&&(C.current=e.isPropagationStopped(),C.current||e.stopPropagation())})}),E&&(0,u.jsx)(w,{control:N,bubbles:!C.current,name:i,value:h,checked:P,required:f,disabled:m,form:b,style:{transform:"translateX(-100%)"}})]})});j.displayName=p;var b="SwitchThumb",v=l.forwardRef((e,s)=>{let{__scopeSwitch:t,...l}=e,n=h(b,t);return(0,u.jsx)(d.sG.span,{"data-state":g(n.checked),"data-disabled":n.disabled?"":void 0,...l,ref:s})});v.displayName=b;var w=l.forwardRef(({__scopeSwitch:e,control:s,checked:t,bubbles:n=!0,...i},a)=>{let d=l.useRef(null),p=(0,r.s)(d,a),f=(0,c.Z)(t),m=(0,o.X)(s);return l.useEffect(()=>{let e=d.current;if(!e)return;let s=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set;if(f!==t&&s){let l=new Event("click",{bubbles:n});s.call(e,t),e.dispatchEvent(l)}},[f,t,n]),(0,u.jsx)("input",{type:"checkbox","aria-hidden":!0,defaultChecked:t,...i,tabIndex:-1,ref:p,style:{...i.style,...m,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function g(e){return e?"checked":"unchecked"}w.displayName="SwitchBubbleInput";var N=j,y=v},55490:(e,s,t)=>{"use strict";t.r(s),t.d(s,{default:()=>L});var l=t(6029),n=t(39794),r=t(16972),i=t(55729),a=t(73492),c=t(34245),o=t(65403),d=t(77153),u=t(34759);let p=function(e){let{isOpen:s,setIsOpen:t,onCancel:n,onDelete:r,isDeletedPending:i}=e;return(0,l.jsx)(u.lG,{open:s,onOpenChange:t,children:(0,l.jsxs)(u.Cf,{className:"flex w-full flex-col gap-2 px-4 py-6 text-center",children:[(0,l.jsx)(d.l,{width:32,height:32,fill:"#F04438",className:"w-full justify-center"}),(0,l.jsx)(u.L3,{className:"text-xl font-extrabold",children:"Voulez-vous aussi supprimer vos donn\xe9es ?"}),(0,l.jsx)("p",{className:"text-base",children:"Cette action est d\xe9finitive. Vous ne pourrez plus r\xe9cup\xe9rer vos donn\xe9es par la suite."}),(0,l.jsxs)(u.Es,{className:"mt-8 gap-4 sm:flex-col",children:[(0,l.jsxs)("div",{className:"flex justify-center gap-4 max-md:flex-col",children:[(0,l.jsx)(o.$,{variant:"destructive",onClick:()=>r({withData:!1}),isLoading:i,children:"Supprimer seulement mon compte"}),(0,l.jsx)(o.$,{variant:"destructive-filled",onClick:()=>r({withData:!0}),isLoading:i,children:"Supprimer mes donn\xe9es"})]}),(0,l.jsx)(o.$,{variant:"outline",onClick:n,children:"Annuler"})]})]})})},f=function(e){let{isOpen:s,setIsOpen:t,onNext:n}=e;return(0,l.jsx)(u.lG,{open:s,onOpenChange:t,children:(0,l.jsx)(u.Cf,{children:(0,l.jsxs)("div",{className:"flex w-full flex-col gap-2 px-4 py-6 text-center",children:[(0,l.jsx)(d.l,{width:32,height:32,fill:"#F04438",className:"w-full justify-center"}),(0,l.jsx)(u.L3,{className:"text-xl font-extrabold",children:"Voulez-vous vraiment supprimer votre compte ?"}),(0,l.jsx)("p",{className:"text-base",children:"Cette action est d\xe9finitive."}),(0,l.jsxs)(u.Es,{className:"mt-8 max-md:gap-4",children:[(0,l.jsx)(o.$,{className:"grow",variant:"outline",onClick:()=>t(!1),children:"Annuler"}),(0,l.jsx)(o.$,{className:"grow font-semibold",variant:"destructive-filled",onClick:n,children:"Supprimer mon compte"})]})]})})})};function m(e){let{onDelete:s,isDeletedPending:t,...r}=e,[a,c]=(0,i.useState)(!1),[d,u]=(0,i.useState)(!1);return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(o.$,{variant:"destructive",onClick:()=>c(!0),...r,className:(0,n.cn)(r.className,"py-8 font-semibold"),children:r.children||"Supprimer mon compte"}),(0,l.jsx)(f,{isOpen:a,setIsOpen:c,onNext:()=>u(!0)}),(0,l.jsx)(p,{isOpen:d,setIsOpen:u,onCancel:()=>{c(!1),u(!1)},onDelete:s,isDeletedPending:t})]})}var x=t(37890),h=t(81278);function j(){let{toast:e}=(0,c.dj)(),s=(0,h.useRouter)(),{disconnect:t}=(0,x.u)(),{mutate:n,isPending:r}=(0,a.jJp)();return(0,l.jsx)(m,{onDelete:l=>{n(l,{onSuccess:()=>{e({title:"Votre compte a \xe9t\xe9 supprim\xe9 avec succ\xe8s"}),t(),s.push("/")},onError:s=>{e({title:"Une erreur est survenue lors de la suppression de votre compte. Veuillez contacter Connect'Events",description:s.message})}})},isDeletedPending:r})}
1var b=t(96930),v=t(62883),w=t(32337),g=t(64713),N=t(40611),y=t(21667),k=t(1909),C=t(52789),E=t(17325);let P=function(e){var s,t,i,d;let{user:u}=e,{user:p}=(0,x.u)(),f=null==(t=null==p?void 0:p.hasPassword)||t,m=(0,k.mN)({resolver:(0,C.u)(a.Ohv),defaultValues:a.uuT}),j=null==(s=m.formState.errors.newPassword)?void 0:s.message,{mutate:P}=(0,a.VT6)(),{toast:S}=(0,c.dj)(),{getValues:_,control:O,setValue:D,trigger:I}=m,L=(0,n.al)(),M=(0,h.useRouter)(),{disconnect:R}=(0,x.u)();return u?(0,l.jsxs)("div",{children:[!L&&(0,l.jsx)("h1",{className:"pb-4 text-2xl font-bold",children:"Identifiants de connexion"}),(0,l.jsxs)("div",{className:(0,n.cn)("flex gap-4 border bg-white px-6 py-10",{"flex-col justify-between":L}),children:[(0,l.jsxs)("div",{className:(0,n.cn)("flex w-1/2 flex-col gap-6",{"w-full":L}),children:[(0,l.jsxs)("div",{className:"grid w-full items-center gap-1.5",children:[(0,l.jsx)(v.J,{htmlFor:"email",children:"Email"}),(0,l.jsx)(w.p,{type:"email",id:"email",className:"flex w-full grow border border-gray-300 p-2",placeholder:(null==u?void 0:u.email)||"Chargement...",disabled:!0,value:null!=(i=null==u?void 0:u.email)?i:""})]}),(0,l.jsxs)("div",{className:"grid w-full  items-center gap-1.5",children:[(0,l.jsx)(v.J,{htmlFor:"email",children:"Identifiant Connect'Events"}),(0,l.jsx)(w.p,{type:"email",className:"grow border border-gray-300 p-2",placeholder:(null==u?void 0:u.connectId)||"Chargement...",disabled:!0,value:null!=(d=null==u?void 0:u.connectId)?d:""})]})]}),(0,l.jsx)(r.w,{orientation:"vertical",className:"h-auto"}),(0,l.jsxs)("div",{className:(0,n.cn)("flex w-1/2 flex-col gap-6",{"w-full":L}),children:[(0,l.jsx)("h2",{className:"flex w-full justify-center text-lg font-bold",children:f?"Modifier mon mot de passe":"D\xe9finir un mot de passe"}),(0,l.jsx)(g.lV,{...m,children:(0,l.jsxs)("form",{onSubmit:m.handleSubmit(function(e){P(e,{onSuccess:()=>{S({title:f?"Mot de passe modifi\xe9 avec succ\xe8s":"Mot de passe d\xe9fini avec succ\xe8s"}),f&&(R(),M.push("/"))},onError:e=>{m.setError("currentPassword",{type:"manual",message:"Le mot de passe actuel est incorrect"}),S({title:"Mot de passe incorrect",description:e.message})}})}),className:"flex flex-col gap-4",children:[f&&(0,l.jsx)(N.W,{className:"grow",control:O,name:"currentPassword",label:"Mot de passe actuel",placeholder:".............",hasMessage:!1}),(0,l.jsx)(N.W,{className:"grow",control:O,name:"newPassword",label:"Nouveau mot de passe",placeholder:".............",onChange:e=>{D("newPassword",e.target.value),I("newPassword")},hasMessage:!1}),(0,l.jsxs)("div",{className:"space-y-3",children:[(0,l.jsx)("h3",{className:"text-sm",children:"Le mot de passe doit contenir les \xe9l\xe9ments suivants :"}),(0,l.jsx)("div",{className:"flex flex-col gap-2",children:E.H3Y.map(e=>(0,l.jsx)(y.A,{desc:e.desc,errorType:e.errorType,toDisplay:!!_().newPassword,passwordError:j},e.errorType))})]}),(0,l.jsx)(o.$,{variant:"blue",type:"submit",children:f?"Modifier mon mot de passe":"D\xe9finir un mot de passe"})]})})]})]})]}):(0,l.jsx)(b.R,{})};var S=t(56363);let _="flex w-1/3 items-center justify-between rounded-lg border bg-white p-4",O=function(e){let{user:s}=e,[t,r]=(0,i.useState)({pushNotifications:s.pushNotifications,emailNotifications:s.emailNotifications}),{toast:o}=(0,c.dj)(),d=(0,n.al)(),{mutate:u}=(0,a.lkt)(),p=e=>{let s={...t,[e]:!t[e]};r(s),u(s,{onSuccess:()=>o({title:"Pr\xe9f\xe9rences mises \xe0 jour avec succ\xe8s."}),onError:e=>{o({title:"Erreur lors de la mise \xe0 jour.",description:e.message}),r(t)}})};return(0,l.jsxs)("div",{children:[!d&&(0,l.jsx)("h1",{className:"pb-4 text-2xl font-bold",children:"Pr\xe9f\xe9rences"}),(0,l.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,l.jsxs)("div",{className:(0,n.cn)(_,{"w-full":d}),children:[(0,l.jsx)("p",{children:"Notifications push nouveaut\xe9s"}),(0,l.jsx)(S.d,{checked:t.pushNotifications,onCheckedChange:()=>p("pushNotifications")})]}),(0,l.jsxs)("div",{className:(0,n.cn)(_,{"w-full":d}),children:[(0,l.jsx)("p",{children:"Notifications par mail"}),(0,l.jsx)(S.d,{checked:t.emailNotifications,onCheckedChange:()=>
1p("emailNotifications")})]}),(0,l.jsxs)("div",{className:(0,n.cn)(_,{"w-full":d}),children:[(0,l.jsx)("p",{children:"G\xe9olocalisation"}),(0,l.jsx)(S.d,{})]})]})]})},D={connection:{component:e=>(0,l.jsx)(P,{...e}),title:"Identifiants de connexion"},preference:{component:e=>(0,l.jsx)(O,{...e}),title:"Pr\xe9f\xe9rences"}},I="flex items-start px-3 py-2",L=function(){let[e,s]=i.useState("connection"),t=e=>{s(e)},{user:a}=(0,x.u)(),c=(0,n.al)(),o=D[e].component;return(0,l.jsx)(l.Fragment,{children:(0,l.jsxs)("div",{className:(0,n.cn)("bg-white",{"p-0":c,"p-20":!c}),children:[(0,l.jsx)("h1",{className:(0,n.cn)("pb-6 text-2xl font-bold",{hidden:c}),children:"Param\xe8tres"}),(0,l.jsxs)("div",{className:(0,n.cn)("flex",{"flex-col":c}),children:[(0,l.jsxs)("div",{className:(0,n.cn)("flex",{"mr-10 flex-col gap-3":!c,"w-full flex-row justify-between":c}),children:[(0,l.jsx)("button",{onClick:()=>t("connection"),className:(0,n.cn)(I,{"border-blue-500 font-bold text-blue-500":"connection"===e,"border-l-2":!c,"w-full items-center justify-center border-b-2":c}),children:D.connection.title}),(0,l.jsx)("button",{onClick:()=>t("preference"),className:(0,n.cn)(I,{"border-blue-500 font-bold text-blue-500":"preference"===e,"border-l-2":!c,"w-full items-center justify-center border-b-2":c}),children:D.preference.title}),!c&&(0,l.jsx)(r.w,{}),!c&&(0,l.jsx)(j,{})]}),(0,l.jsx)("div",{className:(0,n.cn)("flex grow flex-col border bg-gray-50",{"p-0":c,"px-10 py-6":!c}),children:(0,l.jsx)(o,{user:a})}),c&&(0,l.jsx)(j,{})]})]})})}},56363:(e,s,t)=>{"use strict";t.d(s,{d:()=>a});var l=t(6029),n=t(55729),r=t(19548),i=t(39794);let a=n.forwardRef((e,s)=>{let{className:t,...n}=e;return(0,l.jsx)(r.bL,{className:(0,i.cn)("focus-visible:ring-ring focus-visible:ring-offset-background peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-blue-500 data-[state=unchecked]:bg-gray-200",t),...n,ref:s,children:(0,l.jsx)(r.zi,{className:(0,i.cn)("pointer-events-none block h-4 w-4 rounded-full bg-white shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})})});a.displayName=r.bL.displayName}},e=>{e.O(0,[636,6593,8792],()=>e(e.s=12401)),_N_E=e.O()}]);
2//# sourceMappingURL=my-settings-90d3a52816e3eb7f.js.map

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.