import{x as g,j as s}from"./app-BBZbvTSO.js";import{B as l}from"./button-CZmOQP7j.js";import{D as j,a as h,b as f,c as b,d as y,e as D}from"./dialog-D_v2qgP5.js";import{I as v}from"./input-dmj4QjAp.js";import{I}from"./input-error-Bz7f2c6i.js";/* empty css            */import"./utils-YhN_nlHn.js";import"./index-C0VDnRYN.js";import"./index-CbDI-tXU.js";import"./Combination-9YgcTppv.js";import"./index-13DH8-b5.js";import"./index-C1VwruLz.js";function P({open:o,onOpenChange:t,projectId:n,collection:e,onCollectionDeleted:r}){const{data:i,setData:c,delete:d,processing:u,errors:m,reset:p}=g({slug:""}),x=a=>{a.preventDefault(),d(route("projects.collections.destroy",[n,e.id]),{onSuccess:()=>{p(),t(!1),r==null||r()}})};return e?s.jsx(j,{open:o,onOpenChange:t,children:s.jsxs(h,{className:"sm:max-w-[425px]",children:[s.jsxs(f,{children:[s.jsx(b,{children:"Delete Collection"}),s.jsx(y,{children:"This action cannot be undone. This will permanently delete the collection and all its associated data."})]}),s.jsxs("form",{onSubmit:x,className:"space-y-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{children:["Please type ",s.jsx("span",{className:"font-mono bg-muted px-1 py-0.5 rounded border border-input inline-block  select-all",children:e.slug})," to confirm"]}),s.jsx(v,{id:"slug",value:i.slug,onChange:a=>c("slug",a.target.value),required:!0,placeholder:"Enter collection slug"}),s.jsx(I,{message:m.slug})]}),s.jsxs(D,{children:[s.jsx(l,{type:"button",variant:"outline",onClick:()=>t(!1),children:"Cancel"}),s.jsx(l,{type:"submit",variant:"destructive",disabled:u||i.slug!==e.slug,children:"Delete Collection"})]})]})]})}):null}export{P as default};
