import * as __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__ from "react/jsx-runtime";
import "react";
import * as __WEBPACK_EXTERNAL_MODULE__tachybase_client__ from "@tachybase/client";
const myInitializer = new __WEBPACK_EXTERNAL_MODULE__tachybase_client__.SchemaInitializer({
    name: 'myInitializer',
    designable: true,
    title: 'Button Text',
    items: [
        {
            name: 'a',
            type: 'itemGroup',
            title: 'Group a',
            children: [
                {
                    name: 'a1',
                    type: 'item',
                    title: 'A 1',
                    onClick: ()=>{
                        alert('a-1');
                    }
                },
                {
                    name: 'a2',
                    type: 'item',
                    title: 'A 2'
                }
            ]
        },
        {
            name: 'divider',
            type: 'divider'
        },
        {
            name: 'b',
            type: 'subMenu',
            title: 'Group B',
            children: [
                {
                    name: 'b1',
                    type: 'item',
                    title: 'B 1',
                    onClick: ()=>{
                        alert('b-1');
                    }
                },
                {
                    name: 'b2',
                    type: 'item',
                    title: 'B 2'
                }
            ]
        }
    ]
});
const Root = ()=>{
    const { render } = (0, __WEBPACK_EXTERNAL_MODULE__tachybase_client__.useSchemaInitializerRender)('myInitializer');
    return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)("div", {
        children: render()
    });
};
class MyPlugin extends __WEBPACK_EXTERNAL_MODULE__tachybase_client__.Plugin {
    async load() {
        this.app.schemaInitializerManager.add(myInitializer);
        this.app.router.add('root', {
            path: '/',
            Component: Root
        });
    }
}
const app = new __WEBPACK_EXTERNAL_MODULE__tachybase_client__.Application({
    router: {
        type: 'memory',
        initialEntries: [
            '/'
        ]
    },
    plugins: [
        MyPlugin,
        __WEBPACK_EXTERNAL_MODULE__tachybase_client__.SchemaComponentPlugin
    ]
});
const build_type_rslib_entry_ = app.getRootComponent();
export { build_type_rslib_entry_ as default };
