PageSourceSearch

https://www.smilebrilliant.com/wp-content/themes/revolution-child/dist/account/assets/Profile.DKyitpw9.js

js smilebrilliant.com collected 2026-09-25 03:51:26 UTC 14,084 bytes, 1 lines download raw bytes

1import{j as e,r as m}from"./vendor.BwbG8Zcq.js";import{l as E,m as N,n as P,p as T}from"./chrome.B6ris1qF.js";import{E as M,T as y,B as w}from"./ui.BqlJ4-gB.js";import{S as F,T as A,C as b,I as S}from"./ds.oOR8TAn4.js";import{a as H}from"./Skeleton.jbQ9_Mz4.js";import"./data.BLyhXs-t.js";import"./ChromeLink.CIaYJ3pw.js";import"./preload-helper.r23mchnI.js";import"./accountBase.DmtyjK7H.js";const I={instagram:"M12 2.16c3.2 0 3.58.01 4.85.07 1.17.05 1.8.25 2.23.41.56.22.96.48 1.38.9.42.42.68.82.9 1.38.16.42.36 1.06.41 2.23.06 1.27.07 1.65.07 4.85s-.01 3.58-.07 4.85c-.05 1.17-.25 1.8-.41 2.23-.22.56-.48.96-.9 1.38-.42.42-.82.68-1.38.9-.42.16-1.06.36-2.23.41-1.27.06-1.65.07-4.85.07s-3.58-.01-4.85-.07c-1.17-.05-1.8-.25-2.23-.41a3.7 3.7 0 0 1-1.38-.9 3.7 3.7 0 0 1-.9-1.38c-.16-.42-.36-1.06-.41-2.23-.06-1.27-.07-1.65-.07-4.85s.01-3.58.07-4.85c.05-1.17.25-1.8.41-2.23.22-.56.48-.96.9-1.38.42-.42.82-.68 1.38-.9.42-.16 1.06-.36 2.23-.41C8.42 2.17 8.8 2.16 12 2.16M12 0C8.74 0 8.33.01 7.05.07 5.78.13 4.9.33 4.14.63c-.79.3-1.46.72-2.12 1.38C1.35 2.67.94 3.34.63 4.14.33 4.9.13 5.78.07 7.05.01 8.33 0 8.74 0 12s.01 3.67.07 4.95c.06 1.27.26 2.15.56 2.91.3.8.72 1.46 1.38 2.12.66.66 1.33 1.08 2.12 1.38.76.3 1.64.5 2.91.56C8.33 23.99 8.74 24 12 24s3.67-.01 4.95-.07c1.27-.06 2.15-.26 2.91-.56a5.86 5.86 0 0 0 2.12-1.38 5.86 5.86 0 0 0 1.38-2.12c.3-.76.5-1.64.56-2.91.06-1.28.07-1.69.07-4.95s-.01-3.67-.07-4.95c-.06-1.27-.26-2.15-.56-2.91a5.86 5.86 0 0 0-1.38-2.12A5.86 5.86 0 0 0 19.86.63c-.76-.3-1.64-.5-2.91-.56C15.67.01 15.26 0 12 0zm0 5.84a6.16 6.16 0 1 0 0 12.32 6.16 6.16 0 0 0 0-12.32zM12 16a4 4 0 1 1 0-8 4 4 0 0 1 0 8zm6.41-10.85a1.44 1.44 0 1 0 0 2.88 1.44 1.44 0 0 0 0-2.88z",twitter:"M23.95 4.57a10 10 0 0 1-2.83.78 4.96 4.96 0 0 0 2.16-2.72c-.95.55-2 .96-3.13 1.18a4.92 4.92 0 0 0-8.38 4.48A13.97 13.97 0 0 1 1.64 3.16a4.82 4.82 0 0 0-.67 2.48c0 1.7.87 3.21 2.19 4.1a4.9 4.9 0 0 1-2.23-.62v.06a4.92 4.92 0 0 0 3.95 4.83 4.96 4.96 0 0 1-2.21.08 4.94 4.94 0 0 0 4.6 3.42A9.87 9.87 0 0 1 0 19.54a13.94 13.94 0 0 0 7.56 2.21c9.05 0 14-7.5 14-13.99 0-.21 0-.42-.02-.63A9.94 9.94 0 0 0 24 4.59z",facebook:"M24 12.07C24 5.44 18.63.07 12 .07S0 5.44 0 12.07c0 5.99 4.39 10.95 10.13 11.85v-8.38H7.08v-3.47h3.05V9.43c0-3.01 1.79-4.67 4.53-4.67 1.31 0 2.69.24 2.69.24v2.95h-1.51c-1.49 0-1.96.93-1.96 1.87v2.25h3.33l-.53 3.47h-2.8v8.38C19.61 23.02 24 18.06 24 12.07z",youtube:"M23.5 6.19a3.02 3.02 0 0 0-2.12-2.14C19.5 3.55 12 3.55 12 3.55s-7.5 0-9.38.5A3.02 3.02 0 0 0 .5 6.19C0 8.07 0 12 0 12s0 3.93.5 5.81a3.02 3.02 0 0 0 2.12 2.14c1.87.5 9.38.5 9.38.5s7.5 0 9.38-.5a3.02 3.02 0 0 0 2.12-2.14C24 15.93 24 12 24 12s0-3.93-.5-5.81zM9.55 15.57V8.43L15.82 12l-6.27 3.57z",linkedin:"M20.45 20.45h-3.56v-5.57c0-1.33-.03-3.04-1.85-3.04-1.85 0-2.14 1.45-2.14 2.94v5.67H9.35V9h3.41v1.56h.05c.48-.9 1.64-1.85 3.37-1.85 3.6 0 4.27 2.37 4.27 5.46v6.28zM5.34 7.43a2.06 2.06 0 1 1 0-4.13 2.06 2.06 0 0 1 0 4.13zm1.78 13.02H3.56V9h3.56v11.45zM22.22 0H1.77C.79 0 0 .77 0 1.73v20.54C0 23.23.79 24 1.77 24h20.45C23.2 24 24 23.23 24 22.27V1.73C24 .77 23.2 0 22.22 0z",tiktok:"M12.53.02c1.31-.02 2.61-.01 3.91-.02.08 1.53.63 3.09 1.75 4.17 1.12 1.11 2.7 1.62 4.24 1.79v4.03c-1.44-.05-2.89-.35-4.2-.97-.57-.26-1.1-.59-1.62-.93-.01 2.92.01 5.84-.02 8.75-.08 1.4-.54 2.79-1.35 3.94-1.31 1.92-3.58 3.17-5.91 3.21-1.43.08-2.86-.31-4.08-1.03-2.02-1.19-3.44-3.37-3.65-5.71-.02-.5-.03-1-.01-1.49.18-1.9 1.12-3.72 2.58-4.96 1.66-1.44 3.98-2.13 6.15-1.72.02 1.48-.04 2.96-.04 4.44-.99-.32-2.15-.23-3.02.37-.63.41-1.11 1.04-1.36 1.75-.21.51-.15 1.07-.14 1.61.24 1.64 1.82 3.02 3.5 2.87 1.12-.01 2.19-.66 2.77-1.61.19-.33.4-.67.41-1.06.1-1.79.06-3.57.07-5.36.01-4.03-.01-8.05.02-12.07z",blog:"M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"};function L({name:n,size:a=18}){const t=I[n];return t?e.jsx("svg",{width:a,height:a,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",focusable:"false",children:e.jsx("path",{d:t})}):null}function k({title:n,hint:a,editing:t,onEdit:l,onSave:o,onCancel:i,saving:r,children:d}){return e.jsxs(b,{children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",ga
1p:12,marginBottom:6,flexWrap:"wrap"},children:[e.jsxs("div",{children:[e.jsx("h3",{style:{margin:0,fontFamily:"var(--font-display)",fontWeight:700,fontSize:16,color:"var(--ink)"},children:n}),a?e.jsx("div",{style:{fontSize:13,color:"var(--ink-faint)",marginTop:2},children:a}):null]}),t?e.jsxs("div",{style:{display:"flex",gap:6},children:[e.jsx(w,{variant:"ghost",size:"sm",onClick:i,disabled:r,children:"Cancel"}),e.jsx(w,{variant:"primary",size:"sm",loading:r,onClick:o,children:"Save"})]}):e.jsx(w,{variant:"ghost",size:"sm",onClick:l,icon:e.jsx(S,{name:"edit",size:13}),children:"Edit"})]}),d]})}function p({label:n,value:a,editing:t,children:l}){return e.jsxs("div",{className:"sb-prof-row",style:{display:"grid",gridTemplateColumns:"180px 1fr",gap:16,padding:"12px 0",borderTop:"1px solid var(--line-3)",alignItems:t?"center":"baseline"},children:[e.jsx("div",{style:{fontFamily:"var(--font-display)",fontSize:13,fontWeight:500,color:"var(--ink-3)"},children:n}),e.jsx("div",{style:{fontSize:14,color:"var(--ink)"},children:t?l:a||e.jsx("span",{style:{color:"var(--ink-faint)"},children:"Not set"})})]})}function Q(){const{data:n,isLoading:a,isError:t,error:l,refetch:o}=E(),[i,r]=m.useState("personal");return a?e.jsx(H,{variant:"form"}):t?e.jsx(M,{error:l,onRetry:o}):e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:22},children:[e.jsx(F,{eyebrow:"Account",title:"Profile"}),e.jsx(A,{value:i,onChange:r,items:[{value:"personal",label:"Personal info"},{value:"password",label:"Password"},{value:"social",label:"Social links"}]}),i==="personal"?e.jsx(O,{profile:n}):null,i==="password"?e.jsx(U,{}):null,i==="social"?e.jsx(B,{social:n.social}):null]})}function O({profile:n}){const a=N(),[t,l]=m.useState(!1),[o,i]=m.useState(n),[r,d]=m.useState("");m.useEffect(()=>{t||i(n)},[n,t]);const h=c=>u=>i(C=>({...C,[c]:u})),g=c=>{i(u=>({...u,phone:c.replace(/[^\d+()\-.\s]/g,"")})),d("")},x=()=>{const c=(o.phone||"").trim();if(c&&c.replace(/\D/g,"").length<7){d("Please enter a valid phone number (digits only, at least 7).");return}d(""),a.mutate({firstName:o.firstName,lastName:o.lastName,displayName:o.displayName,email:o.email,phone:c},{onSuccess:()=>l(!1)})},f=()=>{i(n),d(""),a.reset(),l(!0)},s=()=>{i(n),d(""),a.reset(),l(!1)};return e.jsxs(e.Fragment,{children:[e.jsxs(k,{title:"Personal information",hint:"How we contact you and address your packages.",editing:t,saving:a.isPending,onEdit:f,onCancel:s,onSave:x,children:[e.jsx(p,{label:"First name",value:n.firstName,editing:t,children:e.jsx(y,{value:o.firstName,onChange:h("firstName")})}),e.jsx(p,{label:"Last name",value:n.lastName,editing:t,children:e.jsx(y,{value:o.lastName,onChange:h("lastName")})}),e.jsx(p,{label:"Display name",value:n.displayName,editing:t,children:e.jsx(y,{value:o.displayName,onChange:h("displayName")})}),e.jsx(p,{label:"Email",value:n.email,editing:t,children:e.jsx(y,{type:"email",value:o.email,onChange:h("email")})}),e.jsx(p,{label:"Phone",value:n.phone,editing:t,children:e.jsx(y,{type:"tel",inputMode:"tel",value:o.phone,onChange:g,invalid:!!r})}),r?e.jsx("p",{className:"sb-field-error",style:{marginTop:8},children:r}):null,t?null:e.jsx(p,{label:"Username",value:n.username,editing:!1}),a.isError?e.jsx("p",{className:"sb-field-error",style:{marginTop:10},children:a.error.message}):null]}),n.organization?e.jsx(V,{organization:n.organization}):null]})}function U(){const n=P(),[a,t]=m.useState(!1),[l,o]=m.useState(!1),[i,r]=m.useState({current:"",next:"",confirm:""}),[d,h]=m.useState(""),g=()=>{r({current:"",next:"",confirm:""}),h(""),n.reset()},x=()=>{if(h(""),!/^(?=.{8,20})(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*\W).*$/.test(i.next))return h("Password must be at least 8 characters in length and must contain at least one number, one upper case letter, one lower case letter and one special character.");if(i.next!==i.confirm)return h("Passwords do not match.");n.mutate({currentPassword:i.current,newPassword:i.next},{onSuccess:s=>{s!=null&&s.reload&&window.location.reload()}})},f=l?"text":"password";return e.jsx(k,{title:"Password",hint:"8–20 chars · upper, lower, number & symbol. Changing it logs out other devices.",editing:a,saving:n.isPending,onEdit:()=>{g(),t(!0)},onCancel:()=>{g(),t(!1)},onSave:x,children:a?e.jsxs(e.Fragment,{children:[e.jsx(p,{label:"Current password",editing:!0,children:e.jsx(y,{type:f,value:i.current,onChange:s=>r(c=>({...c,current:s})),autoComplete:"current-password"})}),e.jsx(p,{label:"New password",editing:!0,children:e.jsx(y,{type:f,value:i.next,onChange:s=>r(c=>({...c,next:s})),autoComplete:"new-password"})}),e.jsx(p,{label:"Confirm new",editing:!0,children:e.jsx(y,{type:f,value:i.confirm,onChange:s=>r(c=>({...c,confirm:s})),autoComplete:"new-password"})}),e.jsxs("label",{style:{display:"inline-flex",alignItems:"center",gap:8,marginTop:10,fontSize:13,color:"var(--ink-3)",cursor:"pointer"},children:[e.jsx("input",{type:"checkbox",checked:l,onChange:s=>o(s.target.checked)})," Show passwords"]}),d||n.isError?e.jsx("p",{className:"sb-field-error",style:{marginTop:8},children:d||n.error.message}):null]}):e.jsx(p,{label:"Password",value:"••••••••••••",editing:!1})})}const R={instagram:["instagram.com","instagr.am"],twitter:["twitter.com","x.com"],facebook:["facebook.com","fb.com","fb.me"],youtube:["youtube.com","youtu.be"],linkedin:["linkedin.com"],tiktok:["tiktok.com"],blog:null};function _(n,a,t){if(!a||!a.trim())return"";let l;
1try{const r=new URL(a.trim());if(r.protocol!=="http:"&&r.protocol!=="https:")return"Enter a valid URL (including https://).";l=r.hostname.replace(/^www\./i,"").toLowerCase()}catch(r){return"Enter a valid URL (including https://)."}const o=R[n];return o?o.some(r=>l===r||l.endsWith("."+r))?"":`Enter a valid ${t} URL (e.g. https://${o[0]}/…).`:""}function B({social:n}){const a=T(),[t,l]=m.useState(!1),[o,i]=m.useState(n||{}),[r,d]=m.useState({});m.useEffect(()=>{t||i(n||{})},[n,t]);const h=s=>c=>{i(u=>({...u,[s]:c})),d(u=>u[s]?{...u,[s]:void 0}:u)},g=[{key:"instagram",label:"Instagram",ph:"www.instagram.com"},{key:"twitter",label:"Twitter",ph:"www.twitter.com"},{key:"facebook",label:"Facebook",ph:"www.facebook.com"},{key:"youtube",label:"Youtube",ph:"www.youtube.com"},{key:"linkedin",label:"Linkedin",ph:"www.linkedin.com"},{key:"tiktok",label:"TikTok",ph:"www.tiktok.com"},{key:"blog",label:"Blog",ph:"www.blog.com"}],x=()=>{i(n||{}),d({}),a.reset()},f=()=>{const s={};g.forEach(c=>{const u=_(c.key,o[c.key],c.label);u&&(s[c.key]=u)}),d(s),!Object.keys(s).length&&a.mutate(o,{onSuccess:()=>{d({}),l(!1)}})};return e.jsxs(k,{title:"Social links",hint:"Shown on your public profile.",editing:t,saving:a.isPending,onEdit:()=>{x(),l(!0)},onCancel:()=>{x(),l(!1)},onSave:f,children:[g.map(s=>e.jsxs(p,{label:e.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:8},children:[e.jsx("span",{style:{display:"inline-flex",width:16,color:"var(--ink-3)"},children:e.jsx(L,{name:s.key})}),s.label]}),value:n==null?void 0:n[s.key],editing:t,children:[e.jsx(y,{type:"url",value:o[s.key]||"",onChange:h(s.key),placeholder:`https://${s.ph}`,invalid:!!r[s.key]}),r[s.key]?e.jsx("p",{className:"sb-field-error",style:{marginTop:5,marginBottom:0},children:r[s.key]}):null]},s.key)),a.isError&&!Object.keys(r).some(s=>r[s])?e.jsx("p",{className:"sb-field-error",style:{marginTop:8},children:a.error.message}):null]})}function V({organization:n}){const[a,t]=m.useState(!1),[l,o]=m.useState(!1),[i,r]=m.useState(!1),[d,h]=m.useState("");async function g(){var x,f,s,c;o(!0),h("");try{const u=new FormData;u.append("action","unlink_organization"),u.append("nonce",((x=window.sbAccount)==null?void 0:x.unlinkOrgNonce)||"");const v=await(await fetch(((f=window.sbAccount)==null?void 0:f.ajaxUrl)||"/wp-admin/admin-ajax.php",{method:"POST",body:u,credentials:"same-origin"})).json();if(!v||!v.success)throw new Error(((s=v==null?void 0:v.data)==null?void 0:s.message)||"Could not unlink. Reload and try again.");const j=z=>{document.cookie=`${z}=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/; domain=${window.location.hostname}`};j("affwp_ref"),(c=v.data)!=null&&c.shine_access_removed&&(j("shine_user"),j("shine_user_provider")),r(!0),t(!1)}catch(u){h(u.message)}finally{o(!1)}}return i?e.jsxs(b,{children:[e.jsx("h3",{className:"sb-h3",children:"My Organization"}),e.jsx("p",{className:"sb-muted",children:"No organization currently linked."}),e.jsx("p",{className:"sb-ok",children:"Organization unlinked successfully."})]}):e.jsxs(b,{children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start"},children:[e.jsxs("div",{children:[e.jsx("div",{style:{fontFamily:"var(--font-display)",fontSize:11,fontWeight:700,color:"var(--ink-faint)",textTransform:"uppercase",letterSpacing:"0.08em"},children:"My Organization"}),e.jsx("h3",{style:{margin:"2px 0 0",fontFamily:"var(--font-display)",fontSize:17,fontWeight:700},children:n.name}),e.jsxs("p",{style:{margin:"2px 0 0",fontSize:13,color:"var(--ink-3)"},children:["Status: ",e.jsx("strong",{style:{color:"var(--success)"},children:"Active"})]})]}),e.jsx("button",{type:"button",title:"Unlink Organization","aria-label":"Unlink Organization",onClick:()=>t(!0),disabled:l,style:{border:0,background:"transparent",cursor:"pointer",padding:6,color:"var(--ink-3)"},children:e.jsx(S,{name:"trash",size:16})})]}),d?e.jsx("p",{className:"sb-field-error",children:d}):null,a?e.jsxs("div",{style:{marginTop:12},children:[e.jsxs("p",{style:{fontSize:14},children:[e.jsx("strong",{children:"Are you sure?"})," Remove yourself as a member of ",n.name,"?"]}),e.jsxs("div",{style:{display:"flex",gap:8},children:[e.jsx(w,{variant:"danger",loading:l,onClick:g,children:"Yes, unlink it"}),e.jsx(w,{variant:"ghost",onClick:()=>t(!1),disabled:l,children:"Cancel"})]})]}):null]})}export{Q 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.