import * as __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__ from "react/jsx-runtime";
import "react";
import * as __WEBPACK_EXTERNAL_MODULE__tachybase_client__ from "@tachybase/client";
import * as __WEBPACK_EXTERNAL_MODULE__tachybase_schema__ from "@tachybase/schema";
import * as __WEBPACK_EXTERNAL_MODULE__testUtils_index_mjs__ from "../../../../testUtils/index.mjs";
const { apiClient, mockRequest } = (0, __WEBPACK_EXTERNAL_MODULE__testUtils_index_mjs__.mockAPIClient)();
mockRequest.onGet('/auth:check').reply(()=>[
        200,
        {
            data: {}
        }
    ]);
const schema = {
    type: 'void',
    name: 'grid1',
    'x-decorator': 'Form',
    'x-component': 'Grid',
    'x-uid': (0, __WEBPACK_EXTERNAL_MODULE__tachybase_schema__.uid)(),
    properties: {
        row1: {
            type: 'void',
            'x-component': 'Grid.Row',
            'x-uid': (0, __WEBPACK_EXTERNAL_MODULE__tachybase_schema__.uid)(),
            properties: {
                col11: {
                    type: 'void',
                    'x-component': 'Grid.Col',
                    properties: {
                        name: {
                            type: 'string',
                            title: 'Name',
                            'x-decorator': 'FormItem',
                            'x-component': 'Input',
                            'x-collection-field': 'posts.name'
                        },
                        title: {
                            type: 'string',
                            title: 'Title',
                            'x-decorator': 'FormItem',
                            'x-component': 'Input',
                            'x-collection-field': 'posts.title'
                        }
                    }
                },
                col12: {
                    type: 'void',
                    'x-component': 'Grid.Col',
                    properties: {
                        intro: {
                            type: 'string',
                            title: 'Intro',
                            'x-decorator': 'FormItem',
                            'x-component': 'Input'
                        }
                    }
                }
            }
        }
    }
};
const Root = ()=>/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__tachybase_client__.APIClientProvider, {
        apiClient: apiClient,
        children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__tachybase_client__.CurrentUserProvider, {
            children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__tachybase_client__.SchemaComponentProvider, {
                components: {
                    Form: __WEBPACK_EXTERNAL_MODULE__tachybase_client__.Form,
                    Grid: __WEBPACK_EXTERNAL_MODULE__tachybase_client__.Grid,
                    Input: __WEBPACK_EXTERNAL_MODULE__tachybase_client__.Input,
                    FormItem: __WEBPACK_EXTERNAL_MODULE__tachybase_client__.FormItem
                },
                children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__tachybase_client__.SchemaComponent, {
                    schema: schema
                })
            })
        })
    });
class MyPlugin extends __WEBPACK_EXTERNAL_MODULE__tachybase_client__.Plugin {
    async load() {
        this.app.router.add('root', {
            path: '/',
            Component: Root
        });
    }
}
const app = new __WEBPACK_EXTERNAL_MODULE__tachybase_client__.Application({
    router: {
        type: 'memory',
        initialEntries: [
            '/'
        ]
    },
    plugins: [
        MyPlugin
    ]
});
const demo2_rslib_entry_ = app.getRootComponent();
export { demo2_rslib_entry_ as default };
