Files
soorya-carpet/public/build/assets/profile-OTgEN9V9.js
admin 9c703306ec
Some checks failed
linter / quality (push) Has been cancelled
tests / ci (push) Has been cancelled
chore: build
2025-10-27 21:32:05 +05:45

2 lines
7.3 KiB
JavaScript

import{r as F,j as r,F as v,c as E,H as C,L as P}from"./app-Ajql0Lt4.js";import{q as u,b as k,B as m}from"./createLucideIcon-B_iAwCmA.js";import{H as b,S as A}from"./layout-B-QAbSfv.js";import{I as h}from"./input-error-Drp3HhtP.js";import{D as _,a as S,b as H,c as L,d as T,e as I,f as O}from"./dialog-CTDbVFLX.js";import{I as p}from"./input-B0_NTiRR.js";import{L as g}from"./label-D8DO87nw.js";import{A as U,e as z}from"./app-layout-BTSySP9M.js";import{z as B}from"./transition-JffmAkBI.js";import"./app-B4XVefei.js";import"./index-em-EQZzp.js";import"./index-BPJbFReo.js";import"./index-B6hfytYC.js";import"./index-D6lErTwd.js";import"./sheet-iBbRuLZ4.js";import"./index-CS1SDu2T.js";import"./index-UHLdfeKp.js";import"./app-logo-icon-B9D8MR-Y.js";import"./package-CgKP903x.js";const o=e=>({url:o.url(e),method:"get"});o.definition={methods:["get","head"],url:"/settings/profile"};o.url=e=>o.definition.url+u(e);o.get=e=>({url:o.url(e),method:"get"});o.head=e=>({url:o.url(e),method:"head"});const f=e=>({action:o.url(e),method:"get"});f.get=e=>({action:o.url(e),method:"get"});f.head=e=>({action:o.url({[e?.mergeQuery?"mergeQuery":"query"]:{_method:"HEAD",...e?.query??e?.mergeQuery??{}}}),method:"get"});o.form=f;const l=e=>({url:l.url(e),method:"patch"});l.definition={methods:["patch"],url:"/settings/profile"};l.url=e=>l.definition.url+u(e);l.patch=e=>({url:l.url(e),method:"patch"});const N=e=>({action:l.url({[e?.mergeQuery?"mergeQuery":"query"]:{_method:"PATCH",...e?.query??e?.mergeQuery??{}}}),method:"post"});N.patch=e=>({action:l.url({[e?.mergeQuery?"mergeQuery":"query"]:{_method:"PATCH",...e?.query??e?.mergeQuery??{}}}),method:"post"});l.form=N;const d=e=>({url:d.url(e),method:"delete"});d.definition={methods:["delete"],url:"/settings/profile"};d.url=e=>d.definition.url+u(e);d.delete=e=>({url:d.url(e),method:"delete"});const Q=e=>({action:d.url({[e?.mergeQuery?"mergeQuery":"query"]:{_method:"DELETE",...e?.query??e?.mergeQuery??{}}}),method:"post"});Q.delete=e=>({action:d.url({[e?.mergeQuery?"mergeQuery":"query"]:{_method:"DELETE",...e?.query??e?.mergeQuery??{}}}),method:"post"});d.form=Q;const D={update:l,destroy:d},s=e=>({url:s.url(e),method:"get"});s.definition={methods:["get","head"],url:"/verify-email"};s.url=e=>s.definition.url+u(e);s.get=e=>({url:s.url(e),method:"get"});s.head=e=>({url:s.url(e),method:"head"});const y=e=>({action:s.url(e),method:"get"});y.get=e=>({action:s.url(e),method:"get"});y.head=e=>({action:s.url({[e?.mergeQuery?"mergeQuery":"query"]:{_method:"HEAD",...e?.query??e?.mergeQuery??{}}}),method:"get"});s.form=y;const a=(e,t)=>({url:a.url(e,t),method:"get"});a.definition={methods:["get","head"],url:"/verify-email/{id}/{hash}"};a.url=(e,t)=>{Array.isArray(e)&&(e={id:e[0],hash:e[1]}),e=k(e);const n={id:e.id,hash:e.hash};return a.definition.url.replace("{id}",n.id.toString()).replace("{hash}",n.hash.toString()).replace(/\/+$/,"")+u(t)};a.get=(e,t)=>({url:a.url(e,t),method:"get"});a.head=(e,t)=>({url:a.url(e,t),method:"head"});const x=(e,t)=>({action:a.url(e,t),method:"get"});x.get=(e,t)=>({action:a.url(e,t),method:"get"});x.head=(e,t)=>({action:a.url(e,{[t?.mergeQuery?"mergeQuery":"query"]:{_method:"HEAD",...t?.query??t?.mergeQuery??{}}}),method:"get"});a.form=x;const i=e=>({url:i.url(e),method:"post"});i.definition={methods:["post"],url:"/email/verification-notification"};i.url=e=>i.definition.url+u(e);i.post=e=>({url:i.url(e),method:"post"});const q=e=>({action:i.url(e),method:"post"});q.post=e=>({action:i.url(e),method:"post"});i.form=q;Object.assign(s,s),Object.assign(a,a),Object.assign(i,i);function R(){const e=F.useRef(null);return r.jsxs("div",{className:"space-y-6",children:[r.jsx(b,{title:"Delete account",description:"Delete your account and all of its resources"}),r.jsxs("div",{className:"space-y-4 rounded-lg border border-red-100 bg-red-50 p-4 dark:border-red-200/10 dark:bg-red-700/10",children:[r.jsxs("div",{className:"relative space-y-0.5 text-red-600 dark:text-red-100",children:[r.jsx("p",{className:"font-medium",children:"Warning"}),r.jsx("p",{className:"text-sm",children:"Please proceed with caution, this cannot be undone."})]}),r.jsxs(_,{children:[r.jsx(S,{asChild:!0,children:r.jsx(m,{variant:"destructive","data-test":"delete-user-button",children:"Delete account"})}),r.jsxs(H,{children:[r.jsx(L,{children:"Are you sure you want to delete your account?"}),r.jsx(T,{children:"Once your account is deleted, all of its resources and data will also be permanently deleted. Please enter your password to confirm you would like to permanently delete your account."}),r.jsx(v,{...D.destroy.form(),options:{preserveScroll:!0},onError:()=>e.current?.focus(),resetOnSuccess:!0,className:"space-y-6",children:({resetAndClearErrors:t,processing:n,errors:c})=>r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"grid gap-2",children:[r.jsx(g,{htmlFor:"password",className:"sr-only",children:"Password"}),r.jsx(p,{id:"password",type:"password",name:"password",ref:e,placeholder:"Password",autoComplete:"current-password"}),r.jsx(h,{message:c.password})]}),r.jsxs(I,{className:"gap-2",children:[r.jsx(O,{asChild:!0,children:r.jsx(m,{variant:"secondary",onClick:()=>t(),children:"Cancel"})}),r.jsx(m,{variant:"destructive",disabled:n,asChild:!0,children:r.jsx("button",{type:"submit","data-test":"confirm-delete-user-button",children:"Delete account"})})]})]})})]})]})]})]})}const V=[{title:"Profile settings",href:z().url}];function ue({mustVerifyEmail:e,status:t}){const{auth:n}=E().props;return r.jsxs(U,{breadcrumbs:V,children:[r.jsx(C,{title:"Profile settings"}),r.jsxs(A,{children:[r.jsxs("div",{className:"space-y-6",children:[r.jsx(b,{title:"Profile information",description:"Update your name and email address"}),r.jsx(v,{...D.update.form(),options:{preserveScroll:!0},className:"space-y-6",children:({processing:c,recentlySuccessful:w,errors:j})=>r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"grid gap-2",children:[r.jsx(g,{htmlFor:"name",children:"Name"}),r.jsx(p,{id:"name",className:"mt-1 block w-full",defaultValue:n.user.name,name:"name",required:!0,autoComplete:"name",placeholder:"Full name"}),r.jsx(h,{className:"mt-2",message:j.name})]}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(g,{htmlFor:"email",children:"Email address"}),r.jsx(p,{id:"email",type:"email",className:"mt-1 block w-full",defaultValue:n.user.email,name:"email",required:!0,autoComplete:"username",placeholder:"Email address"}),r.jsx(h,{className:"mt-2",message:j.email})]}),e&&n.user.email_verified_at===null&&r.jsxs("div",{children:[r.jsxs("p",{className:"-mt-4 text-sm text-muted-foreground",children:["Your email address is unverified."," ",r.jsx(P,{href:i(),as:"button",className:"text-foreground underline decoration-neutral-300 underline-offset-4 transition-colors duration-300 ease-out hover:decoration-current! dark:decoration-neutral-500",children:"Click here to resend the verification email."})]}),t==="verification-link-sent"&&r.jsx("div",{className:"mt-2 text-sm font-medium text-green-600",children:"A new verification link has been sent to your email address."})]}),r.jsxs("div",{className:"flex items-center gap-4",children:[r.jsx(m,{disabled:c,"data-test":"update-profile-button",children:"Save"}),r.jsx(B,{show:w,enter:"transition ease-in-out",enterFrom:"opacity-0",leave:"transition ease-in-out",leaveTo:"opacity-0",children:r.jsx("p",{className:"text-sm text-neutral-600",children:"Saved"})})]})]})})]}),r.jsx(R,{})]})]})}export{ue as default};