import{b as t,j as e,v as l,d5 as x}from"./vendor-BKmmeuxg.js";import{I as p}from"./input-error-LaPr_4wd.js";import{L as n}from"./loading-button-BnTVAMJ7.js";import{C as h}from"./card-D9_SJYq6.js";import"./utils-DxSsnXxD.js";import"./button-BpNwv2aE.js";import"./index-WW_1X1qx.js";const k=()=>{const{post:c,errors:s,processing:r}=t({}),i=t({}),d=()=>{i.post(route("system.refresh"))},o=a=>{a.preventDefault(),c(route("system.backup"))};return e.jsx(e.Fragment,{children:e.jsxs(h,{className:"p-4 sm:p-6",children:[e.jsxs("div",{className:"mb-4",children:[e.jsxs("h2",{className:"flex items-center gap-2 text-xl font-semibold",children:[e.jsx(l,{className:"h-5 w-5"}),"Application Backup"]}),e.jsx("p",{className:"text-muted-foreground mt-1 text-sm",children:"Create a complete backup of your application including files and database"})]}),e.jsx("form",{onSubmit:o,children:e.jsxs("div",{className:"space-y-6",children:[e.jsx("div",{className:"dark:bg-secondary dark:border-border rounded-lg border border-blue-200 bg-blue-50 p-4",children:e.jsxs("div",{className:"flex items-start",children:[e.jsx("div",{className:"flex-shrink-0",children:e.jsx(l,{className:"h-5 w-5 text-blue-600"})}),e.jsxs("div",{className:"ml-3",children:[e.jsx("h3",{className:"text-sm font-medium text-blue-800",children:"What will be backed up?"}),e.jsx("div",{className:"mt-2 text-sm text-blue-700",children:e.jsxs("ul",{className:"list-inside list-disc space-y-1",children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Source Code:"})," All application files and code"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Database:"})," Complete MySQL database dump"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Configuration:"})," Environment and config files"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Assets:"})," Uploaded media and public files"]})]})}),e.jsx("div",{className:"mt-3 text-xs text-blue-600",children:e.jsxs("p",{children:[e.jsx("strong",{children:"Note:"})," Every time refresh server before backup."]})})]})]})}),s&&Object.keys(s).length>0&&e.jsx("div",{className:"space-y-1",children:Object.entries(s).map(([a,m])=>e.jsx(p,{message:String(m)},a))}),e.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row",children:[e.jsx(n,{type:"button",variant:"secondary",onClick:d,loading:i.processing,disabled:r,children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(x,{className:"h-4 w-4"}),e.jsx("span",{children:"Refresh Server"})]})}),e.jsx(n,{type:"submit",loading:r,children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(l,{className:"h-4 w-4"}),e.jsx("span",{children:r?"Creating Backup...":"Create Backup"})]})})]})]})})]})})};export{k as default};
