import { defineComponent, resolveComponent, h } from 'vue';
import { f as useAuthStore, s as storeToRefs, P as PermissionName, A as AuthEntityDelete, D as DomainType } from './server.mjs';
import { i as isRealmResourceWritable } from './utils-252b142e.mjs';
import { SlotName } from '@vue-layout/hyperscript';
import { _ as __nuxt_component_0 } from './nuxt-link-d23e8ff6.mjs';
import 'ofetch';
import 'hookable';
import 'unctx';
import 'destr';
import '@unhead/ssr';
import 'unhead';
import '@unhead/shared';
import 'vue-router';
import 'h3';
import 'ufo';
import '@ebec/http';
import 'hapic';
import '@hapic/oauth2';
import 'rapiq';
import '@vue-layout/basic';
import 'change-case';
import '@ucast/mongo2js';
import 'ilingo';
import '@vuelidate/validators';
import '@vuelidate/core';
import 'nanoid';
import 'smob';
import 'browser-storage-adapter';
import 'cookie-es';
import 'ohash';
import 'vue/server-renderer';
import 'defu';
import './node-server.mjs';
import 'node-fetch-native/polyfill';
import 'node:http';
import 'node:https';
import 'unenv/runtime/fetch/index';
import 'scule';
import 'unstorage';
import 'radix3';
import 'node:fs';
import 'node:url';
import 'pathe';

const index = /* @__PURE__ */ defineComponent({
  emits: ["deleted"],
  setup(props, { emit }) {
    const list = resolveComponent("IdentityProviderList");
    const handleDeleted = (e) => {
      emit("deleted", e);
    };
    const store = useAuthStore();
    const { realmManagement, realmManagementId } = storeToRefs(store);
    return () => h(list, {
      onDeleted: handleDeleted,
      query: {
        filter: {
          realm_id: [realmManagementId.value, null]
        }
      }
    }, {
      [SlotName.HEADER]: () => h("h6", [
        h("i", { class: "fa-solid fa-list pe-1" }),
        "Overview"
      ]),
      [SlotName.ITEM_ACTIONS]: (props2) => h("div", [
        h(
          __nuxt_component_0,
          {
            class: "btn btn-xs btn-outline-primary me-1",
            to: `/admin/identity-providers/${props2.data.id}`,
            disabled: !store.has(PermissionName.PROVIDER_EDIT) || !isRealmResourceWritable(realmManagement.value, props2.data.realm_id)
          },
          {
            default: () => h("i", { class: "fa fa-bars" })
          }
        ),
        h(AuthEntityDelete, {
          class: "btn btn-xs btn-outline-danger",
          entityId: props2.data.id,
          entityType: DomainType.IDENTITY_PROVIDER,
          withText: false,
          onDeleted: props2.deleted,
          disabled: !store.has(PermissionName.PROVIDER_DROP) || !isRealmResourceWritable(realmManagement.value, props2.data.realm_id)
        })
      ])
    });
  }
});

export { index as default };
//# sourceMappingURL=index-6ef86f2d.mjs.map
