PageSourceSearch

https://www.tulipcrm.com/_next/static/chunks/4511.bc524aeeb3e801d4.js

js tulipcrm.com collected 2026-10-09 23:28:00 UTC 11,852 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4511],{20120:(e,t,a)=>{a.d(t,{$v:()=>f,EO:()=>m,Lt:()=>i,Rx:()=>g,Zr:()=>p,ck:()=>x,r7:()=>h,tv:()=>o,wd:()=>u});var s=a(95155);a(12115);var r=a(52498),n=a(25016),l=a(97003);function i(e){let{...t}=e;return(0,s.jsx)(r.bL,{"data-slot":"alert-dialog",...t})}function o(e){let{...t}=e;return(0,s.jsx)(r.l9,{"data-slot":"alert-dialog-trigger",...t})}function d(e){let{...t}=e;return(0,s.jsx)(r.ZL,{"data-slot":"alert-dialog-portal",...t})}function c(e){let{className:t,...a}=e;return(0,s.jsx)(r.hJ,{"data-slot":"alert-dialog-overlay",className:(0,n.cn)("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),...a})}function m(e){let{className:t,...a}=e;return(0,s.jsxs)(d,{children:[(0,s.jsx)(c,{}),(0,s.jsx)(r.UC,{"data-slot":"alert-dialog-content",className:(0,n.cn)("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",t),...a})]})}function u(e){let{className:t,...a}=e;return(0,s.jsx)("div",{"data-slot":"alert-dialog-header",className:(0,n.cn)("flex flex-col gap-2 text-center sm:text-left",t),...a})}function x(e){let{className:t,...a}=e;return(0,s.jsx)("div",{"data-slot":"alert-dialog-footer",className:(0,n.cn)("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),...a})}function h(e){let{className:t,...a}=e;return(0,s.jsx)(r.hE,{"data-slot":"alert-dialog-title",className:(0,n.cn)("text-lg font-semibold",t),...a})}function f(e){let{className:t,...a}=e;return(0,s.jsx)(r.VY,{"data-slot":"alert-dialog-description",className:(0,n.cn)("text-muted-foreground text-sm",t),...a})}function g(e){let{className:t,...a}=e;return(0,s.jsx)(r.rc,{className:(0,n.cn)((0,l.r)(),t),...a})}function p(e){let{className:t,...a}=e;return(0,s.jsx)(r.ZD,{className:(0,n.cn)((0,l.r)({variant:"outline"}),t),...a})}},37772:(e,t,a)=>{a.d(t,{A:()=>s});let s=(0,a(71847).A)("Ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]])},52498:(e,t,a)=>{a.d(t,{rc:()=>_,ZD:()=>U,UC:()=>F,VY:()=>z,hJ:()=>O,ZL:()=>L,bL:()=>S,hE:()=>Z,l9:()=>I});var s=a(12115),r=a(3468),n=a(94446),l=a(93409),i=a(92556),o=a(95155),d=Symbol("radix.slottable"),c="AlertDialog",[m,u]=(0,r.A)(c,[l.Hs]),x=(0,l.Hs)(),h=e=>{let{__scopeAlertDialog:t,...a}=e,s=x(t);return(0,o.jsx)(l.bL,{...s,...a,modal:!0})};h.displayName=c;var f=s.forwardRef((e,t)=>{let{__scopeAlertDialog:a,...s}=e,r=x(a);return(0,o.jsx)(l.l9,{...r,...s,ref:t})});f.displayName="AlertDialogTrigger";var g=e=>{let{__scopeAlertDialog:t,...a}=e,s=x(t);return(0,o.jsx)(l.ZL,{...s,...a})};g.displayName="AlertDialogPortal";var p=s.forwardRef((e,t)=>{let{__scopeAlertDialog:a,...s}=e,r=x(a);return(0,o.jsx)(l.hJ,{...r,...s,ref:t})});p.displayName="AlertDialogOverlay";var b="AlertDialogContent",[y,j]=m(b),v=function(e){let t=({children:e})=>(0,o.jsx)(o.Fragment,{children:e});return t.displayName=`${e}.Slottable`,t.__radixId=d,t}("AlertDialogContent"),N=s.forwardRef((e,t)=>{let{__scopeAlertDialog:a,children:r,...d}=e,c=x(a),m=s.useRef(null),u=(0,n.s)(t,m),h=s.useRef(null);return(0,o.jsx)(l.G$,{contentName:b,titleName:w,docsSlug:"alert-dialog",children:(0,o.jsx)(y,{scope:a,cancelRef:h,children:(0,o.jsxs)(l.UC,{role:"alertdialog",...c,...d,ref:u,onOpenAutoFocus:(0,i.mK)(d.onOpenAutoFocus,e=>{var t;e.preventDefault(),null==(t=h.current)||t.focus({preventScroll:!0})}),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:[(0,o.jsx)(v,{children:r}),(0,o.jsx)(E,{contentRef:m})]})})})});N.displayName=b;var w="AlertDialogTitle",k=s.forwardRef((e,t)=>{let{__scopeAlertDialog:a,...s}=e,r=x(a);return(0,o.jsx)(l.hE,{...r,...s,ref:t})});k.displayName=w;var A="AlertDialogDescription",D=s.forwardRef((e,t)=>
1{let{__scopeAlertDialog:a,...s}=e,r=x(a);return(0,o.jsx)(l.VY,{...r,...s,ref:t})});D.displayName=A;var C=s.forwardRef((e,t)=>{let{__scopeAlertDialog:a,...s}=e,r=x(a);return(0,o.jsx)(l.bm,{...r,...s,ref:t})});C.displayName="AlertDialogAction";var R="AlertDialogCancel",T=s.forwardRef((e,t)=>{let{__scopeAlertDialog:a,...s}=e,{cancelRef:r}=j(R,a),i=x(a),d=(0,n.s)(t,r);return(0,o.jsx)(l.bm,{...i,...s,ref:d})});T.displayName=R;var E=e=>{let{contentRef:t}=e,a="`".concat(b,"` requires a description for the component to be accessible for screen reader users.\n\nYou can add a description to the `").concat(b,"` by passing a `").concat(A,"` component as a child, which also benefits sighted users by adding visible context to the dialog.\n\nAlternatively, you can use your own component as a description by assigning it an `id` and passing the same value to the `aria-describedby` prop in `").concat(b,"`. If the description is confusing or duplicative for sighted users, you can use the `@radix-ui/react-visually-hidden` primitive as a wrapper around your description component.\n\nFor more information, see https://radix-ui.com/primitives/docs/components/alert-dialog");return s.useEffect(()=>{var e;document.getElementById(null==(e=t.current)?void 0:e.getAttribute("aria-describedby"))||console.warn(a)},[a,t]),null},S=h,I=f,L=g,O=p,F=N,_=C,U=T,Z=k,z=D},67723:(e,t,a)=>{a.r(t),a.d(t,{default:()=>m});var s=a(95155),r=a(12115),n=a(91169),l=a(71360),i=a(77303),o=a(20120),d=a(54679),c=a(27716);function m(e){let{stage:t,stageUsersMap:a,apiBaseUrl:m,selectedType:u,host:x,loading:h,onUsersUpdated:f,buildAddUserRequest:g,buildDeleteUserRequest:p}=e,[b,y]=(0,r.useState)(null),[j,v]=(0,r.useState)(!1),[N,w]=(0,r.useState)(""),k=a[t.id]||[],A=(t.tasks||[]).filter(e=>e.name),D=k.reduce((e,t)=>{var a;return e+((null==(a=t.members)?void 0:a.length)||0)},0),C=async(e,a,s)=>{if((t.tasks||[]).filter(e=>e.name===s).some(t=>{var a;return null==(a=(t.assignedTo||"").split(",")[0])?void 0:a.trim().startsWith("".concat(e,"-"))}))return void i.oR.error("".concat(a||"This user"," is the primary assignee for ").concat(s,". Reassign the task before deleting this user."),{duration:5e3});y("".concat(s,":").concat(e));try{let r={url:"".concat(m,"/lead/").concat(u,"/stage/").concat(t.id,"/user/").concat(e),method:"DELETE",body:{taskName:s}},n=p?p({userId:e,taskName:s}):r,l=await fetch(n.url,{method:n.method,headers:{"Content-Type":"application/json","X-Tenant":null!=x?x:""},credentials:"include",...n.body?{body:JSON.stringify(n.body)}:{}});if(!l.ok){let e=await l.json().catch(()=>({}));throw Error(e.error||"Failed to delete user")}i.oR.success("".concat(a||"Agent"," deleted successfully")),f(t.id)}catch(e){console.error("Failed to delete team member:",e),i.oR.error((null==e?void 0:e.message)||"Failed to delete team member")}finally{y(null)}};return(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{className:"flex justify-between items-center",children:[(0,s.jsx)("h4",{className:"text-sm font-semibold text-gray-900",children:"Team Members"}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsxs)("span",{className:"text-xs bg-gray-100 px-2.5 py-1 rounded-full text-gray-600",children:[D," assignment",1!==D?"s":""]}),(0,s.jsxs)("button",{onClick:()=>
1{if(0===A.length)return void i.oR.error("Create a task in Scheduling before adding a team member");v(!0)},disabled:h,className:"flex items-center gap-1.5 text-xs font-medium px-3 py-1.5 rounded-lg bg-blue-600 text-white hover:bg-blue-700 transition-colors",children:[(0,s.jsx)(n.A,{className:"h-3.5 w-3.5"}),"Add User"]})]})]}),0===A.length&&(0,s.jsx)("div",{className:"rounded-lg border border-amber-200 bg-amber-50 px-4 py-3 text-sm text-amber-800",children:"Create a task in the Scheduling tab first. Team members can be assigned only to an existing task."}),(0,s.jsx)(d.lG,{open:j,onOpenChange:v,children:(0,s.jsxs)(d.Cf,{children:[(0,s.jsxs)(d.c7,{children:[(0,s.jsx)(d.L3,{children:"Add team member to a task"}),(0,s.jsx)(d.rr,{children:"Select the task first, then choose the team member."})]}),(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("label",{htmlFor:"users-tab-task-".concat(t.id),className:"text-sm font-medium text-gray-700",children:"Task"}),(0,s.jsxs)("select",{id:"users-tab-task-".concat(t.id),value:N,onChange:e=>w(e.target.value),className:"w-full rounded-md border border-gray-300 px-3 py-2 text-sm",children:[(0,s.jsx)("option",{value:"",children:"Select a task"}),A.map(e=>(0,s.jsx)("option",{value:e.name,children:e.name},e.id))]})]}),N&&(0,s.jsx)(c.t,{fieldId:"users-tab-agent-".concat(t.id),value:"",onSelectAgent:async(e,a)=>{let s="object"==typeof a?a.name:a,r=A.find(e=>e.name===N),n=k.find(e=>e.taskName===N);if(r){if(null==n?void 0:n.members.some(t=>t.userId===e))return void i.oR.error("".concat(s," is already assigned to this task"));try{let a={url:"".concat(m,"/lead/").concat(u,"/stage/").concat(t.id,"/user"),method:"POST",body:{userId:e,name:s,taskName:N,taskId:r.id}},n=g?g({userId:e,name:s,taskName:N,taskId:r.id}):a;if(!(await fetch(n.url,{method:n.method,headers:{"Content-Type":"application/json","X-Tenant":null!=x?x:""},credentials:"include",body:JSON.stringify(n.body)})).ok)throw Error("Failed to add user");i.oR.success("".concat(s," assigned to ").concat(N)),v(!1),w(""),f(t.id)}catch(e){i.oR.error("Failed to add team member")}}},isDisabled:h,label:"Team member"})]})]})}),(0,s.jsx)("div",{className:"border rounded-lg bg-white overflow-hidden",children:k.length>0?(0,s.jsx)("div",{className:"divide-y",children:k.map(e=>(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"bg-gray-50 px-4 py-2 text-xs font-semibold uppercase tracking-wide text-gray-500",children:e.taskName||"Unassigned task"}),e.members.map(a=>{let r=b==="".concat(e.taskName,":").concat(a.userId);return(0,s.jsxs)("div",{className:"group p-4 flex items-center gap-3 hover:bg-gray-50 transition-colors",children:[(0,s.jsx)("div",{className:"h-10 w-10 rounded-full bg-gradient-to-br from-blue-500 to-indigo-600 flex items-center justify-center text-white font-medium shadow-sm",children:a.name?a.name.split(" ").map(e=>e[0]).join("").toUpperCase():"?"}),(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsx)("div",{className:"font-medium text-gray-900 truncate",children:a.name||"Unknown Agent"}),(0,s.jsxs)("div",{className:"text-xs text-gray-500",children:["ID: ",a.userId]})]}),(0,s.jsxs)(o.Lt,{children:[(0,s.jsx)(o.tv,{asChild:!0,children:(0,s.jsx)("button",{title:"Delete from stage","aria-label":"Delete ".concat(a.name||"agent"," from ").concat(t.name),"data-feature-id":"action__delete__stage-user",disabled:r,className:"text-red-500 hover:text-red-700 hover:bg-red-50 p-2 rounded-md",children:(0,s.jsx)(l.A,{className:"h-4 w-4"})})}),(0,s.jsxs)(o.EO,{children:[(0,s.jsxs)(o.wd,{children:[(0,s.jsx)(o.r7,{children:"Delete Team Member"}),(0,s.jsxs)(o.$v,{children:['Are you sure you want to delete "',a.name||"this agent",'" from'," ",t.name,"? This action cannot be undone."]})]}),(0,s.jsxs)(o.ck,{children:[(0,s.jsx)(o.Zr,{children:"Cancel"}),(0,s.jsx)(o.Rx,{onClick:()=>C(a.userId,a.name,e.taskName),children:"Delete"})]})]})]})]},a.id)})]},e.taskName))}):(0,s.jsxs)("div",{className:"p-12 text-center",children:[(0,s.jsx)(n.A,{className:"h-12 w-12 mx-auto text-gray-300 mb-4"}),(0,s.jsx)("p",{className:"text-gray-500 font-medium",children:"No agents assigned yet"}),(0,s.jsx)("p",{className:"text-sm text-gray-400 mt-1",children:"Click Add User to assign team members"})]})})]})}},90368:(e,t,a)=>{a.d(t,{A:()=>s});let s=(0,a(71847).A)("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]])}}]);

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.