import { h, resolveComponent } from 'vue';
import { d as defineNuxtComponent } from './auth-2d06b6ac.mjs';
import { I as IdentityProviderProtocol } from './server.mjs';
import './nuxt-link-5ac46069.mjs';
import 'ufo';
import 'hookable';
import 'unctx';
import 'h3';
import './composables-31566dd1.mjs';
import '@ucast/mongo2js';
import 'change-case';
import '@ebec/http';
import 'hapic';
import '@hapic/oauth2';
import 'ofetch';
import 'destr';
import '@unhead/vue';
import '@unhead/dom';
import '@unhead/ssr';
import './page-011b4897.mjs';
import 'vue-router';
import 'defu';
import 'rapiq';
import '@vue-layout/basic';
import '@vuelidate/validators';
import 'ilingo';
import 'nanoid';
import '@vue-layout/hyperscript';
import 'smob';
import 'browser-storage-adapter';
import 'cookie-es';
import 'ohash';
import 'vue/server-renderer';
import './_plugin-vue_export-helper-cc2b3d55.mjs';
import './config.mjs';
import 'scule';

const index = defineNuxtComponent({
  props: {
    entity: {
      type: Object,
      required: true
    }
  },
  emits: ["updated", "failed"],
  setup(props, { emit }) {
    if (!props.entity) {
      return () => h("div", []);
    }
    const handleUpdated = (e) => {
      emit("updated", e);
    };
    const handleFailed = (e) => {
      emit("failed", e);
    };
    const renderForm = () => {
      switch (props.entity.protocol) {
        case IdentityProviderProtocol.OAUTH2: {
          const form = resolveComponent("OAuth2ProviderForm");
          return h(form, {
            entity: props.entity,
            onUpdated: handleUpdated,
            onFailed: handleFailed
          });
        }
      }
      return [];
    };
    return () => h("div", { class: "row" }, [
      renderForm()
    ]);
  }
});

export { index as default };
//# sourceMappingURL=index-5e532e90.mjs.map
