PageSourceSearch

https://sales-automation.ai/build/assets/OffersTable-D8CZwVtO.js

js sales-automation.ai collected 2026-10-05 12:32:56 UTC 17,526 bytes, 1 lines download raw bytes

1import{d as le,ah as ie,o as s,c as n,a as u,Q as _,V as p,y as a,W as v,N as l,J as x,a3 as N,M as y,m as w,F as I,P as U,ag as re,a7 as ce,r as g,b as A}from"./vue-vendor-D0krlAb0.js";import{a as j}from"./axios-vendor-D8QQWGbA.js";import{l as P,r as R}from"./inertia-vendor-B1UleJax.js";import{u as de}from"./vue-i18n-D1druVO5.js";import{C as ue}from"./CommonTable-Co_-lqHg.js";import{L as pe}from"./LeadTableColumnConfig-BQEgUN7Q.js";import{_ as me}from"./DetailsPopover-DMf_E2Eq.js";import{_ as fe}from"./LeadOverviewV2-CCmkoFzp.js";import{r as _e,f as xe,t as he,u as ye}from"./app-BfyP88rG.js";import{_ as be}from"./CompanyDetailSlider-D3OBIbhD.js";import{aQ as W,aS as ve,aE as ge,aT as ke,aU as we,aV as Ce,aW as $e,ar as Ne}from"./vendor-By_xewFp.js";import"./echo-vendor-BBfRIm2m.js";import"./lodash-vendor-C9X7AA5U.js";import"./emoji-vendor-B-az5UrJ.js";import"./MessageContentRenderer-PRaF9g7p.js";import"./htmlToPlainText-B7wew14e.js";import"./EmbeddedMeetingCalender-BYEbjshZ.js";import"./useTeamsPresence-DQa-eGQv.js";import"./CompanyDetail-BW2-yWIX.js";import"./googleMapsLoader-BBRW8CfH.js";import"./useThumbIo-KOjejobI.js";import"./icons-BDs4JkHp.js";import"./hotLeadsPanels-CtmV3WHI.js";import"./safeHtml-DA1iLTYi.js";import"./useManualCallLog-K76ASk1e.js";import"./unipileAccountsStore-DBvXRk5v.js";import"./pinia-vendor-BDcgz45G.js";import"./AssetPicker-D0-JmGW9.js";import"./LinkedInAccountSelector-BdPLIweD.js";import"./LeadLabelDropdown-DH1lDd17.js";import"./ColorPicker-Be_6ajO4.js";import"./useLabelTranslations-BhYRa59o.js";import"./LabelManager-uQB5K2Al.js";import"./LabelAnswerCard-BWoYQvbO.js";import"./MarkdownRenderer-D_mmVF8V.js";import"./highlight-vendor-DEKntZBs.js";import"./CreateMeetingModal-DAExrT34.js";import"./InlineBookingModal-DV9hVrak.js";import"./SlotPicker-CIRt8LA1.js";import"./useTimezoneOptions-Du-NiLjX.js";import"./ConfirmationCard-oySsQ2CK.js";import"./Form-UG4Z9uam.js";import"./Checkbox-DKe_Came.js";import"./useLeadAvatarDisplay-Bqx7Mbra.js";import"./companyPage-BYBEnI-U.js";import"./LeadAvatar-zlDDHylf.js";import"./leadEmail-ZXTa2m4Q.js";import"./useVoiceCallTimelineRefresh-DTj9FFDN.js";import"./tel-input-vendor-Dsa4Ey81.js";import"./stripe-vendor-CPICCz1r.js";const je={class:"mb-3 flex items-center justify-end"},Se={class:"glass-card overflow-hidden rounded-2xl border border-slate-100 bg-white shadow-xl"},Ee={key:0,class:"flex items-center gap-3"},De={class:"flex h-9 w-9 shrink-0 items-center justify-center overflow-hidden rounded-lg border border-slate-200 bg-slate-50 p-1"},Ie=["src","alt","onError"],Ue={key:1,class:"text-[10px] font-bold text-slate-400"},Ae={class:"min-w-0"},Le=["onClick"],Te={key:1,class:"block truncate font-semibold text-slate-900"},ze=["href"],Oe={key:3,class:"mt-0.5 block truncate text-[11px] text-slate-400"},qe={key:1,class:"text-sm text-slate-400"},Be={class:"min-w-0"},Fe={class:"mt-0.5 flex items-center gap-1.5 text-xs text-slate-500"},Me={key:0},Ve={key:1,class:"font-medium text-amber-600"},Pe={key:2,class:"rounded bg-slate-100 px-1.5 py-0.5 text-[10px] font-medium uppercase tracking-wide text-slate-500"},Re={class:"flex flex-col gap-1"},We={key:0,class:"truncate text-[11px] text-slate-400"},Qe={key:0,class:"font-semibold text-slate-900"},Je={key:1,class:"text-sm text-slate-400"},Ge={key:0,class:"flex flex-wrap gap-1"},He={key:1,class:"text-sm text-slate-400"},Ke={class:"flex items-center gap-1.5"},Xe={class:"flex -space-x-1.5"},Ye={class:"text-sm text-slate-600"},Ze={class:"divide-y divide-slate-100"},et=["onClick"],tt={class:"min-w-0 flex-1"},st={class:"block truncate text-sm text-slate-700"},ot={class:"block truncate text-xs text-slate-400"},nt={key:0,class:"shrink-0 rounded-full bg-blue-50 px-2 py-0.5 text-[10px] font-medium uppercase tracking-wide text-blue-700 ring-1 ring-inset ring-blue-200"},at={key:1,class:"shrink-0 rounded-full bg-emerald-50 px-2 py-0.5 text-[10px] font-medium uppercase tracking-wide text-emerald-700 ring-1 ring-inset ring-emerald-200"},lt={key:1,class:"text-sm text-slate-400"},it={key:0,class:"text-sm"},rt={class:"text-slate-700"},ct={key:0,class:"truncate text-[11px] text-slate-400"},dt={key:1,class:"text-sm text-slate-400"},ut={key:0,class:"text-sm text-slate-700"},pt={key:1,class:"text-sm text-slate-400"},mt={key:0,class:"text-sm text-slate-700"},ft={key:1,class:"text-sm text-slate-400"},_t={key:0,class:"text-sm text-slate-700"},xt={key:1,class:"text-sm text-slate-400"},ht={class:"rounded bg-slate-100 px-1.5 py-0.5 text-xs text-slate-500"},yt={class:"flex items-center justify-end gap-1"},bt=["href"],vt=["disabled","onClick"],gt=["disabled","onClick"],kt=["onClick"],wt=["onClick"],Ct={key:0,class:"fixed inset-0 z-[100001] flex flex-col overflow-hidden bg-slate-50/95 backdrop-blur-xl"},$t={class:"flex items-center justify-between border-b border-slate-200 bg-white/70 px-6 py-3"},Nt={class:"truncate text-sm font-semibold text-slate-900"},jt={key:0,class:"flex flex-1 items-center justify-center"},St={key:1,class:"flex min-h-0 flex-1 flex-col overflow-hidden"},$s={__name:"OffersTable",props:{offers:{type:Array,default:()=>[]}},emits:["rename","delete"],setup(L,{emit:Q}){const T=Q,{t:o}=de(),{addNotification:C}
1=ye(),{formatDateFromNow:z}=_e(),J=new Intl.NumberFormat("de-DE",{style:"currency",currency:"EUR",minimumFractionDigits:0,maximumFractionDigits:0}),G=t=>t==null?null:J.format(Number(t)),H=[{key:"prospect",label:o("Company"),width:"min-w-[220px]"},{key:"offer_name",label:o("Offer"),width:"min-w-[200px]"},{key:"status",label:o("Status"),width:"min-w-[170px]"},{key:"acv",label:o("Deal size (ACV)"),width:"min-w-[140px]"},{key:"upsells",label:o("Upsells"),width:"min-w-[180px]"},{key:"leads",label:o("offers_col_leads"),width:"min-w-[200px]"},{key:"last_touchpoint",label:o("offers_col_last_touchpoint"),width:"min-w-[180px]"},{key:"client",label:o("Client"),width:"min-w-[180px]",visible:!1},{key:"payment",label:o("offers_col_payment"),width:"min-w-[170px]",visible:!1},{key:"signed_at",label:o("Signed"),width:"min-w-[140px]",visible:!1},{key:"offer_link",label:o("Link"),width:"min-w-[160px]",visible:!1},{key:"actions",label:"",width:"min-w-[150px]"}],$=A(()=>H.map((t,i)=>({key:t.key,slotName:t.key,label:t.label,visible:t.visible!==!1,order_index:i,hidden:t.visible===!1,headerClass:`px-3 py-3.5 text-left text-sm font-semibold text-slate-900 ${t.width}`,cellClass:`content-start px-3 py-3 ${t.width}`}))),S=g(null),E=g(!1),D=g(!1),K=(t=[])=>{const i=$.value,r=new Map(i.map(f=>[f.key,f])),c=[...(Array.isArray(t)?t:[]).filter(f=>r.has(f.key)).map(f=>{const b=r.get(f.key);return{...b,...f,key:b.key,slotName:b.slotName,visible:f.visible!==!1}})];return i.forEach((f,b)=>{c.some(ae=>ae.key===f.key)||c.splice(Math.min(b,c.length),0,{...f,visible:!0})}),c.map((f,b)=>({...f,order_index:b,hidden:f.visible===!1}))},O=A(()=>{var i;const t=(i=S.value)==null?void 0:i.columns;return Array.isArray(t)&&t.length>0?t:$.value}),X=A(()=>O.value.slice().sort((t,i)=>(t.order_index??0)-(i.order_index??0)).map(t=>({...t,slotName:t.slotName||t.key})).filter(t=>t.visible!==!1)),q=async()=>{var t,i;if(!D.value){D.value=!0;try{const r=await j.get(route("leads.table-columns.config"),{params:{view:"offers"}}),e=K(((t=r.data)==null?void 0:t.columns)??[]);S.value={columns:e.length>0?e:$.value,is_default:!!((i=r.data)!=null&&i.is_default)}}catch{S.value={columns:$.value,is_default:!0}}finally{D.value=!1}}};le(q);const B={slate:"bg-slate-100 text-slate-600 ring-slate-200",blue:"bg-blue-50 text-blue-700 ring-blue-200",amber:"bg-amber-50 text-amber-700 ring-amber-200",emerald:"bg-emerald-50 text-emerald-700 ring-emerald-200",teal:"bg-teal-50 text-teal-700 ring-teal-200",green:"bg-green-50 text-green-700 ring-green-200",red:"bg-red-50 text-red-700 ring-red-200"},Y=t=>B[t.status_tone]??B.slate,Z=t=>o(`offer_status_${t.status}`),h=g(null),k=g({open:!1,companyId:null}),F=t=>(t||"?").split(/\s+/).filter(Boolean).slice(0,2).map(i=>{var r;return((r=i[0])==null?void 0:r.toUpperCase())??""}).join("")||"?",M=t=>t.is_primary?"bg-blue-100 text-blue-700":t.is_signatory?"bg-emerald-100 text-emerald-700":"bg-slate-100 text-slate-500",m=g({open:!1,loading:!1,data:null,name:""});async function ee(t){if(t!=null&&t.id){m.value={open:!0,loading:!0,data:null,name:t.name};try{const{data:i}=await j.get(route("leads.overview.props",t.id));m.value={open:!0,loading:!1,data:i,name:t.name}}catch{m.value={open:!1,loading:!1,data:null,name:""},C(o("offers_lead_overview_failed"),"error")}}}function V(){m.value={open:!1,loading:!1,data:null,name:""}}function te(t){t&&(k.value={open:!0,companyId:t})}async function se(t,i){var r,e;if(!h.value&&!(i&&!window.confirm(o("offers_confirm_mark_lost")))){h.value=t.id;try{const{data:d}=await j.post(route("admin.offers.lost",t.slug),{lost:i});t.status=d.status,t.lost_at=d.lost_at,t.lost_reason=d.lost_reason,R.reload({only:["offers"],preserveScroll:!0,preserveState:!0})}catch(d){C(((e=(r=d==null?void 0:d.response)==null?void 0:r.data)==null?void 0:e.message)||o("offers_status_update_failed"),"error")}finally{h.value=null}}}async function oe(t){var i;if(!h.value){h.value=t.id;try{const{data:r}=await j.post(route("admin.offers.request-payment-info",t.slug));C(o("offers_payment_info_requested",{recipients:(r.recipients??[]).join(", ")}),"success"),R.reload({only:["offers"],preserveScroll:!0,preserveState:!0})}catch(r){const e=((i=r==null?void 0:r.response)==null?void 0:i.data)??{},d=e.errors?Object.values(e.errors).flat()[0]:e.message;C(d||o("offers_payment_info_request_failed"),"error")}finally{h.value=null}}}const ne=t=>!!t.client&&["signed","payment_info_collected"].includes(t.status);return(t,i)=>{const r=ie("tooltip");return s(),n("div",null,[u("div",je,[_(xe,{size:"sm",type:"button",onClick:i[0]||(i[0]=e=>E.value=!0)},{default:p(()=>[_(a(W),{class:"h-3.5 w-3.5"}),v(" "+l(a(o)("Columns")),1)]),_:1})]),u("div",Se,[_(ue,{columns:X.value,data:L.offers},{prospect:p(({data:e})=>[e.prospect?(s(),n("div",Ee,[u("div",De,[e.prospect.logo_url&&!e._logoError?(s(),n("img",{key:0,src:e.prospect.logo_url,alt:e.prospect.name||"",class:"h-full w-full object-contain",onError:d=>e._logoError=!0},null,40,Ie)):(s(),n("span",Ue,l((e.prospect.name||"?").substring(0,2)),1))]),u("div",Ae,[e.prospect.company_id?x((s(),n("button",{key:0,t
1ype:"button",class:"block max-w-full truncate text-left font-semibold text-slate-900 hover:text-blue-600 hover:underline",onClick:re(d=>te(e.prospect.company_id),["stop"])},[v(l(e.prospect.name||a(o)("Unknown Company")),1)],8,Le)),[[r,a(o)("offers_open_company")]]):(s(),n("span",Te,l(e.prospect.name||a(o)("Unknown Company")),1)),e.prospect.dealroom_slug?(s(),n("a",{key:2,href:t.route("discovery.show",e.prospect.dealroom_slug),class:"mt-0.5 block truncate text-[11px] text-slate-400 hover:text-blue-500 hover:underline"},l(a(o)("Open dealroom")),9,ze)):e.prospect.website?(s(),n("span",Oe,l(e.prospect.website),1)):y("",!0)])])):x((s(),n("span",qe,[v(l(a(o)("offers_no_dealroom")),1)])),[[r,a(o)("offers_no_dealroom_hint")]])]),offer_name:p(({data:e})=>[u("div",Be,[_(a(P),{href:t.route("admin.offers.edit",e.slug),class:"block truncate font-medium text-slate-900 hover:text-blue-600 hover:underline"},{default:p(()=>[v(l(e.name),1)]),_:2},1032,["href"]),u("div",Fe,[e.items_count?(s(),n("span",Me,l(a(o)("{fixed} fixed · {upsell} upsells",{fixed:e.fixed_count,upsell:e.upsell_count})),1)):(s(),n("span",Ve,l(a(o)("No packages yet")),1)),e.is_active?y("",!0):(s(),n("span",Pe,l(a(o)("Inactive")),1))])])]),status:p(({data:e})=>[u("div",Re,[u("span",{class:w(["inline-flex w-fit items-center rounded-full px-2 py-0.5 text-xs font-medium ring-1 ring-inset",Y(e)])},l(Z(e)),3),e.lost_reason?x((s(),n("span",We,[v(l(e.lost_reason),1)])),[[r,e.lost_reason]]):y("",!0)])]),acv:p(({data:e})=>[e.acv!==null?(s(),n("span",Qe,l(G(e.acv)),1)):(s(),n("span",Je,"—"))]),upsells:p(({data:e})=>{var d;return[(d=e.upsells)!=null&&d.length?(s(),n("div",Ge,[(s(!0),n(I,null,U(e.upsells,c=>x((s(),n("span",{key:c.id,class:w(["inline-flex items-center rounded px-1.5 py-0.5 text-[11px] ring-1 ring-inset",c.selected_by_default?"bg-sky-50 text-sky-700 ring-sky-200":"bg-slate-50 text-slate-600 ring-slate-200"])},[v(l(c.name||a(o)("Package")),1)],2)),[[r,c.selected_by_default?a(o)("offers_upsell_preselected"):a(o)("offers_upsell_optional")]])),128))])):(s(),n("span",He,"—"))]}),leads:p(({data:e})=>{var d;return[(d=e.leads)!=null&&d.length?(s(),N(me,{key:0,title:a(o)("offers_col_leads"),"trigger-type":"hover",size:"lg"},{trigger:p(()=>[u("span",Ke,[u("span",Xe,[(s(!0),n(I,null,U(e.leads.slice(0,3),c=>(s(),n("span",{key:c.id,class:w(["flex size-6 shrink-0 items-center justify-center rounded-full text-[10px] font-semibold ring-2 ring-white",M(c)])},l(F(c.name)),3))),128))]),u("span",Ye,l(e.leads.length),1)])]),default:p(()=>[u("ul",Ze,[(s(!0),n(I,null,U(e.leads,c=>(s(),n("li",{key:c.id},[u("button",{type:"button",class:"flex w-full items-center gap-2 py-2 text-left transition-colors hover:bg-slate-50",onClick:f=>ee(c)},[u("span",{class:w(["flex size-7 shrink-0 items-center justify-center rounded-full text-[11px] font-semibold",M(c)])},l(F(c.name)),3),u("span",tt,[u("span",st,l(c.name),1),u("span",ot,l([c.job_title,c.email].filter(Boolean).join(" · ")||a(o)("offers_lead_no_details")),1)]),c.is_primary?(s(),n("span",nt,l(a(o)("offers_lead_primary_short")),1)):c.is_signatory?(s(),n("span",at,l(a(o)("offers_lead_signed_short")),1)):y("",!0)],8,et)]))),128))])]),_:2},1032,["title"])):(s(),n("span",lt,"—"))]}),last_touchpoint:p(({data:e})=>[e.last_touchpoint?(s(),n("div",it,[u("span",rt,l(a(z)(e.last_touchpoint.at)),1),e.last_touchpoint.label?(s(),n("div",ct,l(e.last_touchpoint.label),1)):y("",!0)])):(s(),n("span",dt,l(a(o)("offers_no_touchpoint")),1))]),client:p(({data:e})=>[e.client?(s(),n("span",ut,l(e.client.name),1)):(s(),n("span",pt,l(a(o)("Unassigned")),1))]),payment:p(({data:e})=>[e.client?(s(),n("span",mt,l(e.client.mandate_label),1)):(s(),n("span",ft,"—"))]),signed_at:p(({data:e})=>[e.signed_at?(s(),n("span",_t,l(a(z)(e.signed_at)),1)):(s(),n("span",xt,"—"))]),offer_link:p(({data:e})=>[u("code",ht,"/offer/"+l(e.slug),1)]),actions:p(({data:e})=>[u("div",yt,[x((s(),N(a(P),{href:t.route("admin.offers.edit",e.slug),class:"rounded-md p-1.5 text-slate-400 transition-colors hover:bg-blue-50 hover:text-blue-600"},{default:p(()=>[_(a(W),{class:"h-4 w-4"})]),_:1},8,["href"])),[[r,a(o)("Edit packages")]]),x((s(),n("a",{href:`/offer/${e.slug}`,target:"_blank",class:"rounded-md p-1.5 text-slate-400 transition-colors hover:bg-slate-100 hover:text-slate-700"},[_(a(ve),{class:"h-4 w-4"})],8,bt)),[[r,a(o)("Preview")]]),ne(e)?x((s(),n("button",{key:0,t
1ype:"button",class:"rounded-md p-1.5 text-slate-400 transition-colors hover:bg-teal-50 hover:text-teal-600 disabled:cursor-not-allowed",disabled:h.value===e.id,onClick:d=>oe(e)},[h.value===e.id?(s(),N(a(ge),{key:0,class:"h-4 w-4 animate-spin"})):(s(),N(a(ke),{key:1,class:"h-4 w-4"}))],8,vt)),[[r,a(o)("offers_request_payment_info")]]):y("",!0),x((s(),n("button",{type:"button",class:w(["rounded-md p-1.5 text-slate-400 transition-colors disabled:cursor-not-allowed",e.lost_at?"text-red-500 hover:bg-red-50":"hover:bg-red-50 hover:text-red-500"]),disabled:h.value===e.id,onClick:d=>se(e,!e.lost_at)},[_(a(we),{class:"h-4 w-4"})],10,gt)),[[r,e.lost_at?a(o)("pipeline_reopen"):a(o)("offers_mark_lost")]]),x((s(),n("button",{type:"button",class:"rounded-md p-1.5 text-slate-400 transition-colors hover:bg-slate-100 hover:text-slate-700",onClick:d=>T("rename",e)},[_(a(Ce),{class:"h-4 w-4"})],8,kt)),[[r,a(o)("Rename")]]),x((s(),n("button",{type:"button",class:"rounded-md p-1.5 text-slate-400 transition-colors hover:bg-red-50 hover:text-red-600",onClick:d=>T("delete",e)},[_(a($e),{class:"h-4 w-4"})],8,wt)),[[r,a(o)("Delete")]])])]),_:1},8,["columns","data"])]),_(ce,{"enter-active-class":"transition ease-out duration-200","enter-from-class":"opacity-0","enter-to-class":"opacity-100","leave-active-class":"transition ease-in duration-150","leave-from-class":"opacity-100","leave-to-class":"opacity-0"},{default:p(()=>{var e;return[m.value.open?(s(),n("div",Ct,[u("div",$t,[u("span",Nt,l(m.value.name),1),x((s(),n("button",{type:"button",class:"rounded-md p-1.5 text-slate-400 transition-colors hover:bg-slate-100 hover:text-slate-700",onClick:V},[_(a(Ne),{class:"h-5 w-5"})])),[[r,a(o)("Close")]])]),m.value.loading?(s(),n("div",jt,[_(he,{name:"loading",class:"h-16 w-16"})])):m.value.data?(s(),n("div",St,[_(fe,{class:"h-full min-h-0 flex-1",mode:"browse","lead-data":m.value.data.lead??null,"company-data":m.value.data.company??null,activities:m.value.data.activities??[],"campaign-info":m.value.data.campaignInfo??null,"campaign-infos":m.value.data.campaignInfos??[],priority:m.value.data.priority||"Medium","lead-inbox":((e=m.value.data.chatData)==null?void 0:e.leadInbox)??null,"leo-workspace-access":m.value.data.leoWorkspaceAccess??{has_access:!0,requires_campaign:!1},"can-go-back":!1,"can-go-forward":!1,"total-count":1,"current-index":0,onClose:V},null,8,["lead-data","company-data","activities","campaign-info","campaign-infos","priority","lead-inbox","leo-workspace-access"])])):y("",!0)])):y("",!0)]}),_:1}),_(be,{open:k.value.open,"company-id":k.value.companyId,"route-name":"admin.offers.company-detail","onUpdate:open":i[1]||(i[1]=e=>{k.value.open=e,e||(k.value.companyId=null)})},null,8,["open","company-id"]),_(pe,{show:E.value,view:"offers",columns:O.value,rows:L.offers,onClose:i[2]||(i[2]=e=>E.value=!1),onUpdated:q},null,8,["show","columns","rows"])])}}};export{$s 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.