(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6377],{3152:(e,s,a)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/[user_id]/databases/[single]/users/[user]/change-password",function(){return a(1064)}])},7220:(e,s,a)=>{"use strict";a.d(s,{A:()=>t});let t=(0,a(5737).A)("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]])},7290:(e,s,a)=>{"use strict";a.d(s,{A:()=>t});let t=(0,a(5737).A)("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]])},4266:(e,s,a)=>{"use strict";a.d(s,{A:()=>t});let t=(0,a(5737).A)("FileInput",[["path",{d:"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4",key:"1pf5j1"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M2 15h10",key:"jfw4w8"}],["path",{d:"m9 18 3-3-3-3",key:"112psh"}]])},3419:(e,s,a)=>{"use strict";a.d(s,{A:()=>t});let t=(0,a(5737).A)("FolderOutput",[["path",{d:"M2 7.5V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-1.5",key:"1yk7aj"}],["path",{d:"M2 13h10",key:"pgb2dq"}],["path",{d:"m5 10-3 3 3 3",key:"1r8ie0"}]])},6051:(e,s,a)=>{"use strict";a.d(s,{A:()=>t});let t=(0,a(5737).A)("SquareTerminal",[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]])},1064:(e,s,a)=>{"use strict";a.r(s),a.d(s,{__N_SSP:()=>h,default:()=>p});var t=a(4848),d=a(6540),r=a(4725),n=a(1990),l=a(3647),i=a(5844),o=a(9020),c=a(1710);function u(e){let{singleUser:s,database:a,user:r}=e,[n,u]=d.useState(!1);return(0,t.jsxs)(d.Fragment,{children:[n&&(0,t.jsx)(c.A,{width:"20px"}),(0,t.jsxs)("div",{className:"flex-col items-start gap-0 w-full",children:[(0,t.jsx)("div",{className:"w-full justify-between flex-wrap",children:(0,t.jsxs)("div",{children:[(0,t.jsx)(i.A,{}),(0,t.jsxs)("h1",{className:"text-3xl m-0",children:["Change Password For"," ",(0,t.jsxs)("u",{children:[s.first_name," ",s.last_name]})]})]})}),(0,t.jsx)(l.A,{user:r})]}),(0,t.jsx)("section",{className:"paper",children:(0,t.jsx)("div",{className:"w-full flex-col items-stretch",children:(0,t.jsxs)("form",{className:"flex flex-col items-stretch gap-4",onSubmit:e=>{var t;e.preventDefault(),u(!0);let d=document.getElementById("password"),n=document.getElementById("password-repeat"),l=new RegExp("".concat(d.value));if(!(null==n?void 0:null===(t=n.value)||void 0===t?void 0:t.match(l))){window.alert("Passwords dont Match!");return}if(!window.confirm("change this User's password?")){u(!1);return}(0,o.A)("/api/changeDbUserPassword",{method:"POST",body:{userId:s.id,password:d.value,dbId:a.id}},!0).then(e=>{e.success&&(window.location.pathname="/admin/".concat(null==r?void 0:r.id,"/databases/").concat(a.db_slug,"/users/").concat(s.id))}).catch(e=>{console.log(e.message)}).finally(()=>{setTimeout(()=>{u(!1)},2e3)})},children:[(0,t.jsx)("input",{id:"password",name:"password",type:"password",placeholder:"New Password",required:!0}),(0,t.jsx)("input",{id:"password-repeat",name:"password-repeat",type:"password",placeholder:"Repeat New Password",onInput:e=>{var s;let a=document.getElementById("password"),t=document.getElementById("password-repeat"),d=(null==a?void 0:a.value)?new RegExp("".concat(a.value)):null;d&&((null==t?void 0:null===(s=t.value)||void 0===s?void 0:s.match(d))?t.classList.remove("warning"):t.classList.add("warning"))},required:!0}),(0,t.jsx)("button",{children:"Change Password"})]})})})]})}var h=!0;function p(e){let{user:s,database:a,table:d,dbSchemaData:l,singleUser:i,query:o,confirmedDelegetedUser:c}=e,h="".concat(i.first_name," ").concat(i.last_name,' Users | Datasquirel"'),p=(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("title",{children:h}),(0,t.jsx)("meta",{name:"description",content:"Welcome to your data app"})]});return(0,t.jsx)(r.A,{head:p,extraHeaderContent:(0,t.jsx)(n.A,{database:a,query:o,confirmedDelegetedUser:c,user:s}),children:(0,t.jsx)(u,{singleUser:i,database:a,user:s})})}}},e=>{var s=s=>e(e.s=s);e.O(0,[1335,3348,4725,675,636,6593,8792],()=>s(3152)),_N_E=e.O()}]);