PageSourceSearch

https://vyndra.ai/_next/static/chunks/786.0a3af661bdc5ba37.js

js vyndra.ai collected 2026-10-05 13:46:10 UTC 13,020 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[786],{20786:(e,t,r)=>{r.r(t),r.d(t,{ReferenceGalleryNodeSidebar:()=>u});var l=r(68987),s=r(33361),a=r(45558),o=r(46204),i=r(10752),n=r(2315),d=r(96396),c=r(69029),m=r(66982);let u=(0,n.memo)(function(){let{selectedNode:e,updateNodeData:t,setSelectedNodeId:r,nodeDefinitions:u}=(0,s.kp)((0,d.k)(e=>({selectedNode:null!=e.selectedNodeId?e.nodesById[e.selectedNodeId]??null:null,updateNodeData:e.updateNodeData,setSelectedNodeId:e.setSelectedNodeId,nodeDefinitions:e.nodeDefinitions}))),x=(0,n.useMemo)(()=>u?.find(e=>e.nodeName===m.REFERENCE_GALLERY_NODE_TYPE),[u]),g=(0,n.useMemo)(()=>x?.icon&&o[x.icon]?o[x.icon]:i.A,[x?.icon]);if(!e||"referenceGallery"!==e.type)return null;let p=e.data??{},b=Array.isArray(p.images)?p.images.filter(e=>"string"==typeof e&&e.length>0):[];return(0,l.jsxs)(c.y,{title:"Reference Gallery",icon:g,color:"purple",onClose:()=>r(null),subtitle:x?.description||"",children:[(0,l.jsx)(a.H,{title:"Label",value:void 0!==p.tag?p.tag:x?.tag||"",onChange:r=>t(e.id,{tag:r.target.value})}),(0,l.jsxs)("div",{className:"mt-4 space-y-2",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:"Images"}),(0,l.jsxs)("span",{className:"text-[10px] text-muted-foreground",children:[b.length,"/20"]})]}),(0,l.jsx)("div",{className:"rounded-xl border border-border/60 bg-muted/20 p-2",children:0===b.length?(0,l.jsx)("div",{className:"h-16 flex items-center justify-center text-xs text-muted-foreground",children:"No images uploaded"}):(0,l.jsx)("div",{className:"grid grid-cols-4 gap-2",children:b.map((e,t)=>(0,l.jsxs)("a",{href:e,target:"_blank",rel:"noreferrer",className:"relative block overflow-hidden rounded-md border border-border/60 bg-black/20",children:[(0,l.jsx)("img",{src:e,alt:`Reference ${t+1}`,className:"h-14 w-full object-cover"}),(0,l.jsx)("span",{className:"absolute left-1 top-1 rounded bg-black/60 px-1 text-[9px] text-white",children:t+1})]},`${e}-${t}`))})})]})]})})},45558:(e,t,r)=>{r.d(t,{H:()=>n});var l=r(68987),s=r(76843),a=r(93210),o=r(2315),i=r(52812);let n=(0,o.memo)(({className:e,wrapperClassName:t,labelClassName:r,value:n,onChange:d,placeholder:c,title:m,readOnly:u=!1,type:x="text",maxLength:g,...p})=>{let b=(0,o.useRef)(!1),[f,h]=(0,o.useState)(n||""),v=(0,i.d)(f,500);(0,o.useEffect)(()=>{b.current||n===f||h(n||"")},[n,f]),(0,o.useEffect)(()=>{b.current&&v!==n&&d({target:{value:v}})},[v,n,d]);let N=(0,o.useCallback)(e=>{b.current=!0,h(e.target.value)},[]),y=(0,o.useCallback)(()=>{b.current=!1,f!==n&&d({target:{value:f}})},[f,n,d]);return(0,l.jsxs)("div",{className:(0,a.cn)("space-y-1.5",t),children:[m&&(0,l.jsx)("label",{className:(0,a.cn)("text-xs font-medium text-foreground",r),children:m}),(0,l.jsx)(s.p,{type:x,value:f,onChange:N,onBlur:y,placeholder:c,readOnly:u,maxLength:g,className:(0,a.cn)("h-10",e),...p}),"number"==typeof g?(0,l.jsxs)("p",{className:"text-[10px] text-muted-foreground text-right",children:[f.length,"/",g]}):null]})});n.displayName="NodeInput"},66982:(e,t,r)=>{r.r(t),r.d(t,{REFERENCE_GALLERY_NODE_TYPE:()=>C,ReferenceGalleryNodeComponent:()=>E});var l=r(68987),s=r(96377),a=r(33361),o=r(96401),i=r(74286),n=r(49405),d=r(74130),c=r(93210),m=r(99625),u=r(47924),x=r(90480),g=r(23431),p=r(69226),b=r(2315),f=r(73579),h=r(7083),v=r(57290),N=r(37375),y=r(56648),j=r(94298),w=r(24082),k=r(69770);let C="referenceGallery";function I({url:e,index:t,onRemove:r,onPreview:s}){let{attributes:a,listeners:o,setNodeRef:i,transform:n,transition:d,isDragging:m}=(0,w.gl)({id:e});return(0,l.jsxs)("div",{ref:i,style:{transform:k.Ks.Transform.toString(n),transition:d},className:(0,c.cn)("relative aspect-square rounded-md border bg-muted overflow-hidden group shadow-sm",m&&"z-50 opacity-80 shadow-lg ring-2 ring-primary"),onClick:()=>s(t),children:[(0,l.jsx)("img",{src:(0,c.VG)(e,"thumbnail"),className:"absolute inset-0 w-full h-full object-cover",alt:`Gallery image ${t+1}`,draggable:!1}),(0,l.jsx)("button",{...a,...o,onClick:e=>e.stopPropagation(),className:"absolute top-1.5 left-1.5 p-1.5 bg-black/60 text-white rounded-full opacity-0 group-hover:opacity-100 transition-opacity hover:bg-black/80 cursor-grab active:cursor-grabbing z-20 touch-none","aria-label":"Drag to reorder",children:(0,l.jsx)(x.A,{className:"w-3.5 h-3.5"})}),(0,l.jsx)("button",{onClick:e=>{e.stopPropagation(),r(t)},className:"absolute top-1.5 right-1.5 p-1.5 bg-black/60 text-white rounded-full opacity-0 group-hover:opacity-100 transition-opacity hover:bg-destructive shadow-sm z-20 cursor-pointer","aria-label":"Remove image",children:(0,l.jsx)(g.A,{className:"w-3.5 h-3.5"})})]})}let E=(0,b.memo)(function({id:e,data:t,selected:r}){let x=(0,a.kp)(e=>e.updateNodeData),g=(0,a.kp)(e=>e.deleteNodeWithChildren),k=(0,a.kp)(e=>e.nodeDefinitions),E=(0,a.kp)(e=>
1e.workspaceId),D=(0,u.n_)(m.FH.assets.index.deleteAssetsByNodeId),[R,G]=(0,b.useState)(!1),[A,S]=(0,b.useState)(!1),[$,_]=(0,b.useState)(!1),[L,O]=(0,b.useState)(0),[B,M]=(0,b.useState)(!1),z=(0,b.useMemo)(()=>k?.find(e=>e.nodeName===C),[k]),T=(0,b.useMemo)(()=>z?.color||h.Je,[z?.color]),F=(0,b.useMemo)(()=>Array.isArray(t.images)?t.images.filter(e=>"string"==typeof e&&e.length>0):[],[t.images]),P=(0,b.useCallback)(t=>{x(e,{images:[...F,...t].slice(0,10),status:"idle"})},[F,e,x]),Y=(0,b.useCallback)(t=>{x(e,{images:[...F,...t].slice(0,10),status:"idle"}),M(!1),f.o.success(`Imported ${t.length} image(s)`,{duration:5e3})},[F,e,x]),H=(0,b.useCallback)(async t=>{let r=F.filter((e,r)=>r!==t),l=await D({nodeId:e});(0,d.F)(l),x(e,{images:r,status:"idle"})},[F,e,x,D]),q=(0,b.useCallback)(()=>G(!0),[]),K=(0,b.useCallback)(async()=>{try{let t=await D({nodeId:e});(0,d.F)(t),g(e),G(!1),f.o.success("Node and its images were deleted",{duration:5e3})}catch(t){f.o.error("Error",{description:"Deleted node, but failed to clean up some images.",duration:1e4,action:{label:"Close",onClick:()=>{}}}),g(e),G(!1)}},[D,g,e]),U=Math.max(10-F.length,0),V=F.length>0,J=(0,j.FR)((0,j.MS)(j.AN,{activationConstraint:{distance:6}})),W=(0,b.useCallback)(t=>{let{active:r,over:l}=t;if(!l||r.id===l.id)return;let s=F.indexOf(String(r.id)),a=F.indexOf(String(l.id));-1===s||-1===a||x(e,{images:(0,w.be)(F,s,a),status:"idle"})},[F,e,x]);return(0,l.jsxs)(y.Y,{title:z?.label||"Reference Gallery",nodeId:e,selected:r,connectable:!0,nodeType:C,nodeLabel:t.label||z?.label||"Reference Gallery",sidebarTrigger:"reference-gallery",handleRight:!0,handleLeft:!1,modelAI:"",onDelete:q,cost:0,colorNode:T,children:[(0,l.jsxs)("div",{className:"flex flex-col gap-2 mt-2",children:[(0,l.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,l.jsxs)("span",{className:"text-xs font-semibold text-muted-foreground px-1",children:["Gallery (",F.length,"/",10,")"]}),(0,l.jsxs)("div",{className:(0,c.cn)("flex gap-2",V?"flex-row items-center":"flex-col mb-4"),children:[(0,l.jsx)("div",{className:(0,c.cn)(V&&U>0?"flex-1":"w-full"),children:(0,l.jsx)(v.I,{nodeId:e,currentImageCount:F.length,maxImages:10,multiple:!0,mediaType:"image",onUploadComplete:P})}),U>0&&E&&(0,l.jsxs)(n.$,{variant:"outline",className:(0,c.cn)("h-9 px-3 text-xs font-medium shadow-sm border-dashed transition-colors",V?"flex-1":"w-full"),onClick:()=>M(!0),children:[(0,l.jsx)(p.A,{className:"w-3.5 h-3.5 mr-1.5"}),"Browse Library"]})]})]}),V&&(0,l.jsx)("div",{className:"mt-1 pb-4",children:(0,l.jsx)("div",{className:(0,c.cn)("grid gap-2",1===F.length?"grid-cols-1":"grid-cols-2"),children:F.slice(0,4).map((e,t)=>{let r=F.length-4;return(0,l.jsxs)("div",{className:(0,c.cn)("relative group rounded-md border border-border/80 bg-black overflow-hidden cursor-pointer hover:opacity-90 transition-transform active:scale-[0.98]",1===F.length?"aspect-video":"aspect-square"),onClick:()=>S(!0),children:[(0,l.jsx)("img",{src:(0,c.VG)(e,"thumbnail"),className:"absolute inset-0 w-full h-full object-cover object-top",alt:`Gallery preview ${t+1}`}),3===t&&r>0&&(0,l.jsxs)("div",{className:"absolute inset-0 z-10 flex items-center justify-center bg-black/60 text-lg font-semibold text-white backdrop-blur-[2px]",children:["+",r]})]},`${e}-${t}`)})})})]}),(0,l.jsxs)(s.K,{isOpen:A,onClose:S,title:"Manage Gallery",subtitle:`${F.length} of 10 images uploaded.`,className:"max-w-3xl sm:max-w-3xl",children:[(0,l.jsx)("div",{className:"flex-1 p-6 pt-2",children:0===F.length?(0,l.jsx)("div",{className:"text-center text-muted-foreground mt-10 mb-10",children:"No images in this gallery."}):(0,l.jsx)(j.Mp,{sensors:J,collisionDetection:j.fp,onDragEnd:W,children:(0,l.jsx)("div",{className:"grid grid-cols-3 sm:grid-cols-4 md:grid-cols-5 gap-3",children:(0,l.jsx)(w.gB,{items:F,strategy:w.kL,children:F.map((e,t)=>(0,l.jsx)(I,{url:e,index:t,onRemove:H,onPreview:e=>{O(e),_(!0)}},e))})})})}),(0,l.jsxs)("div",{className:"flex flex-col-reverse sm:flex-row sm:justify-between items-center border-t border-zinc-200 dark:border-zinc-800 p-6",children:[(0,l.jsx)("span",{className:"text-xs text-muted-foreground mt-4 sm:mt-0 font-medium select-none",children:"Drag to reorder. Hover over an image to remove it."}),(0,l.jsx)(n.$,{onClick:()=>S(!1),children:"Done"})]})]}),(0,l.jsx)(i.ji,{isOpen:$,onClose:()=>_(!1),images:F,alt:t.label||"Gallery image",initialIndex:L}),B&&E&&(0,l.jsx)(N.U,{isOpen:B,onClose:()=>M(!1),onImport:Y,maxAllowed:U,workspaceId:E}),(0,l.jsx)(o.a,{isDeleteOpen:R,setIsDeleteOpen:G,label:t.label||"Reference Gallery",handleConfirmDelete:K})]})})},69029:(e,t,r)=>{r.d(t,{y:()=>m});var l=r(68987),s=r(49405),a=r(93210),o=r(23431),i=r(2315),n=r(33361),d=r(71503);let c={borderTop:"border-t-primary",text:"text-primary",iconBg:"bg-primary/10",handle:"bg-primary",shadow:"shadow-primary/25",highlight:"shadow-primary/20 ring-1 ring-primary border-primary",button:"bg-primary text-primary-foreground hover:bg-primary/90",hex:"hsl(var(--primary))"};
1function m({title:e,subtitle:t,icon:r,color:u,onClose:x,children:g,className:p}){let[b,f]=(0,i.useState)(!1),h=(0,n.kp)(e=>e.selectedNodeId&&e.nodesById[e.selectedNodeId]?.type||""),v=(0,n.kp)(e=>e.nodeDefinitionsByNodeName[h]);d.m.includes(h);let N="object"==typeof u&&null!==u?u:v?.color||c;return(0,l.jsxs)("aside",{className:(0,a.cn)(b?"animate-out slide-out-to-right duration-250 ease-in fill-mode-forwards":"animate-in slide-in-from-right duration-300 ease-out","z-50 flex flex-col bg-background/95 shadow-2xl backdrop-blur-xl border-border/70","fixed inset-x-0 bottom-0 top-[4.5rem] w-full rounded-t-3xl border-t-2 border-x-0 border-b-0","md:absolute md:left-auto md:right-0 md:top-18 md:bottom-2 md:w-sm md:rounded-none md:rounded-l-2xl md:border-y-2 md:border-l-2 md:border-r-0",p),style:{borderColor:N.hex},children:[(0,l.jsx)("div",{className:"w-full flex justify-center pt-3 pb-1 md:hidden shrink-0",children:(0,l.jsx)("div",{className:"h-1.5 w-12 rounded-full bg-border/60"})}),(0,l.jsxs)("div",{className:"flex items-center justify-between shrink-0 border-b border-border/50 px-4 pb-4 pt-2 md:pt-4",children:[(0,l.jsxs)("div",{className:"flex items-center gap-3 w-full",children:[r&&(0,l.jsx)("div",{className:(0,a.cn)("flex items-center justify-center p-2 rounded-lg shadow-sm ring-1 ring-border/40",N.iconBg,N.text),children:(0,l.jsx)(r,{className:"w-4 h-4"})}),(0,l.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,l.jsx)("span",{className:"font-semibold text-sm text-foreground/95 select-none",children:e}),(0,l.jsx)("span",{className:"text-[10px] text-muted-foreground/90 font-normal",children:t||"Settings"})]})]}),(0,l.jsx)(s.$,{type:"button",size:"icon",variant:"ghost",className:"h-8 w-8 md:h-7 md:w-7 rounded-lg shrink-0 ml-2 text-muted-foreground hover:text-foreground hover:bg-muted",onClick:()=>{b||(f(!0),setTimeout(()=>{x()},250))},children:(0,l.jsx)(o.A,{className:"h-4 w-4 md:h-4 md:w-4"})})]}),(0,l.jsx)("div",{className:"flex-1 overflow-y-auto space-y-4 p-4 pb-[calc(env(safe-area-inset-bottom)+2rem)] scrollbar-thin",children:g})]})}},76843:(e,t,r)=>{r.d(t,{p:()=>a});var l=r(68987);r(2315);var s=r(93210);function a({className:e,type:t,icon:r,...o}){return(0,l.jsxs)("div",{className:"relative flex w-full items-center",children:[r&&(0,l.jsx)("div",{className:"absolute left-3 flex items-center justify-center pointer-events-none text-muted-foreground",children:r}),(0,l.jsx)("input",{type:t,"data-slot":"input",className:(0,s.cn)("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",r&&"pl-9",e),...o})]})}}}]);

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.