PageSourceSearch

https://xyrus.ai/_next/static/chunks/1953.2a5c10957dd65290.js

js xyrus.ai collected 2026-10-05 15:09:07 UTC 27,153 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1953,8923],{47523:function(e,t,n){var a,i,r;!function(o,s){"use strict";e.exports?e.exports=s(n(21001)):(i=[n(21001)],void 0===(r="function"==typeof(a=s)?a.apply(t,i):a)||(e.exports=r))}(0,function(e){"use strict";void 0===e.version&&e.default&&(e=e.default);var t,n,a={},i={},r={},o={},s={};e&&"string"==typeof e.version||A("Moment Timezone requires Moment.js. See https://momentjs.com/timezone/docs/#/use-it/browser/");var l=e.version.split("."),d=+l[0],c=+l[1];function u(e){return e>96?e-87:e>64?e-29:e-48}function m(e){var t,n=0,a=e.split("."),i=a[0],r=a[1]||"",o=1,s=0,l=1;for(45===e.charCodeAt(0)&&(n=1,l=-1);n<i.length;n++)s=60*s+(t=u(i.charCodeAt(n)));for(n=0;n<r.length;n++)o/=60,s+=(t=u(r.charCodeAt(n)))*o;return s*l}function f(e){for(var t=0;t<e.length;t++)e[t]=m(e[t])}function _(e,t){var n,a=[];for(n=0;n<t.length;n++)a[n]=e[t[n]];return a}function p(e){var t=e.split("|"),n=t[2].split(" "),a=t[3].split(""),i=t[4].split(" ");f(n),f(a),f(i);for(var r=a.length,o=0;o<r;o++)i[o]=Math.round((i[o-1]||0)+6e4*i[o]);return i[r-1]=1/0,{name:t[0],abbrs:_(t[1].split(" "),a),offsets:_(n,a),untils:i,population:0|t[5]}}function h(e){e&&this._set(p(e))}function v(e,t){this.name=e,this.zones=t}function g(e){var t=e.toTimeString(),n=t.match(/\([a-z ]+\)/i);"GMT"===(n=n&&n[0]?(n=n[0].match(/[A-Z]/g))?n.join(""):void 0:(n=t.match(/[A-Z]{3,5}/g))?n[0]:void 0)&&(n=void 0),this.at=+e,this.abbr=n,this.offset=e.getTimezoneOffset()}function y(e){this.zone=e,this.offsetScore=0,this.abbrScore=0}function b(e,t){return e.offsetScore!==t.offsetScore?e.offsetScore-t.offsetScore:e.abbrScore!==t.abbrScore?e.abbrScore-t.abbrScore:e.zone.population!==t.zone.population?t.zone.population-e.zone.population:t.zone.name.localeCompare(e.zone.name)}function S(e){return(e||"").toLowerCase().replace(/\//g,"_")}function T(e){var t,n,i,r;for("string"==typeof e&&(e=[e]),t=0;t<e.length;t++)a[r=S(n=(i=e[t].split("|"))[0])]=e[t],o[r]=n,function(e,t){var n,a;for(f(t),n=0;n<t.length;n++)s[a=t[n]]=s[a]||{},s[a][e]=!0}(r,i[2].split(" "))}function C(e,t){var n,r=a[e=S(e)];return r instanceof h?r:"string"==typeof r?(r=new h(r),a[e]=r,r):i[e]&&t!==C&&(n=C(i[e],C))?((r=a[e]=new h)._set(n),r.name=o[e],r):null}function E(e){var t,n,a,r;for("string"==typeof e&&(e=[e]),t=0;t<e.length;t++)a=S((n=e[t].split("|"))[0]),r=S(n[1]),i[a]=r,o[a]=n[0],i[r]=a,o[r]=n[1]}function z(e){return z.didShowError||(z.didShowError=!0,A("moment.tz.zoneExists('"+e+"') has been deprecated in favor of !moment.tz.zone('"+e+"')")),!!C(e)}function w(e){var t="X"===e._f||"x"===e._f;return!!(e._a&&void 0===e._tzm&&!t)}function A(e){"undefined"!=typeof console&&"function"==typeof console.error&&console.error(e)}function O(t){var n,a=Array.prototype.slice.call(arguments,0,-1),i=arguments[arguments.length-1],r=e.utc.apply(null,a);return!e.isMoment(t)&&w(r)&&(n=C(i))&&r.add(n.parse(r),"minutes"),r.tz(i),r}(d<2||2===d&&c<6)&&A("Moment Timezone requires Moment.js >= 2.6.0. You are using Moment.js "+e.version+". See momentjs.com"),h.prototype={_set:function(e){this.name=e.name,this.abbrs=e.abbrs,this.untils=e.untils,this.offsets=e.offsets,this.population=e.population},_index:function(e){var t;if((t=function(e,t){var n,a=t.length;if(e<t[0])return 0;if(a>1&&t[a-1]===1/0&&e>=t[a-2])return a-1;if(e>=t[a-1])return -1;for(var i=0,r=a-1;r-i>1;)t[n=Math.floor((i+r)/2)]<=e?i=n:r=n;return r}(+e,this.untils))>=0)return t},countries:function(){var e=this.name;return Object.keys(r).filter(function(t){return -1!==r[t].zones.indexOf(e)})},parse:function(e){var t,n,a,i,r=+e,o=this.offsets,s=this.untils,l=s.length-1;for(i=0;i<l;i++)if(t=o[i],n=o[i+1],a=o[i?i-1:i],t<n&&O.moveAmbiguousForward?t=n:t>a&&O.moveInvalidForward&&(t=a),r<s[i]-6e4*t)return o[i];return o[l]},abbr:function(e){return this.abbrs[this._index(e)]},offset:function(e){return A("zone.offset has been deprecated in favor of zone.utcOffset"),this.offsets[this._index(e)]},utcOffset:function(e){return this.offsets[this._index(e)]}},y.prototype.scoreOffsetAt=function(e){this.offsetScore+=Math.abs(this.zone.utcOffset(e.at)-e.offset),this.zone.abbr(e.at).replace(/[^A-Z]/g,"")!==e.abbr&&this.abbrScore++},O.version="0.6.0",O.dataVersion="",O._zones=a,O._links=i,O._names=o,O._countries=r,O.add=T,O.link=E,O.load=function(e){T(e.zone
1s),E(e.links),function(e){var t,n,a,i;if(e&&e.length)for(t=0;t<e.length;t++)n=(i=e[t].split("|"))[0].toUpperCase(),a=i[1].split(" "),r[n]=new v(n,a)}(e.countries),O.dataVersion=e.version},O.zone=C,O.zoneExists=z,O.guess=function(e){return(!n||e)&&(n=function(){try{var e=Intl.DateTimeFormat().resolvedOptions().timeZone;if(e&&e.length>3){var t=o[S(e)];if(t)return t;A("Moment Timezone found "+e+" from the Intl api, but did not have that data loaded.")}}catch(e){}var n,a,i,r=function(){var e,t,n,a,i=new Date().getFullYear()-2,r=new g(new Date(i,0,1)),o=r.offset,s=[r];for(a=1;a<48;a++)(n=new Date(i,a,1).getTimezoneOffset())!==o&&(s.push(e=function(e,t){for(var n,a;a=((t.at-e.at)/12e4|0)*6e4;)(n=new g(new Date(e.at+a))).offset===e.offset?e=n:t=n;return e}(r,t=new g(new Date(i,a,1)))),s.push(new g(new Date(e.at+6e4))),r=t,o=n);for(a=0;a<4;a++)s.push(new g(new Date(i+a,0,1))),s.push(new g(new Date(i+a,6,1)));return s}(),l=r.length,d=function(e){var t,n,a,i,r=e.length,l={},d=[],c={};for(t=0;t<r;t++)if(a=e[t].offset,!c.hasOwnProperty(a)){for(n in i=s[a]||{})i.hasOwnProperty(n)&&(l[n]=!0);c[a]=!0}for(t in l)l.hasOwnProperty(t)&&d.push(o[t]);return d}(r),c=[];for(a=0;a<d.length;a++){for(i=0,n=new y(C(d[a]),l);i<l;i++)n.scoreOffsetAt(r[i]);c.push(n)}return c.sort(b),c.length>0?c[0].zone.name:void 0}()),n},O.names=function(){var e,t=[];for(e in o)o.hasOwnProperty(e)&&(a[e]||a[i[e]])&&o[e]&&t.push(o[e]);return t.sort()},O.Zone=h,O.unpack=p,O.unpackBase60=m,O.needsOffset=w,O.moveInvalidForward=!0,O.moveAmbiguousForward=!1,O.countries=function(){return Object.keys(r)},O.zonesForCountry=function(e,t){if(!(e=r[e.toUpperCase()]||null))return null;var n=e.zones.sort();return t?n.map(function(e){var t=C(e);return{name:e,offset:t.utcOffset(new Date)}}):n};var D=e.fn;function M(e){return function(){return this._z?this._z.abbr(this):e.call(this)}}function I(e){return function(){return this._z=null,e.apply(this,arguments)}}e.tz=O,e.defaultZone=null,e.updateOffset=function(t,n){var a,i=e.defaultZone;if(void 0===t._z&&(i&&w(t)&&!t._isUTC&&t.isValid()&&(t._d=e.utc(t._a)._d,t.utc().add(i.parse(t),"minutes")),t._z=i),t._z)if(16>Math.abs(a=t._z.utcOffset(t))&&(a/=60),void 0!==t.utcOffset){var r=t._z;t.utcOffset(-a,n),t._z=r}else t.zone(a,n)},D.tz=function(t,n){if(t){if("string"!=typeof t)throw Error("Time zone name must be a string, got "+t+" ["+typeof t+"]");return this._z=C(t),this._z?e.updateOffset(this,n):A("Moment Timezone has no data for "+t+". See http://momentjs.com/timezone/docs/#/data-loading/."),this}if(this._z)return this._z.name},D.zoneName=M(D.zoneName),D.zoneAbbr=M(D.zoneAbbr),D.utc=I(D.utc),D.local=I(D.local),t=D.utcOffset,D.utcOffset=function(){return arguments.length>0&&(this._z=null),t.apply(this,arguments)},e.tz.setDefault=function(t){return(d<2||2===d&&c<9)&&A("Moment Timezone setDefault() requires Moment.js >= 2.9.0. You are using Moment.js "+e.version+"."),e.defaultZone=t?C(t):null,e};var N=e.momentProperties;return"[object Array]"===Object.prototype.toString.call(N)?(N.push("_z"),N.push("_a")):N&&(N._z=null),e})},78923:(e,t,n)=>{"use strict";n.d(t,{FJ:()=>s,QG:()=>r,yn:()=>o});var a=n(80587),i=n.n(a);let r=()=>i().tz.names().filter(e=>!e.startsWith("Etc/")&&!e.includes("GMT+")&&!e.includes("GMT-")).map(e=>({label:"".concat(e.replace(/_/g," ")," (").concat(i().tz(e).format("Z"),")"),value:e})),o=()=>["America/New_York","America/Chicago","America/Denver","America/Los_Angeles","America/Toronto","America/Vancouver","Europe/London","Europe/Paris","Europe/Berlin","Europe/Rome","Europe/Madrid","Asia/Dubai","Asia/Kolkata","Asia/Singapore","Asia/Tokyo","Asia/Hong_Kong","Asia/Shanghai","Australia/Sydney","Australia/Melbourne","Pacific/Auckland"].map(e=>({label:"".concat(e.replace(/_/g," ")," (").concat(i().tz(e).format("Z"),")"),value:e})),s=()=>i().tz.guess()},80587:(e,t,n)=>{(e.exports=n(47523)).tz.load(n(86644))},91837:(e,t,n)=>{"use strict";n.d(t,{Y:()=>p});var a=n(12115),i=n(94054),r=n(18720),o=n(75358),s=n(99429),l=n(75557),d=n(41180),c=n(9143),u=n(80587),m=n.n(u),f=n(78923);function _(e,t,n){if(t){let a=null!=e?e:new Date;return m().tz({year:a.getFullYear(),month:a.getMonth(),date:a.getDate(),hour:t.getHours(),minute:t.getMinutes(),second:t.getSeconds(),millisecond:t.getMilliseconds()},n).toISOString()}if(e)return e.toISOString()}let p=e=>{let[t,n]=(0,a.useState)(void 0),[u,m]=(0,a.useState)(""),[p,h]=(0,a.useState)(""),[v,g]=(0,a.useState)(!1),[y,b]=(0,a.useState)([]),[S,T]=(0,a.useState)(!0),[C,E]=(0,a.useState)([]),[z,w]=(0,a.useState)(1),[A,O]=(0,a.useState)(1),[D,M]=(0,a.useState)(!1),[I,N]=(0,a.useState)(""),[x,j]=(0,a.useState)(!1),[R,P]=(0,a.useState)(null),[F,k]=(0,a.useState)({}),[L,V]=(0,a.useState)("events"),[J,K]=(0,a.useState)(!1),[B,Z]=(0,a.useState)(!1),[H,U]=(0,a.useState)({}),[W,Y]=(0,a.useState)({}),[q,G]=(0,a.useState)({}),[X,Q]=(0,a.useState)({}),[$,ee]=(0,a.useState)({}),[et,en]=(0,a.useState)(null),[ea,ei]=(0,a.useState)(null),[er,eo]=(0,a.useState)(null),[es,el]=(0,a.useState)(null),[ed,ec]=(0,a.useState)(!1),[eu,em]=(0,a.useState)({type:"",date:null,startTime:null,endTime:null,timezone:"",mode_of_interaction:"",person:"",selected_member_id:"",selected_member_type:"",description:"",client_member_name:""}),[ef,e_]=(0,a.useState)({title:"",content:""}),ep=(0,a.useMemo)(()=>
1{if(eu.startTime instanceof Date&&!isNaN(eu.startTime.getTime())&&eu.endTime instanceof Date&&!isNaN(eu.endTime.getTime())){let e=60*eu.startTime.getHours()+eu.startTime.getMinutes();return 60*eu.endTime.getHours()+eu.endTime.getMinutes()<=e}return!1},[eu.startTime,eu.endTime]),eh=(0,a.useMemo)(()=>{let e=e=>e instanceof Date&&!isNaN(e.getTime());return""!==eu.type.trim()&&e(eu.date)&&e(eu.startTime)&&e(eu.endTime)&&(""!==eu.selected_member_id||""!==eu.person.trim()||""!==eu.client_member_name.trim())&&!ep},[eu.type,eu.date,eu.startTime,eu.endTime,eu.timezone,eu.mode_of_interaction,eu.selected_member_id,eu.person,eu.client_member_name,ep]),ev=(0,c.GV)(e=>{var t;return null==(t=e.userProfile.profileData)?void 0:t.timezone})||(0,f.FJ)(),eg=(0,a.useMemo)(()=>(null==e?void 0:e.profiles)||[],[null==e?void 0:e.profiles]),ey=(0,a.useMemo)(()=>(null==e?void 0:e.selectedId)||void 0,[null==e?void 0:e.selectedId]),eb=(0,a.useMemo)(()=>(null==e?void 0:e.highlightedCandidateId)||void 0,[null==e?void 0:e.highlightedCandidateId]),eS=(0,a.useMemo)(()=>{var t;return null==(t=null==e?void 0:e.hideClientDetails)||t},[null==e?void 0:e.hideClientDetails]),eT=(0,a.useMemo)(()=>(null==e?void 0:e.projectId)||void 0,[null==e?void 0:e.projectId]),eC=(0,a.useMemo)(()=>(null==e?void 0:e.view)||(ey?"detail":"list"),[null==e?void 0:e.view,ey]),eE=null==e?void 0:e.clientContactsData,ez=(null==e?void 0:e.loadingClientContacts)||!1,ew=null==e?void 0:e.getClientContacts,eA=null==e?void 0:e.handleCreateEvent,eO=(null==e?void 0:e.isCreatingEvent)||!1,{data:eD,isLoading:eM,execute:eI}=(0,o.sO)(e=>s.Sn.PROJECT.EVENT_CANDIDATE_LIST(e),{queryKey:e=>["event-members-list",e]}),eN=(0,a.useRef)(!1),ex=(0,a.useRef)(!1),ej=(0,a.useRef)(""),eR=(0,a.useRef)(null);(0,a.useEffect)(()=>{eT&&!eN.current&&ew&&(ew(),eN.current=!0)},[eT]),(0,a.useEffect)(()=>{eT&&(J||et)&&eI(eT)},[eT,J,et]);let{data:eP,isLoading:eF,error:ek,execute:eL}=(0,o.sO)(e=>s.Sn.PROJECT.RECOMMENDATIONS_ALL_NOTES(e.projectId,e.candidateId),{queryKey:["notes"]}),eV=(0,o.L2)({method:"post",url:eT&&ey?s.Sn.PROJECT.RECOMMENDATIONS_ADD_NOTE(ey):""}),eJ=(0,o.L2)({method:"put"}),eK=(0,o.L2)({method:"delete"}),eB=(0,o.L2)({method:"delete"}),eZ=(0,o.L2)({method:"put"}),{data:eH,isLoading:eU,error:eW,execute:eY}=(0,o.sO)(e=>s.Sn.PROJECT.RECOMMENDED_CANDIDATE_EVENT_FETCH(e.candidateId),{queryKey:e=>{var t,n;return["events",e.candidateId,null!=(n=null==(t=e.params)?void 0:t.project_id)?n:null]}}),eq=(0,o.L2)({method:"put"});(0,a.useEffect)(()=>{ex.current||((async()=>{try{T(!0);let t=null==e?void 0:e.getCandidatesPage;if("function"==typeof t){let e=await t(1,10,I||void 0,R);b(e.items||[]),w(1),O(e.totalPages||1)}else if((null==e?void 0:e.fetchCandidates)&&"function"==typeof e.fetchCandidates){let t=await e.fetchCandidates();b(t),w(1),O(1)}}catch(e){console.error("Failed to fetch candidates:",e),r.oR.error("Failed to load candidates list")}finally{T(!1)}})(),ex.current=!0)},[]);let eG=(0,i.d)(I,500);(0,a.useEffect)(()=>{let t=null==e?void 0:e.getCandidatesPage;"function"==typeof t&&ex.current&&ej.current!==eG&&(async()=>{try{j(!0);let e=await t(1,10,eG||void 0,R);b(e.items||[]),w(1),O(e.totalPages||1),ej.current=eG}catch(e){console.error("Failed to fetch candidates with search:",e),r.oR.error("Failed to search candidates")}finally{j(!1)}})()},[eG,R,e]),(0,a.useEffect)(()=>{let t=null==e?void 0:e.getCandidatesPage;"function"==typeof t&&ex.current&&eR.current!==R&&(async()=>{try{j(!0);let e=await t(1,10,eG||void 0,R);b(e.items||[]),w(1),O(e.totalPages||1),eR.current=R}catch(e){console.error("Failed to fetch candidates with sort:",e),r.oR.error("Failed to sort candidates")}finally{j(!1)}})()},[R,eG,e]);let eX=(0,a.useCallback)(async()=>{let t=null==e?void 0:e.getCandidatesPage;if("function"==typeof t&&!D&&!(z>=A)){M(!0);try{let e=z+1,n=await t(e,10,I||void 0,R);b(e=>[...e,...n.items||[]]),w(e),O(n.totalPages||A)}catch(e){console.error("Failed to load more candidates",e)}finally{M(!1)}}},[e,D,z,A,I,R]);(0,a.useEffect)(()=>{if(y.length>0){let e=y.filter(e=>!0===e.added);E(t=>{let n=new Set(e.map(e=>e.id));return[...e,...t.filter(e=>!n.has(e.id))]})}},[y]),(0,a.useEffect)(()=>{let t=null==e?void 0:e.recommendation;t&&(n(t.status||void 0),m(t.name),h(""))},[null==e?void 0:e.recommendation]),(0,a.useEffect)(()=>{let e=setTimeout(()=>{let e=document.querySelector("[data-radix-select-trigger]");e&&e.focus()},100);return()=>clearTimeout(e)},[]);let eQ=(0,a.useMemo)(()=>y.filter(e=>e.added).map(e=>e.id),[y]),e$=(0,a.useMemo)(()=>C.map(e=>e.id),[C]),e0=(0,a.useMemo)(()=>e$.filter(e=>!eQ.includes(e)),[e$,eQ]),e1=(0,a.useMemo)(()=>eQ.filter(e=>!e$.includes(e)),[eQ,e$]),e2=(0,a.useMemo)(()=>e0.length>0||e1.length>0,[e0,e1]),e6=async()=>{let n=null==e?void 0:e.onSave;if(n){g(!0);try{var a;"function"==typeof(null==e?void 0:e.fetchCandidates)?(await n({candidate_ids:e0,remove_candidate_ids:e1}),E([])):await n({status:t,name:u}),null==e||null==(a=e.closeModal)||a.call(e)}catch(e){console.error("Error saving recommendations:",e)}finally{g(!1)}}},e5=(0,a.useMemo)(()=>eH&&"object"==typeof eH&&"data"in eH&&Array.isArray(eH.data)?eH.data.map(e=>({id:e.id,title:e.title,interactedWith:e.interactedWith,scheduledOn:e.sc
1heduledOn||(e.scheduled_at?(0,l.r6)(e.scheduled_at):void 0),endsOn:e.ends_at?(0,l.r6)(e.ends_at):void 0,interactedOn:e.interactedOn||(e.interacted_at?(0,l.Yq)(e.interacted_at):void 0),description:e.description,scheduledRaw:e.scheduled_at,ends_at:e.ends_at,timezone:e.timezone,mode_of_interaction:e.mode_of_interaction,client_member_id:e.client_member_id,organization_member_id:e.organization_member_id,client_member_name:e.client_member_name,organization_member_name:e.organization_member_name})):[],[eH]),e9=(0,a.useMemo)(()=>{let e=[],t=(null==eD?void 0:eD.organization_members)||[],n=(null==eD?void 0:eD.client_pocs)||[];for(let n of t)(null==n?void 0:n.user_id)&&(null==n?void 0:n.full_name)&&e.push({id:String(n.user_id),label:n.full_name,type:"org"});for(let t of n)if(null==t?void 0:t.client_member_id){var a,i;let n="".concat(null!=(a=t.first_name)?a:""," ").concat(null!=(i=t.last_name)?i:"").trim();e.push({id:String(t.client_member_id),label:n?"".concat(n," (client)"):"(client)",type:"client"})}return e},[eD]),e4=(0,a.useCallback)(e=>{let t=e9.find(t=>String(t.id)===e);em(n=>({...n,selected_member_id:e,selected_member_type:t?t.type:"",client_member_name:t?t.label:"",person:t?t.label:""}))},[e9]),e7=(0,a.useCallback)(e=>{en(e.id),K(!1);let t=e.scheduledRaw?new Date(e.scheduledRaw):null,n=e.ends_at?new Date(e.ends_at):null,a=e.interactedWith||e.client_member_name||e.organization_member_name||"";em({type:e.title||"",date:t,startTime:t,endTime:n,timezone:e.timezone||ev||"",mode_of_interaction:e.mode_of_interaction||"",person:a,selected_member_id:e.client_member_id?String(e.client_member_id):e.organization_member_id?String(e.organization_member_id):"",selected_member_type:e.client_member_id?"client":e.organization_member_id?"org":"",description:e.description||"",client_member_name:a})},[ev]),e8=(0,a.useMemo)(()=>eP&&"object"==typeof eP&&"data"in eP&&Array.isArray(eP.data)?eP.data.map(e=>{var t,n,a,i;return{id:e.id,title:e.note_title,content:e.note_data,addedBy:(null==(t=e.created_metadata)?void 0:t.full_name)?null==(n=e.created_metadata)?void 0:n.full_name:(null==(a=e.created_metadata)?void 0:a.first_name)+" "+(null==(i=e.created_metadata)?void 0:i.last_name),isOptimistic:!1}}):[],[eP]),e3=(0,a.useMemo)(()=>{if(!ey)return e8;let e=($[ey]||[]).filter(e=>!e8.some(t=>t.title===e.title&&t.content===e.content));return[...e8,...e]},[e8,$,ey]);(0,a.useEffect)(()=>{ey&&ee(e=>{let t={...e};return Object.keys(t).forEach(e=>{e!==ey&&delete t[e]}),t})},[ey]),(0,a.useEffect)(()=>{eT&&ey&&(eL({projectId:eT,candidateId:ey}),eY({candidateId:ey,params:{project_id:null!=eT?eT:null}}))},[ey,eT]);let te=async(t,n)=>{if(!eT||!t)return;let a=F[t];k(e=>({...e,[t]:n}));try{await eZ.mutateAsync({url:s.Sn.PROJECT.RECOMMENDATIONS_STATUS_UPDATE(eT,t),data:{status:n}});let a=null==e?void 0:e.refreshRecommendations;"function"==typeof a&&await a()}catch(e){k(e=>({...e,[t]:a||""})),console.error("Failed to update recommendation status",e)}},tt=async()=>{if(ef.title.trim()&&ef.content.trim())try{let e=new FormData;e.append("note_input",JSON.stringify({title:ef.title,content:ef.content,project_id:eT})),await eV.mutateAsync({data:e,config:{headers:{"Content-Type":"multipart/form-data"}}}),eT&&ey&&await eL({projectId:eT,candidateId:ey}),e_({title:"",content:""}),Z(!1)}catch(e){console.error("Failed to create note:",e),r.oR.error("Failed to create note. Please try again.")}},tn=async()=>{if(ea&&ey)try{let e=new FormData,t={title:ef.title,content:ef.content};eT&&(t.project_id=eT),e.append("note_input",JSON.stringify(t)),await eJ.mutateAsync({url:s.Sn.CANDIDATES.NOTES.UPDATE(ey,ea),data:e,config:{headers:{"Content-Type":"multipart/form-data"}}}),r.oR.success("Note updated successfully"),eT&&ey&&await eL({projectId:eT,candidateId:ey}),Z(!1),e_({title:"",content:""}),ei(null)}catch(e){throw console.error("Failed to update note:",e),r.oR.error("Failed to update note. Please try again."),e}},ta=async e=>{if(ey&&e)try{eo(e);let t=await eK.mutateAsync({url:s.Sn.PROJECT.RECOMMENDED_NOTES_DELETION(ey,e)});if((null==t?void 0:t.status_code)===200)r.oR.success(null==t?void 0:t.message);else throw Error((null==t?void 0:t.message)||"Failed to delete note");eT&&ey&&await eL({projectId:eT,candidateId:ey})}catch(e){throw console.error("Failed to delete note:",e),r.oR.error("Failed to delete note. Please try again."),e}finally{eo(null)}},ti=async e=>{if(e)try{el(e);let t=await eB.mutateAsync({url:s.Sn.PROJECT.RECOMMENDED_EVENTS_DELETION(e)});if(null==t?void 0:t.success)r.oR.success(null==t?void 0:t.message);else throw Error(null==t?void 0:t.message);ey&&await eY({candidateId:ey,params:{project_id:null!=eT?eT:null}})}catch(e){throw r.oR.error("Failed to delete event. Please try again."),e}finally{el(null)}},tr=(0,a.useCallback)(e=>()=>{eK.isPending||d.Lx.openDialog("confirmation",{title:"Delete Note",data:{message:"Are you sure you want to delete this note? This action cannot be undone.",confirmText:"Delete",cancelText:"Cancel",onConfirm:()=>ta(e),onCancel:()=>{}},size:"sm"})},[eK.isPending,ta]),to=(0,a.useCallback)(e=>()=>{eB.isPending||d.Lx.openDialog("confirmation",{title:"Delete Event",data:{message:"Are you sure you want to delete this event? This action cannot be undone.",confirmText:"Delete",cancelText:"Cancel",onConfirm:()=>ti(e),onCancel:()=>{}},size:"sm"})},[eB.isPending,ti]),ts=async()=>
1{if(!eA){console.error("handleCreateEvent is not defined. Please pass handleCreateEvent in the data prop."),r.oR.error("Unable to create event. Please refresh and try again.");return}if(ec(!0),eu.startTime&&eu.endTime){let e=60*eu.startTime.getHours()+eu.startTime.getMinutes();if(60*eu.endTime.getHours()+eu.endTime.getMinutes()<=e){r.oR.error("End time must be after start time"),ec(!1);return}}try{await eA(eu,ey||"",async()=>{ey&&await eY({candidateId:ey,params:{project_id:null!=eT?eT:null}}),K(!1),em({type:"",date:null,startTime:null,endTime:null,timezone:"",mode_of_interaction:"",person:"",selected_member_id:"",selected_member_type:"",description:"",client_member_name:""}),en(null)})}catch(e){console.error("Error in handleCreateEventSubmit:",e),r.oR.error("Failed to create event. Please try again.")}finally{ec(!1)}},tl=async()=>{if(et){if(ec(!0),eu.startTime&&eu.endTime){let e=60*eu.startTime.getHours()+eu.startTime.getMinutes();if(60*eu.endTime.getHours()+eu.endTime.getMinutes()<=e){r.oR.error("End time must be after start time"),ec(!1);return}}try{let e=eu.timezone||ev,t={event_type:eu.type,title:eu.type,description:eu.description||""},n=_(eu.date,eu.startTime,e);n&&(t.scheduled_at=n);let a=_(eu.date,eu.endTime,e);a&&(t.ends_at=a),t.timezone=e,eu.mode_of_interaction&&(t.mode_of_interaction=eu.mode_of_interaction),eu.selected_member_id&&("client"===eu.selected_member_type?t.client_member_id=eu.selected_member_id:"org"===eu.selected_member_type&&(t.organization_member_id=eu.selected_member_id)),await eq.mutateAsync({url:s.Sn.PROJECT.RECOMMENDED_CANDIDATE_EVENT_EDIT(et),data:t}),r.oR.success("Event updated successfully"),ey&&await eY({candidateId:ey,params:{project_id:null!=eT?eT:null}}),K(!1),em({type:"",date:null,startTime:null,endTime:null,timezone:"",mode_of_interaction:"",person:"",selected_member_id:"",selected_member_type:"",description:"",client_member_name:""}),en(null)}catch(e){throw console.error("Failed to update event:",e),r.oR.error("Failed to update event. Please try again."),e}finally{ec(!1)}}};return{status:t,setStatus:n,candidate:u,setCandidate:m,description:p,setDescription:h,isLoading:v,handleSave:e6,handleCancel:()=>{var t;E([]),null==e||null==(t=e.closeModal)||t.call(e)},candidates:y,loadingCandidates:S,isLoadingMore:D,selectedCandidates:C,setSelectedCandidates:E,handleSelectionChange:e=>{E(e)},hasMore:z<A,onLoadMore:eX,hasChanges:e2,searchQuery:I,setSearchQuery:N,isSearching:x,sortBy:R,setSortBy:P,profiles:eg,selectedId:ey,highlightedCandidateId:eb,hideClientDetails:eS,view:eC,projectId:eT,localStatuses:F,activeTab:L,setActiveTab:V,showEventForm:J,setShowEventForm:K,showNoteForm:B,setShowNoteForm:Z,expandedEvents:H,setExpandedEvents:U,truncatable:W,setTruncatable:Y,expandedNotes:q,setExpandedNotes:G,truncatableNotes:X,setTruncatableNotes:Q,optimisticNotes:$,setOptimisticNotes:ee,newEvent:eu,setNewEvent:em,newNote:ef,setNewNote:e_,clientContactsData:eE,loadingClientContacts:ez,loadingNotes:eF,notesError:ek,loadingEvents:eU,eventsError:eW,interactionOptions:e9,loadingInteractionWith:eM,handleInteractionWithChange:e4,openEventEditor:e7,events:e5,notes:e8,allNotes:e3,addNoteMutation:eV,updateRecommendationStatusMutation:eZ,isCreatingEvent:eO,updateStatus:te,handleCreateNote:tt,handleCreateEventSubmit:ts,editingEventId:et,setEditingEventId:en,handleUpdateEventSubmit:tl,isUpdatingEvent:eq.isPending,isSavingEvent:ed,editingNoteId:ea,setEditingNoteId:ei,handleUpdateNoteSubmit:tn,isUpdatingNote:eJ.isPending,deleteNoteMutation:eK,handleDeleteNote:ta,isDeletingNote:eK.isPending,deletingNoteId:er,deleteEventMutation:eB,handleDeleteEvent:ti,isDeletingEvent:eB.isPending,deletingEventId:es,getDeleteNoteHandler:tr,getDeleteEventHandler:to,isTimeInvalid:ep,isEventFormValid:eh}}},91953:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>d});var a=n(95155);n(12115);var i=n(97003),r=n(47507),o=n(67001),s=n(97582),l=n(91837);let d=e=>{let{data:t}=e,{status:n,setStatus:d,candidate:c,description:u,setDescription:m,isLoading:f,handleSave:_,handleCancel:p}=(0,l.Y)(t);return(0,a.jsxs)("div",{className:"h-full flex flex-col relative z-50",children:[(0,a.jsxs)("div",{className:"flex-1 space-y-6 overflow-y-auto p-1",children:[(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)("label",{htmlFor:"status",className:"text-sm font-medium text-gray-700",children:"Choose Status*"}),(0,a.jsxs)(r.Select,{onValueChange:e=>d(e),children:[(0,a.jsx)(r.SelectTrigger,{className:"w-full border-none focus:ring-0 focus:ring-offset-0 focus:outline-none",children:(0,a.jsx)(r.SelectValue,{placeholder:n||"Select status"})}),(0,a.jsxs)(r.SelectContent,{className:"z-[9999]",children:[(0,a.jsx)(r.SelectItem,{value:s.Kk.InProgress,children:"In Progress"}
1),(0,a.jsx)(r.SelectItem,{value:s.Kk.Accepted,children:"Accepted"}),(0,a.jsx)(r.SelectItem,{value:s.Kk.RejectedByClient,children:"Rejected By Client"}),(0,a.jsx)(r.SelectItem,{value:s.Kk.RejectedByCandidate,children:"Rejected By Candidate"}),(0,a.jsx)(r.SelectItem,{value:s.Kk.Abandoned,children:"Abandoned"})]})]})]}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)("label",{htmlFor:"description",className:"text-sm font-medium text-gray-700",children:"Add Description"}),(0,a.jsx)(o.T,{id:"description",placeholder:"Enter here",value:u,onChange:e=>m(e.target.value),className:"min-h-[120px] resize-none focus:ring-0 focus:ring-offset-0 focus:outline-none"})]})]}),(0,a.jsxs)("div",{className:"flex gap-3  pb-7  border-gray-200 bg-gray-50",children:[(0,a.jsx)(i.Button,{variant:"outline",onClick:p,disabled:f,className:"px-6",children:"Cancel"}),(0,a.jsx)(i.Button,{onClick:_,disabled:f||!c||!n,className:"px-6",children:f?"Saving...":"Save"})]})]})}},97582:(e,t,n)=>{"use strict";n.d(t,{$V:()=>l,Kk:()=>f,Ks:()=>i,N1:()=>r,_Y:()=>o,eX:()=>u,eb:()=>d,kF:()=>m,md:()=>s});var a=n(30590),i=function(e){return e.Active="Active",e.ClosedWon="Close WON",e.ClosedLost="Closed LOST",e.Abandon="Inactive",e}({});function r(e){let t=e.toLowerCase();return t===a.gc.INACTIVE||t.includes("abandon")}function o(e){return r(e)?"Inactive":Object.values(i).includes(e)?e:"Active"}function s(e){return r(e)?d.Inactive:d[e]||e}function l(e){let t=(e.lost_reason||"").trim();return"Inactive"===e.status?{status:"Inactive",lost_reason:t}:{status:e.status,...Array.isArray(e.candidate_id)&&e.candidate_id.length>0?{candidate_id:e.candidate_id}:{},lost_reason:t}}let d={Active:"Active","Close WON":"Closed won","Closed LOST":"Closed lost",Inactive:"Inactive"},c={CLOSED:"closed",INACTIVE:a.gc.INACTIVE};function u(e){return e&&"All"!==e?e===c.CLOSED?"Closed":e===c.INACTIVE?"Inactive":d[e]||e:"All"}let m={Active:"bg-success-bg text-success-solid","Close WON":"bg-brand-4th/10 text-brand-4th","Closed LOST":"bg-error-bg text-error-solid",Inactive:"bg-gray-100 text-gray-600"};var f=function(e){return e.Accepted="accepted",e.OfferExtended="offer_extended",e.InProgress="in_progress",e.Rejected="rejected",e.RejectedByClient="rejected_by_client",e.RejectedByCandidate="rejected_by_candidate",e.Abandoned="abandoned",e}({})}}]);

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.