"use strict";exports.id=3932,exports.ids=[3932],exports.modules={30671:(e,s)=>{Object.defineProperty(s,"M",{enumerable:!0,get:function(){return function e(s,t){return t in s?s[t]:"then"in s&&"function"==typeof s.then?s.then(s=>e(s,t)):"function"==typeof s&&"default"===t?s:void 0}}})},93615:(e,s,t)=>{let{IncomingMessage:a}=t(81630),l=t(77463),r=t(6505);e.exports=async function(e){let{keyCookieName:s,csrfCookieName:t}=r(),a=`${s}_su`;if(!e.cookies?.[a])return console.log("No auth key cookie found"),null;let n=l({encryptedString:e.cookies[a]});if(!n)return console.log("No user payload found"),null;let i=JSON.parse(n);return i.password!==process.env.DSQL_USER_KEY?(console.log("Invalid password"),null):i.authKey!==process.env.DSQL_SPECIAL_KEY?(console.log("Invalid auth key"),null):i}},49888:(e,s,t)=>{t.d(s,{A:()=>b});var a=t(8732),l=t(82015),r=t.n(l),n=t(27912),i=t.n(n),c=t(93353),o=t(82544);let d=(0,o.A)("Home",[["path",{d:"m3 9 9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"y5dka4"}],["polyline",{points:"9 22 9 12 15 12 15 22",key:"e2us08"}]]);var h=t(25294);let x=(0,o.A)("FileWarning",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);var p=t(2459);let u=(0,o.A)("CloudUpload",[["path",{d:"M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242",key:"1pljnt"}],["path",{d:"M12 12v9",key:"192myk"}],["path",{d:"m16 16-4-4-4 4",key:"119tzi"}]]),m=(0,o.A)("DatabaseBackup",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 12a9 3 0 0 0 5 2.69",key:"1ui2ym"}],["path",{d:"M21 9.3V5",key:"6k6cib"}],["path",{d:"M3 5v14a9 3 0 0 0 6.47 2.88",key:"i62tjy"}],["path",{d:"M12 12v4h4",key:"1bxaet"}],["path",{d:"M13 20a5 5 0 0 0 9-3 4.5 4.5 0 0 0-4.5-4.5c-1.33 0-2.54.54-3.41 1.41L12 16",key:"1f4ei9"}]]),g=(0,o.A)("SquareChevronRight",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"m10 8 4 4-4 4",key:"1wy4r4"}]]),j=(0,o.A)("LockKeyhole",[["circle",{cx:"12",cy:"16",r:"1",key:"1au0dj"}],["rect",{x:"3",y:"10",width:"18",height:"12",rx:"2",key:"6s8ecr"}],["path",{d:"M7 10V7a5 5 0 0 1 10 0v3",key:"1pqi11"}]]);function f(e){let[s,t]=r().useState(!0);return(0,a.jsxs)("aside",{className:"aside"+(s?" mobile-collapsed":" mobile-expanded"),style:{maxWidth:s?"250px":"300px",zIndex:800},children:[(0,a.jsx)(c.A,{adminAside:!0,collapseAsideMobile:s,setCollapseAsideMobile:t}),(0,a.jsx)("hr",{className:"opacity-0 mt-4"}),(0,a.jsxs)("div",{className:"main-links"+(s?" hidden lg:flex":" "),children:[(0,a.jsxs)("a",{href:"/su","data-currentlink":"/su","data-strictlink":"true",children:[(0,a.jsx)(d,{size:20}),(0,a.jsx)("span",{children:"Dashboard"})]}),(0,a.jsxs)("a",{href:"/su/users","data-currentlink":"/su/users",children:[(0,a.jsx)(h.A,{size:20}),(0,a.jsx)("span",{children:"Users"})]}),(0,a.jsxs)("a",{href:"/su/error-logs","data-currentlink":"/su/error-logs",children:[(0,a.jsx)(x,{size:20}),(0,a.jsx)("span",{children:"Error Logs"})]}),(0,a.jsxs)("a",{href:"/su/servers","data-currentlink":"/su/servers",children:[(0,a.jsx)(p.A,{size:20}),(0,a.jsx)("span",{children:"Servers"})]}),(0,a.jsxs)("a",{href:"/su/load-balancing","data-currentlink":"/su/load-balancing",children:[(0,a.jsx)(u,{size:20}),(0,a.jsx)("span",{children:"Load Balancing"})]}),!1,(0,a.jsxs)("a",{href:"/su/backups","data-currentlink":"/su/backups",children:[(0,a.jsx)(m,{size:20}),(0,a.jsx)("span",{children:"Backups"})]}),(0,a.jsxs)("a",{href:"/su/console","data-currentlink":"/su/console",children:[(0,a.jsx)(g,{size:20}),(0,a.jsx)("span",{children:"Console"})]}),(0,a.jsxs)("a",{href:"/su/envar","data-currentlink":"/su/envar",children:[(0,a.jsx)(j,{size:20}),(0,a.jsx)("span",{children:"Env"})]})]})]})}var y=t(34254),v=t(58526);function k({user:e,extraHeaderContent:s}){let[t,l]=r().useState(e||null);return(0,a.jsx)("section",{className:"overflow-visible w-full px-0 md:px-8 py-0 flex justify-center bg-white dark:bg-slate-800 shadow-lg gap-4 dark:shadow-black/10 z-50 shadow-slate-900/5",style:{zIndex:700,border:"none"},children:(0,a.jsxs)("div",{className:"w-full items-center justify-between gap-4 md:gap-8",children:[(0,a.jsxs)("div",{className:"hidden xl:flex flex-col items-stretch grow fixed xl:static top-0 right-0 px-4 xl:px-0 shadow-xl xl:shadow-none h-screen xl:h-auto overflow-auto xl:overflow-visible w-screen sl:w-auto bg-white xl:bg-transparent pb-10 xl:pb-0",id:"main-nav-content-wrapper",children:[(0,a.jsxs)("div",{className:"items-center mb-2 flex xl:hidden",children:[(0,a.jsx)("a",{href:"/",className:"hidden xl:flex",children:(0,a.jsx)("img",{src:"/images/logo-icon-alt-2.png",alt:"Logo Icon",width:37})}),(0,a.jsx)("button",{className:"outlined gray ml-auto",onClick:e=>{let s=document.getElementById("main-nav-content-wrapper");s?.classList.toggle("hidden")},style:{border:"none"},children:(0,a.jsx)("span",{className:"font-semibold text-4xl",children:"✕"})})]}),(0,a.jsx)("div",{className:"flex items-center w-full gap-6 grow flex-col xl:flex-row justify-start xl:justify-between",children:(0,a.jsx)("div",{className:"gap-2 flex-col-reverse xl:flex-row gap-y-6 w-full xl:w-auto py-2",children:(0,a.jsxs)("div",{className:"ml-auto dropdown-wrapper",children:[(0,a.jsx)("div",{className:"bg-white rounded-full overflow-hidden",style:{width:"36px",height:"36px"},children:(0,a.jsx)("img",{src:"/images/user-preset-thumbnail.png",alt:"User Image",width:35,className:"w-full h-full object-cover"})}),(0,a.jsx)("span",{children:(0,a.jsx)("b",{children:"Super User"})}),(0,a.jsx)(v.A,{size:20}),(0,a.jsx)("div",{className:"dropdown",children:(0,a.jsx)("a",{href:"/su/logout",children:"Logout"})})]})})})]}),(0,a.jsx)("div",{className:"ml-2",children:(0,a.jsx)(y.A,{})}),(0,a.jsxs)("button",{className:"bg-transparent w-16 p-4 gap-1.5 flex xl:hidden flex-col hover:bg-transparent transition-all ml-auto",onClick:e=>{let s=document.getElementById("main-nav-content-wrapper");s?.classList.toggle("hidden")},style:{minWidth:"50px",backgroundColor:"transparent"},id:"main-header-hamburger-button","aria-label":"Mobile Hambutget Button",children:[(0,a.jsx)("div",{className:"w-full h-1 bg-slate-600 dark:bg-slate-400 rounded-full"}),(0,a.jsx)("div",{className:"w-full h-1 bg-slate-600 dark:bg-slate-400 rounded-full"}),(0,a.jsx)("div",{className:"w-full h-1 bg-slate-600 dark:bg-slate-400 rounded-full"})]})]})})}function b({children:e,head:s,user:t}){return(0,a.jsxs)(r().Fragment,{children:[(0,a.jsxs)(i(),{children:[(0,a.jsx)("link",{rel:"stylesheet",href:"/styles/admin.css"}),s]}),(0,a.jsxs)("div",{className:"admin w-full flex items-start gap-0",children:[(0,a.jsx)(f,{}),(0,a.jsxs)("main",{className:"relative",children:[(0,a.jsx)(k,{user:t}),(0,a.jsx)("div",{className:"flex-col items-start gap-6 px-4 sl:px-8 py-8 bg-slate-50 dark:bg-slate-900",children:e}),(0,a.jsx)("footer",{className:"flex justify-center w-full items-center p-4",children:(0,a.jsxs)("div",{className:"max-w-6xl w-full justify-center flex-wrap",children:[(0,a.jsxs)("a",{href:"/",className:"flex items-center gap-2",children:[(0,a.jsx)("img",{src:"/images/logo-icon-alt-2.png",alt:"Datasquirel Logo",width:30}),(0,a.jsx)("span",{className:"text-lg font-bold",children:"Datasquirel"})]}),(0,a.jsx)("span",{className:"opacity-25",children:"|"}),(0,a.jsxs)("span",{className:"text-sm text-slate-400 dark:text-slate-600 text-center",children:[new Date().getFullYear()," \xa9 Datasquirel. All rights reserved."]}),(0,a.jsx)("span",{className:"opacity-25",children:"|"}),(0,a.jsx)("a",{href:"/docs",children:"Docs"}),(0,a.jsx)("span",{className:"opacity-25",children:"|"}),(0,a.jsx)("a",{href:"/terms",children:"Terms"})]})})]})]})]})}t(54896)},2459:(e,s,t)=>{t.d(s,{A:()=>a});let a=(0,t(82544).A)("Server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]])},25294:(e,s,t)=>{t.d(s,{A:()=>a});let a=(0,t(82544).A)("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]])},6505:e=>{e.exports=function(e){let s=process.env.DSQL_COOKIES_PREFIX||"dsql_",t=process.env.DSQL_COOKIES_KEY_NAME||"key",a=process.env.DSQL_COOKIES_CSRF_NAME||"csrf",l=e?.database||process.env.DSQL_DB_NAME?.replace(/^datasquirel_user_\d+_/,""),r=s;e?.userId&&(r+=`user_${e.userId}_`),l&&(r+=`${l}_`),r+=t;let n=s;return e?.userId&&(n+=`user_${e.userId}_`),l&&(n+=`${l}_`),{keyCookieName:r,csrfCookieName:n+=a}}},77463:(e,s,t)=>{let{scryptSync:a,createDecipheriv:l}=t(55511),{Buffer:r}=t(79428);e.exports=({encryptedString:e,encryptionKey:s,encryptionSalt:t})=>{if(!e?.match(/./))return console.log("Encrypted string is invalid"),e;let n=s||process.env.DSQL_ENCRYPTION_PASSWORD,i=t||process.env.DSQL_ENCRYPTION_SALT,c=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(!i?.match(/.{8,}/))return console.log("Decrption salt is invalid"),e;let o=l("aes-192-cbc",a(n,i,c),r.alloc(16,0));try{let s=o.update(e,"hex","utf8");return s+=o.final("utf8")}catch(s){return console.log("Error in decrypting =>",s.message),e}}},49407:(e,s,t)=>{t.r(s),t.d(s,{default:()=>r});var a=t(8732);t(82015);var l=t(20883);function r(e){return(0,a.jsxs)(l.Html,{lang:"en",children:[(0,a.jsxs)(l.Head,{children:[(0,a.jsx)("meta",{name:"author",content:"Datasquirel"}),(0,a.jsx)("meta",{name:"Copyright",content:`Copyright (c) ${new Date().getFullYear()} Datasquirel`}),"dev_dev".match(/dev/)&&(0,a.jsx)("meta",{name:"robots",content:"noindex,nofollow"}),(0,a.jsx)("link",{rel:"preconnect",href:"https://fonts.googleapis.com/",crossOrigin:"anonymous"}),(0,a.jsx)("link",{rel:"preconnect",href:"https://fonts.gstatic.com",crossOrigin:"anonymous"}),(0,a.jsx)("link",{rel:"stylesheet",href:"https://fonts.googleapis.com/css?family=Poppins"}),(0,a.jsx)("link",{rel:"stylesheet",href:"https://fonts.googleapis.com/css?family=Inter"}),(0,a.jsx)("link",{rel:"stylesheet",href:"https://fonts.googleapis.com/css?family=IBM+Plex+Mono"}),(0,a.jsx)("script",{src:"/scripts/themeSelector.js"}),(0,a.jsx)("meta",{httpEquiv:"Content-Type",content:"text/html; charset=UTF-8"}),(0,a.jsx)("meta",{property:"og:site_name",content:"DATASQUIREL"}),(0,a.jsx)("meta",{property:"og:type",content:"website"}),(0,a.jsx)("meta",{name:"twitter:card",content:"summary"}),(0,a.jsx)("meta",{property:"og:image",content:"https://static.datasquirel.com/images/user-images/user-2/email-banner.jpeg"}),(0,a.jsx)("meta",{itemProp:"image",content:"https://static.datasquirel.com/images/user-images/user-2/email-banner.jpeg"}),(0,a.jsx)("meta",{name:"twitter:image",content:"https://static.datasquirel.com/images/user-images/user-2/email-banner.jpeg"}),(0,a.jsx)("link",{rel:"stylesheet",href:"/styles/prism.css"}),(0,a.jsx)("script",{src:"/scripts/prism.js",async:!0}),(0,a.jsx)("script",{dangerouslySetInnerHTML:{__html:"var DSQL = {}"}})]}),(0,a.jsxs)("body",{children:[(0,a.jsx)(l.Main,{}),(0,a.jsx)(l.NextScript,{})]})]})}},9455:(e,s)=>{var t;Object.defineProperty(s,"A",{enumerable:!0,get:function(){return t}}),function(e){e.PAGES="PAGES",e.PAGES_API="PAGES_API",e.APP_PAGE="APP_PAGE",e.APP_ROUTE="APP_ROUTE",e.IMAGE="IMAGE"}(t||(t={}))}};