"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,s){return s in t?t[s]:"then"in t&&"function"==typeof t.then?t.then(t=>e(t,s)):"function"==typeof t&&"default"===s?t:void 0}}})},90678:(e,t,s)=>{s.r(t),s.d(t,{config:()=>N,default:()=>v,getServerSideProps:()=>b,getStaticPaths:()=>A,getStaticProps:()=>E,reportWebVitals:()=>w,routeModule:()=>q,unstable_getServerProps:()=>I,unstable_getServerSideProps:()=>M,unstable_getStaticParams:()=>O,unstable_getStaticPaths:()=>k,unstable_getStaticProps:()=>D});var r={};s.r(r),s.d(r,{SendPassResetContext:()=>S,default:()=>y,getServerSideProps:()=>P});var n=s(63865),a=s(9455),i=s(30671),o=s(5583),l=s(19796),c=s(8732),u=s(82015),d=s.n(u),m=s(1013),p=s(91258),f=s(16757),h=s(92702),g=s(46169),x=s(90048);let _=(0,s(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,c.jsxs)("div",{className:"info gray",children:[(0,c.jsx)(_,{}),(0,c.jsx)("span",{className:"font-normal",children:e})]})}let S=d().createContext({});function y(e){let t="Cloudbased SQL data management system | Datasquirel",s="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.",r=(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("title",{children:t}),(0,c.jsx)("meta",{name:"description",content:s}),(0,c.jsx)(p.A,{pageTitle:t,pageDescription:s,pagePathname:"/"})]}),[n,a]=d().useState(!1),[i,o]=d().useState(!1);return(0,c.jsx)(m.A,{head:r,user:e.user,children:(0,c.jsx)(S.Provider,{value:{user:e.user},children:(0,c.jsx)("main",{children:(0,c.jsxs)("section",{children:[n&&(0,c.jsx)(f.A,{}),i?(0,c.jsx)(x.A,{message:"Email Sent. Please check your email address and follow the link provided",className:"whitespace-nowrap"}):(0,c.jsx)("div",{className:"paper",children:(0,c.jsxs)("div",{className:"max-w-xl flex-col items-stretch",children:[(0,c.jsx)("h1",{className:"m-0 text-4xl",children:"Send Password Reset Link"}),(0,c.jsx)("span",{children:"Please enter your email address to receive a password reset link"}),(0,c.jsxs)("form",{className:"w-full flex flex-col items-stretch gap-4",onSubmit:e=>{a(!0),e.preventDefault();let t=e.target["email-address"].value;(0,g.A)(`/api/sendPasswordResetLink?email=${t}`).then(e=>{console.log(e),setTimeout(()=>{a(!1)},500),e.success&&o(!0)})},children:[(0,c.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,c.jsx)("button",{children:"Send password reset Email"}),(0,c.jsx)(j,{message:"Please note that this link will expire after 1 hour"})]})]})})]})})})})}async function P({req:e,res:t}){let s=await (0,h.A)(e,t);return s?.social_login?{redirect:{destination:"/",permanent:!1}}:{props:{user:s}}}let v=(0,i.M)(r,"default"),E=(0,i.M)(r,"getStaticProps"),A=(0,i.M)(r,"getStaticPaths"),b=(0,i.M)(r,"getServerSideProps"),N=(0,i.M)(r,"config"),w=(0,i.M)(r,"reportWebVitals"),D=(0,i.M)(r,"unstable_getStaticProps"),k=(0,i.M)(r,"unstable_getStaticPaths"),O=(0,i.M)(r,"unstable_getStaticParams"),I=(0,i.M)(r,"unstable_getServerProps"),M=(0,i.M)(r,"unstable_getServerSideProps"),q=new n.PagesRouteModule({definition:{kind:a.A.PAGES,page:"/send-password-reset-link",pathname:"/send-password-reset-link",bundlePath:"",filename:""},components:{App:l.default,Document:o.default},userland:r})},90048:(e,t,s)=>{s.d(t,{A:()=>n});var r=s(8732);function n({message:e,className:t}){return(0,r.jsxs)("div",{className:"info green"+(t?" "+t:""),children:[(0,r.jsx)("img",{src:"/images/checkmark.svg",alt:"Warning Image Icon",width:22,className:"-my-2"}),(0,r.jsx)("span",{children:e})]})}s(82015)},91258:(e,t,s)=>{s.d(t,{A:()=>i});var r=s(8732),n=s(82015),a=s.n(n);function i({pageTitle:e,pageDescription:t,pagePathname:s,aceEditor:n}){return(0,r.jsxs)(a().Fragment,{children:[(0,r.jsx)("link",{rel:"canonical",href:"http://localhost:7070"+s}),(0,r.jsx)("meta",{property:"og:url",content:"http://localhost:7070"+s}),(0,r.jsx)("meta",{itemProp:"url",content:"http://localhost:7070"+s}),(0,r.jsx)("meta",{name:"twitter:url",content:"http://localhost:7070"+s}),(0,r.jsx)("meta",{property:"og:title",content:e}),(0,r.jsx)("meta",{property:"og:description",content:t}),(0,r.jsx)("meta",{itemProp:"name",content:e}),(0,r.jsx)("meta",{itemProp:"description",content:t}),(0,r.jsx)("meta",{name:"twitter:title",content:e}),(0,r.jsx)("meta",{name:"twitter:description",content:t}),n&&(0,r.jsxs)(a().Fragment,{children:[(0,r.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,r.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,s)=>{s.d(t,{A:()=>l});var r=s(71934),n=s(71205),a=s(29021),i=s.n(a),o=s(41939);async function l(e,t,s){let{keyCookieName:a,csrfCookieName:l}=(0,o.A)();if(!e.cookies?.[a]?.match(/./))return null;let c=(0,n.A)({encryptedString:e.cookies[a]});if(!c)return null;let u=JSON.parse(c);if(!u.csrf_k||s&&!Object.keys(e.headers).find(e=>e.includes(u.csrf_k)))return null;let d=process.env.DSQL_USER_LOGIN_KEYS_PATH;if(!d)return console.log("DSQL_USER_LOGIN_KEYS_PATH env variable not found. Please set this variable."),null;if(s&&!i().existsSync(`${d}/${u.csrf_k}`))return null;if(0==u.verification_status&&!s){let e=await (0,r.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"])}return u?.date&&Date.now()-u.date>6048e5?null:u}},41939:(e,t,s)=>{s.d(t,{A:()=>r});function r(e){let t=process.env.DSQL_COOKIES_PREFIX||"dsql_",s=process.env.DSQL_COOKIES_KEY_NAME||"key",r=process.env.DSQL_COOKIES_CSRF_NAME||"csrf",n=process.env.DSQL_COOKIES_ONE_TIME_CODE_NAME||"one-time-code",a=e?.database?.replace(/^datasquirel_user_\d+_/,"")||process.env.DSQL_DB_NAME?.replace(/^datasquirel_user_\d+_/,""),i=t;e?.userId&&(i+=`user_${e.userId}_`),a&&(i+=`${a}_`),i+=s;let o=t;e?.userId&&(o+=`user_${e.userId}_`),a&&(o+=`${a}_`),o+=r;let l=t;return e?.userId&&(l+=`user_${e.userId}_`),a&&(l+=`${a}_`),{keyCookieName:i,csrfCookieName:o,oneTimeCodeName:l+=n}}},71205:(e,t,s)=>{s.d(t,{A:()=>a});var r=s(55511),n=s(79428);function a({encryptedString:e,encryptionKey:t,encryptionSalt:s}){if(!e?.match(/./))return console.log("Encrypted string is invalid"),e;let a=t||process.env.DSQL_ENCRYPTION_PASSWORD,i=s||process.env.DSQL_ENCRYPTION_SALT,o=process.env.DSQL_ENCRYPTION_KEY_LENGTH?Number(process.env.DSQL_ENCRYPTION_KEY_LENGTH):24;if(!a?.match(/.{8,}/))return console.log("Decrption key is invalid"),e;if(!i?.match(/.{8,}/))return console.log("Decrption salt is invalid"),e;let l=(0,r.scryptSync)(a,i,o),c=n.Buffer.alloc(16,0),u=(0,r.createDecipheriv)("aes-192-cbc",l,c);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,s)=>{s.d(t,{A:()=>r});async function r(...e){let t=global.DSQL_DB_CONN;try{if(!t)throw Error("No Connection provided to DB_HANDLER function!");let s=await t.query(...e);return JSON.parse(JSON.stringify(s))}catch(e){return console.log("DB Error =>",e),{success:!1,error:e.message}}finally{await t?.end()}}},5583:(e,t,s)=>{s.r(t),s.d(t,{default:()=>a});var r=s(8732);s(82015);var n=s(20883);function a(){return(0,r.jsxs)(n.Html,{lang:"en",children:[(0,r.jsxs)(n.Head,{children:[(0,r.jsx)("meta",{name:"author",content:"Datasquirel"}),(0,r.jsx)("meta",{name:"Copyright",content:`Copyright (c) ${new Date().getFullYear()} Datasquirel`}),"dev_dev".match(/dev/)&&(0,r.jsx)("meta",{name:"robots",content:"noindex,nofollow"}),(0,r.jsx)("link",{rel:"preconnect",href:"https://fonts.googleapis.com/",crossOrigin:"anonymous"}),(0,r.jsx)("link",{rel:"preconnect",href:"https://fonts.gstatic.com",crossOrigin:"anonymous"}),(0,r.jsx)("link",{rel:"stylesheet",href:"https://fonts.googleapis.com/css?family=Poppins"}),(0,r.jsx)("link",{rel:"stylesheet",href:"https://fonts.googleapis.com/css?family=Inter"}),(0,r.jsx)("link",{rel:"stylesheet",href:"https://fonts.googleapis.com/css?family=IBM+Plex+Mono"}),(0,r.jsx)("script",{src:"/scripts/themeSelector.js"}),(0,r.jsx)("meta",{httpEquiv:"Content-Type",content:"text/html; charset=UTF-8"}),(0,r.jsx)("meta",{property:"og:site_name",content:"DATASQUIREL"}),(0,r.jsx)("meta",{property:"og:type",content:"website"}),(0,r.jsx)("meta",{name:"twitter:card",content:"summary"}),(0,r.jsx)("meta",{property:"og:image",content:"https://static.datasquirel.com/images/user-images/user-2/email-banner.jpeg"}),(0,r.jsx)("meta",{itemProp:"image",content:"https://static.datasquirel.com/images/user-images/user-2/email-banner.jpeg"}),(0,r.jsx)("meta",{name:"twitter:image",content:"https://static.datasquirel.com/images/user-images/user-2/email-banner.jpeg"}),(0,r.jsx)("link",{rel:"stylesheet",href:"/styles/prism.css"}),(0,r.jsx)("script",{src:"/scripts/prism.js",async:!0}),(0,r.jsx)("script",{dangerouslySetInnerHTML:{__html:"var DSQL = {}"}})]}),(0,r.jsxs)("body",{children:[(0,r.jsx)(n.Main,{}),(0,r.jsx)(n.NextScript,{})]})]})}},9455:(e,t)=>{Object.defineProperty(t,"A",{enumerable:!0,get:function(){return s}});var s=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 s=e=>t(t.s=e),r=t.X(0,[883,9821,9796],()=>s(90678));module.exports=r})();