import AppInfo from '../../../src/pages/schema-design/AppInfo.js';
import SchemaDesignerScreen from '../../../src/pages/schema-design/SchemaDesigner.screen.js';
import { WebHttpClientStoreBindings } from '../../../src/bindings/web/WebHttpClientStoreBindings.js';
import { WebStoreBindings } from '../../../src/bindings/web/WebStoreBindings.js';
import { WebConfigurationBindings } from '../../../src/bindings/web/WebConfigurationBindings.js';

const workerUri = new URL('/src/http-client/store/IdbThread.ts', import.meta.url).toString();
const configUri = new URL('/demo/lib/io/AppConfig.ts', import.meta.url).toString();

(async (): Promise<void> => {
  const config = new WebConfigurationBindings(AppInfo, configUri);
  const idb = new WebHttpClientStoreBindings(AppInfo, workerUri);
  const store = new WebStoreBindings(AppInfo, `http://localhost:8550/v1`);
  const page = new SchemaDesignerScreen({
    store,
    idb,
    config,
  });
  await page.initialize();
})();
