import{j as t,ak as d,Q as p,at as x,W as u}from"./vendor-mui-core-BPQ6AEW_.js";import{r as o}from"./vendor-react-CUXIiAnY.js";import{p as g}from"./vendor-ux-r9bApERu.js";import{a as h}from"./page-header-BkgoSN-0.js";import{ac as j}from"./index-DY2wgD65.js";import{A as b}from"./config-NQEwUL-b.js";import{S as k}from"./step-actions-D5Cu9stE.js";import{S}from"./layout-PANci1G8.js";import"./vendor-utils-BgSaqjGx.js";import"./vendor-hooks-PN9SWiQm.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-D8WYBDYe.js";import"./isURL-C1rexYxN.js";import"./section-Cyr0YvGa.js";import"./required-Btg6mEmX.js";import"./form-wrapper-CU8kJXy5.js";import"./form-text-input-Sp9mVO8Z.js";import"./edit.svg-Dz9cVo7r.js";import"./wait-connect-DEq0_d-q.js";import"./get-safe-url-DqysS0i0.js";import"./index-BsA1v5Kx.js";import"./index-DBs9Ljax.js";import"./use-mobile-C5RjvO7g.js";import"./content-layout-B-2tfq3i.js";function y({onNext:s=()=>{},onPrevious:l=()=>{}}){const{t:r}=o.useContext(g),{blocklet:e}=j(),i=o.useMemo(()=>e?.meta?.requirements,[e]),n=o.useRef(null),[a,m]=o.useState(!1),f=async()=>{try{m(!0),(await n.current.onSubmit()||!i?.aigne)&&s()}catch(c){console.error("error",c)}finally{m(!1)}};return t.jsxs(C,{children:[t.jsx("div",{className:"header",children:t.jsx(h,{title:r("setting.aigne.config"),onClickBack:l})}),t.jsx(d,{className:"form-container",children:t.jsx(b,{orientation:"vertical",hideSubmitButton:!0,hideDivider:!0,ref:n,source:"setup",forceValidate:i?.aigne})}),t.jsxs(k,{blocklet:e,children:[!i?.aigne&&t.jsx(p,{className:"bottom-button-skip",sx:{mr:1},onClick:()=>s(),children:r("setup.skip")}),t.jsx(p,{className:"start-now bottom-button",loading:a,variant:"contained",disabled:a,onClick:f,children:r("setup.continue")})]})]})}y.propTypes={onNext:u.func,onPrevious:u.func};const C=x(S)`
  height: 100%;
  overflow-y: auto;

  .form-container {
    width: 100%;
    margin: 0 auto;
    padding: 0 16px;
  }
`;export{y as default};
