import ApiClient from '../../../src/pages/api-client/ApiClient.screen.js';
import { WebHttpClientStoreBindings } from '../../../src/bindings/web/WebHttpClientStoreBindings.js';
import AppInfo from '../../../src/pages/api-client/AppInfo.js';
import { WebStoreBindings } from '../../../src/bindings/web/WebStoreBindings.js';
import { WebConfigurationBindings } from '../../../src/bindings/web/WebConfigurationBindings.js';
import { WebNavigationBindings } from '../../../src/bindings/web/WebNavigationBindings.js';
import { WebFileBindings } from '../../../src/bindings/web/WebFileBindings.js';

const idbUri = 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 idb = new WebHttpClientStoreBindings(AppInfo, idbUri);
  const store = new WebStoreBindings(AppInfo, `http://localhost:8550/v1`);
  const config = new WebConfigurationBindings(AppInfo, configUri);
  const navigation = new WebNavigationBindings(AppInfo);
  const files = new WebFileBindings(AppInfo);

  const page = new ApiClient({
    idb,
    store,
    config,
    navigation,
    files,
  });
  await page.initialize();
})();
