PageSourceSearch

https://ops.opengrants.io/assets/AdminOpportunities-CnmFsk4m.js

js opengrants.io collected 2026-09-25 02:35:00 UTC 21,077 bytes, 6 lines download raw bytes

1import{c as Ue,a5 as ye,j as e,C as be,a as _e,o as U,B as d,s as qe,bo as Re,b7 as Ye,bp as He,b4 as Je,Y as Qe,F as ee,X as oe,M as de,bq as ce,br as ue,bs as ge,bt as me,bu as Ve,bv as xe,bw as Xe,bx as he,by as Ke,bz as We,bA as Ze,bB as et,I as C,T as tt,l as pe,bC as at}from"./index-CH4KUdzn.js";import{r as l}from"./react-vendor-DFxO6R2g.js";import{T as st}from"./Table-B6nm0F2Q.js";import{E as te}from"./EmptyState-ENCEWhQq.js";import{C as fe}from"./ConfirmDialog-CCzRwiKv.js";import{S as rt}from"./SimpleTabs-BpSEyv3R.js";import{S as nt}from"./SocialPreviewMenu-5rbBHcq0.js";import{P as ae}from"./plus-D4k7gPbD.js";import{T as se}from"./trash-2-BHX8vl4o.js";import{P as lt}from"./pencil-HSllAVYZ.js";import"./supabase-sxj-XQo7.js";import"./share-2-BhinGFrc.js";/**
2 * @license lucide-react v0.344.0 - ISC
3 *
4 * This source code is licensed under the ISC license.
5 * See the LICENSE file in the root directory of this source tree.
6 */const je=Ue("CheckSquare",[["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}],["path",{d:"M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11",key:"1jnkn4"}]]);function it(){const i=ye(),[w,h]=l.useState(null),[D,m]=l.useState(null),q=async(f,b,c)=>{h(f),m(null);try{const{data:p,error:g}=await qe.functions.invoke(b,{body:c});if(g)throw g;m(p),i.success(`${f} complete`)}catch(p){i.error(`${f} failed: ${p.message}`),m({error:p.message})}finally{h(null)}},y=({label:f,fn:b,body:c})=>e.jsx(d,{variant:"outline",disabled:!!w,onClick:()=>q(f,b,c),children:w===f?"Running…":f});return e.jsx(be,{children:e.jsxs(_e,{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h2",{className:"text-lg font-display font-bold text-gray-900 dark:text-gray-100",children:"Data quality"}),e.jsx(U,{variant:"neutral",size:"sm",children:"admin"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:"Award notices — label & hide already-awarded records (reversible)"}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx(y,{label:"Detect (dry-run)",fn:"award-notice-sweep",body:{entity:"both",dry_run:!0}}),e.jsx(y,{label:"Apply labels",fn:"award-notice-sweep",body:{entity:"both",dry_run:!1}})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:"Link health — find & hide dead links (run Seed → Sample, review, then Full)"}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx(y,{label:"Seed link table",fn:"link-crawler",body:{mode:"seed"}}),e.jsx(y,{label:"Sample crawl",fn:"link-crawler",body:{mode:"sample",sample_size:300}}),e.jsx(y,{label:"Full crawl",fn:"link-crawler",body:{mode:"full",batch_size:200}})]})]}),D&&e.jsx("pre",{className:"max-h-72 overflow-auto rounded-lg bg-gray-50 dark:bg-gray-800/60 p-3 text-xs text-gray-700 dark:text-gray-300",children:JSON.stringify(D,null,2)})]})})}function bt(){const[i,w]=l.useState("grants"),[h,D]=l.useState([]),[m,q]=l.useState([]),[,y]=l.useState([]),[f,b]=l.useState(!0),[c,p]=l.useState(new Set),[g,v]=l.useState(new Set),[G,I]=l.useState(!1),[F,z]=l.useState(!1),[R,Ce]=l.useState(0),[Y,ve]=l.useState(0),[ke,A]=l.useState(!1),[Se,T]=l.useState(!1),[Ne,H]=l.useState(!1),[we,O]=l.useState(!1),[x,re]=l.useState(null),[u,J]=l.useState("grant"),[$,j]=l.useState(!1),[ne,Q]=l.useState(!1),o=ye(),[V,E]=l.useState({title:"",slug:"",description:"",amount_min:"",amount_max:"",deadline_date:"",is_rolling:!1,status:"open",geography:"",listing_url:"",category_ids:[]}),[X,L]=l.useState({title:"",slug:"",description:"",amount_min:"",amount_max:"",deadline_date:"",is_rolling:!1,status:"open",geography:"",listing_url:"",category_ids:[]}),De=[{id:"grants",label:"Grants"},{id:"contracts",label:"Contracts"},{id:"all",label:"All Opportunities"}];l.useEffect(()=>{k()},[]);const k=async()=>{try{b(!0);const[t,a,n]=await Promise.all([Re({limit:1e3,includeArchived:!0}),Ye({limit:1e3,includeArchived:!0}),He()]);D(t.grants),q(a.contracts),Ce(t.count),ve(a.count),y(n)}catch(t){o.error("Failed to load data"),console.error(t)}finally{b(!1)}},Ge=async t=>{try{if(t==="grants"){const a=await ce();
6p(new Set(a)),I(!0)}else{const a=await ge();v(new Set(a)),z(!0)}}catch(a){o.error("Failed to select all records"),console.error(a)}},Ie=t=>{const a=new Set(c);a.has(t)?(a.delete(t),I(!1)):a.add(t),p(a)},Fe=t=>{const a=new Set(g);a.has(t)?(a.delete(t),z(!1)):a.add(t),v(a)},B=()=>{p(new Set),v(new Set),I(!1),z(!1)},ze=async()=>{if(!ne){o.error("Please confirm the deletion");return}try{j(!0);let t=0;if((i==="grants"||i==="all")&&c.size>0)if(G){const a=await ce();await ue(Array.from(a)),t+=a.length}else await ue(Array.from(c)),t+=c.size;if((i==="contracts"||i==="all")&&g.size>0)if(F){const a=await ge();await me(Array.from(a)),t+=a.length}else await me(Array.from(g)),t+=g.size;o.success(`Successfully deleted ${t} opportunities`),O(!1),Q(!1),B(),k()}catch(t){o.error(t.message||"Failed to delete opportunities"),console.error(t)}finally{j(!1)}},Ae=(t,a)=>{const n=at(t);a==="grant"?E(s=>({...s,title:t,slug:n})):L(s=>({...s,title:t,slug:n}))},K=t=>{J(t),t==="grant"?E({title:"",slug:"",description:"",amount_min:"",amount_max:"",deadline_date:"",is_rolling:!1,status:"open",geography:"",listing_url:"",category_ids:[]}):L({title:"",slug:"",description:"",amount_min:"",amount_max:"",deadline_date:"",is_rolling:!1,status:"open",geography:"",listing_url:"",category_ids:[]}),A(!0)},Te=(t,a)=>{var n,s,N,_;re(t),J(a),a==="grant"?E({title:t.title,slug:t.slug,description:t.description||"",amount_min:((n=t.amount_min)==null?void 0:n.toString())||"",amount_max:((s=t.amount_max)==null?void 0:s.toString())||"",deadline_date:t.deadline_date||"",is_rolling:t.is_rolling,status:t.status,geography:t.geography||"",listing_url:t.listing_url||"",category_ids:[]}):L({title:t.title,slug:t.slug,description:t.description||"",amount_min:((N=t.amount_min)==null?void 0:N.toString())||"",amount_max:((_=t.amount_max)==null?void 0:_.toString())||"",deadline_date:t.deadline_date||"",is_rolling:t.is_rolling,status:t.status,geography:t.geography||"",listing_url:t.listing_url||"",category_ids:[]}),T(!0)},Oe=(t,a)=>{re(t),J(a),H(!0)},$e=async()=>{const t=u==="grant"?V:X;if(!t.title.trim()){o.error("Title is required");return}if(!t.deadline_date&&!t.is_rolling){o.error("Either deadline date or rolling opportunity must be specified");return}try{j(!0);const a={title:t.title.trim(),slug:t.slug.trim(),description:t.description.trim()||null,amount_min:t.amount_min?parseInt(t.amount_min):null,amount_max:t.amount_max?parseInt(t.amount_max):null,deadline_date:t.deadline_date||null,is_rolling:t.is_rolling,status:t.status,geography:t.geography||null,listing_url:t.listing_url.trim()};if(u==="grant"){const n=await Ve(a);t.category_ids.length>0&&await xe(n.id,t.category_ids)}else{const n=await Xe(a);t.category_ids.length>0&&await he(n.id,t.category_ids)}o.success(`${u==="grant"?"Grant":"Contract"} created successfully`),A(!1),k()}catch(a){o.error(a.message||"Failed to create opportunity"),console.error(a)}finally{j(!1)}},Ee=async()=>{if(!x)return;const t=u==="grant"?V:X;if(!t.title.trim()){o.error("Title is required");return}if(!t.deadline_date&&!t.is_rolling){o.error("Either deadline date or rolling opportunity must be specified");return}try{j(!0);const a={title:t.title.trim(),slug:t.slug.trim(),description:t.description.trim()||null,amount_min:t.amount_min?parseInt(t.amount_min):null,amount_max:t.amount_max?parseInt(t.amount_max):null,deadline_date:t.deadline_date||null,is_rolling:t.is_rolling,status:t.status,geography:t.geography||null,listing_url:t.listing_url.trim()};u==="grant"?(await Ke(x.id,a),t.category_ids.length>0&&await xe(x.id,t.category_ids)):(await We(x.id,a),t.category_ids.length>0&&await he(x.id,t.category_ids)),o.success(`${u==="grant"?"Grant":"Contract"} updated successfully`),T(!1),k()}catch(a){o.error(a.message||"Failed to update opportunity"),console.error(a)}finally{j(!1)}},Le=async()=>{if(x)try{j(!0),u==="grant"?await Ze(x.id):await et(x.id),o.success(`${u==="grant"?"Grant":"Contract"} deleted successfully`),H(!1),k()}catch(t){o.error(t.message||"Failed to delete opportunity"),console.error(t)}finally{j(!1)}},M=t=>t?new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:0}).format(t):"N/A",Be=t=>t?new Date(t).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}):"N/A",Me=t=>{const a={open:"success",upcoming:"neutral",closed:"error"};return e.jsx(U,{variant:a[t]||"neutral",children:t})},P=(t,a,n=!1)=>{const s=a==="grant"?c:g,N=a==="grant"?G:F,_=a==="grant"?R:Y,W=t.every(r=>s.has(r.id)),Pe=t.some(r=>s.has(r.id));return e.jsxs(e.Fragment,{children:[s.size>0&&e.jsxs("div",{className:"mb-4 p-4 bg-brand-50 dark:bg-brand-900/20 border border-brand-200 dark:border-brand-800 rounded-lg flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(je,{className:"w-5 h-5 text-brand-600 dark:text-brand-400"}),e.jsxs("div",{children:[e.jsxs("p",{className:"font-medium text-brand-900 dark:text-brand-100",children:[N?_:s.size," ",a==="grant"?"grants":"contracts"," selected"]}),!N&&s.size===t.length&&t.length<_&&e.jsxs("button",{onClick:()=>Ge(a==="grant"?"grants":"contracts"),className:"text-sm text-brand-600 dark:text-brand-400 hover:underline",children:["Select all ",_," ",a==="grant"?"grants":"contracts"]})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(d,{size:"sm",variant:"outline",onClick:B,iconLeft:e.jsx(oe,{className:"w-4 h-4"}),children:"Clear Selection"}),e.jsx(d,{size:"sm",variant:"outline",onClick:()=>O(!0),iconLeft:e.jsx(se,{className:"w-4 h-4"}),className:"text-red-600 hover:text-red-700 hover:border-red-600",children:"Delete Selected"})]})]}),e.jsxs(st,{children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{className:"w-12",children:e.jsx("input",{type:"checkbox",checked:W,ref:r=>{r&&(r.indeterminate=Pe&&!W)},onChange:()=>{if(W){const r=new Set(s);t.forEach(Z=>r.delete(Z.id)),a==="grant"?(p(r),I(!1)):(v(r),z(!1))}else{const r=new Set(s);t.forEach(Z=>r.add(Z.id)),a==="grant"?p(r):v(r)}},className:"w-4 h-4 rounded border-gray-300 dark:border-gray-600 text-brand-600 focus:ring-brand-600"})}),n&&e.jsx("th",{children:"Type"}),e.jsx("th",{children:"Title"}),e.jsx("th",{children:"Amount"}),e.jsx("th",{children:"Deadline"}),e.jsx("th",{children:"Status"}),e.jsx("th",{children:"Geography"}),e.jsx("th",{className:"text-right",children:"Actions"})]})}),e.jsx("tbody",{children:t.map(r=>e.jsxs("tr",{className:s.has(r.id)?"bg-brand-50/50 dark:bg-brand-900/10":"",children:[e.jsx("td",{children:e.jsx("input",{type:"checkbox",checked:s.has(r.id),onChange:()=>
6a==="grant"?Ie(r.id):Fe(r.id),className:"w-4 h-4 rounded border-gray-300 dark:border-gray-600 text-brand-600 focus:ring-brand-600"})}),n&&e.jsx("td",{children:e.jsx(U,{variant:"neutral",size:"sm",children:a==="grant"?"Grant":"Contract"})}),e.jsx("td",{className:"font-medium",children:r.title}),e.jsx("td",{children:r.amount_min&&r.amount_max?`${M(r.amount_min)} - ${M(r.amount_max)}`:r.amount_min?`${M(r.amount_min)}+`:r.amount_max?`Up to ${M(r.amount_max)}`:"N/A"}),e.jsx("td",{children:r.is_rolling?e.jsx(U,{variant:"brand",size:"sm",children:"Rolling"}):Be(r.deadline_date)}),e.jsx("td",{children:Me(r.status)}),e.jsx("td",{className:"capitalize",children:r.geography||"N/A"}),e.jsx("td",{children:e.jsxs("div",{className:"flex items-center justify-end gap-2",children:[e.jsx(nt,{publicUrl:`https://ops.opengrants.io/${a==="contract"?"contracts":"grants"}/${r.slug}`}),e.jsx(d,{size:"sm",variant:"outline",iconLeft:e.jsx(lt,{className:"w-4 h-4"}),onClick:()=>Te(r,a),children:"Edit"}),e.jsx(d,{size:"sm",variant:"outline",iconLeft:e.jsx(se,{className:"w-4 h-4"}),onClick:()=>Oe(r,a),className:"text-red-600 hover:text-red-700 hover:border-red-600",children:"Delete"})]})})]},r.id))})]})]})},le=t=>{const a=t==="grant"?V:X,n=t==="grant"?E:L;return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Title *"}),e.jsx(C,{value:a.title,onChange:s=>Ae(s.target.value,t),placeholder:`Enter ${t} title`})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Slug"}),e.jsx(C,{value:a.slug,onChange:s=>n({...a,slug:s.target.value}),placeholder:"auto-generated-slug"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Description"}),e.jsx(tt,{value:a.description,onChange:s=>n({...a,description:s.target.value}),placeholder:`Enter ${t} description`,rows:4})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Min Amount"}),e.jsx(C,{type:"number",value:a.amount_min,onChange:s=>n({...a,amount_min:s.target.value}),placeholder:"0"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Max Amount"}),e.jsx(C,{type:"number",value:a.amount_max,onChange:s=>n({...a,amount_max:s.target.value}),placeholder:"0"})]})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:["Deadline Date ",!a.is_rolling&&"*"]}),e.jsx(C,{type:"date",value:a.deadline_date,onChange:s=>n({...a,deadline_date:s.target.value}),disabled:a.is_rolling})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"checkbox",id:"is-rolling",checked:a.is_rolling,onChange:s=>n({...a,is_rolling:s.target.checked,deadline_date:s.target.checked?"":a.deadline_date}),className:"w-4 h-4 rounded border-gray-300 dark:border-gray-600 text-brand-600 focus:ring-brand-600"}),e.jsx("label",{htmlFor:"is-rolling",className:"text-sm text-gray-700 dark:text-gray-300",children:"Rolling opportunity (no fixed deadline)"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Listing URL *"}),e.jsx(C,{type:"url",value:a.listing_url,onChange:s=>n({...a,listing_url:s.target.value}),placeholder:"https://example.com/opportunity",required:!0})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Status"}),e.jsxs(pe,{value:a.status,onChange:s=>n({...a,status:s.target.value}),children:[e.jsx("option",{value:"open",children:"Open"}),e.jsx("option",{value:"upcoming",children:"Upcoming"}),e.jsx("option",{value:"closed",children:"Closed"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Geography"}),e.jsxs(pe,{value:a.geography,onChange:s=>n({...a,geography:s.target.value}),children:[e.jsx("option",{value:"",children:"Select..."}),e.jsx("option",{value:"national",children:"National"}),e.jsx("option",{value:"state",children:"State"}),e.jsx("option",{value:"local",children:"Local"}),e.jsx("option",{value:"international",children:"International"})]})]})]})]})},S=()=>
6{if(i==="grants")return G?R:c.size;if(i==="contracts")return F?Y:g.size;{const t=G?R:c.size,a=F?Y:g.size;return t+a}},ie=()=>{const t=[];return(i==="grants"||i==="all")&&t.push(...h.slice(0,3).filter(a=>c.has(a.id)).map(a=>a.title)),(i==="contracts"||i==="all")&&t.push(...m.slice(0,3).filter(a=>g.has(a.id)).map(a=>a.title)),t.slice(0,3)};return e.jsxs("div",{className:"space-y-8",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-3xl font-display font-bold text-gray-900 dark:text-gray-100 mb-2",children:"Manage Opportunities"}),e.jsx("p",{className:"text-gray-600 dark:text-gray-400",children:"Create, edit, and manage grant and contract opportunities"})]}),e.jsxs("div",{className:"flex gap-3",children:[e.jsx(d,{variant:"outline",onClick:()=>window.location.href="/app/admin/imports",iconLeft:e.jsx(Je,{className:"w-4 h-4"}),children:"Import"}),i!=="all"&&e.jsxs(d,{onClick:()=>K(i==="grants"?"grant":"contract"),iconLeft:e.jsx(ae,{className:"w-4 h-4"}),children:["Create ",i==="grants"?"Grant":"Contract"]})]})]}),e.jsx(it,{}),e.jsx(be,{children:e.jsxs(_e,{children:[e.jsx(rt,{tabs:De,activeTab:i,onChange:t=>{w(t),B()}}),e.jsx("div",{className:"mt-6",children:f?e.jsx("div",{className:"space-y-4",children:[1,2,3].map(t=>e.jsx(Qe,{height:60},t))}):e.jsxs(e.Fragment,{children:[i==="grants"&&e.jsx(e.Fragment,{children:h.length===0?e.jsx(te,{icon:ee,title:"No grants yet",description:"Create your first grant opportunity to get started.",action:e.jsx(d,{onClick:()=>K("grant"),iconLeft:e.jsx(ae,{className:"w-4 h-4"}),children:"Create Grant"})}):P(h,"grant")}),i==="contracts"&&e.jsx(e.Fragment,{children:m.length===0?e.jsx(te,{icon:ee,title:"No contracts yet",description:"Create your first contract opportunity to get started.",action:e.jsx(d,{onClick:()=>K("contract"),iconLeft:e.jsx(ae,{className:"w-4 h-4"}),children:"Create Contract"})}):P(m,"contract")}),i==="all"&&e.jsx(e.Fragment,{children:h.length===0&&m.length===0?e.jsx(te,{icon:ee,title:"No opportunities yet",description:"Create your first opportunity to get started."}):e.jsxs(e.Fragment,{children:[c.size>0||g.size>0?e.jsxs("div",{className:"mb-4 p-4 bg-brand-50 dark:bg-brand-900/20 border border-brand-200 dark:border-brand-800 rounded-lg flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(je,{className:"w-5 h-5 text-brand-600 dark:text-brand-400"}),e.jsx("div",{children:e.jsxs("p",{className:"font-medium text-brand-900 dark:text-brand-100",children:[S()," opportunities selected"]})})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(d,{size:"sm",variant:"outline",onClick:B,iconLeft:e.jsx(oe,{className:"w-4 h-4"}),children:"Clear Selection"}),e.jsx(d,{size:"sm",variant:"outline",onClick:()=>O(!0),iconLeft:e.jsx(se,{className:"w-4 h-4"}),className:"text-red-600 hover:text-red-700 hover:border-red-600",children:"Delete Selected"})]})]}):null,h.length>0&&e.jsxs("div",{className:"mb-8",children:[e.jsxs("h3",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100 mb-4",children:["Grants (",h.length,")"]}),P(h,"grant",!0)]}),m.length>0&&e.jsxs("div",{children:[e.jsxs("h3",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100 mb-4",children:["Contracts (",m.length,")"]}),P(m,"contract",!0)]})]})})]})})]})}),e.jsxs(de,{isOpen:ke,onClose:()=>A(!1),title:`Create ${u==="grant"?"Grant":"Contract"}`,children:[le(u),e.jsxs("div",{className:"flex gap-3 justify-end pt-4 border-t border-gray-200 dark:border-gray-800 mt-4",children:[e.jsx(d,{variant:"outline",onClick:()=>A(!1),children:"Cancel"}),e.jsx(d,{onClick:$e,loading:$,children:"Create"})]})]}),e.jsxs(de,{isOpen:Se,onClose:()=>T(!1),title:`Edit ${u==="grant"?"Grant":"Contract"}`,children:[le(u),e.jsxs("div",{className:"flex gap-3 justify-end pt-4 border-t border-gray-200 dark:border-gray-800 mt-4",children:[e.jsx(d,{variant:"outline",onClick:()=>T(!1),children:"Cancel"}),e.jsx(d,{onClick:Ee,loading:$,children:"Save Changes"})]})]}),e.jsx(fe,{isOpen:Ne,onClose:()=>
6H(!1),onConfirm:Le,title:`Delete ${u==="grant"?"Grant":"Contract"}`,message:e.jsxs(e.Fragment,{children:["Are you sure you want to delete ",e.jsx("strong",{children:x==null?void 0:x.title}),"? This action cannot be undone."]}),confirmText:"Delete",variant:"danger",loading:$}),e.jsx(fe,{isOpen:we,onClose:()=>{O(!1),Q(!1)},onConfirm:ze,title:"Delete Selected Opportunities",message:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("p",{children:["You are about to permanently delete ",e.jsxs("strong",{children:[S()," opportunities"]}),"."]}),ie().length>0&&e.jsxs("div",{className:"bg-gray-50 dark:bg-gray-900 p-3 rounded-lg",children:[e.jsx("p",{className:"text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Including:"}),e.jsxs("ul",{className:"text-sm text-gray-600 dark:text-gray-400 list-disc list-inside space-y-1",children:[ie().map((t,a)=>e.jsx("li",{children:t},a)),S()>3&&e.jsxs("li",{children:["And ",S()-3," more..."]})]})]}),e.jsxs("div",{className:"flex items-start gap-2 p-3 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg",children:[e.jsx("input",{type:"checkbox",id:"bulk-delete-confirm",checked:ne,onChange:t=>Q(t.target.checked),className:"mt-0.5 w-4 h-4 rounded border-gray-300 dark:border-gray-600 text-red-600 focus:ring-red-600"}),e.jsx("label",{htmlFor:"bulk-delete-confirm",className:"text-sm text-gray-700 dark:text-gray-300",children:"I understand this action cannot be undone and will permanently delete all selected opportunities."})]})]}),confirmText:`Delete ${S()} Opportunities`,variant:"danger",loading:$})]})}export{bt as default};

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.