module.exports=[259067,a=>{"use strict";let b=(0,a.i(578447).default)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);a.s(["default",0,b])},421878,a=>{"use strict";var b=a.i(259067);a.s(["Loader2",()=>b.default])},924031,a=>{"use strict";var b=a.i(542082),c=a.i(421878),d=a.i(888890),e=a.i(535567);a.s(["DeleteConfirmation",0,function({itemName:a="this item",isSubmitting:f,onDelete:g,customTitle:h,customDescription:i,children:j}){return(0,b.jsxs)(e.DialogContent,{children:[(0,b.jsx)(e.DialogTitle,{children:h??`Delete ${a}`}),(0,b.jsx)(e.DialogDescription,{className:"whitespace-pre-wrap",children:i??`Are you sure you want to delete ${a}? This action cannot be undone.`}),j,(0,b.jsxs)(e.DialogFooter,{children:[(0,b.jsx)(e.DialogClose,{asChild:!0,children:(0,b.jsx)(d.Button,{variant:"outline",children:"Cancel"})}),(0,b.jsx)(d.Button,{variant:"destructive",onClick:g,disabled:f,children:f?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(c.Loader2,{className:"size-4 animate-spin"})," Deleting..."]}):"Delete"})]})]})}])},884161,a=>{"use strict";var b=a.i(542082),c=a.i(284141),d=a.i(225526),e=a.i(952313),f=a.i(924031),g=a.i(713116);let h=(0,g.createServerReference)("70614d3d6ee41e9445bff098963cd3dc5f5ff19f89",g.callServer,void 0,g.findSourceMapURL,"deleteDatasetAction");a.s(["DeleteDatasetConfirmation",0,function({datasetId:a,datasetName:g,setIsOpen:i,redirectOnDelete:j=!1}){let{tenantId:k,projectId:l}=(0,c.useParams)(),m=(0,c.useRouter)(),[n,o]=(0,d.useState)(!1),p=async()=>{o(!0);let b=await h(k,l,a);b.success?(e.toast.success("Test suite deleted."),i(!1),j&&m.push(`/${k}/projects/${l}/datasets`)):e.toast.error(b.error),o(!1)};return(0,b.jsx)(f.DeleteConfirmation,{itemName:g||"this test suite",isSubmitting:n,onDelete:p})}],884161)},931537,a=>{"use strict";let b,c;var d=a.i(542082),e=a.i(417998),f=a.i(284141),g=a.i(225526),h=a.i(995209),i=a.i(952313),j=a.i(884161),k=a.i(157544);let l=k.z.object({name:k.z.string().min(1,"Name is required")});var m=a.i(178880),n=a.i(888890),o=a.i(535567);a.i(910436);var p=a.i(759713),q=a.i(713116);let r=(0,q.createServerReference)("70927639c5205ef532d940fae0294c3d867bfc4353",q.callServer,void 0,q.findSourceMapURL,"createDatasetAction");var s=a.i(542752);a.s(["default",0,function({params:a}){let{tenantId:k,projectId:q}=(0,g.use)(a),[t,u]=(0,g.useState)(!1),v=(0,h.useForm)({resolver:(0,e.zodResolver)(l),defaultValues:c?{name:c.name||""}:{name:""}}),{isSubmitting:w}=v.formState,x=(0,f.useRouter)(),{data:{canEdit:y}}=(0,s.useProjectPermissionsQuery)(),z=v.handleSubmit(async a=>{try{let b={name:a.name};{let a=await r(k,q,b);if(!a.success||!a.data)return void i.toast.error(a.error||"Failed to create test suite");i.toast.success("Test suite created"),x.push(`/${k}/projects/${q}/datasets/${a.data.id}`)}}catch(b){console.error("Error submitting dataset:",b);let a=b instanceof Error?b.message:"An unexpected error occurred";i.toast.error(a)}});return(0,d.jsxs)(o.Dialog,{open:t,onOpenChange:u,children:[(0,d.jsx)(p.Form,{...v,children:(0,d.jsxs)("form",{onSubmit:z,className:"space-y-8 max-w-2xl mx-auto",children:[(0,d.jsx)(m.GenericInput,{control:v.control,name:"name",label:"Name",placeholder:"Test Suite",description:"A descriptive name for this test suite"}),(0,d.jsxs)("div",{className:"flex w-full justify-between",children:[(0,d.jsxs)(n.Button,{type:"submit",disabled:w||!y,children:["Create"," Test Suite"]}),b&&(0,d.jsx)(o.DialogTrigger,{asChild:!0,children:(0,d.jsx)(n.Button,{type:"button",variant:"destructive-outline",children:"Delete Test Suite"})})]})]})}),t&&b&&(0,d.jsx)(j.DeleteDatasetConfirmation,{datasetId:b,datasetName:v.getValues("name")||void 0,setIsOpen:u,redirectOnDelete:!0})]})}],931537)}];

//# sourceMappingURL=_12l15ct._.js.map