PageSourceSearch

https://www.talentpicker.io/assets/connectivity-Uu1w7cI9.js

js talentpicker.io collected 2026-10-06 09:07:28 UTC 37,271 bytes, 6 lines download raw bytes

1import{Z as ot,X as Se,G as H,W as Ae,D as Y,A as $,K as Ee,_ as nt,r as v,b as de,a as st,c as be,t as xe,am as lt,j as t,C as ne,e as se,e5 as le,B as M,T as c,N as L,i as re,l as R,aB as rt,bR as ie,P as ce,o as N,e6 as it,m as ct,p as ut,H as k,a8 as ue,cG as G,a4 as W,e7 as ve,e8 as Re,I as fe,bT as pt,c4 as qe,e9 as p,u as je,dk as dt,V as P,av as ge,al as mt,aD as ht,a7 as _t,au as yt,E as g,ea as B,eb as bt,J as ye,d9 as ae,ec as oe,ed as xt,ao as Ve,ap as pe,bH as Be,aq as Je,ar as We,as as Ke,at as Ge,bI as Qe,bJ as Ye,bB as $e,U as gt,aA as Oe}from"./index-B-lJU8zi.js";import{D as St}from"./divider-04cIewc4.js";import{I as Te}from"./integrations-icons-DZd25Y-5.js";import{P as At}from"./password-input-B_dhC2Ow.js";import{d as Ce,f as Ie,j as Xe,k as Ue,a as D,D as w,l as Q,n as Fe,o as Et,p as Ne,q as Le,r as De,s as we}from"./useOrganizationPermissions-D7my2hLq.js";import{j as ft,k as jt,h as Tt}from"./autopilot-sequence-selector-Bvz1r9V3.js";import{S as Ct}from"./slider-Ck3cUzyy.js";import{L as It}from"./link-CvaSHgxW.js";import{G as Mt}from"./grid-9szbpQG_.js";import"./input-group-MLwYRR1-.js";import"./get-campaigns-DJ90ol1m.js";import"./native-select-B1FibqXF.js";import"./native-select-Zs8KgcuK.js";import"./zap-DWc0RsuP.js";import"./for-30bwjwqq.js";/**
2 * @license lucide-react v0.542.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 vt=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-4 8",key:"7n84p3"}]],Rt=ot("at-sign",vt),qt=async()=>await H.get("/ats-connector"),X=()=>Se({queryKey:["integrations"],queryFn:qt}),Ot=({queryConfig:e}={})=>Ae({...X(),...e});$({email:Ee()});const Ut=async({data:e})=>(await H.put("/organization/push-lead-connector-email",e)).data,Ft=({mutationConfig:e})=>{const{onSuccess:a,...o}=e||{};return Y({onSuccess:(...n)=>{a==null||a(...n)},...o,mutationFn:Ut})},Nt=async()=>(await H.get("/organization/push-lead-connector-email")).data,Ze=()=>Se({queryKey:["defaultLeadPushEmail"],queryFn:Nt}),Lt=()=>Ae({...Ze()});$({email:Ee()});const Dt=async({data:e})=>(await H.patch("/account-settings/push-lead-connector-email",e)).data,wt=({mutationConfig:e})=>{const{onSuccess:a,...o}=e||{};return Y({onSuccess:(...n)=>{a==null||a(...n)},...o,mutationFn:Dt})},kt=ce.object({email:ce.email()}),Pt=ce.object({email:ce.email()}),Ht=({firstTime:e=!1})=>{var ee,s,m,I,A,b,f,te;const{data:a}=Lt(),{data:o}=nt(),[n,l]=v.useState(!!((ee=o==null?void 0:o.data)!=null&&ee.default_push_lead_connector_email)&&!!(a!=null&&a.email)&&(a==null?void 0:a.email)!==((s=o==null?void 0:o.data)==null?void 0:s.default_push_lead_connector_email));v.useEffect(()=>{var j,F,Me;a!=null&&a.email&&((j=o==null?void 0:o.data)!=null&&j.default_push_lead_connector_email)?l(a.email!==o.data.default_push_lead_connector_email):(F=o==null?void 0:o.data)!=null&&F.default_push_lead_connector_email&&(a==null?void 0:a.email)!==((Me=o==null?void 0:o.data)==null?void 0:Me.default_push_lead_connector_email)&&l(!0)},[(m=o==null?void 0:o.data)==null?void 0:m.default_push_lead_connector_email,a==null?void 0:a.email]);const i=de(),d=st(),{register:u,clearErrors:E,getValues:_,setValue:y,formState:{errors:S}}=be({resolver:xe(Pt)});v.useEffect(()=>{a!=null&&a.email&&!_("email")&&y("email",a.email)},[a==null?void 0:a.email,y,_]);const T=Ft({mutationConfig:{onSuccess:()=>{N.create({title:"Email enregistré avec succès",type:"success"}),i.invalidateQueries({queryKey:it().queryKey}),i.invalidateQueries({queryKey:Ze().queryKey})}}}),{register:q,clearErrors:C,getValues:r,setValue:x,formState:{errors:z}}=be({resolver:xe(kt)});v.useEffect(()=>{var j;(j=o==null?void 0:o.data)!=null&&j.default_push_lead_connector_email&&!r("email")&&x("email",o.data.default_push_lead_connector_email)},[(I=o==null?void 0:o.data)==null?void 0:I.default_push_lead_connector_email,x,r]);const h=wt({mutationConfig:{onSuccess:()=>{N.create({title:"Email de réception de votre comtpe enregistré avec succès",type:"success"}),i.invalidateQueries({queryKey:ct().queryKey})}}}),O=(A=o==null?void 0:o.data)==null?void 0:A.default_push_lead_connector_email,me=((O==null?void 0:O.trim())??"")==="",K=O===(a==null?void 0:a.email),U=me||K,V=T.isPending||U&&h.isPending,J=o!=null&&o.data?lt(o.data):!1,Z=async j=>{j.preventDefault();const F=_("email");if(!J){N.create({title:"Vous n'avez pas les permissions pour modifier l'email de l'organisation",type:"error"});return}try{await T.mutateAsync({data:{email:F}}),U&&await h.mutateAsync({data:{email:F}}),e&&d(ut.app.dashboard.getHref())}catch{}},he=j=>{j.preventDefault(),h.mutate({data:{email:r("email")}})},_e=()=>{var j,F;n&&((j=o==null?void 0:o.data)!=null&&j.default_push_lead_connector_email)?(a!=null&&a.email?((F=o==null?void 0:o.data)==null?void 0:F.default_push_lead_connector_email)!==a.email&&h.mutate({data:{email:a.email}}):h.mutate({data:{email:""}}),l(!1)):l(!n)};return t.jsx(ne,{w:"100%",children:t.jsxs(se,{gap:10,children:[t.jsx(le,{children:t.jsxs(M,{display:"flex",alignItems:"center",gap:2,children:[t.jsx(Rt,{}),t.jsx(c,{fontWeight:"bold",fontSize:"xl",children:"Configuration Email"})]})}),t.jsxs(M,{display:"flex",flexDirection:"column",gap:4,children:[t.jsxs(M,{spaceY:1,children:[t.jsx(c,{fontWeight:"bold",fontSize:"lg",children:"Transfert des candidatures par email"}),t.jsx(c,{color:"gray",children:"Les candidatures de l'organisation seront automatiquement transférées a cette adresse email"})]}),t.jsx("form",{onSubmit:Z,children:t.jsxs(M,{w:{base:"full",lg:"1/2"},display:"flex",gap:4,alignItems:"flex-end",children:[t.jsx(L,{invalid:!!S.email,errorText:(b=S.email)==null?void 0:b.message,children:t.jsx(re,{placeholder:"Adresse email",colorPalette:"brand",...u("email",{onChange:()=>E("email")}),type:"email"})}),t.jsx(R,{colorScheme:"brand",type:"submit",loading:V,disabled:V,children:"Enregistrer"})]})})]}),((a==null?void 0:a.email)||((f=o==null?void 0:o.data)==null?void 0:f.default_push_lead_connector_email)||!(a!=null&&a.email)&&(o==null?void 0:o.data.membership.role)===rt.MEMBER)&&t.jsxs(t.Fragment,{children:[t.jsx(ie,{checked:n,onChange:()=>_e(),children:"Utiliser un email différent de celui de l'organisation"}),n&&t.jsxs(M,{display:"flex",flexDirection:"column",gap:4,children:[t.jsxs(M,{spaceY:1,children:[t.jsx(c,{fontWeight:"bold",fontSize:"lg",children:"Mes préférences | Réception des candidatures par email"}),t.jsx(c,{color:"gray",children:"Les candidatures sur mes campagnes seront automatiquement transférées a cette adresse email"})]}),t.jsx("form",{onSubmit:he,children:t.jsxs(M,{w:{base:"full",lg:"1/2"},display:"flex",gap:4,alignItems:"flex-end",children:[t.jsx(L,{invalid:!!z.email,errorText:(te=z.email)==null?void 0:te.message,children:t.jsx(re,{placeholder:"Adresse email",colorPalette:"brand",...q("email",{onChange:()=>C("email")}),type:"email"})}),t.jsx(R,{colorScheme:"brand",type:"submit",loading:h.isPending,disabled:h.isPending,children:"Enregistrer"})]})})]})]})]})})},ke=e=>{if(e.skeleton)return t.jsxs(ne,{minW:"300px",children:[t.jsxs(se,{gap:4,children:[t.jsxs(k,{align:"stretch",justifyContent:"space-between",children:[t.jsx(ue,{children:t.jsx(G,{width:"24px",height:"24px",rounded:"md"})}),t.jsx(G,{width:2,height:2,rounded:"full"})]}),t.jsxs(W,{children:[t.jsx(le,{asChild:!0,children:t.jsx(G,{height:"24px",width:"120px"})}),t.jsx(ve,{asChild:!0,children:t.jsx(G,{height:"16px",width:"80px",mt:1})})]})]}),t.jsx(Re,{justifyContent:"end",children:t.jsx(G,{height:"32px",width:"80px",rounded:"md"})})]});const{name:a,description:o,isActive:n,isSetupCompleted:l,cta:i,disableCta:d}=e;return t.jsxs(ne,{minW:"300px",transition:"all 0.3s cubic-bezier(0.4, 0, 0.2, 1)",_hover:{transform:"translateY(-4px)",boxShadow:"0 10px 25px rgba(0, 0, 0, 0.1)"},children:[t.jsxs(se,{gap:4,children:[t.jsxs(k,{align:"stretch",justifyContent:"space-between",children:[t.jsx(ue,{w:12,h:12,bg:"transparent",children:t.jsx(fe,{src:Te[a]})}),t.jsx(W,{w:2,h:2,bg:n?"green.500":n&&!l?"yellow.500":"red.500",rounded:"full",transition:"all 0.3s ease",css:{animation:"scaleIn 0.3s ease-out",boxShadow:n?"0 0 8px rgba(34, 197, 94, 0.4)":"none"}})]}),t.jsxs(W,{children:[t.jsx(le,{asChild:!0,children:t.jsx(c,{_firstLetter:{textTransform:"capitalize"},children:a})}),t.jsx(ve,{asChild:!0,children:t.jsx(c,{children:o})})]})]}),t.jsx(Re,{justifyContent:"end",children:n?t.jsxs(t.Fragment,{children:[t.jsx(R,{variant:"plain",colorScheme:"red",onClick:d,children:"Désactiver"}),t.jsx(R,{variant:"outline",colorScheme:"brand",onClick:i,children:"Modifier"})]}):t.jsxs(R,{colorScheme:"purple",onClick:i,children:[t.jsx(pt,{})," Connecter"]})})]})}
6,zt=(e,a)=>{if(!(!e&&!a))return{auto_sync_account_enabled:e==null?void 0:e.auto_sync_account_enabled,auto_sync_disable_cvdr_jobboard_publish:e==null?void 0:e.auto_sync_disable_cvdr_jobboard_publish,auto_sync_campaign_mode:e==null?void 0:e.auto_sync_campaign_mode,auto_sync_campaign_nb_expected_leads:e==null?void 0:e.auto_sync_campaign_nb_expected_leads,auto_sync_autopilot_processing_step1_rules:e==null?void 0:e.auto_sync_autopilot_processing_step1_rules,auto_sync_autopilot_step_action1:e==null?void 0:e.auto_sync_autopilot_step_action1,auto_sync_autopilot_processing_step2_rules:e==null?void 0:e.auto_sync_autopilot_processing_step2_rules,auto_sync_autopilot_step_action2:e==null?void 0:e.auto_sync_autopilot_step_action2,auto_sync_shortlist_processing_rules:e==null?void 0:e.auto_sync_shortlist_processing_rules,defaultCampaignMode:a==null?void 0:a.defaultCampaignMode,defaultNbExpectedLeads:a==null?void 0:a.defaultNbExpectedLeads}},Vt=e=>{const a=e.auto_sync_autopilot_step_action1;return a?a.action==="auto_match"?"auto_match":a.action==="send_dm"?"direct_approach":a.action==="send_job_offer_suggestion"&&!e.auto_sync_autopilot_step_action2?"job_offer_suggestion":a.action==="send_job_offer_suggestion"&&e.auto_sync_autopilot_step_action2&&e.auto_sync_autopilot_step_action2.action==="send_dm_follow_up"?"boost":Q:Q},Bt=e=>{var C,r;const a=(e==null?void 0:e.auto_sync_campaign_mode)??((e==null?void 0:e.defaultCampaignMode)==="shortlist"?"shortlist":(e==null?void 0:e.defaultCampaignMode)==="manual"?"manual":"autopilot"),o=(e==null?void 0:e.auto_sync_campaign_nb_expected_leads)??(e==null?void 0:e.defaultNbExpectedLeads)??5,n=e!=null&&e.auto_sync_autopilot_step_action1?Vt(e):Q,l=e==null?void 0:e.auto_sync_autopilot_step_action1,i=(e==null?void 0:e.auto_sync_autopilot_step_action2)??void 0,d=Fe(l),u=Fe(i),E=e!=null&&e.auto_sync_autopilot_step_action1&&e.auto_sync_autopilot_step_action1.action!=="auto_match"&&"morning_contact_hours_schedule_range"in e.auto_sync_autopilot_step_action1?{morning:e.auto_sync_autopilot_step_action1.morning_contact_hours_schedule_range??w,afternoon:e.auto_sync_autopilot_step_action1.afternoon_contact_hours_schedule_range??D}:{morning:w,afternoon:D},_=e!=null&&e.auto_sync_autopilot_step_action2?{morning:e.auto_sync_autopilot_step_action2.morning_contact_hours_schedule_range??w,afternoon:e.auto_sync_autopilot_step_action2.afternoon_contact_hours_schedule_range??D}:{morning:w,afternoon:D},y=((C=e==null?void 0:e.auto_sync_shortlist_processing_rules)==null?void 0:C.ai_evaluation_threshold)??Ce,S=((r=e==null?void 0:e.auto_sync_autopilot_processing_step1_rules)==null?void 0:r.validated_ai_evaluation_threshold)??Ie(n),T=(e==null?void 0:e.auto_sync_account_enabled)!==void 0?e.auto_sync_account_enabled:!!((e==null?void 0:e.auto_sync_campaign_mode)??(e==null?void 0:e.defaultCampaignMode)),q=(e==null?void 0:e.auto_sync_disable_cvdr_jobboard_publish)!==!0;return{autoSyncAccountEnabled:T,publishOnCvdrJobboard:q,autoSyncCampaignMode:a,autoSyncCampaignNbExpectedLeads:Number(o),autopilotSequenceMode:n,autopilotMessageSource:De(l),autopilotMessageTemplateId:Le(l),autopilotCustomMessage:Ne(l),autopilotEnableSms:d.enableSms,autopilotAttachJobOffer:d.attachJobOffer,autopilotMorningContactHourRange:E.morning,autopilotAfternoonContactHourRange:E.afternoon,autopilotStep2MorningContactHourRange:_.morning,autopilotStep2AfternoonContactHourRange:_.afternoon,autopilotStep2MessageSource:De(i),autopilotStep2MessageTemplateId:Le(i),autopilotStep2CustomMessage:Ne(i),autopilotStep2EnableSms:u.enableSms,autopilotStep2AttachJobOffer:u.attachJobOffer,autopilotReminderDelayInDays:Et(l),aiAutopilotMatchingThreshold:S,autopilotProcessingStep1Rules:e==null?void 0:e.auto_sync_autopilot_processing_step1_rules,aiShortlistMatchingThreshold:y}},Jt=e=>{const a=!e.publishOnCvdrJobboard,o={sourcingMode:e.autoSyncCampaignMode==="autopilot"?qe.AUTOPILOT:qe.SHORTLIST,autopilotSequenceMode:e.autopilotSequenceMode,autopilotMessageSource:e.autopilotMessageSource,autopilotMessageTemplateId:e.autopilotMessageTemplateId,autopilotCustomMessage:e.autopilotCustomMessage,autopilotEnableSms:e.autopilotEnableSms,autopilotAttachJobOffer:e.autopilotAttachJobOffer,autopilotMorningContactHourRange:e.autopilotMorningContactHourRange,auto
6pilotAfternoonContactHourRange:e.autopilotAfternoonContactHourRange,autopilotStep2MorningContactHourRange:e.autopilotStep2MorningContactHourRange,autopilotStep2AfternoonContactHourRange:e.autopilotStep2AfternoonContactHourRange,autopilotStep2MessageSource:e.autopilotStep2MessageSource,autopilotStep2MessageTemplateId:e.autopilotStep2MessageTemplateId,autopilotStep2CustomMessage:e.autopilotStep2CustomMessage,autopilotStep2EnableSms:e.autopilotStep2EnableSms,autopilotStep2AttachJobOffer:e.autopilotStep2AttachJobOffer,autopilotReminderDelayInDays:e.autopilotReminderDelayInDays??Xe,aiAutopilotMatchingThreshold:e.aiAutopilotMatchingThreshold,autopilotProcessingStep1Rules:e.autopilotProcessingStep1Rules,aiShortlistMatchingThreshold:e.aiShortlistMatchingThreshold};if(e.autoSyncCampaignMode==="autopilot"){const l=ft(o);return{auto_sync_campaign_mode:"autopilot",auto_sync_campaign_nb_expected_leads:e.autoSyncCampaignNbExpectedLeads,auto_sync_disable_cvdr_jobboard_publish:a,auto_sync_autopilot_processing_step1_rules:l.autopilot_processing_step1_rules,auto_sync_autopilot_step_action1:l.autopilot_step_action1,auto_sync_autopilot_processing_step2_rules:l.autopilot_processing_step2_rules,auto_sync_autopilot_step_action2:l.autopilot_step_action2}}if(e.autoSyncCampaignMode==="manual")return{auto_sync_campaign_mode:"manual",auto_sync_campaign_nb_expected_leads:e.autoSyncCampaignNbExpectedLeads,auto_sync_disable_cvdr_jobboard_publish:a};const n=jt(o);return{auto_sync_campaign_mode:"shortlist",auto_sync_campaign_nb_expected_leads:e.autoSyncCampaignNbExpectedLeads,auto_sync_disable_cvdr_jobboard_publish:a,auto_sync_shortlist_processing_rules:n.auto_shortlist_processing_rules}},Wt=()=>({autoSyncAccountEnabled:!1,publishOnCvdrJobboard:!0,autoSyncCampaignMode:"autopilot",autoSyncCampaignNbExpectedLeads:5,autopilotSequenceMode:Q,autopilotMessageSource:Ue,autopilotEnableSms:!0,autopilotAttachJobOffer:!0,autopilotMorningContactHourRange:w,autopilotAfternoonContactHourRange:D,autopilotStep2MorningContactHourRange:w,autopilotStep2AfternoonContactHourRange:D,autopilotStep2MessageSource:Ue,autopilotStep2EnableSms:!0,autopilotStep2AttachJobOffer:!0,autopilotReminderDelayInDays:Xe,aiAutopilotMatchingThreshold:Ie(Q),aiShortlistMatchingThreshold:Ce}),et=async e=>(await H.post("/ats-connector/configure",e)).data,Kt=({mutationConfig:e}={})=>{const a=de(),{onSuccess:o,...n}=e||{};return Y({mutationFn:et,onSuccess:(...l)=>{a.invalidateQueries({queryKey:X().queryKey}),o==null||o(...l)},...n})},Gt=async e=>(await H.get(`/ats-connector/${e}/active-imported-campaigns-count`)).data.count,Qt=e=>Se({queryKey:["active-imported-campaigns-count",e],queryFn:()=>Gt(e)}),Yt=({integrationName:e,enabled:a,queryConfig:o})=>Ae({...Qt(e),enabled:a,...o}),$t=async e=>(await H.post(`/ats-connector/${e}/apply-auto-sync-to-existing-campaigns`)).data.updated_count,Xt=async e=>(await et(e),$t(e.name)),Zt=()=>{const e=de();return Y({mutationFn:Xt,onSuccess:()=>{e.invalidateQueries({queryKey:X().queryKey})}})},tt={BEETWEEN:{integrationName:p.BEETWEEN,fields:[{name:"token",type:"password",label:"labels.APIToken",placeholder:"placeholders.APIToken.BEETWEEN",required:!0},{name:"baseUrl",type:"url",label:"labels.baseUrl",placeholder:"placeholders.baseUrl",required:!0,defaultValue:"https://software11.beetween.com/WeaselWeb/api"},{name:"jobOffersEntityIds",type:"text",label:"labels.jobOffersEntityIds",placeholder:"placeholders.jobOffersEntityIds",required:!0}]},TEAMTAILOR:{integrationName:p.TEAMTAILOR,fields:[{name:"jobOffersCompanyIds",type:"array",label:"labels.jobOffersEntityIds",placeholder:"placeholders.jobOffersEntityIds",required:!0}]},TEAMTAILOR_API:{integrationName:p.TEAMTAILOR_API,fields:[{name:"apiBearerToken",type:"password",label:"labels.APIToken",placeholder:"placeholders.APIToken.TEAMTAILOR_API",required:!0},{name:"fakeFeedJsonUrl",type:"text",label:"labels.fakeFeedJsonUrl",placeholder:"placeholders.fakeFeedJsonUrl",required:!1}]},SALESFORCE_1:{integrationName:p.SALESFORCE_1,fields:[{name:"candidate_endpoint",type:"url",label:"settings.integration.salesforce_1.endpoint",placeholder:"settings.integration.salesforce_1.endpoint",required:!0,defaultValue:"https://digitsalesforcepreproduction.azurewebsites.net/api/Candidat/talentpicker"},{name:"candidate_fields",type:"number",label:"settings.integration.salesforce_1.bu",placeholder:"settings.integration.salesforce_1.bu",required:!0,defaultValue:"1"}]},GESTMAX:{integrationName:p.GESTMAX,fields:[{name:"xmlFeedUrl",type:"url",label:"labels.xmlFeedUrl",placeholder:"placeholders.gestmaxXmlFeedUrl",required:!0},{name:"apiBaseUrl",type:"url",label:"labels.baseUrl",placeholder:"placeholders.gestmaxApiBaseUrl",required:!0}]},CUSTOM_TWININ:{integrationName:p.CUSTOM_TWININ,fields:[{name:"xmlFeedUrl",type:"url",label:"labels.xmlFeedUrl",placeholder:"placeholders.customTwininXmlFeedUrl",required:!0}]},RECRUITEE:{integrationName:p.RECRUITEE,fields:[{name:"jobOffersCompanyId",type:"number",label:"labels.jobOffersRecruiteeCompanyId",placeholder:"placeholders.jobOffersRecruiteeCompanyId",required:!0,description:"helperTexts.jobOffersRecruiteeCompanyId"},{name:"jobOffersCompanyDomain",type:"text",label:"labels.jobOffersRecruiteeCompanyDomain",placeholder:"placeholders.jobOffersRecruiteeCompanyDomain",required:!0,description:"helperTexts.jobOffersRecruiteeCompanyDomain"},{name:"apiBearerToken",type:"password",label:"labels.APIToken",placeholder:"placeholders.APIToken.RECRUITEE",required:!0}]},EOLIA_DIRECT:{integrationName:p.EOLIA_DIRECT,fields:[{name:"applyEmail",type:"email",label:"labels.applyEmail",placeholder:"placeholders.applyEmail",required:!0},{name:"xmlFeedUrl",type:"url",label:"labels.xmlFeedUrl",placeholder:"placeholders.eoliaDirectXmlFeedUrl",required:!0}]},TALENTSOFT:{integrationName:p.TALENTSOFT,fields:[{name:"apiBaseUrl",type:"url",label:"labels.baseUrl",placeholder:"placeholders.talentsoftApiBaseUrl",required:!0},{name:"clientId",type:"text",label:"placeholders.clientId",placeholder:"placeholders.clientId",required:!0},{name:"clientSecret",type:"text",label:"placeholders.clientSecret",placeholder:"placeholders.clientSecret",required:!0}]},TALENTPLUG:{integrationName:p.TALENTPLUG,fields:[{name:"postingId",type:"text",label:"labels.postingId",placeholder:"placeholders.postingId",required:!0}]},TOOL4STAFFING:{integrationName:p.TOOL4STAFFING,fields:[{name:"xmlFeedUrl",type:"url",label:"labels.xmlFeedUrl",placeholder:"placeholders.tool4staffingXmlFeedUrl",required:!0}]},SUCCESSFACTORS:{integrationName:p.SUCCESSFACTORS,fields:[{name:"apiBaseUrl",type:"url",label:"labels.baseUrl",placeholder:"placeholders.successfactorsApiBaseUrl",required:!0},{name:"apiKey",type:"text",label:"labels.apiKey",placeholder:"placeholders.apiKey",required:!0},{name:"userId",type:"text",label:"labels.successFactorsUserId",placeholder:"placeholders.successFactorsUserId",required:!0}]},SMART_RECRUITERS:{integrationName:p.SMART_RECRUITERS,fields:[{name:"companyIdentifier",type:"text",label:"placeholders.companyIdentifier",placeholder:"placeholders.companyIdentifier",required:!0},{name:"clientId",type:"text",label:"placeholders.clientId",placeholder:"placeholders.clientId",required:!0},{name:"clientSecret",type:"text",label:"placeholders.clientSecret",placeholder:"placeholders.clientSecret",required:!0},{name:"tpkrCustomSource",type:"text",label:"placeholders.tpkrCustomSource",placeholder:"placeholders.tpkrCustomSource",required:!0},{name:"tpkrCustomSourceType",type:"select",options:[{label:"AUTRE",value:"OTHER"}],defaultValue:"OTHER",label:"placeholders.tpkrCustomSourceType",required:!0}]},DATA4JOB:{integrationName:p.DATA4JOB,fields:[{name:"clientId",type:"text",label:"placeholders.clientId",placeholder:"placeholders.clientId",required:!0}]},JOB_AFFINITY:{integrationName:p.JOB_AFFINITY,fields:[{name:"url",type:"url",label:"labels.url",placeholder:"placeholders.url",required:!0}]},TALEEZ:{integrationName:p.TALEEZ,fields:[{name:"publicKey",type:"text",label:"placeholders.publicKey",placeholder:"placeholders.publicKey",required:!0},{name:"secretKey",type:"password",label:"placeholders.secretKey",placeholder:"placeholders.secretKey",required:!0}]},TALENTS_ADV_SUPPLY:{integrationName:p.TALENTS_ADV_SUPPLY,fields:[{name:"feedUrl",type:"url",label:"labels.xmlFeedUrl",placeholder:"placeholders.xmlFeedUrl",required:!0}]},MARVIN_RECRUITER:{integrationName:p.MARVIN_RECRUITER,fields:[{name:"feedUrl",type:"url",label:"labels.xmlFeedUrl",placeholder:"placeholders.xmlFeedUrl",required:!0},{name:"clientId",type:"text",label:"placeholders.clientId",placeholder:"placeholders.clientId",required:!0},{name:"clientSecret",type:"password",label:"placeholders.clientSecret",placeholder:"placeholders.clientSecret",required:!0}]},SAMSIC_EMPLOI:{integrationName:p.SAMSIC_EMPLOI,fields:[{name:"xmlFeedUrl",type:"url",label:"labels.xmlFeedUrl",placeholder:"placeholders.samsicEmploiXmlFeedUrl",required:!0,defaultValue:"https://cv.samsic-emploi.fr/media/flux/GIF/jobs.xml"}]}},at=e=>e in tt,ea=e=>
6tt[e]||null,Pe=({value:e,onChange:a})=>t.jsxs(P,{align:"stretch",gap:2,children:[t.jsx(c,{fontSize:"xs",fontWeight:700,color:"gray.600",children:"Exigence face aux approximations de l'IA"}),t.jsx(k,{align:"flex-start",width:"full",gap:4,pr:4,children:t.jsx(Ct,{flex:1,colorPalette:"brand",draggingIndicatorText:`${Math.round(e*100)}%`,size:"sm",min:.4,max:.9,step:.05,marks:[{value:.4,label:t.jsx(c,{fontSize:"xs",color:"gray.600",children:"Souple"})},{value:.9,label:t.jsx(c,{fontSize:"xs",color:"gray.600",children:"Exigeant"})}],value:[e],onValueChange:o=>{a(o.value[0])}})})]}),He=({isSetup:e=!1,showActiveImportedCampaignsCount:a=!1,activeImportedCampaignsCount:o,isActiveImportedCampaignsCountLoading:n=!1,isActiveImportedCampaignsCountError:l=!1})=>{var x,z;const{t:i}=je(["integrations"]),{register:d,watch:u,setValue:E,control:_,formState:{errors:y}}=dt(),S=u("autoSyncAccountEnabled"),T=u("autoSyncCampaignMode"),q=u("autopilotSequenceMode"),C=u("aiShortlistMatchingThreshold")??Ce,r=u("aiAutopilotMatchingThreshold")??Ie(q);return t.jsxs(P,{align:"stretch",gap:4,borderTop:e?void 0:"1px solid",borderColor:"gray.200",pt:e?0:4,children:[t.jsx(ge,{name:"autoSyncAccountEnabled",control:_,render:({field:h})=>t.jsx(ie,{colorPalette:"brand",checked:h.value===!0,onCheckedChange:O=>{h.onChange(O.checked===!0)},children:t.jsx(c,{fontSize:"sm",fontWeight:600,children:i("labels.autoSyncAccountEnabled")})})}),S&&t.jsxs(P,{align:"stretch",gap:4,pl:1,children:[t.jsx(c,{fontWeight:700,fontSize:"sm",children:"Configuration des campagnes auto-sync"}),t.jsx(ge,{name:"publishOnCvdrJobboard",control:_,render:({field:h})=>t.jsx(ie,{colorPalette:"brand",checked:h.value===!0,onCheckedChange:O=>{h.onChange(O.checked===!0)},children:t.jsx(c,{fontSize:"sm",children:i("labels.publishOnCvdrJobboard")})})}),t.jsx(L,{label:i("labels.defaultNbExpectedLeads"),required:!0,invalid:!!y.autoSyncCampaignNbExpectedLeads,errorText:(x=y.autoSyncCampaignNbExpectedLeads)==null?void 0:x.message,children:t.jsx(re,{type:"number",min:1,placeholder:i("placeholders.defaultNbExpectedLeads"),...d("autoSyncCampaignNbExpectedLeads",{valueAsNumber:!0})})}),t.jsx(L,{label:i("labels.defaultCampaignMode"),required:!0,invalid:!!y.autoSyncCampaignMode,errorText:(z=y.autoSyncCampaignMode)==null?void 0:z.message,children:t.jsxs("select",{...d("autoSyncCampaignMode"),style:{padding:"8px",borderRadius:"4px",border:"1px solid #ccc",width:"100%"},children:[t.jsx("option",{value:"autopilot",children:"Autopilot IA (prise de contact auto)"}),t.jsx("option",{value:"shortlist",children:"Shortlist IA"}),t.jsx("option",{value:"manual",children:"Manuel"})]})}),T==="shortlist"&&t.jsx(Pe,{value:C,onChange:h=>{E("aiShortlistMatchingThreshold",h,{shouldDirty:!0})}}),T==="autopilot"&&t.jsxs(P,{align:"stretch",gap:4,children:[t.jsx(Pe,{value:r,onChange:h=>{E("aiAutopilotMatchingThreshold",h,{shouldDirty:!0})}}),t.jsx(Tt,{gridColumns:2})]}),a&&t.jsx(k,{gap:2,pt:2,children:n?t.jsxs(t.Fragment,{children:[t.jsx(mt,{size:"sm",color:"brand.solid"}),t.jsx(c,{fontSize:"sm",color:"gray.600",children:i("autoSyncExistingCampaigns.activeOffersCountLoading")})]}):l?t.jsx(c,{fontSize:"sm",color:"gray.600",children:i("autoSyncExistingCampaigns.activeOffersCountError")}):t.jsx(c,{fontSize:"sm",fontWeight:600,color:"gray.700",children:i("autoSyncExistingCampaigns.activeOffersCount",{count:o??0})})})]})]})},ta=e=>{const a={};return e.forEach(o=>{let n;switch(o.type){case"email":n=Ee("email invalide");break;case"url":n=bt("url invalide");break;case"checkbox":n=B().default(!1);break;case"select":n=g();break;default:n=g()}o.required&&o.type!=="checkbox"&&(o.type==="number"?n=n.refine(l=>l!=null,{message:"Ce champ est requis"}):n=n.min(1,"Ce champ est requis")),o.required||(n=n.optional()),a[o.name]=n}),$(a)},aa=$({autoSyncAccountEnabled:B(),publishOnCvdrJobboard:B(),autoSyncCampaignMode:ae(["autopilot","shortlist","manual"]).optional(),autoSyncCampaignNbExpectedLeads:xt().min(1,"Ce champ est requis").optional(),autopilotSequenceMode:ae(["auto_match","job_offer_suggestion","direct_approach","boost"]).optional(),autopilotMessageSource:ae(["ai_layout","template","custom"]).optional(),autopilotMessageTemplateId:g().optional(),autopilotCustomMessage:g().optional(),autopilotEnableSms:B().optional(),autopilotAttachJobOffer:B().optional(),autopilotMorningContactHourRange:oe([g(),g()]).optional(),autopilotAfternoonContactHourRange:oe([g(),g()]).optional(),autopilotStep2MorningContactHourRange:oe([g(),g()]).optional(),autopilotStep2AfternoonContactHourRange:oe([g(),g()]).optional(),autopilotStep2MessageSource:ae(["ai_layout","template","custom"]).optional(),autopilotStep2MessageTemplateId:g().optional(),autopilotStep2CustomMessage:g().optional(),autopilotStep2EnableSms:B().optional(),autopilotStep2AttachJobOffer:B().optional(),autopilotReminderDelayInDays:ye().int().min(1).max(5).optional(),aiShortlistMatchingThreshold:ye().min(.4).max(.9).optional(),aiAutopilotMatchingThreshold:ye().min(.4).max(.9).optional()}).superRefine((e,a)=>{e.autoSyncAccountEnabled&&(e.autoSyncCampaignMode||a.addIssue({code:"custom",message:"Ce champ est requis",path:["autoSyncCampaignMode"]}
6),(!e.autoSyncCampaignNbExpectedLeads||e.autoSyncCampaignNbExpectedLeads<1)&&a.addIssue({code:"custom",message:"Ce champ est requis",path:["autoSyncCampaignNbExpectedLeads"]}),e.autoSyncCampaignMode==="autopilot"&&!e.autopilotSequenceMode&&a.addIssue({code:"custom",message:"Ce champ est requis",path:["autopilotSequenceMode"]}))}),ze=e=>{if(!e.autoSyncAccountEnabled||e.autoSyncCampaignMode!=="autopilot"||e.autopilotSequenceMode==="auto_match")return;const a=we(e.autopilotMorningContactHourRange??w,e.autopilotAfternoonContactHourRange??D);if(a)return a;if(e.autopilotSequenceMode!=="boost")return;const o=we(e.autopilotStep2MorningContactHourRange??w,e.autopilotStep2AfternoonContactHourRange??D);if(o)return o},oa=(e,a)=>{const o={};return e.forEach(n=>{if(a&&a[n.name]!==void 0)o[n.name]=a[n.name];else if(n.defaultValue!==void 0)o[n.name]=n.defaultValue;else switch(n.type){case"number":o[n.name]="";break;case"checkbox":o[n.name]=!1;break;default:o[n.name]=""}}),o},na=({integrationName:e,integration:a,handleClose:o})=>{const{t:n}=je(["integrations"]),l=at(e),i=!(a!=null&&a.is_active),d=a==null?void 0:a.options,u=v.useMemo(()=>ea(e),[e]),E=v.useMemo(()=>{if(!u)return $({});const s=ta(u.fields);return l?s.merge(aa):s},[u,l]),_=v.useMemo(()=>{if(!u)return{};const s=oa(u.fields,d);if(!l)return s;const m=Bt(zt(a,d));return{...Wt(),...s,...m}},[u,a,d,l]),y=be({resolver:xe(E),defaultValues:_}),{register:S,control:T,handleSubmit:q,reset:C,watch:r,getValues:x,trigger:z,formState:{errors:h,isSubmitting:O}}=y,me=r("autoSyncAccountEnabled")===!0,K=l&&!i&&me,U=Yt({integrationName:e,enabled:K}),V=Zt();v.useEffect(()=>{u&&C(_)},[e,u,C,_]);const J=Kt({mutationConfig:{onSuccess:()=>{N.create({title:"Intégration configurée avec succès",type:"success"}),o()},onError:s=>{N.create({title:"Erreur lors de la configuration",description:(s==null?void 0:s.message)||"Une erreur est survenue",type:"error"})}}});if(!u)return t.jsxs(P,{gap:4,children:[t.jsx("p",{children:"Configuration non disponible pour cette intégration"}),t.jsx(R,{variant:"outline",onClick:o,children:"Fermer"})]});const Z=s=>{const m=u.fields,I={};m.forEach(b=>{let f=s[b.name];b.type==="array"&&(f=f.split(",").filter(te=>te!=="")),b.type==="number"&&(f=parseInt(f)),I[b.name]=f});const A=s;return{name:e,options:I,auto_sync_account_enabled:l?A.autoSyncAccountEnabled:void 0,auto_sync_account_per_entity_enabled:l&&A.autoSyncAccountEnabled&&e===p.TALENTPLUG,...l&&A.autoSyncAccountEnabled?Jt(A):{}}},he=s=>{if(l){const m=ze(s);
6if(m){N.create({title:"Configuration invalide",description:m,type:"error"});return}}J.mutate(Z(s))},_e=async()=>{if(!await z())return;const m=x(),A=ze(m);if(A){N.create({title:"Configuration invalide",description:A,type:"error"});return}const b=Z(m);V.mutate(b,{onSuccess:f=>{N.create({title:n("autoSyncExistingCampaigns.applySuccess",{count:f}),type:"success"}),o()}})},ee=s=>{var A;const m=h[s.name],I=m==null?void 0:m.message;switch(s.type){case"password":return t.jsx(L,{label:n(s.label),required:s.required,invalid:!!m,errorText:I,helperText:s.description?n(s.description):void 0,children:t.jsx(At,{placeholder:s.placeholder?n(s.placeholder):"",...S(s.name)})},s.name);case"select":return t.jsx(L,{label:n(s.label),required:s.required,invalid:!!m,errorText:I,helperText:s.description?n(s.description):void 0,children:t.jsx("select",{...S(s.name),style:{padding:"8px",borderRadius:"4px",border:"1px solid #ccc"},children:(A=s.options)==null?void 0:A.map(b=>t.jsx("option",{value:b.value,children:b.label},b.value))})},s.name);case"checkbox":return t.jsx(L,{label:n(s.label),required:s.required,invalid:!!m,errorText:I,helperText:s.description?n(s.description):void 0,children:t.jsx(ge,{name:s.name,control:T,render:({field:b})=>t.jsx(P,{align:"start",gap:2,children:t.jsx(ie,{checked:b.value===!0,onCheckedChange:f=>{b.onChange(f.checked===!0)},children:"Activer"})})})},s.name);default:return t.jsx(L,{label:n(s.label),required:s.required,invalid:!!m,errorText:I,helperText:s.description?n(s.description):void 0,children:t.jsx(re,{type:s.type,placeholder:s.placeholder?n(s.placeholder):"",...S(s.name)})},s.name)}};return t.jsx(ht,{...y,children:t.jsx("form",{onSubmit:q(he),children:t.jsxs(P,{gap:4,align:"stretch",children:[u.fields.map(ee),l&&i&&t.jsx(He,{isSetup:!0}),l&&!i&&t.jsx(He,{showActiveImportedCampaignsCount:K,activeImportedCampaignsCount:U.data,isActiveImportedCampaignsCountLoading:U.isLoading,isActiveImportedCampaignsCountError:U.isError}),t.jsxs(k,{justify:"space-between",gap:3,mt:6,align:"center",children:[K?t.jsxs(k,{gap:2,children:[t.jsx(R,{type:"button",variant:"outline",colorScheme:"brand",onClick:()=>{_e()},loading:V.isPending,disabled:V.isPending||J.isPending||U.isLoading||U.isError||(U.data??0)<1,children:n("autoSyncExistingCampaigns.applyButton")}),t.jsx(_t,{content:n("autoSyncExistingCampaigns.applyTooltip"),showArrow:!0,contentProps:{maxW:"280px"},children:t.jsx(W,{color:"gray.500",display:"inline-flex",cursor:"help","aria-label":n("autoSyncExistingCampaigns.applyTooltip"),children:t.jsx(yt,{size:16})})})]}):t.jsx(W,{}),t.jsxs(k,{gap:3,children:[t.jsx(R,{variant:"outline",onClick:o,disabled:O,children:"Annuler"}),t.jsx(R,{type:"submit",colorScheme:"brand",loading:J.isPending,disabled:J.isPending||V.isPending,children:a!=null&&a.is_active?"Mettre à jour":"Configurer"})]})]})]})})})},sa=({open:e,setOpen:a,selectedIntegration:o})=>{var i;const{t:n}=je(["integrations"]),l=()=>{a(!1)};return t.jsx(Ve,{placement:"center",motionPreset:"slide-in-bottom",open:e,onOpenChange:d=>
6a(d.open),size:"lg",closeOnInteractOutside:!1,children:t.jsxs(pe,{children:[t.jsx(Be,{}),t.jsx(pe,{children:t.jsxs(Je,{maxW:o&&at(o.name)?"720px":"600px",children:[t.jsx(We,{children:t.jsxs(Ke,{children:[(i=o==null?void 0:o.integration)!=null&&i.is_active?n("connectivity.dialog.title.update"):n("connectivity.dialog.title.configure"),o&&t.jsxs(c,{fontSize:"sm",fontWeight:"normal",color:"gray.600",mt:1,children:[o.name,t.jsx(ue,{w:12,h:12,bg:"transparent",children:t.jsx(fe,{src:Te[o.name]})})]})]})}),t.jsx(Ge,{maxH:"80vh",overflowY:"auto",children:o?t.jsx(na,{integrationName:o.name,integration:o.integration,handleClose:l}):t.jsx(c,{children:"Aucune intégration sélectionnée"})}),t.jsx(Qe,{asChild:!0,children:t.jsx(Ye,{})})]})})]})})},la=["BEETWEEN","TEAMTAILOR","TEAMTAILOR_API","CUSTOM_TWININ","RECRUITEE","SMART_RECRUITERS","SALESFORCE_1","GESTMAX","EOLIA_DIRECT","TALENTSOFT","TALEEZ","DATA4JOB","TALENTPLUG","TOOL4STAFFING","SUCCESSFACTORS","JOB_AFFINITY","TALENTS_ADV_SUPPLY","MARVIN_RECRUITER","SAMSIC_EMPLOI"],ra=async e=>(await H.post(`/ats-connector/${e}/disable`)).data,ia=({mutationConfig:e}={})=>{const a=de(),{onSuccess:o,...n}=e||{};return Y({mutationFn:ra,onSuccess:(...l)=>{a.invalidateQueries({queryKey:X().queryKey}),o==null||o(...l)},...n})},ca=({open:e,setOpen:a,selectedIntegration:o})=>{const n=ia({mutationConfig:{onSuccess:()=>{a(!1)}}}),l=()=>{a(!1)},i=()=>{o!=null&&o.name&&n.mutate(o.name)};return t.jsx(Ve,{placement:"center",motionPreset:"slide-in-bottom",open:e,onOpenChange:d=>
6a(d.open),size:"lg",children:t.jsxs(pe,{children:[t.jsx(Be,{}),t.jsx(pe,{children:t.jsxs(Je,{maxW:"600px",children:[t.jsx(We,{children:t.jsxs(Ke,{children:["Désactiver",o&&t.jsxs(W,{fontSize:"sm",fontWeight:"normal",color:"gray.600",mt:1,children:[o.name,t.jsx(ue,{w:12,h:12,bg:"transparent",children:t.jsx(fe,{src:Te[o.name]})})]})]})}),t.jsx(Ge,{children:o?t.jsxs(t.Fragment,{children:[t.jsxs(c,{children:["Voulez-vous vraiment désactiver l'intégration ",o.name," ?"]}),t.jsx(c,{children:"Si un ou plusieurs comptes sont automatiquement créés pour accueillir des offres d'emploi de cet ATS, ces comptes seront conservés mais l'ensemble des offres ne seront plus diffusées et seront désactivées."}),t.jsxs(k,{mt:6,gap:4,children:[t.jsx(R,{variant:"outline",colorScheme:"gray",onClick:l,children:"Annuler"}),t.jsx(R,{variant:"solid",colorScheme:"red",onClick:i,loading:n.isPending,children:"Désactiver"})]})]}):t.jsx(c,{children:"Aucune intégration sélectionnée"})}),t.jsx(Qe,{asChild:!0,children:t.jsx(Ye,{})})]})})]})})},ua=()=>{const e=Ot(),[a]=$e(),o=a.get("show")==="samsic",[n,l]=v.useState(!1),[i,d]=v.useState(!1),[u,E]=v.useState(),_=r=>r===p.SAMSIC_EMPLOI?o:!0;if(e.isLoading)return t.jsx(gt,{});const y=e.data;if(!y)return null;const S=y.data.filter(r=>_(r.name)),T=la.filter(r=>_(r)===!1?!1:!y.data.some(x=>x.name===r)),q=(r,x)=>{E({name:r,integration:x}),l(!0)},C=r=>{E({name:r}),d(!0)};return t.jsx(ne,{w:"100%",children:t.jsxs(se,{gap:10,children:[t.jsxs(le,{children:[t.jsxs(M,{display:"flex",alignItems:"center",gap:2,children:[t.jsx(It,{}),t.jsx(c,{fontWeight:"bold",fontSize:"xl",children:"Synchroniser mon ATS"})]}),t.jsx(c,{fontSize:"sm",color:"gray",children:"Vos offres d'emploi sont importées en tant que campagnes, et les candidats partent directement sur votre ATS"})]}),t.jsx(sa,{open:n,setOpen:l,selectedIntegration:u}),t.jsx(ca,{open:i,setOpen:d,selectedIntegration:u}),t.jsxs(Mt,{templateColumns:"repeat(auto-fit, minmax(300px, 1fr))",gap:4,children:[S.map((r,x)=>t.jsx(M,{css:{animation:`fadeInUp 0.5s ease-out ${x*.08}s both`,opacity:0},children:t.jsx(ke,{isActive:r.is_active,isSetupCompleted:r.is_setup_completed,cta:()=>q(r.name,r),disableCta:()=>C(r.name),name:r.name,description:`Connecteur ${Oe(r.name)} pour synchroniser mes offres d'emploi`})},r.id)),T.map((r,x)=>t.jsx(M,{css:{animation:`fadeInUp 0.5s ease-out ${(S.length+x)*.08}s both`,opacity:0},children:t.jsx(ke,{name:r,description:`Connecteur ${Oe(r)} pour synchroniser mes offres d'emploi`,isActive:!1,isSetupCompleted:!1,cta:()=>q(r)})},r))]})]})})},Ca=e=>async()=>{const a=X();return e.getQueryData(a.queryKey)??await e.fetchQuery(a)},Ia=()=>{const[e]=$e(),a=e.get("firstTime")==="true";return t.jsxs(P,{align:"start",children:[t.jsxs(M,{mb:10,children:[t.jsx(c,{fontSize:"2xl",fontWeight:"semibold",children:"Connectivité"}),t.jsx(c,{color:"gray.500",children:"Connectez TalentPicker à vos outils RH préférés ou configurez lenvoi par email."})]}),t.jsx(Ht,{firstTime:a}),t.jsx(St,{children:t.jsx(c,{fontWeight:"bold",fontSize:"xl",color:"gray",children:"OU"})}),t.jsx(ua,{})]})};export{Ca as clientLoader,Ia 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.