import{j as t,ak as d,Q as p,at as x,W as u}from"./vendor-mui-core-DnR6WYuU.js";import{r as o}from"./vendor-react-CTtPmzVP.js";import{b2 as g}from"./vendor-ux-DMZIE6wA.js";import{a as h}from"./page-header-CHAwrgX-.js";import{Y as b}from"./index-DwyzCfdd.js";import{A as j}from"./config-BkqISfFO.js";import{S as k}from"./step-actions-AHe2MQxo.js";import{S}from"./layout-tkk_Lr2y.js";import"./vendor-utils-D5UG1a5Y.js";import"./vendor-hooks-BZ19vVZ7.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-DkdOhPyM.js";import"./isURL-ZFgr0DWl.js";import"./section-jXB9AxBb.js";import"./required-BQln5OcV.js";import"./form-wrapper-PT5ZzMQy.js";import"./form-text-input-B_h8beXh.js";import"./edit.svg-RRSklUg-.js";import"./wait-connect-D2wPrbE3.js";import"./get-safe-url-gaxZoVzJ.js";import"./index-_tncRnTu.js";import"./index-DBs9Ljax.js";import"./use-mobile-D5clNlrm.js";import"./content-layout-DmSBGGVm.js";function y({onNext:s=()=>{},onPrevious:l=()=>{}}){const{t:r}=o.useContext(g),{blocklet:e}=b(),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(j,{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};
