1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2583],{52583:function(e,s,r){r.r(s);var t=r(85893),a=r(11163),i=r(57350),c=r(31963),n=r(31948),l=r(44504),d=r(55819),o=r(73793),h=r(25559),u=r(68055),x=r(23100),f=r(66946),j=r(33499),m=r(47018),p=r(96272),v=r(87536),S=r(86630),g=r(58561),C=r(88417),y=r(24907);let b="create-saved-search-form",w=e=>{let{isOpen:s,onClose:r,searchType:w}=e,k=(0,v.cI)({defaultValues:{name:"",visibility:"private",filters:{}}}),_=(0,i.p)(),z=(0,a.useRouter)(),Z=async e=>{try{let s=await (0,C.v_)("/system/saved-search/create",{...e,searchType:w});z.push("/search/".concat(w,"/").concat(s.slug)),r(),_({title:"Search Saved!",description:"Saved Search created successfully",status:"success",duration:5e3,isClosable:!0})}catch(e){_({title:"Error",description:"Something went wrong.",status:"error",duration:5e3,isClosable:!0})}},{selectedFilters:E}=(0,g.Z)(w),N=!E.length;return(0,t.jsxs)(S.Z,{isOpen:s,onClose:r,size:"2xl",children:[(0,t.jsx)(c.Z,{}),(0,t.jsxs)(n.h,{children:[(0,t.jsx)(l.x,{children:"Create Saved Search"}),(0,t.jsx)(d.o,{}),(0,t.jsxs)(o.f,{children:[(0,t.jsx)(y.Z,{searchType:w,createOrUpdateSavedSearch:Z,formControls:k,formId:b}),N&&(0,t.jsxs)(h.b,{status:"warning",variant:"left-accent",rounded:"md",children:[(0,t.jsx)(u.z,{}),(0,t.jsxs)(x.xu,{children:[(0,t.jsx)(f.C,{children:"No filters added"}),(0,t.jsx)(j.X,{children:"Currently we do not support saving a search without filters. Please add filters to your search and try again."})]})]})]}),(0,t.jsxs)(m.m,{children:[(0,t.jsx)(p.z,{variant:"ghost",mr:3,onClick:r,children:"Close"}),(0,t.jsx)(p.z,{type:"submit",colorScheme:"green",mr:3,isLoading:k.formState.isSubmitting,form:b,isDisabled:N,children:"Save"})]})]})]})};s.default=w}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.