"use strict";(()=>{var e={};e.id=6827,e.ids=[3220,6827],e.modules={30671:(e,t)=>{Object.defineProperty(t,"M",{enumerable:!0,get:function(){return function e(t,r){return r in t?t[r]:"then"in t&&"function"==typeof t.then?t.then(t=>e(t,r)):"function"==typeof t&&"default"===r?t:void 0}}})},90678:(e,t,r)=>{r.r(t),r.d(t,{config:()=>w,default:()=>v,getServerSideProps:()=>b,getStaticPaths:()=>A,getStaticProps:()=>E,reportWebVitals:()=>N,routeModule:()=>C,unstable_getServerProps:()=>q,unstable_getServerSideProps:()=>I,unstable_getStaticParams:()=>O,unstable_getStaticPaths:()=>D,unstable_getStaticProps:()=>k});var s={};r.r(s),r.d(s,{SendPassResetContext:()=>S,default:()=>y,getServerSideProps:()=>P});var a=r(63865),n=r(9455),o=r(30671),i=r(5583),c=r(19796),l=r(8732),u=r(82015),d=r.n(u),p=r(1013),m=r(91258),h=r(16757),f=r(92702),g=r(46169),x=r(90048);let _=(0,r(82544).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"}]]);function j({message:e}){return(0,l.jsxs)("div",{className:"info gray",children:[(0,l.jsx)(_,{}),(0,l.jsx)("span",{className:"font-normal",children:e})]})}let S=d().createContext({});function y(e){let t="Cloudbased SQL data management system | Datasquirel",r="Datasquirel is a fast and efficient cloud-based SQL data management system that takes away the entire hassle of dealing with data both locally and across different platforms.",s=(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("title",{children:t}),(0,l.jsx)("meta",{name:"description",content:r}),(0,l.jsx)(m.A,{pageTitle:t,pageDescription:r,pagePathname:"/"})]}),[a,n]=d().useState(!1),[o,i]=d().useState(!1);return(0,l.jsx)(p.A,{head:s,user:e.user,children:(0,l.jsx)(S.Provider,{value:{user:e.user},children:(0,l.jsx)("main",{children:(0,l.jsxs)("section",{children:[a&&(0,l.jsx)(h.A,{}),o?(0,l.jsx)(x.A,{message:"Email Sent. Please check your email address and follow the link provided",className:"whitespace-nowrap"}):(0,l.jsx)("div",{className:"paper",children:(0,l.jsxs)("div",{className:"max-w-xl flex-col items-stretch",children:[(0,l.jsx)("h1",{className:"m-0 text-4xl",children:"Send Password Reset Link"}),(0,l.jsx)("span",{children:"Please enter your email address to receive a password reset link"}),(0,l.jsxs)("form",{className:"w-full flex flex-col items-stretch gap-4",onSubmit:e=>{n(!0),e.preventDefault();let t=e.target["email-address"].value;(0,g.A)(`/api/sendPasswordResetLink?email=${t}`).then(e=>{console.log(e),setTimeout(()=>{n(!1)},500),e.success&&i(!0)})},children:[(0,l.jsx)("input",{type:"text",autoComplete:"email",name:"email-address",id:"email-address",className:"w-full",placeholder:"Email Address",defaultValue:e?.user?.logged_in_status?e.user.email:"",required:!0}),(0,l.jsx)("button",{children:"Send password reset Email"}),(0,l.jsx)(j,{message:"Please note that this link will expire after 1 hour"})]})]})})]})})})})}async function P({req:e,res:t}){let r=await (0,f.A)(e,t);return r?.social_login?{redirect:{destination:"/",permanent:!1}}:{props:{user:r}}}let v=(0,o.M)(s,"default"),E=(0,o.M)(s,"getStaticProps"),A=(0,o.M)(s,"getStaticPaths"),b=(0,o.M)(s,"getServerSideProps"),w=(0,o.M)(s,"config"),N=(0,o.M)(s,"reportWebVitals"),k=(0,o.M)(s,"unstable_getStaticProps"),D=(0,o.M)(s,"unstable_getStaticPaths"),O=(0,o.M)(s,"unstable_getStaticParams"),q=(0,o.M)(s,"unstable_getServerProps"),I=(0,o.M)(s,"unstable_getServerSideProps"),C=new a.PagesRouteModule({definition:{kind:n.A.PAGES,page:"/send-password-reset-link",pathname:"/send-password-reset-link",bundlePath:"",filename:""},components:{App:c.default,Document:i.default},userland:s})},90048:(e,t,r)=>{r.d(t,{A:()=>a});var s=r(8732);function a({message:e,className:t}){return(0,s.jsxs)("div",{className:"info green"+(t?" "+t:""),children:[(0,s.jsx)("img",{src:"/images/checkmark.svg",alt:"Warning Image Icon",width:22,className:"-my-2"}),(0,s.jsx)("span",{children:e})]})}r(82015)},91258:(e,t,r)=>{r.d(t,{A:()=>o});var s=r(8732),a=r(82015),n=r.n(a);function o({pageTitle:e,pageDescription:t,pagePathname:r,aceEditor:a}){return(0,s.jsxs)(n().Fragment,{children:[(0,s.jsx)("link",{rel:"canonical",href:"http://localhost:7070"+r}),(0,s.jsx)("meta",{property:"og:url",content:"http://localhost:7070"+r}),(0,s.jsx)("meta",{itemProp:"url",content:"http://localhost:7070"+r}),(0,s.jsx)("meta",{name:"twitter:url",content:"http://localhost:7070"+r}),(0,s.jsx)("meta",{property:"og:title",content:e}),(0,s.jsx)("meta",{property:"og:description",content:t}),(0,s.jsx)("meta",{itemProp:"name",content:e}),(0,s.jsx)("meta",{itemProp:"description",content:t}),(0,s.jsx)("meta",{name:"twitter:title",content:e}),(0,s.jsx)("meta",{name:"twitter:description",content:t}),a&&(0,s.jsxs)(n().Fragment,{children:[(0,s.jsx)("script",{src:"https://cdnjs.cloudflare.com/ajax/libs/ace/1.22.0/ace.min.js",integrity:"sha512-q6CTB0jS+VuJnSct82rVcWlI06LGzNjaG3CWenHWVUncRvc4UQMFkA3a5Ip880xr+lBx38FcHDclOxPdSg+sBw==",crossOrigin:"anonymous",referrerPolicy:"no-referrer"}),(0,s.jsx)("script",{src:"https://cdnjs.cloudflare.com/ajax/libs/ace/1.22.0/ext-language_tools.min.js",integrity:"sha512-6g6cvocV7eT/J8L44lL8gJKqq9onqQeYGgJO0DmrsYFcCfRl6wYkYA/KHS768r4QVTB4JxsCcMQ9gIezxpTCZw==",crossOrigin:"anonymous",referrerPolicy:"no-referrer"})]})]})}},92702:(e,t,r)=>{r.d(t,{A:()=>c});var s=r(71934),a=r(71205),n=r(29021),o=r.n(n),i=r(41939);async function c(e,t,r){try{let{keyCookieName:n,csrfCookieName:c}=(0,i.A)();if(!e.cookies?.[n]?.match(/./))throw Error("Request Cookies not Found!");let l=(0,a.A)({encryptedString:e.cookies[n]});if(!l)throw Error("Couldn't decrypt auth cookie!");let u=JSON.parse(l);if(!u.csrf_k)throw Error("No `csrf_k` present in user Object!");if(r&&!Object.keys(e.headers).find(e=>e.includes(u.csrf_k)))throw console.log("req.headers",e.headers),console.log("userObject",u),Error("Deep Auth Failed. `csrf` key not found in request headers!");let d=process.env.DSQL_USER_LOGIN_KEYS_PATH;if(!d)throw Error("DSQL_USER_LOGIN_KEYS_PATH env variable not found. Please set this variable.");if(r&&!o().existsSync(`${d}/${u.csrf_k}`))throw Error("Key not found in Auth Keys Folder!");if(0==u.verification_status&&!r){let e=await (0,s.A)(`SELECT verification_status FROM users WHERE id='${u.id}'`);e&&e[0]&&1==e[0].verification_status&&t.setHeader("Set-Cookie",["user_refresh=1"])}if(u?.date&&Date.now()-u.date>6048e5)throw Error("Key expired!");return u}catch(e){return console.log(`userAuth Error: ${e.message}`),null}}},41939:(e,t,r)=>{r.d(t,{A:()=>s});function s(e){let t=process.env.DSQL_COOKIES_PREFIX||"dsql_",r=process.env.DSQL_COOKIES_KEY_NAME||"key",s=process.env.DSQL_COOKIES_CSRF_NAME||"csrf",a=process.env.DSQL_COOKIES_ONE_TIME_CODE_NAME||"one-time-code",n=e?.database?.replace(/^datasquirel_user_\d+_/,"")||process.env.DSQL_DB_NAME?.replace(/^datasquirel_user_\d+_/,""),o=t;e?.userId&&(o+=`user_${e.userId}_`),n&&(o+=`${n}_`),o+=r;let i=t;e?.userId&&(i+=`user_${e.userId}_`),n&&(i+=`${n}_`),i+=s;let c=t;return e?.userId&&(c+=`user_${e.userId}_`),n&&(c+=`${n}_`),{keyCookieName:o,csrfCookieName:i,oneTimeCodeName:c+=a}}},71205:(e,t,r)=>{r.d(t,{A:()=>n});var s=r(55511),a=r(79428);function n({encryptedString:e,encryptionKey:t,encryptionSalt:r}){if(!e?.match(/./))return console.log("Encrypted string is invalid"),e;let n=t||process.env.DSQL_ENCRYPTION_PASSWORD,o=r||process.env.DSQL_ENCRYPTION_SALT,i=process.env.DSQL_ENCRYPTION_KEY_LENGTH?Number(process.env.DSQL_ENCRYPTION_KEY_LENGTH):24;if(!n?.match(/.{8,}/))return console.log("Decrption key is invalid"),e;if(!o?.match(/.{8,}/))return console.log("Decrption salt is invalid"),e;let c=(0,s.scryptSync)(n,o,i),l=a.Buffer.alloc(16,0),u=(0,s.createDecipheriv)("aes-192-cbc",c,l);try{let t=u.update(e,"hex","utf8");return t+=u.final("utf8")}catch(t){return console.log("Error in decrypting =>",t.message),e}}},71934:(e,t,r)=>{r.d(t,{A:()=>s});async function s(...e){let t=global.DSQL_DB_CONN;try{if(!t)throw Error("No Connection provided to DB_HANDLER function!");let r=await t.query(...e);return JSON.parse(JSON.stringify(r))}catch(e){return console.log("DB Error =>",e),{success:!1,error:e.message}}finally{await t?.end()}}},5583:(e,t,r)=>{r.r(t),r.d(t,{default:()=>n});var s=r(8732);r(82015);var a=r(20883);function n(){return(0,s.jsxs)(a.Html,{lang:"en",children:[(0,s.jsxs)(a.Head,{children:[(0,s.jsx)("meta",{name:"author",content:"Datasquirel"}),(0,s.jsx)("meta",{name:"Copyright",content:`Copyright (c) ${new Date().getFullYear()} Datasquirel`}),"dev_dev".match(/dev/)&&(0,s.jsx)("meta",{name:"robots",content:"noindex,nofollow"}),(0,s.jsx)("link",{rel:"preconnect",href:"https://fonts.googleapis.com/",crossOrigin:"anonymous"}),(0,s.jsx)("link",{rel:"preconnect",href:"https://fonts.gstatic.com",crossOrigin:"anonymous"}),(0,s.jsx)("link",{rel:"stylesheet",href:"https://fonts.googleapis.com/css?family=Poppins"}),(0,s.jsx)("link",{rel:"stylesheet",href:"https://fonts.googleapis.com/css?family=Inter"}),(0,s.jsx)("link",{rel:"stylesheet",href:"https://fonts.googleapis.com/css?family=IBM+Plex+Mono"}),(0,s.jsx)("script",{src:"/scripts/themeSelector.js"}),(0,s.jsx)("meta",{httpEquiv:"Content-Type",content:"text/html; charset=UTF-8"}),(0,s.jsx)("meta",{property:"og:site_name",content:"DATASQUIREL"}),(0,s.jsx)("meta",{property:"og:type",content:"website"}),(0,s.jsx)("meta",{name:"twitter:card",content:"summary"}),(0,s.jsx)("meta",{property:"og:image",content:"https://static.datasquirel.com/images/user-images/user-2/email-banner.jpeg"}),(0,s.jsx)("meta",{itemProp:"image",content:"https://static.datasquirel.com/images/user-images/user-2/email-banner.jpeg"}),(0,s.jsx)("meta",{name:"twitter:image",content:"https://static.datasquirel.com/images/user-images/user-2/email-banner.jpeg"}),(0,s.jsx)("link",{rel:"stylesheet",href:"/styles/prism.css"}),(0,s.jsx)("script",{src:"/scripts/prism.js",async:!0}),(0,s.jsx)("script",{dangerouslySetInnerHTML:{__html:"var DSQL = {}"}})]}),(0,s.jsxs)("body",{children:[(0,s.jsx)(a.Main,{}),(0,s.jsx)(a.NextScript,{})]})]})}},9455:(e,t)=>{Object.defineProperty(t,"A",{enumerable:!0,get:function(){return r}});var r=function(e){return e.PAGES="PAGES",e.PAGES_API="PAGES_API",e.APP_PAGE="APP_PAGE",e.APP_ROUTE="APP_ROUTE",e.IMAGE="IMAGE",e}({})},13893:e=>{e.exports=require("@moduletrace/datasquirel/dist/client/fetch")},40361:e=>{e.exports=require("next/dist/compiled/next-server/pages.runtime.prod.js")},27912:e=>{e.exports=require("next/head")},82015:e=>{e.exports=require("react")},22326:e=>{e.exports=require("react-dom")},8732:e=>{e.exports=require("react/jsx-runtime")},79428:e=>{e.exports=require("buffer")},55511:e=>{e.exports=require("crypto")},29021:e=>{e.exports=require("fs")},33873:e=>{e.exports=require("path")}};var t=require("../webpack-runtime.js");t.C(e);var r=e=>t(t.s=e),s=t.X(0,[883,9821,9796],()=>r(90678));module.exports=s})();