"use client";
import { B as Y } from "./chunks/badge-dfc1r37osagi3rs4.js";
import { B as E } from "./chunks/banner-j52y8l13puk7dybi.js";
import { a as Q } from "./chunks/banner-j52y8l13puk7dybi.js";
import { B as n } from "./chunks/button-ebfdg9mkhojue36n.js";
import { L as aa, R as ea, b as oa } from "./chunks/button-ebfdg9mkhojue36n.js";
import { D as sa } from "./chunks/date-range-picker-oks2r14lbbukd545.js";
import { C as ia } from "./chunks/checkbox-k355pnfisqt0h4eg.js";
import { C as na } from "./chunks/clipboard-text-isb05zkg2aox0tp6.js";
import { C as ma, a as pa } from "./chunks/code-pbkfdfat0yilg6dx.js";
import { C as Ta } from "./chunks/combobox-hc9wi9nwsyyli8ur.js";
import { a as ca, K as ba, T as Sa } from "./chunks/toolbar-lmylyrod70sn0q4i.js";
import { a as M, D as U, c as N, e as S } from "./chunks/dialog-ovhmzfuppr5xix0e.js";
import { d as ua, b as xa } from "./chunks/dialog-ovhmzfuppr5xix0e.js";
import { D as Ia } from "./chunks/dropdown-iey8f344rd5dgahz.js";
import { C as Oa } from "./chunks/collapsible-f9hgtc1u6xvqrgt8.js";
import { F as Ea, a as Ma, K as Ua, f as Na } from "./chunks/field-bmglk138wa8bf3ei.js";
import { b as ga, K as ha, L as Va, a as Da, l as Ba } from "./chunks/label-i1xbmg8y1n0tbtkx.js";
import { I as K } from "./chunks/input-ckl5misj0jd9cu5r.js";
import { i as Pa } from "./chunks/input-ckl5misj0jd9cu5r.js";
import { I as Fa, T as ya } from "./chunks/input-area-sg518xu4pyg4m0km.js";
import { I as za } from "./chunks/input-group-bflx1m6ki55e99vf.js";
import { L as ja } from "./chunks/layer-card-m6h85dpadvee39h2.js";
import { L as qa } from "./chunks/loader-g8a6j76ue5nq0lr8.js";
import { S as Wa } from "./chunks/skeleton-line-omxgxia23vpav94x.js";
import { M as Ya, u as Ja } from "./chunks/menubar-opzxfzylaatfz4nv.js";
import { M as Za } from "./chunks/meter-6br6z5ekw41trxeh.js";
import { P as ee } from "./chunks/pagination-j33ntwqmm9qskfgv.js";
import { S as re } from "./chunks/select-p8adn2tnpom25hpl.js";
import { S as te } from "./chunks/surface-gc2gblserrxcb1eg.js";
import { S as le } from "./chunks/switch-ljsq915e0l1a5mjd.js";
import { T as de } from "./chunks/tabs-kemdy19kfesj2xjr.js";
import { T as pe } from "./chunks/table-ojjjeqszmt9jgnug.js";
import { T as Te } from "./chunks/text-oqp48b9m5u6t62b4.js";
import { a as ce, T as be, c as Se, u as _e } from "./chunks/toast-ldj9zi940w83ub90.js";
import { T as xe, a as Ce } from "./chunks/tooltip-mooldq78tg77ekvv.js";
import { g as Le, K as Oe, P as Re } from "./chunks/popover-cqdmpp8i4hg8gzzx.js";
import { a as Me, K as Ue, S as Ne } from "./chunks/sensitive-input-it1hsswlccq3u7g6.js";
import { b as ge, K as he, R as Ve, a as De, r as Be } from "./chunks/radio-ejey7i6r4tq314av.js";
import { C as Pe, a as ke, K as Fe } from "./chunks/command-palette-c03zze4ayuytwxjg.js";
import { a as we, K as ze, L as Ge, l as je } from "./chunks/link-j93fl5m8zrcfivsr.js";
import { B as qe } from "./chunks/breadcrumbs-js59m7m57bdsveew.js";
import { E as We } from "./chunks/empty-k83r53jh5utqvv7w.js";
import { G as Ye, a as Je, c as Qe, K as Ze, b as ao, g as eo } from "./chunks/grid-jze04557ljywg3uc.js";
import { C as ro, a as so, K as to, P as io, g as lo } from "./chunks/cloudflare-logo-fiuocxdxqrxawjfv.js";
import { D as mo } from "./chunks/date-picker-bffp889exjixmgz3.js";
import { Flow as fo } from "./components/flow.js";
import { B as Ao, C as co, a as bo, c as So, b as _o, S as uo, T as xo } from "./chunks/Maps-imwfwgb7do9lr3i5.js";
import { A as Io, b as Lo, K as Oo, a as Ro } from "./chunks/autocomplete-a4gvspveibfuod24.js";
import { z as Mo, A as Uo, K as No, S as Ko, t as go, v as ho, u as Vo, d as Do, e as Bo, f as vo, g as Po, c as ko, h as Fo, k as yo, j as wo, s as zo, i as Go, l as jo, n as $o, m as qo, a as Ho, q as Wo, r as Xo, b as Yo, o as Jo, x as Qo, w as Zo, p as ar, y as er } from "./chunks/sidebar-7whsl7qwrw5b6ip8.js";
import { a as rr, K as sr, T as tr } from "./chunks/table-of-contents-cghjqyk43nj5zmlw.js";
import { s as lr } from "./chunks/cn-bo7ya7641lkickbt.js";
import { L as dr, u as mr } from "./chunks/link-provider-mn2voeohon7cj9o4.js";
import { K as fr } from "./chunks/portal-provider-hwmkdmkpvct0cb76.js";
import { jsx as a, jsxs as e } from "react/jsx-runtime";
import { useState as _, useEffect as g, useCallback as d } from "react";
import { XIcon as h, WarningCircleIcon as V, CheckIcon as D, CopyIcon as B } from "@phosphor-icons/react";
import { c as v } from "./chunks/vendor-styling-ofvnbcuht98q88oo.js";
import { i as Ar } from "./chunks/vendor-base-ui-elpbzr8xeffrz4h2.js";
const H = {
  size: {
    sm: {
      classes: "",
      description: "Small dialog for simple delete confirmations"
    },
    base: {
      classes: "",
      description: "Default delete confirmation dialog size"
    }
  }
}, P = {
  size: "base"
};
function k({
  open: t,
  onOpenChange: u,
  resourceType: m,
  resourceName: o,
  onDelete: p,
  isDeleting: s = !1,
  caseSensitive: f = !0,
  deleteButtonText: x,
  size: C = P.size,
  errorMessage: T,
  className: I
}) {
  const [A, c] = _(""), [L, i] = _(!1);
  g(() => {
    t || (c(""), i(!1));
  }, [t]);
  const b = d(
    (r) => f ? r : r.toLowerCase(),
    [f]
  ), l = b(A) === b(o), O = d(async () => {
    !l || s || await p();
  }, [l, s, p]), R = d(async () => {
    await navigator.clipboard.writeText(o), i(!0), setTimeout(() => i(!1), 1500);
  }, [o]);
  return /* @__PURE__ */ a(M, { open: t, onOpenChange: u, children: /* @__PURE__ */ e(U, { size: C, className: v("p-0", I), children: [
    /* @__PURE__ */ e("div", { className: "flex items-center justify-between border-b border-kumo-line px-6 py-4", children: [
      /* @__PURE__ */ e(N, { className: "text-lg font-semibold", children: [
        "Delete ",
        o
      ] }),
      /* @__PURE__ */ a(
        S,
        {
          render: (r) => /* @__PURE__ */ a(
            n,
            {
              ...r,
              variant: "ghost",
              shape: "square",
              size: "sm",
              "aria-label": "Close",
              disabled: s,
              children: /* @__PURE__ */ a(h, { size: 18 })
            }
          )
        }
      )
    ] }),
    /* @__PURE__ */ e("div", { className: "flex flex-col p-6 gap-4", children: [
      /* @__PURE__ */ e("div", { className: "flex flex-col gap-2", children: [
        T && /* @__PURE__ */ a(E, { icon: /* @__PURE__ */ a(V, {}), variant: "error", children: T }),
        /* @__PURE__ */ e("p", { className: "text-base text-kumo-subtle max-w-prose text-pretty", children: [
          "This action cannot be undone. This will permanently delete the",
          " ",
          /* @__PURE__ */ a("span", { className: "font-medium text-kumo-default", children: o }),
          " ",
          m.toLowerCase(),
          "."
        ] })
      ] }),
      /* @__PURE__ */ e("div", { className: "flex flex-col gap-2", children: [
        /* @__PURE__ */ a("div", { className: "flex items-center gap-1.5 text-base", children: /* @__PURE__ */ e("span", { children: [
          "Type",
          " ",
          /* @__PURE__ */ e(
            "button",
            {
              className: "font-mono text-sm inline font-semibold bg-kumo-tint hover:bg-kumo-fill rounded-md px-2 py-1 group hover:cursor-pointer",
              onClick: R,
              "aria-label": `Copy ${o} to clipboard`,
              children: [
                o,
                L ? /* @__PURE__ */ a(
                  D,
                  {
                    size: 12,
                    weight: "bold",
                    className: "inline ml-1.5"
                  }
                ) : /* @__PURE__ */ a(
                  B,
                  {
                    size: 12,
                    weight: "bold",
                    className: "inline text-kumo-subtle group-hover:text-kumo-default ml-1.5"
                  }
                )
              ]
            }
          ),
          " ",
          "to confirm:"
        ] }) }),
        /* @__PURE__ */ a(
          K,
          {
            placeholder: o,
            value: A,
            onChange: (r) => c(r.target.value),
            disabled: s,
            autoComplete: "off",
            autoCorrect: "off",
            autoCapitalize: "off",
            spellCheck: !1,
            "aria-label": `Type ${o} to confirm deletion`,
            className: "w-full"
          }
        )
      ] })
    ] }),
    /* @__PURE__ */ e("div", { className: "flex justify-end gap-3 border-t border-kumo-line px-6 py-4", children: [
      /* @__PURE__ */ a(
        S,
        {
          render: (r) => /* @__PURE__ */ a(n, { ...r, variant: "secondary", disabled: s, children: "Cancel" })
        }
      ),
      /* @__PURE__ */ a(
        n,
        {
          variant: "destructive",
          onClick: O,
          disabled: !l || s,
          loading: s,
          children: x || `Delete ${m}`
        }
      )
    ] })
  ] }) });
}
k.displayName = "DeleteResource";
export {
  Io as Autocomplete,
  Y as Badge,
  E as Banner,
  Q as BannerVariant,
  qe as Breadcrumbs,
  Ao as BubbleMap,
  n as Button,
  co as Chart,
  bo as ChartLegend,
  So as ChartPalette,
  ia as Checkbox,
  _o as ChoroplethMap,
  na as ClipboardText,
  ro as CloudflareLogo,
  ma as Code,
  pa as CodeBlock,
  Oa as Collapsible,
  Ta as Combobox,
  Pe as CommandPalette,
  mo as DatePicker,
  sa as DateRangePicker,
  k as DeleteResource,
  U as Dialog,
  S as DialogClose,
  ua as DialogDescription,
  M as DialogRoot,
  N as DialogTitle,
  xa as DialogTrigger,
  Ia as DropdownMenu,
  We as Empty,
  Ea as Field,
  fo as Flow,
  Ye as Grid,
  Je as GridItem,
  K as Input,
  Fa as InputArea,
  za as InputGroup,
  Lo as KUMO_AUTOCOMPLETE_DEFAULT_VARIANTS,
  Oo as KUMO_AUTOCOMPLETE_VARIANTS,
  so as KUMO_CLOUDFLARE_LOGO_DEFAULT_VARIANTS,
  to as KUMO_CLOUDFLARE_LOGO_VARIANTS,
  ke as KUMO_COMMAND_PALETTE_DEFAULT_VARIANTS,
  Fe as KUMO_COMMAND_PALETTE_VARIANTS,
  P as KUMO_DELETE_RESOURCE_DEFAULT_VARIANTS,
  H as KUMO_DELETE_RESOURCE_VARIANTS,
  Ma as KUMO_FIELD_DEFAULT_VARIANTS,
  Ua as KUMO_FIELD_VARIANTS,
  Qe as KUMO_GRID_DEFAULT_VARIANTS,
  Ze as KUMO_GRID_VARIANTS,
  ga as KUMO_LABEL_DEFAULT_VARIANTS,
  ha as KUMO_LABEL_VARIANTS,
  we as KUMO_LINK_DEFAULT_VARIANTS,
  ze as KUMO_LINK_VARIANTS,
  Le as KUMO_POPOVER_DEFAULT_VARIANTS,
  Oe as KUMO_POPOVER_VARIANTS,
  ge as KUMO_RADIO_DEFAULT_VARIANTS,
  he as KUMO_RADIO_VARIANTS,
  Me as KUMO_SENSITIVE_INPUT_DEFAULT_VARIANTS,
  Ue as KUMO_SENSITIVE_INPUT_VARIANTS,
  Mo as KUMO_SIDEBAR_DEFAULT_VARIANTS,
  Uo as KUMO_SIDEBAR_STYLING,
  No as KUMO_SIDEBAR_VARIANTS,
  rr as KUMO_TABLE_OF_CONTENTS_DEFAULT_VARIANTS,
  sr as KUMO_TABLE_OF_CONTENTS_VARIANTS,
  ca as KUMO_TOOLBAR_DEFAULT_VARIANTS,
  ba as KUMO_TOOLBAR_VARIANTS,
  fr as KumoPortalProvider,
  Va as Label,
  ja as LayerCard,
  Ge as Link,
  aa as LinkButton,
  dr as LinkProvider,
  qa as Loader,
  Ya as MenuBar,
  Za as Meter,
  ee as Pagination,
  Re as Popover,
  io as PoweredByCloudflare,
  Ve as Radio,
  De as RadioGroup,
  ea as RefreshButton,
  uo as SankeyChart,
  re as Select,
  Ne as SensitiveInput,
  Ko as Sidebar,
  go as SidebarCollapsible,
  ho as SidebarCollapsibleContent,
  Vo as SidebarCollapsibleTrigger,
  Do as SidebarContent,
  Bo as SidebarFooter,
  vo as SidebarGroup,
  Po as SidebarGroupLabel,
  ko as SidebarHeader,
  Fo as SidebarMenu,
  yo as SidebarMenuBadge,
  wo as SidebarMenuButton,
  zo as SidebarMenuChevron,
  Go as SidebarMenuItem,
  jo as SidebarMenuSub,
  $o as SidebarMenuSubButton,
  qo as SidebarMenuSubItem,
  Ho as SidebarProvider,
  Wo as SidebarRail,
  Xo as SidebarResizeHandle,
  Yo as SidebarRoot,
  Jo as SidebarSeparator,
  Qo as SidebarSlidingView,
  Zo as SidebarSlidingViews,
  ar as SidebarTrigger,
  Wa as SkeletonLine,
  te as Surface,
  le as Switch,
  pe as Table,
  tr as TableOfContents,
  de as Tabs,
  Te as Text,
  ya as Textarea,
  xo as TimeseriesChart,
  Ar as Toast,
  ce as ToastProvider,
  be as Toasty,
  Sa as Toolbar,
  xe as Tooltip,
  Ce as TooltipProvider,
  Ro as autocompleteVariants,
  oa as buttonVariants,
  v as cn,
  Se as createKumoToastManager,
  Na as fieldVariants,
  lo as generateCloudflareLogoSvg,
  ao as gridItemVariants,
  eo as gridVariants,
  Pa as inputVariants,
  Da as labelContentVariants,
  Ba as labelVariants,
  je as linkVariants,
  Be as radioVariants,
  lr as safeRandomId,
  _e as useKumoToastManager,
  mr as useLinkComponent,
  Ja as useMenuNavigation,
  er as useSidebar
};
//# sourceMappingURL=index.js.map
