PageSourceSearch

https://jigsawconferences.co.uk/_next/static/chunks/87664-5812ccd475da9ff4.js

js jigsawconferences.co.uk collected 2026-09-28 13:38:00 UTC 26,036 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[87664],{87664:(e,t,a)=>{a.r(t),a.d(t,{default:()=>y});var s=a(95155),n=a(12115),l=a(39867),r=a(86651),i=a(66955),d=a(23664),c=a(93499),o=a(65229),x=a(30814),m=a(89559);function u(e){var t;let{bearerToken:a,sessionToken:l}=e,[i,d]=(0,n.useState)(null),[c,o]=(0,n.useState)(""),[u,p]=(0,n.useState)(""),h={"Content-Type":"application/json",...l?{"X-Admin-Token":l}:{},...a?{Authorization:"Bearer ".concat(a)}:{}},b=(0,n.useCallback)(async()=>{try{let e=await fetch("".concat("","/api/ads-offline/status"),{headers:h});e.ok&&d(await e.json())}catch(e){}},[a,l]);(0,n.useEffect)(()=>{b()},[b]);let g=async(e,t)=>{p(e),o("");try{let a=await fetch("".concat("","/api/ads-offline/").concat(e),{method:"POST",headers:h,body:JSON.stringify(t||{})}),s=await a.json();if(!a.ok)throw Error(s.detail||"Failed");o("run-now"===e?s.note||"Picked ".concat(s.picked," \xb7 uploaded ").concat(s.uploaded," \xb7 failed ").concat(s.failed," \xb7 blocked ").concat(s.blocked):"Found ".concat(s.actions.length," import actions: ").concat(s.actions.map(e=>"".concat(e.name," (#").concat(e.id,")")).join(", ")||'none — create "Qualified lead" and "Booked event" in Google Ads')),b()}catch(e){o(e.message)}p("")};if(!i)return null;let f=i.counts||{};return(0,s.jsxs)("div",{className:"bg-white rounded-lg shadow-sm border border-gray-200 p-4","data-testid":"ads-offline-panel",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[(0,s.jsxs)("div",{children:[(0,s.jsxs)("p",{className:"text-xs font-bold uppercase tracking-[0.18em] text-orange-600 flex items-center gap-2",children:[(0,s.jsx)(x.A,{className:"w-4 h-4"})," Google Ads offline conversions"]}),(0,s.jsxs)("p",{className:"mt-1 text-sm text-gray-600",children:["Marking an enquiry ",(0,s.jsx)("strong",{children:"Qualified"})," or ",(0,s.jsx)("strong",{children:"Booked"})," queues a conversion for AW-11048340059; the worker uploads ",i.schedule,". Booked default \xa3",i.booked_default_value,"."]})]}),(0,s.jsx)("span",{"data-testid":"ads-offline-state",className:"text-xs font-bold px-3 py-1 rounded-full ".concat(i.enabled?"bg-emerald-100 text-emerald-800":"bg-amber-100 text-amber-800"),children:i.enabled?"Connected":"Awaiting credentials \xb7 ".concat(i.missing_env.length," env vars")})]}),(0,s.jsx)("div",{className:"mt-3 flex flex-wrap gap-2 text-xs","data-testid":"ads-offline-counts",children:["queued","uploading","uploaded","failed","blocked","unmatchable"].map(e=>(0,s.jsxs)("span",{className:"rounded-full bg-gray-100 text-gray-700 font-semibold px-3 py-1 capitalize",children:[e," \xb7 ",f[e]||0]},e))}),(0,s.jsxs)("div",{className:"mt-3 flex flex-wrap gap-2",children:[(0,s.jsxs)("button",{"data-testid":"ads-offline-run-now",disabled:""!==u,onClick:()=>g("run-now",{force:!1}),className:"inline-flex items-center gap-1.5 rounded-lg bg-gray-900 hover:bg-gray-700 text-white text-sm font-bold px-3 py-2 disabled:opacity-60",children:[(0,s.jsx)(m.A,{className:"w-4 h-4"})," Sync now"]}),(0,s.jsxs)("button",{"data-testid":"ads-offline-discover",disabled:""!==u||!i.enabled,onClick:()=>g("discover-actions"),className:"inline-flex items-center gap-1.5 rounded-lg border border-gray-300 hover:bg-gray-50 text-gray-800 text-sm font-bold px-3 py-2 disabled:opacity-60",children:[(0,s.jsx)(r.A,{className:"w-4 h-4"})," Discover conversion actions"]})]}),c?(0,s.jsx)("p",{"data-testid":"ads-offline-msg",className:"mt-2 text-xs text-gray-700",children:c}):null,i.enabled?null:(0,s.jsxs)("p",{className:"mt-2 text-xs text-amber-700","data-testid":"ads-offline-missing",children:["Set in backend/.env: ",i.missing_env.join(", ")," (+ GOOGLE_ADS_ACTION_QUALIFIED / GOOGLE_ADS_ACTION_BOOKED after discovery). Queued conversions are kept and upload once connected."]}),(null==(t=i.recent)?void 0:t.length)?(0,s.jsxs)("table",{className:"mt-3 w-full text-xs","data-testid":"ads-offline-recent",children:[(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{className:"text-left text-gray-500 uppercase tracking-wider",children:[(0,s.jsx)("th",{className:"pb-1 pr-3",children:"Queued"}),(0,s.jsx)("th",{className:"pb-1 pr-3",children:"Enquiry"}),(0,s.jsx)("th",{className:"pb-1 pr-3",children:"Stage"}),(0,s.jsx)("th",{className:"pb-1 pr-3",children:"Match"}),(0,s.jsx)("th",{className:"pb-1 pr-3",children:"Value"}),(0,s.jsx)("th",{className:"pb-1",children:"Status"})]})}),(0,s.jsx)("tbody",{children:i.recent.map(e=>(0,s.jsxs)("tr",{className:"border-t border-gray-100",children:[(0,s.jsx)("td",{className:"py-1 pr-3",children:new Date(e.queued_at).toLocaleStr
1ing("en-GB")}),(0,s.jsx)("td",{className:"py-1 pr-3 font-mono",children:String(e.enquiry_id).slice(0,8)}),(0,s.jsx)("td",{className:"py-1 pr-3 capitalize",children:e.stage}),(0,s.jsx)("td",{className:"py-1 pr-3",children:"click_id"===e.match_method?e.click_id_type:e.match_method}),(0,s.jsxs)("td",{className:"py-1 pr-3",children:["\xa3",e.conversion_value,e.value_defaulted?"*":""]}),(0,s.jsxs)("td",{className:"py-1",children:[e.status,e.error?" \xb7 ".concat(e.error):""]})]},e.order_id))})]}):null]})}var p=a(73577),h=a(77801),b=a(5917);let g={bot_token_missing:"no bot token",free_mail:"free-mail address",role_address:"role address",duplicate_24h:"duplicate (24h)",submitted_too_fast:"submitted <3s",spam_content_pattern:"spam pattern",bot_unverified:"verifier unavailable"};function f(e){let{r:t}=e;return(0,s.jsx)("span",{className:"inline-block rounded bg-amber-100 text-amber-900 text-[11px] font-semibold px-1.5 py-0.5 mr-1 mb-1",children:g[t]||t.replace(/_/g," ")})}function v(e){var t,a,n;let{e:l}=e;return l.email_verified?(0,s.jsxs)("span",{"data-testid":"review-verified-".concat(l.id),className:"inline-flex items-center gap-1 rounded bg-emerald-100 text-emerald-800 text-[11px] font-bold px-1.5 py-0.5 mr-1 mb-1",children:[(0,s.jsx)(p.A,{className:"w-3 h-3"})," email verified"]}):"expired"===l.status?(0,s.jsx)("span",{"data-testid":"review-expired-".concat(l.id),className:"inline-flex items-center gap-1 rounded bg-slate-200 text-slate-800 text-[11px] font-bold px-1.5 py-0.5 mr-1 mb-1",children:"expired \xb7 never confirmed"}):(null==(t=l.review)?void 0:t.reminder_sent)?(0,s.jsxs)("span",{"data-testid":"review-reminder-sent-".concat(l.id),className:"inline-flex items-center gap-1 rounded bg-sky-100 text-sky-800 text-[11px] font-semibold px-1.5 py-0.5 mr-1 mb-1",children:[(0,s.jsx)(d.A,{className:"w-3 h-3"})," reminder sent \xb7 expires at 72h"]}):(null==(a=l.review)?void 0:a.confirm_sent)?(0,s.jsxs)("span",{"data-testid":"review-confirm-sent-".concat(l.id),className:"inline-flex items-center gap-1 rounded bg-sky-100 text-sky-800 text-[11px] font-semibold px-1.5 py-0.5 mr-1 mb-1",children:[(0,s.jsx)(d.A,{className:"w-3 h-3"})," confirmation sent \xb7 awaiting click"]}):(null==(n=l.review)?void 0:n.confirm_sent_at)?(0,s.jsxs)("span",{"data-testid":"review-confirm-failed-".concat(l.id),className:"inline-flex items-center gap-1 rounded bg-slate-100 text-slate-700 text-[11px] font-semibold px-1.5 py-0.5 mr-1 mb-1",children:[(0,s.jsx)(d.A,{className:"w-3 h-3"})," confirmation not delivered"]}):null}function j(e){var t,a,l,r,i,c;let{bearerToken:x,onChanged:u}=e,[p,g]=(0,n.useState)(null),[j,y]=(0,n.useState)(null),[w,N]=(0,n.useState)(""),[k,_]=(0,n.use
1State)(""),[S,A]=(0,n.useState)(null),[C,q]=(0,n.useState)(""),[E,O]=(0,n.useState)(!1),[D,z]=(0,n.useState)(!1),[B,P]=(0,n.useState)("review"),R={"Content-Type":"application/json",Authorization:"Bearer ".concat(x)},G=(0,n.useCallback)(async()=>{try{let[e,t]=await Promise.all([fetch("".concat("","/api/admin/review/queue?status=").concat(B),{headers:R}).then(e=>e.json()),fetch("".concat("","/api/admin/review/events?limit=1"),{headers:R}).then(e=>e.json())]);g(e),y(t)}catch(e){_("Could not load review queue")}},[x,B]);(0,n.useEffect)(()=>{G()},[G]);let L=async(e,t,a)=>{N(e+t),_("");try{var s;let n=await fetch(e?"".concat("","/api/admin/review/").concat(e,"/").concat(t):"".concat("","/api/admin/review/").concat(t),{method:"POST",headers:R,body:JSON.stringify(a||{})}),l=await n.json();if(!n.ok)throw Error(l.detail||"Failed");_("approve"===t?"Approved — released to sales, SLA clock started, confirmation sent.":"run-followups"===t?"Follow-up sweep: ".concat(l.reminded," reminded \xb7 ").concat(l.expired," expired"):"resend-confirmation"===t?l.sent?"Confirmation email re-sent.":"Confirmation email not sent".concat(l.error?" \xb7 ".concat(l.error):""):"Rejected".concat((null==(s=l.blocked)?void 0:s.length)?" \xb7 blocked ".concat(l.blocked.map(e=>"".concat(e.type,":").concat(e.value)).join(", ")):"")),A(null),q(""),O(!1),z(!1),await G(),u&&u()}catch(e){_("Error: ".concat(e.message))}N("")},T=(null==p?void 0:p.items)||[];return(0,s.jsxs)("div",{"data-testid":"review-queue-panel",className:"rounded-xl border border-amber-300 bg-amber-50/60 p-5 mb-6",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,s.jsxs)("p",{className:"text-sm font-black uppercase tracking-[0.18em] text-amber-900 flex items-center gap-2",children:[(0,s.jsx)(h.A,{className:"w-4 h-4"})," Review queue \xb7 ",null!=(r=null==p||null==(t=p.counts)?void 0:t.review)?r:T.length," held"]}),(0,s.jsxs)("div",{className:"flex items-center gap-3 text-xs text-slate-600",children:[(0,s.jsxs)("span",{className:"inline-flex rounded-lg border border-amber-300 overflow-hidden","data-testid":"review-view-toggle",children:[(0,s.jsxs)("button",{"data-testid":"review-view-review",onClick:()=>P("review"),className:"px-2.5 py-1 font-semibold ".concat("review"===B?"bg-amber-200 text-amber-950":"bg-white text-slate-600 hover:bg-amber-50"),children:["Held ",null!=(i=null==p||null==(a=p.counts)?void 0:a.review)?i:""]}),(0,s.jsxs)("button",{"data-testid":"review-view-expired",onClick:()=>P("expired"),className:"px-2.5 py-1 font-semibold border-l border-amber-300 ".concat("expired"===B?"bg-amber-200 text-amber-950":"bg-white text-slate-600 hover:bg-amber-50"),children:["Expired ",null!=(c=null==p||null==(l=p.counts)?void 0:l.expired)?c:""]})]}),(0,s.jsx)("button",{"data-testid":"review-run-followups",disabled:""!==w,onClick:()=>L("","run-followups"),className:"font-semibold text-slate-700 hover:text-black disabled:opacity-60",children:"run 24h/72h sweep"}),(null==j?void 0:j.totals)?(0,s.jsxs)("span",{"data-testid":"gate-totals",children:["gate decisions: ",Object.entries(j.totals).map(e=>{let[t,a]=e;return"".concat(t," ").concat(a)}).join(" \xb7 ")]}):null,(0,s.jsxs)("button",{"data-testid":"review-refresh",onClick:G,className:"inline-flex items-center gap-1 font-semibold text-slate-700 hover:text-black",children:[(0,s.jsx)(m.A,{className:"w-3.5 h-3.5"})," refresh"]})]})]}),(0,s.jsxs)("p",{className:"mt-1 text-xs text-slate-600",children:["Held enquiries have ",(0,s.jsx)("strong",{children:"not"})," been emailed to sales, have ",(0,s.jsx)("strong",{children:"no"})," SLA clock and the customer has ",(0,s.jsx)("strong",{children:"not"})," received a confirmation. Personal-mailbox senders get a one-tap “confirm your enquiry” email — a click on soft-signal holds auto-releases them; anything stronger stays here marked ",(0,s.jsx)("em",{children:"email verified"}),". Approve releases into the normal workflow; reject records the reason and can block the sender."]}),k?(0,s.jsx)("p",{"data-testid":"review-msg",className:"mt-2 text-xs font-semibold text-slate-800",children:k}):null,0===T.length?(0,s.jsx)("p",{"data-testid":"review-empty",className:"mt-3 text-sm text-slate-500",children:"expired"===B?"No expired enquiries — every held sender confirmed or was decided within 72h.":"Nothing waiting — every recent enquiry passed the gate."}):(0,s.jsx)("ul",{className:"mt-3 space-y-2",children:T.map(e=>{var t,a,n,l,r;return(0,s.jsxs)("li",{"data-testid":"review-item-".concat(e.id),className:"rounded-lg bg-white border border-slate-200 p-3",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-2",children:[(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsxs)("p",{className:"text-sm font-bold text-slate-900",children:[e.full_name||e.name||"—"," ",(0,s.jsxs)("span",{className:"font-normal text-slate-500",children:["\xb7 ",e.email]})," ",e.email_class?(0,s.jsx)("span",{className:"ml-1 rounded bg-slate-100 px-1.5 py-0.5 text-[11px] font-semibold text-slate-700",children:e.email_class}):null]}),(0,s.jsxs)("p",{className:"text-xs text-slate-500",children:[e.company&&"N/A"!==e.company?"".concat(e.company," \xb7 "):"",e.type||e.source||"enquiry"," \xb7 ",e.page_path||(null==(t=e.gate)?void 0:t.family)||""," \xb7 risk ",null!=(r=null!=(l=e.risk_score)?l:null==(a=e.gate)?void 0:a.risk)?r:"—"," \xb7 ",e.ip_address||""," \xb7 ",e.created_at?new Date(e.created_at).toLocaleStr
1ing("en-GB"):""]}),(0,s.jsxs)("div",{className:"mt-1",children:[(0,s.jsx)(v,{e:e}),((null==(n=e.gate)?void 0:n.reasons)||[]).map(e=>(0,s.jsx)(f,{r:e},e))]}),e.message||e.requirements?(0,s.jsx)("p",{className:"mt-1 text-xs text-slate-700 line-clamp-2",children:e.message||e.requirements}):null]}),(0,s.jsxs)("div",{className:"flex gap-2 shrink-0",children:[(0,s.jsxs)("button",{"data-testid":"review-approve-".concat(e.id),disabled:""!==w,onClick:()=>L(e.id,"approve"),className:"inline-flex items-center gap-1 rounded-lg bg-emerald-600 hover:bg-emerald-700 text-white text-xs font-bold px-3 py-1.5 disabled:opacity-60",children:[(0,s.jsx)(b.A,{className:"w-3.5 h-3.5"})," Approve"]}),"expired"!==e.status&&!e.email_verified&&["free","role","corporate"].includes(e.email_class)?(0,s.jsxs)("button",{"data-testid":"review-resend-".concat(e.id),disabled:""!==w,onClick:()=>L(e.id,"resend-confirmation"),className:"inline-flex items-center gap-1 rounded-lg border border-sky-300 text-sky-800 hover:bg-sky-50 text-xs font-bold px-3 py-1.5 disabled:opacity-60",children:[(0,s.jsx)(d.A,{className:"w-3.5 h-3.5"})," Resend confirm"]}):null,"expired"!==e.status?(0,s.jsxs)("button",{"data-testid":"review-reject-".concat(e.id),disabled:""!==w,onClick:()=>A(S===e.id?null:e.id),className:"inline-flex items-center gap-1 rounded-lg border border-rose-300 text-rose-700 hover:bg-rose-50 text-xs font-bold px-3 py-1.5 disabled:opacity-60",children:[(0,s.jsx)(o.A,{className:"w-3.5 h-3.5"})," Reject"]}):null]})]}),S===e.id?(0,s.jsxs)("div",{className:"mt-2 flex flex-wrap items-center gap-2 border-t border-slate-100 pt-2","data-testid":"review-reject-form-".concat(e.id),children:[(0,s.jsx)("input",{"data-testid":"review-reject-reason",value:C,onChange:e=>q(e.target.value),placeholder:"Reason (required) e.g. SEO spam, random Gmail, duplicate",className:"flex-1 min-w-[220px] rounded-md border border-slate-300 px-2 py-1.5 text-xs"}),(0,s.jsxs)("label",{className:"text-xs text-slate-700 flex items-center gap-1",children:[(0,s.jsx)("input",{type:"checkbox",checked:E,onChange:e=>O(e.target.checked)})," block domain"]}),(0,s.jsxs)("label",{className:"text-xs text-slate-700 flex items-center gap-1",children:[(0,s.jsx)("input",{type:"checkbox",checked:D,onChange:e=>z(e.target.checked)})," block IP"]}),(0,s.jsx)("button",{"data-testid":"review-reject-confirm",disabled:!C.trim()||""!==w,onClick:()=>L(e.id,"reject",{reason:C,block_domain:E,block_ip:D}),className:"rounded-lg bg-rose-600 hover:bg-rose-700 text-white text-xs font-bold px-3 py-1.5 disabled:opacity-60",children:"Confirm reject"})]}):null]},e.id)})})]})}let y=e=>{let{token:t}=e,[a,x]=(0,n.useState)([]),[m,p]=(0,n.useState)(!0),[h,b]=(0,n.useState)(""),[g,f]=(0,n.useState)(""),[v,y]=(0,n.useState)(null),[w,N]=(0,n.useState)(""),[k,_]=(0,n.use
1State)(""),[S,A]=(0,n.useState)(!1),[C,q]=(0,n.useState)(""),[E,O]=(0,n.useState)(null);(0,n.useEffect)(()=>{D()},[g,h]);let D=async()=>{p(!0);try{let e=new URLSearchParams;g&&e.append("status",g),h&&e.append("search",h);let a=await fetch("".concat("","/api/admin/dashboard/enquiries?").concat(e),{headers:{Authorization:"Bearer ".concat(t)}});if(a.ok){let e=await a.json();x(e.enquiries)}}catch(e){console.error("Failed to fetch enquiries:",e)}finally{p(!1)}},z=async e=>{A(!0);try{let a=await fetch("".concat("","/api/admin/dashboard/enquiries/").concat(e,"/status"),{method:"PATCH",headers:{Authorization:"Bearer ".concat(t),"Content-Type":"application/json"},body:JSON.stringify({status:w,notes:k,booking_value:"booked"===w&&""!==C?Number(C):null})});if(a.ok){let e=await a.json().catch(()=>({}));O(e.ads_offline||null),y(null),N(""),_(""),q(""),D()}}catch(e){console.error("Failed to update enquiry:",e)}finally{A(!1)}},B=async()=>{try{let e=new URLSearchParams;g&&e.append("status",g);let a=await fetch("".concat("","/api/admin/dashboard/enquiries/export/csv?").concat(e),{headers:{Authorization:"Bearer ".concat(t)}});if(a.ok){let e=await a.blob(),t=window.URL.createObjectURL(e),s=document.createElement("a");s.href=t,s.download="enquiries_".concat(new Date().toISOString().split("T")[0],".csv"),document.body.appendChild(s),s.click(),s.remove()}}catch(e){console.error("Failed to export:",e)}};return(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-6",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h2",{className:"text-2xl font-bold text-gray-800",children:"Enquiries Management"}),(0,s.jsx)("p",{className:"text-gray-600 mt-1",children:"View and manage customer enquiries"})]}),(0,s.jsxs)("button",{onClick:B,className:"flex items-center space-x-2 px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors",children:[(0,s.jsx)(l.A,{size:18}),(0,s.jsx)("span",{children:"Export CSV"})]})]}),E&&(0,s.jsxs)("div",{"data-testid":"ads-offline-sync-note",className:"mb-4 rounded-lg border border-emerald-200 bg-emerald-50 px-4 py-2 text-sm text-emerald-900 flex items-center justify-between",children:[(0,s.jsxs)("span",{children:["Google Ads offline conversion ",(0,s.jsx)("strong",{children:E.stage})," ",E.status," \xb7 match via ","click_id"===E.match_method?"click ID":"enhanced_leads"===E.match_method?"hashed email":"none",E.conversion_value?" \xb7 \xa3".concat(E.conversion_value).concat(E.value_defaulted?" (default)":""):""]}),(0,s.jsx)("button",{onClick:()=>O(null),className:"text-emerald-700 hover:text-emerald-900 text-xs font-semibold",children:"Dismiss"})]}),(0,s.jsx)(j,{bearerToken:t,onChanged:D}),(0,s.jsx)("div",{className:"mb-6",children:(0,s.jsx)(u,{bearerToken:t})}),(0,s.jsx)("div",{className:"bg-white rounded-lg shadow p-4 mb-6",children:(0,s.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)(r.A,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400",size:20}),(0,s.jsx)("input",{type:"text",placeholder:"Search by name, email, or company...",value:h,onChange:e=>b(e.target.value),className:"w-full pl-10 pr-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent"})]}),(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,s.jsx)(i.A,{size:20,className:"text-gray-400"}),(0,s.jsxs)("select",{value:g,onChange:e=>f(e.target.value),className:"flex-1 px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent",children:[(0,s.jsx)("option",{value:"",children:"All Status"}),(0,s.jsx)("option",{value:"pending",children:"Pending"}),(0,s.jsx)("option",{value:"in_progress",children:"In Progress"}),(0,s.jsx)("option",{value:"review",children:"In review (held)"}),(0,s.jsx)("option",{value:"rejected",children:"Rejected"}),(0,s.jsx)("option",{value:"expired",children:"Expired (unconfirmed)"}),(0,s.jsx)("option",{value:"qualified",children:"Qualified"}),(0,s.jsx)("option",{value:"booked",children:"Booked"}),(0,s.jsx)("option",{value:"resolved",children:"Resolved"})]})]})]})}),m?(0,s.jsx)("div",{className:"text-center py-12",children:(0,s.jsx)("div",{className:"inline-block animate-spin rounded-full h-8 w-8 border-b-2 border-blue-600"})}):0===a.length?(0,s.jsxs)("div",{className:"bg-white rounded-lg shadow p-12 text-center",children:[(0,s.jsx)(d.A,{className:"h-12 w-12 text-gray-400 mx-auto mb-4"}),(0,s.jsx)("p",{className:"text-gray-600",children:"No enquiries found"})]}):(0,s.jsx)("div",{className:"bg-white rounded-lg shadow overflow-hidden",children:(0,s.jsxs)("table",{className:"min-w-full divide-y divide-gray-200",children:[(0,s.jsx)("thead",{className:"bg-gray-50",children:(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Contact"}),(0,s.jsx)("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Event Details"}),(0,s.jsx)("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Status"}),(0,s.jsx)("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Date"}),(0,s.jsx)("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Actions"})]})}),(0,s.jsx)("tbody",{className:"bg-white divide-y divide-gray-200",children:a.map(e=>{var t;return(0,s.jsxs)("tr",{className:"hover:bg-gray-50",children:[(0,s.jsx)("td",{className:"px-6 py-4 whitespace-nowrap",children:(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"font-medium text-gray-900",children:e.name}),(0,s.jsx)("div",{className:"text-sm text-gray-500",children:e.company}),(0,s.jsx)("div",{className:"text-sm text-blue-600",children:e.email}),(0,s.jsx)("div",{className:"text-sm text-gray-500",children:e.phone})]})}),(0,s.jsx)("td",{className:"px-6 py-4",children:(0,s.jsxs)("div",{className:"text-sm",children:[(0,s.jsx)("div",{className:"font-medium text-gray-900",children:e.event_type}),(0,s.jsxs)("div",{className:"text-gray-500",children:["Date: ",e.event_date]}),(0,s.jsxs)("div",{className:"text-gray-500 text-xs mt-1 truncate max-w-xs",title:e.message,children:[null==(t=e.message)?void 0:t.substring(0,50),"..."]})]})}),(0,s.jsx)("td",{className:"px-6 py-4 whitespace-nowrap",children:(0,s.jsx)("span",{className:"px-2 py-1 inline-flex text-xs leading-5 font-semibold rounded-full ".concat((e=>
1{let t={pending:"bg-orange-100 text-orange-800",in_progress:"bg-blue-100 text-blue-800",resolved:"bg-green-100 text-green-800"};return t[e]||t.pending})(e.status)),children:e.status.replace("_"," ")})}),(0,s.jsx)("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500",children:new Date(e.submitted_at).toLocaleDateString()}),(0,s.jsx)("td",{className:"px-6 py-4 whitespace-nowrap text-sm",children:(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,s.jsx)("a",{href:"mailto:".concat(e.email,"?subject=Re: Your enquiry - ").concat(e.event_type),className:"text-blue-600 hover:text-blue-800",title:"Send email",children:(0,s.jsx)(d.A,{size:18})}),(0,s.jsx)("button",{onClick:()=>{y(e),N(e.status)},className:"text-gray-600 hover:text-gray-800",title:"Update status",children:(0,s.jsx)(c.A,{size:18})})]})})]},e.id)})})]})}),v&&(0,s.jsx)("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",children:(0,s.jsxs)("div",{className:"bg-white rounded-lg shadow-xl p-6 max-w-2xl w-full mx-4 max-h-[90vh] overflow-y-auto",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,s.jsx)("h3",{className:"text-xl font-bold text-gray-800",children:"Update Enquiry"}),(0,s.jsx)("button",{onClick:()=>y(null),className:"text-gray-400 hover:text-gray-600",children:(0,s.jsx)(o.A,{size:24})})]}),(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{className:"bg-gray-50 p-4 rounded-lg",children:[(0,s.jsx)("p",{className:"font-semibold text-gray-800 mb-2",children:v.name}),(0,s.jsxs)("p",{className:"text-sm text-gray-600",children:[v.email," • ",v.phone]}),(0,s.jsx)("p",{className:"text-sm text-gray-600 mt-2",children:v.company}),(0,s.jsxs)("p",{className:"text-sm text-gray-600 mt-2",children:[v.event_type," - ",v.event_date]}),(0,s.jsx)("p",{className:"text-sm text-gray-600 mt-2",children:v.message})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Status"}),(0,s.jsxs)("select",{value:w,onChange:e=>N(e.target.value),className:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent",children:[(0,s.jsx)("option",{value:"pending",children:"Pending"}),(0,s.jsx)("option",{value:"in_progress",children:"In Progress"}),(0,s.jsx)("option",{value:"qualified",children:"Qualified — sends to Google Ads"}),(0,s.jsx)("option",{value:"booked",children:"Booked — sends to Google Ads with value"}),(0,s.jsx)("option",{value:"resolved",children:"Resolved"})]})]}),"booked"===w&&(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Booking value (\xa3) — leave blank for the \xa32,500 default"}),(0,s.jsx)("input",{"data-testid":"booking-value-input",type:"number",inputMode:"decimal",min:"0",value:C,onChange:e=>q(e.target.value),placeholder:"2500",className:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Add Note (Optional)"}),(0,s.jsx)("textarea",{value:k,onChange:e=>_(e.target.value),rows:3,className:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent",placeholder:"Add internal notes about this enquiry..."})]}),(0,s.jsxs)("div",{className:"flex justify-end space-x-3",children:[(0,s.jsx)("button",{onClick:()=>y(null),className:"px-4 py-2 border border-gray-300 rounded-lg hover:bg-gray-50",children:"Cancel"}),(0,s.jsx)("button",{onClick:()=>z(v.id),disabled:S,className:"px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 disabled:opacity-50",children:S?"Updating...":"Update"})]})]})]})})]})}}}]);

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.