PageSourceSearch

https://stackviv.ai/_next/static/chunks/6999.fe01f56a2c14be49.js

js stackviv.ai collected 2026-10-05 08:17:24 UTC 3,718 bytes, 1 lines download raw bytes

1try{!function(){var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},a=(new e.Error).stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="ab2a0217-1c96-4a48-9812-d0242caeeae4",e._sentryDebugIdIdentifier="sentry-dbid-ab2a0217-1c96-4a48-9812-d0242caeeae4")}()}catch(e){}"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6999],{66999:(e,a,s)=>{s.r(a),s.d(a,{default:()=>v});var t=s(95155),l=s(12115),r=s(97003),d=s(84916),n=s(54679),i=s(33789),o=s(27346),c=s(30926);let u=(0,c.createServerReference)("7f4281463d8d8635a2e6e55f642588cc52c00152a3",c.callServer,void 0,c.findSourceMapURL,"addNewAlternative");var m=s(53550),h=s(35299),f=s(61229),x=s(15239),g=s(73627);function v(e){let{open:a,onClose:s,itemId:c,onSuccess:v}=e,[j,p]=(0,l.useState)([]),[y,N]=(0,l.useState)(!0),[A,b]=(0,l.useState)(!1),[w,I]=(0,l.useState)([]),[C,S]=(0,l.useState)("");(0,l.useEffect)(()=>{a?k():(I([]),S(""))},[a]);let k=async()=>{N(!0);try{let e=await (0,m.c)({isAdmin:!0});e.data&&Array.isArray(e.data)&&p(e.data.filter(e=>e.id!==c))}catch(e){console.error("Error loading items:",e),f.oR.error("Failed to load AI tools")}finally{N(!1)}},_=async()=>{if(0===w.length)return void f.oR.error("Please select at least one AI tool");b(!0);try{let e=w.map(e=>u({data:{isFeatured:!1,alternative_item_id:e,itemId:c,status:"PENDING",rejectionReasons:null,modificationsMade:null}}));(await Promise.all(e)).some(e=>null==e?void 0:e.error)?f.oR.error("This alternative already exists for this AI tool!"):(f.oR.success("Added ".concat(w.length," alternatives successfully")),v&&v(),s())}catch(e){console.error("Error adding alternatives:",e),f.oR.error("Failed to add alternatives")}finally{b(!1)}},E=e=>{I(a=>a.includes(e)?a.filter(a=>a!==e):[...a,e])},R=j.filter(e=>e.name.toLowerCase().includes(C.toLowerCase()));return(0,t.jsx)(n.lG,{open:a,onOpenChange:s,children:(0,t.jsxs)(n.Cf,{className:"sm:max-w-md md:max-w-2xl",children:[(0,t.jsxs)(n.c7,{children:[(0,t.jsx)(n.L3,{children:"Add Alternatives"}),(0,t.jsx)(n.rr,{children:"Select AI tools to add as alternatives. You can select multiple."})]}),(0,t.jsxs)("div",{className:"py-4",children:[(0,t.jsx)(i.p,{placeholder:"Search AI tools...",value:C,onChange:e=>S(e.target.value),className:"mb-4"}),y?(0,t.jsx)("div",{className:"flex justify-center items-center h-60",children:(0,t.jsx)(h.A,{className:"h-8 w-8 animate-spin text-primary"})}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"text-sm text-muted-foreground mb-2",children:[w.length," AI tools selected"]}),(0,t.jsx)(o.F,{className:"h-[400px] rounded-md border p-4",children:0===R.length?(0,t.jsx)("div",{className:"text-center py-8 text-muted-foreground",children:"No AI tools found"}):(0,t.jsx)("div",{className:"space-y-4",children:R.map(e=>(0,t.jsxs)("div",{className:"flex items-center space-x-4 p-2 rounded-md hover:bg-muted/50 cursor-pointer",onClick:()=>E(e.id),children:[(0,t.jsx)(d.S,{checked:w.includes(e.id),onCheckedChange:()=>E(e.id)}),e.logo&&(0,t.jsx)(x.default,{src:e.logo||g.n,alt:e.name,width:30,height:30,className:"rounded-full",loading:"lazy"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("div",{className:"font-medium",children:e.name}),(0,t.jsxs)("div",{className:"text-sm text-muted-foreground",children:["ID: ",e.id]})]})]},e.id))})})]})]}),(0,t.jsxs)(n.Es,{children:[(0,t.jsx)(r.$,{variant:"outline",onClick:s,children:"Cancel"}),(0,t.jsx)(r.$,{onClick:_,disabled:A||0===w.length,children:A?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(h.A,{className:"mr-2 h-4 w-4 animate-spin"}),"Adding..."]}):"Add ".concat(w.length," Alternatives")})]})]})})}}}]);

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.