import{j as t,ak as d,Q as p,at as x,W as u}from"./vendor-mui-core-CnXrAOs3.js";import{r as o}from"./vendor-react-Dvs43sk9.js";import{p as g}from"./vendor-ux-IiQnod3w.js";import{a as h}from"./page-header-DCvzRay5.js";import{ac as j}from"./index-sNHCLgAE.js";import{A as b}from"./config-Ceq_JEL5.js";import{S as k}from"./step-actions-thgNsMmu.js";import{S}from"./layout-Ccrs-yyw.js";import"./vendor-utils-cJEl_UEd.js";import"./vendor-hooks-CjESGRlR.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-CuFtPveO.js";import"./isURL-D_2bLHU_.js";import"./section-C75bzkkL.js";import"./required-BGaDOGrj.js";import"./form-wrapper-C8oo_Fdy.js";import"./form-text-input-Ce6g965V.js";import"./edit.svg-DycWG9v3.js";import"./wait-connect-DiO80nu-.js";import"./get-safe-url-DpalOXcM.js";import"./index-BPy8_fa2.js";import"./index-DBs9Ljax.js";import"./use-mobile-DCNBsOlH.js";import"./content-layout-oyz1EqNZ.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};
