(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,77071,e=>{"use strict";let r=(0,e.i(56420).default)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);e.s(["Plus",0,r],77071)},95187,(e,r,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0});var l={callServer:function(){return t.callServer},createServerReference:function(){return s.createServerReference},findSourceMapURL:function(){return i.findSourceMapURL}};for(var a in l)Object.defineProperty(n,a,{enumerable:!0,get:l[a]});let t=e.r(32120),i=e.r(92245),s=e.r(35326)},4198,e=>{"use strict";var r=e.i(43476),n=e.i(71645),l=e.i(77071),a=e.i(38286),t=e.i(19367),i=e.i(95187);let s=(0,i.createServerReference)("40e71ca6e6399c1ea60c37cb120dc711e0cd2a41f8",i.callServer,void 0,i.findSourceMapURL,"createAutomation"),o=(0,i.createServerReference)("400da584ef99050d50d6f1eda119ef64f2a5c2593c",i.callServer,void 0,i.findSourceMapURL,"createTemplate");e.s(["NewAutomationButton",0,function(){let[e,i]=(0,n.useState)(!1);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(a.Button,{onClick:()=>i(!0),children:[(0,r.jsx)(l.Plus,{className:"h-4 w-4"})," Nouvelle automatisation"]}),(0,r.jsx)(t.Modal,{open:e,onClose:()=>i(!1),title:"Nouvelle automatisation",wide:!0,children:(0,r.jsxs)("form",{action:s,className:"space-y-4",children:[(0,r.jsx)(a.Field,{label:"Nom",required:!0,children:(0,r.jsx)(a.Input,{name:"name",placeholder:"Ex : Relance livrable manquant",required:!0})}),(0,r.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,r.jsx)(a.Field,{label:"Déclencheur",children:(0,r.jsxs)(a.Select,{name:"trigger",defaultValue:"LIVRABLE_NON_DEPOSE",children:[(0,r.jsx)("option",{value:"CONTRAT_ECHEANCE",children:"Contrat arrivant à échéance"}),(0,r.jsx)("option",{value:"LIVRABLE_NON_DEPOSE",children:"Livrable non déposé avant la date limite"}),(0,r.jsx)("option",{value:"INACTIVITE_LIVE",children:"Inactivité LIVE prolongée"}),(0,r.jsx)("option",{value:"CAMPAGNE_PUBLIEE",children:"Campagne passée au statut « Publié »"}),(0,r.jsx)("option",{value:"STATS_COMPLETES",children:"Statistiques toutes renseignées"}),(0,r.jsx)("option",{value:"IMPAYE_SEUIL",children:"Impayé dépassant un seuil"})]})}),(0,r.jsx)(a.Field,{label:"Action",children:(0,r.jsxs)(a.Select,{name:"action",defaultValue:"CREER_TACHE",children:[(0,r.jsx)("option",{value:"CREER_TACHE",children:"Créer une tâche"}),(0,r.jsx)("option",{value:"NOTIFIER",children:"Notifier"}),(0,r.jsx)("option",{value:"GENERER_FACTURE",children:"Préparer une facture"}),(0,r.jsx)("option",{value:"GENERER_RAPPORT",children:"Générer un rapport PDF"}),(0,r.jsx)("option",{value:"ALERTER",children:"Alerter la direction"})]})})]}),(0,r.jsx)(a.Field,{label:"Configuration (JSON)",hint:"Paramètres avancés du déclencheur",children:(0,r.jsx)(a.Textarea,{name:"config",placeholder:'{ "seuil": 1000, "delaiJours": 3 }'})}),(0,r.jsxs)("div",{className:"flex justify-end gap-2 border-t border-ink-700 pt-4",children:[(0,r.jsx)(a.Button,{type:"button",variant:"ghost",onClick:()=>i(!1),children:"Annuler"}),(0,r.jsx)(a.Button,{type:"submit",children:"Créer"})]})]})})]})},"NewTemplateButton",0,function(){let[e,i]=(0,n.useState)(!1);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(a.Button,{onClick:()=>i(!0),children:[(0,r.jsx)(l.Plus,{className:"h-4 w-4"})," Nouveau modèle"]}),(0,r.jsx)(t.Modal,{open:e,onClose:()=>i(!1),title:"Nouveau modèle",wide:!0,children:(0,r.jsxs)("form",{action:o,className:"space-y-4",children:[(0,r.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,r.jsx)(a.Field,{label:"Nom",required:!0,children:(0,r.jsx)(a.Input,{name:"name",required:!0})}),(0,r.jsx)(a.Field,{label:"Type",children:(0,r.jsxs)(a.Select,{name:"type",defaultValue:"CONTRAT",children:[(0,r.jsx)("option",{value:"CONTRAT",children:"Contrat"}),(0,r.jsx)("option",{value:"BRIEF",children:"Brief"}),(0,r.jsx)("option",{value:"RAPPORT",children:"Rapport"}),(0,r.jsx)("option",{value:"FACTURE",children:"Facture"}),(0,r.jsx)("option",{value:"MAIL",children:"Email"})]})})]}),(0,r.jsx)(a.Field,{label:"Variables (séparées par des virgules)",children:(0,r.jsx)(a.Input,{name:"variables",placeholder:"{{nom}}, {{pseudo}}"})}),(0,r.jsx)(a.Field,{label:"Contenu",required:!0,children:(0,r.jsx)(a.Textarea,{name:"content",className:"min-h-40 font-mono text-xs",required:!0})}),(0,r.jsxs)("div",{className:"flex justify-end gap-2 border-t border-ink-700 pt-4",children:[(0,r.jsx)(a.Button,{type:"button",variant:"ghost",onClick:()=>i(!1),children:"Annuler"}),(0,r.jsx)(a.Button,{type:"submit",children:"Créer"})]})]})})]})}],4198)}]);