PageSourceSearch

https://www.auttiv.com/assets/CadencesModal-kRVCXcK6.js

js auttiv.com collected 2026-10-02 01:24:30 UTC 4,379 bytes, 1 lines download raw bytes

1import{k as i,j as t}from"./vendor-Dfxs0MA2.js";import{d as _}from"./SellerConsole-DjgxrZyx.js";import{u as S,t as a,s as d}from"./index-CIKckvOq.js";function B({onClose:g}){S();const m={nuevo:a("cadences.stage.nuevo"),contactado:a("cadences.stage.contactado"),test_drive:a("cadences.stage.test_drive"),negociando:a("cadences.stage.negociando"),cerrado:a("cadences.stage.cerrado"),perdido:a("cadences.stage.perdido")},x={nuevo:"#3B82F6",contactado:"#A855F7",test_drive:"#F97316",negociando:"#EAB308",cerrado:"#22C55E",perdido:"#6B7280"},c=_(),[f,l]=i.useState([]),[v,h]=i.useState(!0),[p,y]=i.useState(null);i.useEffect(()=>{(async()=>{var s;if(!d)return;const{data:e}=await d.auth.getUser();y(((s=e.user)==null?void 0:s.id)??null);const{data:r}=await d.from("cadences").select("*").order("stage").order("day_offset");l(r??[]),h(!1)})()},[]);async function b(e){if(!d||!p)return;if(e.user_id!==p){const{data:n,error:o}=await d.from("cadences").insert({stage:e.stage,day_offset:e.day_offset,name:e.name,prompt_template:e.prompt_template,channel_pref:e.channel_pref,user_id:p,status:"paused"}).select().single();n?(c.push("info",e.status==="active"?a("cadences.duplicatedPause"):a("cadences.duplicatedActivate")),l(j=>[...j,n])):c.push("error",(o==null?void 0:o.message)||"No se pudo crear tu copia de la cadencia.");return}const r=e.status==="active"?"paused":"active",{error:s}=await d.from("cadences").update({status:r}).eq("id",e.id);if(s){c.push("error","No se pudo cambiar la cadencia — inténtalo de nuevo.");return}l(n=>n.map(o=>o.id===e.id?{...o,status:r}:o))}const u={};for(const e of f)(u[e.stage]=u[e.stage]??[]).push(e);return t.jsx("div",{className:"mask",onClick:g,children:t.jsxs("div",{className:"modal-card",style:{maxWidth:640,maxHeight:"92vh",overflowY:"auto"},onClick:e=>e.stopPropagation(),children:[t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:6},children:[t.jsx("h2",{className:"modal-h",children:a("cadences.title")}),t.jsx("button",{onClick:g,style:{background:"transparent",border:"none",color:"var(--text-tertiary)",fontSize:22},children:"×"})]}),t.jsx("p",{style:{fontSize:13,color:"var(--text-secondary)",marginBottom:14},children:a("cadences.sub")}),v?t.jsx("div",{style:{padding:40,textAlign:"center",color:"var(--text-tertiary)"},children:a("common.loading")}):f.length===0?t.jsx("div",{style:{padding:30,textAlign:"center",background:"rgba(0,0,0,.02)",borderRadius:10,color:"var(--text-tertiary)"},children:a("cadences.empty")}):["nuevo","contactado","test_drive","negociando","cerrado","perdido"].map(e=>{const r=u[e]??[];return r.length===0?null:t.jsxs("div",{style:{background:"rgba(0,0,0,.02)",border:"1px solid var(--border-subtle)",borderRadius:12,padding:14,marginBottom:10},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:10},children:[t.jsx("div",{style:{width:10,height:10,borderRadius:5,background:x[e]}}),t.jsx("div",{style:{fontWeight:700,fontSize:14},children:m[e]}),t.jsxs("div",{style:{marginLeft:"auto",fontSize:11,color:"var(--text-tertiary)"},children:[r.length," ",a("nav.messages")]})]}),r.map(s=>t.jsxs("div",{style:{display:"flex",gap:10,alignItems:"flex-start",padding:"8px 0",borderTop:"1px solid var(--border-subtle)"},children:[t.jsxs("div",{style:{fontFamily:"'Playfair Display', serif",fontWeight:700,color:"var(--primary)",minWidth:40,textAlign:"center",fontSize:15},children:["D",s.day_offset]}),t.jsxs("div",{style:{flex:1,minWidth:0},children:[t.jsx("div",{style:{fontSize:13,fontWeight:600},children:s.name}),t.jsxs("div",{style:{fontSize:11,color:"var(--text-tertiary)",marginTop:2,lineHeight:1.4},children:[s.prompt_template.slice(0,120),"…"]}),t.jsx("div",{style:{display:"flex",gap:4,marginTop:4},children:s.channel_pref.map(n=>t.jsx("span",{style:{fontSize:9,fontWeight:700,letterSpacing:1,padding:"2px 6px",borderRadius:4,background:"var(--tint-1)",color:"var(--text-secondary)"},children:n.toUpperCase()},n))})]}),t.jsx("button",{type:"button",onClick:()=>b(s),style:{background:s.status==="active"?"rgba(34,197,94,.15)":"rgba(107,114,128,.15)",color:s.status==="active"?"#16a34a":"#6B7280",border:0,padding:"4px 10px",borderRadius:6,fontSize:10,fontWeight:800,letterSpacing:1,cursor:"pointer"},children:s.status==="active"?`▶ ${a("cadences.active")}`:`⏸ ${a("cadences.paused")}`})]},s.id))]},e)})]})})}export{B 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.