PageSourceSearch

https://piquora.com/static/js/5237.44761cc9.chunk.js

js piquora.com collected 2026-09-25 21:45:19 UTC 33,317 bytes, 2 lines download raw bytes

1/*! For license information please see 5237.44761cc9.chunk.js.LICENSE.txt */
2"use strict";(self.webpackChunkpiquoraweb_frontend=self.webpackChunkpiquoraweb_frontend||[]).push([[5237],{55237(e,r,a){a.r(r),a.d(r,{default:()=>z});var t=a(89379),o=a(88094),n=a(49679),i=a(89602),s=a(48886),l=a(91504),d=a(68456),c=a(53988),u=a(73962),p=a(38499),x=a(91531),h=a(8498),m=a(15295),v=a(12552),b=a(28814),g=a(86938),f=a(39104),y=a(87194),A=a(77695),j=a(92168),w=a(64703),C=a(19582),k=a(75184),S=a(55353);const q=(0,a(74557).A)("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);var P=a(61238),N=a(8397),W=a(73634),I=a(40974),L=a(84745),O=a(13379),E=a(79590),R=a(15678);const T=[{regex:/.{8,}/,message:"at least 8 characters"},{regex:/[A-Z]/,message:"an uppercase letter"},{regex:/[a-z]/,message:"a lowercase letter"},{regex:/[0-9]/,message:"a number"},{regex:/[^A-Za-z0-9]/,message:"a special character"}],M=e=>{let{children:r,sx:a={}}=e;return(0,R.jsxs)(n.A,{role:"note",sx:(0,t.A)({mt:1,p:1.5,borderRadius:2,border:"1px solid color-mix(in srgb, var(--primary-color) 44%, var(--piq-border))",background:"linear-gradient(135deg, color-mix(in srgb, var(--primary-color) 12%, var(--piq-surface-2)) 0%, color-mix(in srgb, var(--piq-surface) 92%, transparent) 100%)",display:"flex",alignItems:"center",gap:1.25},a),children:[(0,R.jsx)(n.A,{sx:{width:24,height:24,borderRadius:"999px",display:"inline-flex",alignItems:"center",justifyContent:"center",color:"var(--primary-color)",background:"color-mix(in srgb, var(--primary-color) 14%, transparent)",flexShrink:0},children:(0,R.jsx)(q,{size:14,"aria-hidden":"true"})}),(0,R.jsx)(i.A,{variant:"body2",sx:{color:"var(--piq-text)",fontWeight:600,lineHeight:1.45},children:r})]})},z=()=>{const[e,r]=(0,o.useState)(!1),[a,t]=(0,o.useState)(""),[q,z]=(0,o.useState)(""),[B,V]=(0,o.useState)(""),[F,D]=(0,o.useState)(!1),[_,H]=(0,o.useState)(!1),[U,K]=(0,o.useState)(!1),[X,Y]=(0,o.useState)(!1),[Z,G]=(0,o.useState)(null),[$,J]=(0,o.useState)(null),[Q,ee]=(0,o.useState)(""),[re,ae]=(0,o.useState)("#bdbdbd"),[te,oe]=(0,o.useState)(0),ne=(0,s.A)(),ie=(0,l.A)("(max-width: 991px)"),se=(0,E.A)("/messages"),le={"& .MuiInputLabel-root":{color:"var(--piq-muted)"},"& .MuiInputLabel-root.Mui-focused":{color:"var(--primary-color)"},"& .MuiOutlinedInput-root":{backgroundColor:"var(--piq-surface-2)",color:"var(--piq-text)","& fieldset":{borderColor:"var(--piq-border)"},"&:hover fieldset":{borderColor:"var(--primary-color)"},"&.Mui-focused fieldset":{borderColor:"var(--primary-color)"}},"& input::placeholder":{color:"var(--piq-placeholder)"}},de=(0,o.useCallback)(e=>{let r=0;return T.forEach(a=>{a.regex.test(e)&&r++}),e?r<=2?{label:"Weak",color:ne.palette.error.main,value:33}:3===r||4===r?{label:"Medium",color:ne.palette.warning.main,value:66}:5===r?{label:"Strong",color:ne.palette.success.main,value:100}:{label:"",color:"#bdbdbd",value:0}:{label:"",color:"#bdbdbd",value:0}},[ne.palette.error.main,ne.palette.success.main,ne.palette.warning.main]),ce=async e=>{if(e.preventDefault(),G(null),J(null),a&&q&&B){for(let e of T)if(!e.regex.test(q))return void G("Password must contain ".concat(e.message,"."));if(q===B){Y(!0);try{const e=await W._.post("/auth/change-password",{currentPassword:a,newPassword:q});e.data.success?(J("Password changed successfully!"),t(""),z(""),V(""),r(!1)):G(e.data.message||"Failed to change password.")}catch(i){var o,n;G((null===(o=i.response)||void 0===o||null===(n=o.data)||void 0===n?void 0:n.message)||"An error occurred while changing password.")}finally{Y(!1)}}else G("New passwords do not match.")}else G("All fields are required.")};(0,o.useEffect)(()=>{const{label:e,color:r,value:a}=de(q);ee(e),ae(r),oe(a)},[de,q]);const[ue,pe]=(0,o.useState)(!1),[xe,he]=(0,o.useState)("email"),[me,ve]=(0,o.useState)(!1),[be,ge]=(0,o.useState)(""),[fe,ye]=(0,o.useState)(!1),[Ae,je]=(0,o.useState)(!1),[we,Ce]=(0,o.useState)(!0),[ke,Se]=(0,o.useState)(!0),[qe,Pe]=(0,o.useState)(!0),[Ne,We]=(0,o.useState)(!0),[Ie,Le]=(0,o.useState)(!1),[Oe,Ee]=(0,o.useState)(!1),[Re,Te]=(0,o.useState)(null),[Me,ze]=(0,o.useState)(null),[Be,Ve]=(0,o.useState)(null),[Fe,De]=(0,o.useState)([]),[_e,He]=(0,o.useState)(!1),[Ue,Ke]=(0,o.useState)(null),[Xe,Ye]=(0,o.useState)(null);(0,o.useEffect)(()=>{(async()=>
2{try{We(!0),ze(null),Ve(null);const c=await W._.get("/users/me");var e;if(c.data&&c.data.success&&c.data.user)pe(!!c.data.user.alwaysVerifyOnLogin),he("phone"===c.data.user.loginOtpChannel?"phone":"email"),ve(!!c.data.user.isPhoneVerified),ge(String(c.data.user.loginOtpPhoneMasked||"")),ye(!!c.data.user.loginOtpSmsConsentAccepted),Ce(!1!==c.data.user.securityEmailNotifications);else ze((null===(e=c.data)||void 0===e?void 0:e.message)||"Failed to load security settings.");try{var r;const e=await W._.get("/users/share-settings"),a=null===e||void 0===e||null===(r=e.data)||void 0===r?void 0:r.shareSettings;a&&(Se(!1!==a.allowExternalShare),Pe(!0))}catch(x){var a,t,o,n;console.error("Error fetching share settings:",x);const e=(null===(a=x.response)||void 0===a||null===(t=a.data)||void 0===t?void 0:t.error)||(null===(o=x.response)||void 0===o||null===(n=o.data)||void 0===n?void 0:n.message)||"Failed to load profile sharing settings.";Ve(e)}try{Ke(null),He(!0);const e=await(0,I.UP)();De(Array.isArray(null===e||void 0===e?void 0:e.links)?e.links:[])}catch(h){var i,s,l,d;console.error("Error listing owner share links:",h);const e=(null===(i=h.response)||void 0===i||null===(s=i.data)||void 0===s?void 0:s.error)||(null===(l=h.response)||void 0===l||null===(d=l.data)||void 0===d?void 0:d.message)||"Failed to load active share links.";Ke(e)}finally{He(!1)}}catch(m){var c,u,p;if(console.error("Error fetching security settings:",m),401===(null===(c=m.response)||void 0===c?void 0:c.status))ze("Please log in to access security settings.");else ze((null===(u=m.response)||void 0===u||null===(p=u.data)||void 0===p?void 0:p.message)||"Failed to load security settings.")}finally{We(!1)}})()},[]);const Ze=async function(e,r){let a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Le(!0),Te(null),ze(null);try{const i=await W._.post("/users/update-preferences",{alwaysVerifyOnLogin:"alwaysVerifyOnLogin"===e?r:ue,securityEmailNotifications:"securityEmailNotifications"===e?r:we,loginOtpChannel:xe,smsConsentAccepted:!0===a.smsConsentAccepted,smsConsentVersion:a.smsConsentVersion,smsConsentStatement:a.smsConsentStatement,smsConsentSource:a.smsConsentSource});if(i.data&&i.data.success){var t,o;null!==i&&void 0!==i&&null!==(t=i.data)&&void 0!==t&&null!==(o=t.preferences)&&void 0!==o&&o.loginOtpChannel&&he("phone"===i.data.preferences.loginOtpChannel?"phone":"email"),!0===a.smsConsentAccepted&&(ye(!0),je(!1));Te("alwaysVerifyOnLogin"===e?"OTP login preference updated.":"securityEmailNotifications"===e?"Security email notification preference updated.":"Security preferences updated.")}else{var n;ze((null===(n=i.data)||void 0===n?void 0:n.message)||"Failed to update preferences.")}}catch(d){var i,s,l;if(console.error("Error updating preferences:",d),401===(null===(i=d.response)||void 0===i?void 0:i.status))ze("Please log in to update preferences.");else ze((null===(s=d.response)||void 0===s||null===(l=s.data)||void 0===l?void 0:l.message)||"An error occurred while updating preferences.")}finally{Le(!1)}};return Ne?(0,R.jsx)(L.A,{variant:"security"}):(0,R.jsxs)("div",{className:"home-layout security-settings-page",children:[(0,R.jsx)(N.default,{isSettings:!0}),(0,R.jsx)("div",{className:"home-content settings-page-content piq-settings-width-home",children:(0,R.jsxs)(n.A,{className:"security-settings-shell",sx:{width:"100%",mx:"auto",mt:{xs:1.5,md:4},px:{xs:0,sm:0,md:0},"& > *":{width:"100%",maxWidth:"100%",boxSizing:"border-box",mx:0}},children:[(0,R.jsxs)(n.A,{className:"settings-header security-settings-header",sx:{width:"100%",maxWidth:"100%",mx:0,boxSizing:"border-box",boxShadow:"var(--piq-shadow)",overflow:"hidden"},children:[(0,R.jsx)("button",{type:"button",className:"back-btn",onClick:se,"aria-label":"Back",children:(0,R.jsx)(P.A,{size:22,"aria-hidden":"true"})}),(0,R.jsxs)("div",{children:[(0,R.jsx)("h1",{className:"settings-title",children:"Security Settings"}),(0,R.jsx)("p",{className:"settings-subtitle",children:"Keep your account protected and manage shared access, verification, and alerts."})]})]}),Re&&(0,R.jsx)(d.A,{severity:"success",sx:{mt:2},children:Re}),Me&&(0,R.jsx)(d.A,{severity:"error",sx:{mt:2},children:Me}),(0,R.jsxs)(c.A,{sx:{p:{xs:2,sm:3,md:4},border:"1px solid var(--piq-border)",borderRadius:3,background:"var(--piq-surface)",color:"var(--piq-text)",width:"100%",maxWidth:"100%",mx:0,boxSizing:"border-box",boxShadow:"var(--piq-shadow)"},children:[(0,R.jsxs)(n.A,{sx:{border:"1px solid color-mix(in srgb, var(--primary-color) 24%, var(--piq-border))",borderRadius:3,p:{xs:2,md:3},mb:3,background:"linear-gradient(135deg, color-mix(in srgb, var(--primary-color) 9%, var(--piq-surface)) 0%, var(--piq-surface) 62%)"},children:[(0,R.jsx)(i.A,{variant:"h5",sx:{fontWeight:800,color:"var(--piq-text)",mb:.75},children:"Login Verification (OTP)"}),(0,R.jsx)(i.A,{variant:"body1",sx:{color:"var(--piq-muted)",mb:2.25},children:"Add an extra security step when signing in with email and choose where your login code is delivered."}),(0,R.jsx)(u.A,{control:(0,R.jsx)(p.A,{checked:ue,onChange:e=>pe(e.target.checked),color:"primary",id:"alwaysVerifyOnLogin",disabled:Ie}),label:"Require a one-time code every time I sign in with email",sx:{mb:1,"& .MuiFormControl
2Label-label":{color:"var(--piq-text)",fontWeight:600}}}),(0,R.jsx)(i.A,{variant:"subtitle2",sx:{color:"var(--piq-muted)",mb:1},children:"OTP delivery channel"}),(0,R.jsxs)(n.A,{sx:{display:"flex",flexWrap:"wrap",gap:1.25,mb:1.5},children:[(0,R.jsx)(x.A,{type:"button",variant:"email"===xe?"contained":"outlined",onClick:()=>he("email"),disabled:Ie,sx:{textTransform:"none",borderRadius:999,fontWeight:700,px:2.5},children:"Email OTP"}),(0,R.jsx)(x.A,{type:"button",variant:"phone"===xe?"contained":"outlined",onClick:()=>he("phone"),disabled:Ie||!me,sx:{textTransform:"none",borderRadius:999,fontWeight:700,px:2.5},children:"Phone OTP"})]}),!me&&!e&&(0,R.jsx)(M,{sx:{mb:1.5},children:"Verify your phone number first to unlock phone OTP delivery."}),"phone"===xe&&me&&(0,R.jsxs)(n.A,{sx:{mb:1.5},children:[(0,R.jsxs)(i.A,{variant:"body2",sx:{color:"var(--piq-muted)",mb:1},children:["Codes will be sent to ",be||"your verified phone number","."]}),!fe&&(0,R.jsx)(u.A,{control:(0,R.jsx)(p.A,{checked:Ae,onChange:e=>je(e.target.checked),disabled:Ie}),label:"I agree to receive login verification SMS from Piquora. Msg and data rates may apply. Reply STOP to opt out and HELP for help.",sx:{alignItems:"flex-start","& .MuiFormControlLabel-label":{fontSize:"0.92rem",color:"var(--piq-text)"}}})]}),(0,R.jsx)(x.A,{variant:"outlined",sx:{color:"var(--piq-text)",borderColor:"var(--primary-color)",borderRadius:2,px:4,textTransform:"none",fontWeight:700,backgroundColor:"transparent","&:hover":{backgroundColor:"var(--piq-surface-2)"}},disabled:Ie||"phone"===xe&&me&&!fe&&!Ae,onClick:async()=>{const e={};if("phone"===xe&&!fe){if(!Ae)return void ze("You must accept phone/text terms before enabling phone OTP.");e.smsConsentAccepted=!0,e.smsConsentVersion="account-login-otp-v1",e.smsConsentStatement="I agree to receive login verification SMS from Piquora. Msg and data rates may apply. Reply STOP to opt out and HELP for help.",e.smsConsentSource="account-security-login-otp"}await Ze("bulk",null,e)},children:Ie?(0,R.jsx)(h.A,{size:20}):"Save OTP Settings"})]}),(0,R.jsx)(n.A,{sx:{my:4},children:(0,R.jsx)(n.A,{sx:{borderBottom:"1px solid var(--piq-border)",width:"100%",mb:4}})}),(0,R.jsxs)(n.A,{sx:{mt:2},children:[(0,R.jsx)(i.A,{variant:"h6",sx:{fontWeight:600,mb:1},children:"Change Password"}),(0,R.jsx)(x.A,{variant:"contained",color:"primary",sx:{mb:2},onClick:()=>r(!0),children:"Change Password"}),ie?(0,R.jsxs)(O.cj,{isOpen:e,onClose:()=>r(!1),snapPoints:[0,.65,.9,1],initialSnap:3,style:{zIndex:1e3},children:[(0,R.jsx)(O.cj.Backdrop,{onClick:()=>r(!1),style:{backgroundColor:"rgba(0, 0, 0, 0.5)"}}),(0,R.jsxs)(O.cj.Container,{children:[(0,R.jsxs)(O.cj.Header,{children:[(0,R.jsx)(n.A,{sx:{width:"100%",display:"flex",justifyContent:"center",padding:"8px 0 4px 0",backgroundColor:"var(--piq-surface)"},children:(0,R.jsx)(n.A,{sx:{width:40,height:4,backgroundColor:"var(--piq-border)",borderRadius:2}})}),(0,R.jsxs)(n.A,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",px:2.5,py:2,borderBottom:"1px solid var(--piq-border)",background:"linear-gradient(135deg, var(--secondary-color) 0%, var(--primary-color) 100%)",color:"var(--piq-on-primary, white)"},children:[(0,R.jsx)(i.A,{sx:{fontWeight:800,fontSize:16},children:"Change Password"}),(0,R.jsx)(x.A,{onClick:()=>r(!1),variant:"text",sx:{color:"var(--piq-on-primary, white)",fontWeight:700,textTransform:"none",minWidth:0},children:"Close"})]})]}),(0,R.jsx)(O.cj.Content,{scrollStyle:{paddingBottom:"max(20px, var(--piq-app-bottom-inset, 0px))",WebkitOverflowScrolling:"touch",overscrollBehavior:"contain",touchAction:"pan-y"},style:{touchAction:"pan-y"},children:(0,R.jsx)(n.A,{sx:{p:2.5},children:(0,R.jsxs)("form",{onSubmit:ce,children:[(0,R.jsxs)(n.A,{sx:{mb:2,display:"flex",flexDirection:"column",gap:1},children:[(0,R.jsx)(m.A,{label:"Current Password",type:F?"text":"password",value:a,onChange:e=>t(e.target.value),fullWidth:!0,margin:"dense",sx:le,InputProps:{endAdornment:(0,R.jsx)(v.A,{position:"end",children:(0,R.jsx)(b.A,{onClick:()=>D(e=>!e),edge:"end",sx:{color:"var(--piq-muted)"},children:F?(0,R.jsx)(S.mx3,{}):(0,R.jsx)(S.Ny1,{})})})}}),(0,R.jsx)(m.A,{label:"New Password",type:_?"text":"password",value:q,onChange:e=>z(e.target.value),fullWidth:!0,margin:"dense",sx:le,InputProps:{endAdornment:(0,R.jsx)(v.A,{position:"end",children:(0,R.jsx)(b.A,{onClick:()=>H(e=>!e),edge:"end",sx:{color:"var(--piq-muted)"},children:_?(0,R.jsx)(S.mx3,{}):(0,R.jsx)(S.Ny1,{})})})}}),q&&(0,R.jsxs)(n.A,{sx:{mt:.5,mb:1},children:[(0,R.jsx)(g.A,{variant:"determinate",value:te,sx:{height:8,borderRadius:5,background:"var(--piq-border)","& .MuiLinearProgress-bar":{backgroundColor:re}}}),(0,R.jsxs)(i.A,{sx:{color:re,fontWeight:600,mt:.5,textAlign:"right",fontSize:13},children:["Password strength: ",Q]})]}),(0,R.jsx)(m.A,{label:"Confirm New Password",type:U?"text":"password",value:
2B,onChange:e=>V(e.target.value),fullWidth:!0,margin:"dense",sx:le,InputProps:{endAdornment:(0,R.jsx)(v.A,{position:"end",children:(0,R.jsx)(b.A,{onClick:()=>K(e=>!e),edge:"end",sx:{color:"var(--piq-muted)"},children:U?(0,R.jsx)(S.mx3,{}):(0,R.jsx)(S.Ny1,{})})})}})]}),Z&&(0,R.jsx)(d.A,{severity:"error",sx:{mt:1},children:Z}),$&&(0,R.jsx)(d.A,{severity:"success",sx:{mt:1},children:$}),!Z&&!$&&X&&(0,R.jsx)(d.A,{severity:"info",sx:{mt:1},children:"Changing password, please wait..."}),(0,R.jsxs)(n.A,{sx:{display:"flex",gap:1.5,mt:2},children:[(0,R.jsx)(x.A,{onClick:()=>r(!1),variant:"outlined",fullWidth:!0,sx:{borderColor:"var(--primary-color)",color:"var(--primary-color)",fontWeight:700,textTransform:"none",backgroundColor:"var(--piq-surface-2)"},children:"Cancel"}),(0,R.jsx)(x.A,{type:"submit",variant:"contained",fullWidth:!0,disabled:X,sx:{background:"linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%)",color:"var(--piq-on-primary, white)",fontWeight:800,textTransform:"none",borderRadius:3},children:X?(0,R.jsx)(h.A,{size:20}):"Change Password"})]})]})})})]})]}):(0,R.jsxs)(f.A,{open:e,onClose:()=>r(!1),maxWidth:"sm",fullWidth:!0,PaperProps:{sx:{borderRadius:4,boxShadow:8,p:2,background:"var(--piq-surface)",width:"650px",maxWidth:"98vw",color:"var(--piq-text)",border:"1px solid var(--piq-border)"}},children:[(0,R.jsx)(y.A,{sx:{fontWeight:700,color:"var(--piq-on-primary, white)",textAlign:"center",pb:0,background:"linear-gradient(135deg, var(--secondary-color) 0%, var(--primary-color) 100%)",borderRadius:2,mb:2},children:"Change Password"}),(0,R.jsx)(A.A,{sx:{pt:1},children:(0,R.jsxs)("form",{onSubmit:ce,children:[(0,R.jsxs)(n.A,{sx:{mb:2,display:"flex",flexDirection:"column",gap:1},children:[(0,R.jsx)(m.A,{label:"Current Password",type:F?"text":"password",value:a,onChange:e=>t(e.target.value),fullWidth:!0,margin:"dense",sx:le,InputProps:{endAdornment:(0,R.jsx)(v.A,{position:"end",children:(0,R.jsx)(b.A,{onClick:()=>D(e=>!e),edge:"end",sx:{color:"var(--piq-muted)"},children:F?(0,R.jsx)(S.mx3,{}):(0,R.jsx)(S.Ny1,{})})})}}),(0,R.jsx)(m.A,{label:"New Password",type:_?"text":"password",value:q,onChange:e=>z(e.target.value),fullWidth:!0,margin:"dense",sx:le,InputProps:{endAdornment:(0,R.jsx)(v.A,{position:"end",children:(0,R.jsx)(b.A,{onClick:()=>H(e=>!e),edge:"end",sx:{color:"var(--piq-muted)"},children:_?(0,R.jsx)(S.mx3,{}):(0,R.jsx)(S.Ny1,{})})})}}),q&&(0,R.jsxs)(n.A,{sx:{mt:.5,mb:1},children:[(0,R.jsx)(g.A,{variant:"determinate",value:te,sx:{height:8,borderRadius:5,background:"var(--piq-border)","& .MuiLinearProgress-bar":{backgroundColor:re}}}),(0,R.jsxs)(i.A,{sx:{color:re,fontWeight:600,mt:.5,textAlign:"right",fontSize:13},children:["Password strength: ",Q]})]}),(0,R.jsx)(m.A,{label:"Confirm New Password",type:U?"text":"password",value:B,onChange:e=>V(e.target.value),fullWidth:!0,margin:"dense",sx:le,InputProps:{endAdornment:(0,R.jsx)(v.A,{position:"end",children:(0,R.jsx)(b.A,{onClick:()=>K(e=>!e),edge:"end",sx:{color:"var(--piq-muted)"},children:U?(0,R.jsx)(S.mx3,{}):(0,R.jsx)(S.Ny1,{})})})}})]}),Z&&(0,R.jsx)(d.A,{severity:"error",sx:{mt:1},children:Z}),$&&(0,R.jsx)(d.A,{severity:"success",sx:{mt:1},children:$}),!Z&&!$&&X&&(0,R.jsx)(d.A,{severity:"info",sx:{mt:1},children:"Changing password, please wait..."})]})}),(0,R.jsxs)(j.A,{sx:{justifyContent:"space-between",px:3,pb:2},children:[(0,R.jsx)(x.A,{onClick:()=>r(!1),variant:"outlined",sx:{minWidth:120,borderColor:"var(--primary-color)",color:"var(--primary-color)",fontWeight:600,textTransform:"none",backgroundColor:"var(--piq-surface-2)","&:hover":{borderColor:"var(--secondary-color)",color:"var(--secondary-color)",backgroundColor:"var(--tertiary-color)"}},children:"Cancel"}),(0,R.jsx)(x.A,{onClick:ce,variant:"contained",disabled:X,sx:{minWidth:140,background:"linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%)",color:"var(--piq-on-primary, white)",fontWeight:700,textTransform:"none",borderRadius:3,boxShadow:"0 4px 12px var(--piq-btn-shadow)","&:hover":{background:"linear-gradient(135deg, var(--secondary-color) 0%, var(--primary-color) 100%)",opacity:.95}},children:X?(0,R.jsx)(h.A,{size:20}):"Change Password"})]})]}),(0,R.jsxs)(i.A,{variant:"body2",sx:{color:"text.secondary",mb:1},children:["Password Strength: ",(0,R.jsx)("span",{style:{color:"var(--brand)",fontWeight:600},children:"Strong"})," "]})]}),(0,R.jsx)(n.A,{sx:{my:4},children:(0,R.jsx)(n.A,{sx:{borderBottom:"1px solid var(--piq-border)",width:"100%",mb:4}})}),(0,R.jsxs)(n.A,{sx:{mt:2},children:[(0,R.jsx)(i.A,{variant:"h6",sx:{fontWeight:600,mb:1},children:"Security Email Notifications"}),(0,R.jsx)(u.A,{control:(0,R.jsx)(p.A,{color:"primary",checked:we,onChange:async e=>{Ce(e.target.checked),await Ze("securityEmailNotifications",e.target.checked)},disabled:Ie}),label:"Email me when a new device logs in or my password is changed",sx:{"& .MuiFormControl
2Label-label":{color:"var(--piq-text)"}}})]}),(0,R.jsx)(n.A,{sx:{my:4},children:(0,R.jsx)(n.A,{sx:{borderBottom:"1px solid var(--piq-border)",width:"100%",mb:4}})}),(0,R.jsxs)(n.A,{sx:{mt:2},children:[(0,R.jsx)(i.A,{variant:"h6",sx:{fontWeight:600,mb:1},children:"Profile Sharing"}),(0,R.jsx)(i.A,{variant:"body2",sx:{color:"var(--piq-muted)",mb:2},children:"Control whether others can generate share links to your profile. PIN protection is mandatory, each link is limited to two browser/app sessions, and access is capped at 10 counted opens."}),(0,R.jsx)(u.A,{control:(0,R.jsx)(p.A,{color:"primary",checked:ke,onChange:async e=>{const r=e.target.checked;Se(r),await(async(e,r)=>{Ee(!0),Te(null),Ve(null);try{var a;const t={allowExternalShare:"allowExternalShare"===e?r:ke,requirePinForSharedLinks:!0},o=await W._.patch("/users/share-settings",t),n=null===o||void 0===o||null===(a=o.data)||void 0===a?void 0:a.shareSettings;n&&(Se(!1!==n.allowExternalShare),Pe(!0)),Te("Profile sharing updated. Existing active links keep their current expiry unless you revoke them.")}catch(s){var t,o,n,i;console.error("Error updating share settings:",s);const e=(null===(t=s.response)||void 0===t||null===(o=t.data)||void 0===o?void 0:o.error)||(null===(n=s.response)||void 0===n||null===(i=n.data)||void 0===i?void 0:i.message)||"Failed to update profile sharing settings.";Ve(e)}finally{Ee(!1)}})("allowExternalShare",r)},disabled:Oe}),label:"Allow external share links to my profile",sx:{"& .MuiFormControlLabel-label":{color:"var(--piq-text)"}}}),(0,R.jsx)(u.A,{control:(0,R.jsx)(p.A,{color:"primary",checked:qe,disabled:!0}),label:"PIN required for share links to my profile",sx:{"& .MuiFormControlLabel-label":{color:"var(--piq-text)"}}}),!ke&&(0,R.jsx)(d.A,{severity:"info",sx:{mt:1},children:"Sharing is disabled for new links. Existing active links remain accessible until they expire or you revoke them."}),Be&&(0,R.jsx)(d.A,{severity:"error",sx:{mt:2},children:Be}),(0,R.jsxs)(n.A,{sx:{mt:3},children:[(0,R.jsxs)(n.A,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:2,mb:1,flexWrap:"wrap"},children:[(0,R.jsx)(i.A,{variant:"subtitle1",sx:{fontWeight:700,color:"var(--piq-text)"},children:"Active share links"}),(0,R.jsx)(x.A,{variant:"outlined",onClick:async()=>{try{Ke(null),He(!0);const e=await(0,I.UP)();De(Array.isArray(null===e||void 0===e?void 0:e.links)?e.links:[])}catch(o){var e,r,a,t;console.error("Error listing owner share links:",o);const n=(null===(e=o.response)||void 0===e||null===(r=e.data)||void 0===r?void 0:r.error)||(null===(a=o.response)||void 0===a||null===(t=a.data)||void 0===t?void 0:t.message)||"Failed to load active share links.";Ke(n)}finally{He(!1)}},disabled:_e,sx:{borderColor:"var(--primary-color)",color:"var(--primary-color)",textTransform:"none",fontWeight:700,borderRadius:2},children:_e?(0,R.jsx)(h.A,{size:18}):"Refresh"})]}),(0,R.jsx)(i.A,{variant:"body2",sx:{color:"var(--piq-muted)",mb:2},children:"These are currently active links that point to your profile. You can revoke a link at any time."}),Ue&&(0,R.jsx)(d.A,{severity:"error",sx:{mb:2},children:Ue}),_e?(0,R.jsxs)(n.A,{sx:{display:"flex",alignItems:"center",gap:2,py:1},children:[(0,R.jsx)(h.A,{size:22}),(0,R.jsx)(i.A,{sx:{color:"var(--piq-muted)"},children:"Loading active links\u2026"})]}):null!==Fe&&void 0!==Fe&&Fe.length?(0,R.jsx)(w.A,{disablePadding:!0,children:Fe.map(e=>{const r=String((null===e||void 0===e?void 0:e.shareToken)||""),a=r?"".concat(r.slice(0,6),"\u2026").concat(r.slice(-4)):"Unknown token",t=null!==e&&void 0!==e&&e.expiresAt?new Date(e.expiresAt):null,o=null!==e&&void 0!==e&&e.firstViewedAt?new Date(e.firstViewedAt):null,s=null!==e&&void 0!==e&&e.lastViewedAt?new Date(e.lastViewedAt):null,l=Boolean(null===e||void 0===e?void 0:e.accessPinSetAt),d=Number.isFinite(Number(null===e||void 0===e?void 0:e.viewCount))?Number(e.viewCount):0,c=Number.isFinite(Number(null===e||void 0===e?void 0:e.maxViews))&&Number(e.maxViews)>0?Number(e.maxViews):10,u=Xe===r,p=[];return t&&!isNaN(t.getTime())&&p.push("Expires ".concat(t.toLocaleString())),p.push("Views ".concat(d,"/").concat(c)),o&&!isNaN(o.getTime())&&p.push("First opened ".concat(o.toLocaleStr
2ing())),s&&!isNaN(s.getTime())&&p.push("Last opened ".concat(s.toLocaleString())),l&&p.push("PIN enabled"),(0,R.jsxs)(C.Ay,{disableGutters:!0,sx:{border:"1px solid var(--piq-border)",borderRadius:2,px:2,py:1.5,mb:1.25,background:"var(--piq-surface-2)",display:"flex",alignItems:"center",justifyContent:"space-between",gap:2},children:[(0,R.jsx)(k.A,{primary:(0,R.jsxs)(i.A,{sx:{fontWeight:800,color:"var(--piq-text)"},children:["Link ",a]}),secondary:(0,R.jsx)(i.A,{sx:{color:"var(--piq-muted)",fontSize:13},children:p.join(" \u2022 ")})}),(0,R.jsxs)(n.A,{sx:{display:"flex",alignItems:"center",gap:1,flexShrink:0},children:[(0,R.jsx)(x.A,{variant:"outlined",onClick:()=>(async e=>{const r=String(e||"").trim();if(!r)return;const a="".concat(window.location.origin,"/share/").concat(r);try{await navigator.clipboard.writeText(a),Te("Share link copied.")}catch(t){Ke("Failed to copy share link.")}})(r),disabled:!r||u,sx:{borderColor:"var(--primary-color)",color:"var(--primary-color)",textTransform:"none",fontWeight:800,borderRadius:2},children:"Copy link"}),(0,R.jsx)(x.A,{variant:"contained",onClick:()=>(async e=>{const r=String(e||"").trim();if(!r)return;const a=r?"".concat(r.slice(0,6),"\u2026").concat(r.slice(-4)):"this link",t=window.prompt("Revoke share link ".concat(a,"?\n\nThis will immediately disable access for anyone who has it.\n\nType REVOKE to confirm:"));if("REVOKE"===String(t||"").trim().toUpperCase())try{Ye(r),Ke(null),await(0,I.$n)(r),Te("Share link revoked."),De(e=>Array.isArray(e)?e.filter(e=>(null===e||void 0===e?void 0:e.shareToken)!==r):[])}catch(l){var o,n,i,s;console.error("Error revoking owner share link:",l);const e=(null===(o=l.response)||void 0===o||null===(n=o.data)||void 0===n?void 0:n.error)||(null===(i=l.response)||void 0===i||null===(s=i.data)||void 0===s?void 0:s.message)||"Failed to revoke share link.";Ke(e)}finally{Ye(null)}})(r),disabled:!r||u,sx:{backgroundColor:"var(--piq-danger)",color:"#fff",textTransform:"none",fontWeight:800,borderRadius:2,"&:hover":{backgroundColor:"var(--piq-danger-hover)"},"&:disabled":{color:"rgba(255, 255, 255, 0.72)"}},children:u?(0,R.jsx)(h.A,{size:18,sx:{color:"inherit"}}):"Revoke"})]})]},r||"".concat((null===e||void 0===e?void 0:e._id)||Math.random()))})}):e?null:(0,R.jsx)(M,{sx:{mt:.75},children:"No active share links found."})]})]}),(0,R.jsx)(n.A,{sx:{my:4},children:(0,R.jsx)(n.A,{sx:{borderBottom:"1px solid var(--piq-border)",width:"100%",mb:4}})})]})]})})]})}},86938(e,r,a){a.d(r,{A:()=>z});var t=a(89379),o=a(80045),n=a(57528),i=a(88094),s=a(93494),l=a(55452),d=a(37205),c=a(1083),u=a(4861),p=a(90517),x=a(34647),h=a(30640),m=a(95669),v=a(86),b=a(15918);function g(e){return(0,b.Ay)("MuiLinearProgress",e)}(0,v.A)("MuiLinearProgress",["root","colorPrimary","colorSecondary","determinate","indeterminate","buffer","query","dashed","dashedColorPrimary","dashedColorSecondary","bar","bar1","bar2","barColorPrimary","barColorSecondary","bar1Indeterminate","bar1Determinate","bar1Buffer","bar2Indeterminate","bar2Buffer"]);var f=a(15678);const y=["className","color","value","valueBuffer","variant"];var A,j,w,C,k,S;const q=(0,c.i7)(A||(A=(0,n.A)(["\n  0% {\n    left: -35%;\n    right: 100%;\n  }\n\n  60% {\n    left: 100%;\n    right: -90%;\n  }\n\n  100% {\n    left: 100%;\n    right: -90%;\n  }\n"]))),P="string"!==typeof q?(0,c.AH)(j||(j=(0,n.A)(["\n        animation: "," 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite;\n      "])),q):null,N=(0,c.i7)(w||(w=(0,n.A)(["\n  0% {\n    left: -200%;\n    right: 100%;\n  }\n\n  60% {\n    left: 107%;\n    right: -8%;\n  }\n\n  100% {\n    left: 107%;\n    right: -8%;\n  }\n"]))),W="string"!==typeof N?(0,c.AH)(C||(C=(0,n.A)(["\n        animation: "," 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) 1.15s infinite;\n      "])),N):null,I=(0,c.i7)(k||(k=(0,n.A)(["\n  0% {\n    opacity: 1;\n    background-position: 0 -23px;\n  }\n\n  60% {\n    opacity: 0;\n    background-position: 0 -23px;\n  }\n\n  100% {\n    opacity: 1;\n    background-position: -200px -23px;\n  }\n"]))),L="string"!==typeof I?(0,c.AH)(S||(S=(0,n.A)(["\n        animation: "," 3s infinite linear;\n      "])),I):null,O=(e,r)=>e.vars?e.vars.palette.LinearProgress["".concat(r,"Bg")]:"light"===e.palette.mode?e.lighten(e.palette[r].main,.62):e.darken(e.palette[r].main,.5),E=(0,u.Ay)("span",{name:"MuiLinearProgress",slot:"Root",overridesResolver:(e,r)=>{const{ownerState:a}=e;return[r.root,r["color".concat((0,m.A)(a.color))],r[a.variant]]}})((0,p.A)(e=>{let{theme:r}=e;return{position:"relative",overflow:"hidden",display:"block",height:4,zIndex:0,"@media print":{colorAdjust:"exact"},variants:[...Object.entries(r.palette).filter((0,x.A)()).map(e=>{let[a]=e;return{props:{color:a},style:{backgroundColor:O(r,a)}}}),{props:e=>{let{ownerState:r}=e;return"inherit"===r.color&&"buffer"!==r.variant},style:{"&::before":{content:'""',position:"absolute",left:0,top:0,right:0,bottom:0,backgroundColor:"currentColor",opacity:.3}}},{props:{variant:"buffer"},style:{backgroundColor:"transparent"}},{props:{variant:"query"},style:{transform:"rotate(180deg)"}}]}})),R=(0,u.Ay)("span",{name:"MuiLinearProgress",slot:"Dashed",overridesResolver:(e,r)=>{const{ownerState:a}=e;return[r.dashed,r["dashedColor".concat((0,m.A)(a.color))]]}})((0,p.A)(e=>{let{theme:r}=e;return{position:"absolute",marginTop:0,height:"100%",width:"100%",backgroundSize:"10px 10px",backgroundPosition:"0 -23px",variants:[{props:{color:"inherit"},style:{opacity:.3,backgroundImage:"radial-gradient(currentColor 0%, currentColor 16%, transparent 42%)"}},...Object.entries(r.palette).filter((0,x.A)()).map(e=>{let[a]=e;const t=O(r,a);return{props:{color:a},style:{backgroundImage:"radial-gradient(".concat(t," 0%, ").concat(t," 16%, transparent 42%)")}}})]}}),L||{animation:"".concat(I," 3s infinite linear")}),T=(0,u.Ay)("span",{name:"MuiLinearProgress",slot:"Bar1",overridesResolver:(e,r)=>{const{ownerState:a}=e;return[r.bar,r.bar1,r["barColor".concat((0,m.A)(a.color))],("indeterminate"===a.variant||"query"===a.variant)&&r.bar1Indeterminate,"determinate"===a.variant&&r.bar1Determinate,"buffer"===a.variant&&r.bar1Buffer]}})((0,p.A)(e=>{let{theme:r}=e;return{width:"100%",position:"absolute",left:0,bottom:0,top:0,transition:"transform 0.2s linear",transformOrigin:"left",variants:[{props:{color:"inherit"},style:{backgroundColor:"currentColor"}},...Object.entries(r.palette).filter((0,x.A)()).map(e=>{let[a]=e;return{props:{color:a},style:{backgroundColor:(r.vars||r).palette[a].main}}}),{props:{variant:"determinate"},style:{transition:"transform .".concat(4,"s linear")}},{props:{variant:"buffer"},style:{zIndex:1,transition:"transform .".concat(4,"s linear")}},{props:e=>{let{ownerState:r}=e;return"indeterminate"===r.variant||"query"===r.variant},style:{width:"auto"}},{props:e=>{let{ownerState:r}=e;return"indeterminate"===r.variant||"query"===r.variant},style:P||{animation:"".concat(q," 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite")}}]}})),M=(0,u.Ay)("span",{name:"MuiLinearProgress",slot:"Bar2",overridesResolver:(e,r)=>{const{ownerState:a}=e;return[r.bar,r.bar2,r["barColor".concat((0,m.A)(a.color))],("indeterminate"===a.variant||"query"===a.variant)&&r.bar2Indeterminate,"buffer"===a.variant&&r.bar2Buffer]}})((0,p.A)(e=>{let{theme:r}=e;return{width:"100%",position:"absolute",left:0,bottom:0,top:0,transition:"transform 0.2s linear",transformOrigin:"left",variants:[...Object.entries(r.palette).filter((0,x.A)()).map(e=>{let[a]=e;return{props:{color:a},style:{"--LinearProgressBar2-barColor":(r.vars||r).palette[a].main}}}),{props:e=>{let{ownerState:r}=e;return"buffer"!==r.variant&&"inherit"!==r.color},style:{backgroundColor:"var(--LinearProgressBar2-barColor, currentColor)"}},{props:e=>{let{ownerState:r}=e;return"buffer"!==r.variant&&"inherit"===r.color},style:{backgroundColor:"currentColor"}},{props:{color:"inherit"},style:{opacity:.3}},...Object.entries(r.palette).filter((0,x.A)()).map(e=>{let[a]=e;return{props:{color:a,variant:"buffer"},style:{backgroundColor:O(r,a),transition:"transform .".concat(4,"s linear")}}}),{props:e=>{let{ownerState:r}=e;return"indeterminate"===r.variant||"query"===r.variant},style:{width:"auto"}},{props:e=>{let{ownerState:r}=e;return"indeterminate"===r.variant||"query"===r.variant},style:W||{animation:"".concat(N," 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) 1.15s infinite")}}]}})),z=i.forwardRef(function(e,r){const a=(0,h.b)({props:e,name:"MuiLinearProgress"}),{className:n,color:i="primary",value:c,valueBuffer:u,variant:p="indeterminate"}=a,x=(0,o.A)(a,y),v=(0,t.A)((0,t.A)({},a),{},{color:i,variant:p}),b=(e=>
2{const{classes:r,variant:a,color:t}=e,o={root:["root","color".concat((0,m.A)(t)),a],dashed:["dashed","dashedColor".concat((0,m.A)(t))],bar1:["bar","bar1","barColor".concat((0,m.A)(t)),("indeterminate"===a||"query"===a)&&"bar1Indeterminate","determinate"===a&&"bar1Determinate","buffer"===a&&"bar1Buffer"],bar2:["bar","bar2","buffer"!==a&&"barColor".concat((0,m.A)(t)),"buffer"===a&&"color".concat((0,m.A)(t)),("indeterminate"===a||"query"===a)&&"bar2Indeterminate","buffer"===a&&"bar2Buffer"]};return(0,l.A)(o,g,r)})(v),A=(0,d.I)(),j={},w={bar1:{},bar2:{}};if("determinate"===p||"buffer"===p)if(void 0!==c){j["aria-valuenow"]=Math.round(c),j["aria-valuemin"]=0,j["aria-valuemax"]=100;let e=c-100;A&&(e=-e),w.bar1.transform="translateX(".concat(e,"%)")}else 0;if("buffer"===p)if(void 0!==u){let e=(u||0)-100;A&&(e=-e),w.bar2.transform="translateX(".concat(e,"%)")}else 0;return(0,f.jsxs)(E,(0,t.A)((0,t.A)((0,t.A)({className:(0,s.A)(b.root,n),ownerState:v,role:"progressbar"},j),{},{ref:r},x),{},{children:["buffer"===p?(0,f.jsx)(R,{className:b.dashed,ownerState:v}):null,(0,f.jsx)(T,{className:b.bar1,ownerState:v,style:w.bar1}),"determinate"===p?null:(0,f.jsx)(M,{className:b.bar2,ownerState:v,style:w.bar2})]}))})}}]);

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.