PageSourceSearch

https://glovbox.com.au/_next/static/chunks/3855-6ac61646518faa71.js

js glovbox.com.au collected 2026-09-24 14:08:52 UTC 65,907 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3855],{166:(e,t,s)=>{s.d(t,{M:()=>o});var r=s(7876);s(4232);var a=s(2037),l=s(9200);let n=s(5364).env.NEXT_PUBLIC_SUPPORT_EMAIL||"[email protected]";function o(e){let{vehicleRegistration:t,vehicleState:s,vehicleMake:o,vehicleModel:i,vehicleYear:c,vehicleEngine:d,vehicleBadgeUrl:u,onBack:h,onLogin:m,onUseDifferentRegistration:x,onClose:p}=e,f=[o,i].filter(Boolean).join(" "),b=[c,d].filter(Boolean).join(", "),g=f||"this vehicle";return(0,r.jsx)("div",{className:"mx-auto flex min-h-full w-full max-w-md flex-col pb-6",children:(0,r.jsxs)("div",{children:[(0,r.jsx)(a.G9,{onClick:h,className:"mb-4"}),(0,r.jsx)("div",{className:"mt-2 flex justify-center sm:mt-3",children:(0,r.jsx)("span",{className:"flex h-16 w-16 items-center justify-center rounded-2xl bg-amber-50 text-amber-600 ring-1 ring-amber-100 sm:h-20 sm:w-20 sm:rounded-3xl",children:(0,r.jsx)("svg",{width:"30",height:"30",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:(0,r.jsx)("path",{d:"M12 9v4m0 4h.01M10.3 4.3 2.8 17.2A2 2 0 0 0 4.5 20h15a2 2 0 0 0 1.7-2.8L13.7 4.3a2 2 0 0 0-3.4 0Z",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})})})}),(0,r.jsx)("h1",{className:"mt-5 text-center sm:mt-6 ".concat(l.X),children:"This vehicle is already linked to a GlovBox account"}),(0,r.jsxs)("p",{className:"mx-auto mt-3 max-w-sm text-center sm:mt-5 ".concat(l.q),children:["It looks like ",g," has already been added to GlovBox. If this is your vehicle, log in to continue. If you think this is a mistake, our support team can help."]}),(0,r.jsxs)("div",{className:"mt-5 rounded-2xl border border-slate-200 bg-white px-4 py-4 shadow-sm sm:mt-7 sm:px-5 sm:py-5",children:[(0,r.jsx)(a.Sz,{vehicleRegistration:t.trim().toUpperCase(),vehicleState:s}),f&&(0,r.jsx)("div",{className:"mt-4 border-t border-slate-200 pt-4 sm:mt-5 sm:pt-5",children:(0,r.jsxs)("div",{className:"flex items-center gap-3 sm:gap-4",children:[(0,r.jsx)(a.Es,{vehicleBadgeUrl:u,vehicleMake:o||f,size:"lg"}),(0,r.jsxs)("div",{className:"min-w-0 text-left",children:[(0,r.jsx)("p",{className:"break-words text-xl font-extrabold leading-tight text-slate-900",children:f}),b&&(0,r.jsx)("p",{className:"mt-0.5 text-base text-slate-500",children:b})]})]})})]}),(0,r.jsxs)("div",{className:"mt-5 flex items-center gap-3 rounded-2xl bg-slate-50 px-4 py-4 sm:mt-6 sm:gap-4",children:[(0,r.jsx)("span",{className:"flex h-11 w-11 shrink-0 items-center justify-center rounded-full bg-blue-100 text-blue-700 sm:h-12 sm:w-12",children:(0,r.jsxs)("svg",{width:"26",height:"26",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[(0,r.jsx)("path",{d:"M4 13v-2a8 8 0 0 1 16 0v2",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round"}),(0,r.jsx)("path",{d:"M5.5 12h2v5h-2a2 2 0 0 1-2-2v-1a2 2 0 0 1 2-2ZM18.5 12h-2v5h2a2 2 0 0 0 2-2v-1a2 2 0 0 0-2-2Z",stroke:"currentColor",strokeWidth:"1.8",strokeLinejoin:"round"})]})}),(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsx)("p",{className:"text-sm font-black text-slate-950",children:"Think this looks wrong?"}),(0,r.jsxs)("p",{className:"mt-1 text-sm leading-relaxed text-slate-700",children:["Contact support at"," ",(0,r.jsx)("a",{href:"mailto:".concat(n),className:"break-all font-semibold text-blue-700 hover:text-blue-800",children:n})," ","and we'll help sort it out."]})]})]}),(0,r.jsxs)("div",{className:"mx-auto mt-5 flex max-w-sm items-start gap-3 px-2 text-slate-500 sm:mt-6 sm:gap-4",children:[(0,r.jsx)("span",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-full bg-slate-100 text-slate-500",children:(0,r.jsxs)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[(0,r.jsx)("rect",{x:"5",y:"10",width:"14",height:"10",rx:"2",stroke:"currentColor",strokeWidth:"1.8"}),(0,r.jsx)("path",{d:"M8 10V7a4 4 0 0 1 8 0v3",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round"})]})}),(0,r.jsx)("p",{className:"text-sm font-medium leading-relaxed",children:"For security, only the existing account holder can access this vehicle profile."})]}),(0,r.jsxs)("div",{className:"mt-5 space-y-3 sm:mt-6 sm:space-y-4",children:[m&&(0,r.jsx)(a.jn,{onClick:m,children:"Log in to continue"}),x&&(0,r.jsx)("button",{type:"button",onClick:x,className:"w-full rounded-2xl border border-slate-200 bg-white px-4 py-4 text-base font-bold text-blue-700 transition-colors hover:bg-slate-50 focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-600",children:"Use a different registration"}),!m&&(0,r.jsx)(a.jn,{onClick:p,children:"Done"}),(0,r.jsx)("a",{href:"mailto:".concat(n),className:"block w-full py-1 text-center text-lg font-bold text-blue-700 hover:text-blue-800",children:"Contact support"})]})]})})}},1214:(e,t,s)=>{s.d(t,{M:()=>h});var r=s(7876),a=s(2037),l=s(8468),n=s(9200);let o=()=>(0,r.jsxs)("svg",{"aria-hidden":"true",className:"h-5 w-5 shrink-0",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,r.jsx)("circle",{cx:"12",cy:"12",r:"9"}),(0,r.jsx)("path",{d:"M12 8v5M12 16.5v.01"})]}),i=()=>(0,r.jsx)("span",{"aria-hidden":"true",className:"h-5 w-5 animate-spin rounded-full border-2 border-current border-t-transparent"}),c=()=>(0,r.jsx)("svg",{"aria-hidden":"true",className:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 21h18M5 21V9l7-5 7 5v12M9 21v-6h6v6"})}),d=()=>(0,r.jsx)("svg",{"aria-hidden":"true",className:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"2",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 16V4m0 0 4 4m-4-4-4 4M4 16v3a1 1 0 0 0 1 1h14a1 1 0 0 0 1-1v-3"})});function u(e){let{icon:t,title:s,body:a,badge:l,selected:n,busy:o,disabled:u,onClick:h}=e;return(0,r.jsxs)("button",{type:"button",onClick:h,disabled:u,"aria-busy":o,className:"flex w-full gap-3.5 rounded-2xl border-[1.5px] bg-white p-4 text-left transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-600 disabled:cursor-not-allowed sm:p-5 ".concat(u&&!o?"opacity-50":""," ").concat(n?"border-blue-600 hover:bg-blue-50/40":"border-slate-200 hover:border-blue-200 hover:bg-blue-50/40"),children:[(0,r.jsx)("span",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-xl ".concat(n?"bg-blue-600 text-white":"bg-slate-950 text-white"),children:o?(0,r.jsx)(i,{}):"workshop"===t?(0,r.jsx)(c,{}):(0,r.jsx)(d,{})}),(0,r.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,r.jsx)("span",{className:"block text-base font-extrabold leading-tight text-slate-950",children:s}),l&&(0,r.jsx)("span",{className:"mt-2 inline-block rounded-md bg-blue-100 px-2 py-1 text-[10px] font-black uppercase tracking-[0.12em] text-blue-700",children:l}),(0,r.jsx)("span",{className:"mt-2 block text-sm font-medium leading-relaxed text-slate-500",children:a})]})]})}function h(e){let{vehicleRegistration:t,vehicleState:s,vehicleMake:i="",vehicleModel:c="",vehicleYear:d="",vehicleEngine:h="",vehicleBadgeUrl:m,vehicleTransmission:x,vehicleBodyType:p,vehicleFuelType:f,vehicleSeries:b,vehicleInduction:g,isTransmissionEditable:j=!1,selectedTransmission:v,onTransmissionChange:w,onBack:y,onEditVehicle:k,onSelectMethod:N,error:C,pendingMethod:_}=e,S=[{label:"Transmission",value:x,node:j&&w?(0,r.jsx)(a.J2,{value:v||"",onChange:w}):void 0},{label:"Fuel type",value:f},{label:"Series",value:b},{label:"Induction",value:g},{label:"Body type",value:p}];return(0,r.jsxs)("div",{className:"mx-auto flex min-h-full w-full max-w-xl flex-col pb-6 sm:pb-8",children:[y&&(0,r.jsx)(l.G,{onClick:y}
1),(0,r.jsxs)("div",{className:"mx-auto w-full max-w-md",children:[(0,r.jsx)("h1",{className:"pt-1 text-center ".concat(n.X),children:"We found your vehicle"}),(0,r.jsx)(a.Hx,{vehicleRegistration:t,vehicleState:s,vehicleMake:i,vehicleModel:c,vehicleYear:d,vehicleDescriptor:h||p,vehicleBadgeUrl:m,specs:S,onEditRego:k})]}),(0,r.jsxs)("div",{className:"mt-7 border-t border-slate-200 pt-7 text-center",children:[(0,r.jsx)("h2",{className:"mx-auto max-w-sm text-xl font-extrabold leading-snug tracking-tight text-slate-950",children:"How would you like to share your service history?"}),(0,r.jsx)("p",{className:"mx-auto mt-2 max-w-sm ".concat(n.q),children:"Pick whichever's easiest — we'll take it from there."})]}),C&&(0,r.jsxs)("div",{role:"alert",className:"mt-5 flex items-start gap-3 rounded-2xl border-[1.5px] border-red-300 bg-red-50 p-4 text-left text-sm font-semibold text-red-700",children:[(0,r.jsx)("span",{className:"mt-0.5 text-red-500",children:(0,r.jsx)(o,{})}),(0,r.jsx)("span",{children:C})]}),(0,r.jsxs)("div",{className:"mt-5 space-y-3.5",children:[(0,r.jsx)(u,{icon:"workshop",title:"Ask my workshop",badge:"Recommended",body:"We'll reach out to your workshop directly and request your records for you.",selected:!0,busy:"workshop"===_,disabled:!!_,onClick:()=>N("workshop")}),(0,r.jsx)(u,{icon:"upload",title:"Upload invoices myself",body:"Best if you've already got them as photos, PDFs or screenshots.",busy:"upload"===_,disabled:!!_,onClick:()=>N("upload")})]}),(0,r.jsx)("div",{className:"mt-7 rounded-2xl bg-blue-50 px-5 py-4 text-center text-[13px] font-medium leading-relaxed text-slate-500",children:"Your privacy comes first. We remove personal details from workshop invoices before they're shown or shared."})]})}},1856:(e,t,s)=>{s.d(t,{C:()=>a});var r=s(7876);s(4232);let a=e=>{let{stepCount:t,currentIndex:s,complete:a=!1,className:l=""}=e;return(0,r.jsx)("div",{className:"px-8 pb-6 shrink-0 ".concat(l),children:(0,r.jsx)("div",{className:"flex gap-2 w-full",children:Array.from({length:t},(e,t)=>(0,r.jsx)("div",{className:"h-1.5 flex-1 rounded-full transition-all duration-700 ".concat(t<=s?a?"bg-emerald-500":"bg-blue-700":"bg-slate-100")},t))})})}},1921:(e,t,s)=>{s.d(t,{$X:()=>f,rE:()=>u});var r=s(7876),a=s(4232),l=s(9508),n=s(8468),o=s(5957),i=s(9200),c=s(7229),d=s(3867);let u=async(e,t)=>{let{data:s}=await (0,l.oc)(e,t.map(e=>({file_name:e.name})));return await Promise.all(s.upload_urls.map((e,s)=>(0,l.F4)(e.url,t[s]))),s.draft},h=e=>e<1024?"".concat(e," B"):e<1048576?"".concat(Math.round(e/1024)," KB"):"".concat((e/1048576).toFixed(1)," MB"),m=()=>(0,r.jsxs)("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"h-5 w-5",children:[(0,r.jsx)("path",{d:"M12 15V4m0 0-4 4m4-4 4 4"}),(0,r.jsx)("path",{d:"M4 15v3a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-3"})]}),x=()=>(0,r.jsxs)("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",className:"h-5 w-5",children:[(0,r.jsx)("path",{d:"M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8l-5-5Z"}),(0,r.jsx)("path",{d:"M14 3v5h5"})]}),p=()=>(0,r.jsx)("svg",{"aria-hidden":"true",viewBox:"0 0 18 18",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"h-4 w-4",children:(0,r.jsx)("path",{d:"M3 9h12m0 0-4.5-4.5M15 9l-4.5 4.5"})});function f(e){let{draftToken:t,initialFiles:s,onBack:u,onNext:f,uploadFiles:b,validateFiles:g=l.st,accept:j=".jpg,.jpeg,.png,.webp,.pdf,image/jpeg,image/png,image/webp,application/pdf",collectOdometer:v=!1,initialOdometer:w=""}=e,y=(0,a.useRef)(null),[k,N]=(0,a.useState)(null!=s?s:[]),[C,_]=(0,a.useState)(w),[S,L]=(0,a.useState)(null),[M,B]=(0,a.useState)(!1),[P,W]=(0,a.useState)(!1),[E,T]=(0,a.useState)(null),[F,R]=(0,a.useState)([]);(0,a.useEffect)(()=>{let e=k.map(e=>URL.createObjectURL(e));return R(e),()=>e.forEach(e=>URL.revokeObjectURL(e))},[k]);let A=e=>{if(!e||0===e.length)return;let t=Array.from(e);try{g(t)}catch(e){T(e instanceof Error?e.message:"Some files could not be added.");return}T(null),N(e=>[...e,...t])},O=e=>N(t=>t.filter((t,s)=>s!==e)),G=()=>{if(!v)return"";let e=d.xZ.safeParse(C);if(!e.success){var t,s;return L(null!=(s=null==(t=e.error.issues[0])?void 0:t.message)?s:"Enter a valid odometer reading"),null}return L(null),e.data},U=async()=>
1{if(!k.length)return void T("Add at least one service record to continue.");let e=G();if(null!==e){if(!t){try{g(k)}catch(e){T(e instanceof Error?e.message:"Some files could not be added.");return}T(null),f(k,void 0,e);return}W(!0),T(null);try{g(k);let s=await b(t,k);f(k,s,e)}catch(e){T(e instanceof Error?e.message:"We couldn’t upload your files. Please try again.")}finally{W(!1)}}};return(0,r.jsxs)("div",{className:"mx-auto flex min-h-full w-full max-w-lg flex-col pb-2 text-slate-950",children:[(0,r.jsx)(n.G,{onClick:()=>u(k,C)}),(0,r.jsx)("h1",{className:"text-center ".concat(i.X),children:"Upload invoices"}),(0,r.jsx)("p",{className:"mt-2 text-center ".concat(i.q),children:"Attach photos, PDFs or screenshots to verify history."}),(0,r.jsx)("input",{ref:y,type:"file",multiple:!0,accept:j,className:"hidden",onChange:e=>{A(e.target.files),e.target.value=""}}),(0,r.jsxs)("button",{type:"button",onClick:()=>{var e;return null==(e=y.current)?void 0:e.click()},onDragOver:e=>{e.preventDefault(),B(!0)},onDragLeave:()=>B(!1),onDrop:e=>{e.preventDefault(),B(!1),A(e.dataTransfer.files)},className:"mt-5 flex flex-col items-center justify-center gap-3 rounded-2xl border-2 border-dashed px-6 py-10 text-center transition-colors ".concat(M?"border-blue-600 bg-blue-50":"border-slate-300 bg-slate-50 hover:border-blue-300 hover:bg-blue-50/40"),children:[(0,r.jsx)("span",{className:"flex h-11 w-11 items-center justify-center rounded-full bg-blue-100 text-blue-700",children:(0,r.jsx)(m,{})}),(0,r.jsx)("span",{className:"text-base font-extrabold text-slate-900",children:"Tap to snap or upload"}),(0,r.jsx)("span",{className:"text-[11px] font-black uppercase tracking-[0.08em] text-slate-400",children:"PDF, JPG, PNG accepted"})]}),k.length>0&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("p",{className:"mt-5 text-[11px] font-black uppercase tracking-[0.12em] text-slate-500",children:[k.length," file",1===k.length?"":"s"," added"]}),(0,r.jsx)("ul",{className:"mt-2 space-y-2",children:k.map((e,t)=>{var s,a;let l=F[t],n=e.type.startsWith("image/"),o=null!=(a=null==(s=e.name.split(".").pop())?void 0:s.toUpperCase())?a:"FILE";return(0,r.jsxs)("li",{className:"flex items-center gap-3 rounded-xl border border-slate-200 bg-white p-3 transition-colors hover:border-blue-200",children:[n&&l?(0,r.jsx)("img",{src:l,alt:"",className:"h-11 w-11 shrink-0 rounded-lg object-cover ring-1 ring-slate-200"}):(0,r.jsx)("span",{className:"flex h-11 w-11 shrink-0 items-center justify-center rounded-lg bg-blue-50 text-blue-700",children:(0,r.jsx)(x,{})}),(0,r.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,r.jsx)("span",{className:"block truncate text-sm font-bold text-slate-900",children:e.name}),(0,r.jsxs)("span",{className:"mt-0.5 block text-xs font-semibold text-slate-400",children:[o," \xb7 ",h(e.size)]})]}),(0,r.jsxs)("span",{className:"flex shrink-0 items-center gap-1",children:[l&&(0,r.jsx)("a",{href:l,target:"_blank",rel:"noopener noreferrer",className:"rounded-lg px-2.5 py-1.5 text-xs font-extrabold text-blue-700 transition-colors hover:bg-blue-50",children:"View"}),(0,r.jsx)("button",{type:"button",onClick:()=>O(t),disabled:P,className:"rounded-lg px-2.5 py-1.5 text-xs font-extrabold text-slate-400 transition-colors hover:bg-red-50 hover:text-red-600 disabled:opacity-50 disabled:hover:bg-transparent disabled:hover:text-slate-400","aria-label":"Remove ".concat(e.name),children:"Remove"})]})]},"".concat(e.name,":").concat(t))})})]}),v&&(0,r.jsxs)("div",{className:"mt-6",children:[(0,r.jsxs)("label",{className:c.x,htmlFor:"logbook-odometer",children:["Current odometer ",(0,r.jsx)("span",{className:"text-slate-400",children:"(optional)"})]}),(0,r.jsx)("input",{id:"logbook-odometer",type:"text",inputMode:"numeric",autoComplete:"off",value:C,onChange:e=>{_(e.target.value),S&&L(null)},disabled:P,placeholder:"e.g. 84500","aria-invalid":!!S,"aria-describedby":"logbook-odometer-help",className:(0,c.jb)(!!S)}),(0,r.jsx)("p",{id:"logbook-odometer-help",className:"ml-1 mt-2 text-xs font-medium text-slate-500",children:"Helps us build your service timeline straight away. We can also read it from your invoices."}),S&&(0,r.jsx)("p",{className:c.r1,children:S})]}),E&&(0,r.jsx)("p",{className:"mt-4 rounded-2xl bg-red-50 p-3 text-sm font-semibold text-red-700",children:E}),(0,r.jsx)("div",{className:"mt-6",children:(0,r.jsx)(o.$,{onClick:U,disabled:P||0===k.length,className:"flex items-center justify-center gap-2",children:P?"Uploading…":(0,r.jsxs)(r.Fragment,{children:["Continue",(0,r.jsx)(p,{})]})})})]})}},3640:(e,t,s)=>{s.d(t,{c:()=>h});var r=s(7876),a=s(4232),l=s(9508);function n(e,t){return e===t?null:e}let o=e=>{var t;let{value:s,onChange:l}=e,n=(0,a.useRef)(null),o=(0,a.useRef)(null!=(t=null==s?void 0:s.strokes)?t:[]),i=(0,a.useRef)(null),c=(0,a.useRef)(null),d=(0,a.useCallback)(()=>{let e=n.current;if(!e)return;let t=e.getContext("2d");if(!t)return;let s=e.getBoundingClientRect(),r=window.devicePixelRatio||1;for(let a of(e.width=Math.max(1,Math.round(s.width*r)),e.height=Math.max(1,Math.round(s.height*r)),t.setTransform(r,0,0,r,0,0),t.clearRect(0,0,s.width,s.height),t.strokeStyle="#0f172a",t.lineWidth=2.5,t.lineCap="round",t.lineJoin="round",o.current))if(!(a.length<2)){for(let e of(t.beginPath(),t.moveTo(a[0].x*s.width,a[0].y*s.height),a.slice(1)))t.lineTo(e.x*s.width,e.y*s.height);t.stroke()}},[]);(0,a.useEffect)(()=>{var e;o.current=null!=(e=null==s?void 0:s.strokes)?e:[],d()},[d,s]),(0,a.useEffect)(()=>{let e=new ResizeObserver(d);return n.current&&e.observe(n.current),()=>e.disconnect()},[d]);let u=e=>(function(e,t,s){if(e.width<=0||e.height<=0)return null;let r=(t-e.left)/e.width,a=(s-e.top)/e.height;return Number.isFinite(r)&&Number.isFinite(a)?{x:Number(Math.min(1,Math.max(0,r)).toFixed(4)),y:Number(Math.min(1,Math.max(0,a)).toFixed(4))}:null})(e.currentTarget.getBoundingClientRect(),e.clientX,e.clientY),h=()=>o.current.reduce((e,t)=>
1e+t.length,0),m=e=>{var t;c.current===e.pointerId&&(i.current=null,t=c.current,c.current=t===e.pointerId?null:t,e.currentTarget.hasPointerCapture(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId),d())};return(0,r.jsx)("div",{children:(0,r.jsxs)("div",{className:"relative overflow-hidden rounded-2xl border border-slate-300 bg-white focus-within:ring-4 focus-within:ring-blue-100",children:[(0,r.jsx)("canvas",{ref:n,"aria-label":"Draw your signature",className:"block h-40 w-full touch-none cursor-crosshair",onPointerDown:e=>{var t,s;let r=(t=c.current,s=e.pointerId,null===t?s:t);if(r!==e.pointerId||o.current.length>=32||h()>=2e3)return;let a=u(e);a&&(c.current=r,e.currentTarget.setPointerCapture(e.pointerId),i.current=[a])},onPointerMove:e=>{if(c.current!==e.pointerId)return;let t=i.current;if(!t||t.length>=500||h()+t.length>=2e3)return;let s=u(e);if(!s)return;let r=t[t.length-1];(s.x!==r.x||s.y!==r.y)&&(t.push(s),o.current=[...o.current,t],d(),o.current=o.current.slice(0,-1))},onPointerUp:e=>{var t;if(c.current!==e.pointerId)return;let s=i.current;i.current=null,t=c.current,c.current=t===e.pointerId?null:t,e.currentTarget.hasPointerCapture(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId),s&&!(s.length<2)&&(o.current=[...o.current,s],l({version:1,strokes:o.current}))},onPointerCancel:m,onLostPointerCapture:m}),(0,r.jsx)("button",{type:"button",onClick:()=>{let e=c.current,t=n.current;null!==e&&(null==t?void 0:t.hasPointerCapture(e))&&t.releasePointerCapture(e),c.current=null,i.current=null,o.current=[],l(null),d()},className:"absolute bottom-3 right-3 rounded-lg bg-blue-50 px-3 py-1.5 text-sm font-extrabold text-blue-700 shadow-sm ring-1 ring-blue-100",children:"Clear"})]})})};var i=s(8468),c=s(2037);function d(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}let u={getContext:l.jL,sign:l.db,isStaleError:l.i_},h=e=>{let{draftToken:t,transport:s=u,onBack:l,onCorrectCustomerDetails:n,onSuccess:h,fallbackMake:m,fallbackModel:x,fallbackVariant:p,fallbackYear:f,fallbackVin:b,fallbackPhone:g,documentLabel:j="Proof of Service report"}=e,[v,w]=(0,a.useState)(null),[y,k]=(0,a.useState)(!0),[N,C]=(0,a.useState)(!1),[_,S]=(0,a.useState)(null),[L,M]=(0,a.useState)(!1),[B,P]=(0,a.useState)({}),[W,E]=(0,a.useState)("drawn_signature"),[T,F]=(0,a.useState)(""),[R,A]=(0,a.useState)(null),[O,G]=(0,a.useState)(!1);(0,a.useEffect)(()=>{let e=!0;return k(!0),S(null),s.getContext(t).then(t=>{if(!e)return;let s=t.data;w(s),P(Object.fromEntries(s.confirmations.map(e=>{let{key:t}=e;return[t,!0]}))),G(!0===s.current_authorisation_matches_context)}).catch(t=>{e&&S(t instanceof Error?t.message:"We couldn’t load this authorisation.")}).finally(()=>e&&k(!1)),()=>{e=!1}},[t,s]);let U=(0,a.useMemo)(()=>!!((null==v?void 0:v.confirmations.length)&&v.confirmations.every(e=>{let{key:t}=e;return!0===B[t]})),[B,v]),I=O||("typed_name"===W?T.trim().length>0:!!(null==R?void 0:R.strokes.length)),z=!!(v&&U&&I&&!N),D=(0,a.useMemo)(()=>{if(!v)return null;let e=v.vehicle_make||m||"",t=v.vehicle_model||x||"",s=v.vehicle_variant||p||"",r=v.vehicle_year||f||"",a=v.vehicle_vin||b||"",l=v.customer_phone||g||"",n=v.vehicle_display||[r,e,t,s].filter(Boolean).join(" "),o=[t,s].filter(Boolean).reduce((e,t)=>{let s=t.toLowerCase().replace(/[^a-z0-9]/g,""),r=e.findIndex(e=>e.toLowerCase().replace(/[^a-z0-9]/g,"")===s);return -1===r?[...e,t]:(!e[r].includes(" ")&&t.includes(" ")&&(e[r]=t),e)},[]),i=[e,o[0]].filter(Boolean).join(" "),c=[o.slice(1).join(" \xb7 "),r].filter(Boolean).join(" \xb7 "),d=v.purpose_display||"Confirm service history for this ".concat(j),u=v.workshops.map(e=>{let{name:t}=e;return t}),h=!function(e){return"string"==typeof e&&e.includes("may include service dates")}(v.wording)?function(e){let t=function(e){let t=e.filter(e=>!!e);return t.length<=1?t.join(""):"".concat(t.slice(0,-1).join(", ")," and ").concat(t[t.length-1])}(e.workshopNames)||"the selected workshops",s=e.vehicleDisplay||"my vehicle",r=[e.registration,e.state?"(".concat(e.state,")"):""].filter(Boolean).join(" ");
1return["I, ".concat(e.customerName,", authorise GlovBox to contact and request service information from ").concat(t," relating to my ").concat(s,", registration ").concat(r,", for the purpose of ").concat(e.purpose,"."),"The information requested may include service dates, odometer readings, work performed, maintenance records, and relevant invoices or job cards needed to prepare or verify the ".concat(e.documentLabel,"."),"GlovBox may provide the workshop or workshops with the customer, vehicle and request details reasonably required to locate and supply those records. Personal payment information must not be requested for or displayed in the ".concat(e.documentLabel,"."),"This authorisation is valid for ".concat(e.validForDays," days from the date signed and may be withdrawn before the relevant records are supplied.")].join("\n\n")}({customerName:v.customer_display_name,workshopNames:u,vehicleDisplay:n,registration:v.registration,state:v.registration_state,purpose:d,validForDays:v.valid_for_days,documentLabel:j}):v.wording,w=[v.customer_display_name,...u,n,v.registration,"(".concat(v.registration_state,")"),d,"".concat(v.valid_for_days," days")];return{make:e,heading:i,vin:a,phone:l,subtitle:c,vehicleDisplay:n,wording:h,highlights:w}},[v,m,x,p,f,b,g,j]),q=async()=>{if(!v||!U)return void S("Confirm all three statements before continuing.");if(!I)return void S("typed_name"===W?"Enter your full name before continuing.":"Draw your signature before continuing.");C(!0),S(null);try{if(!O){let e={context_digest:v.context_digest,confirm_details_correct:!0===B.confirm_details_correct,confirm_workshop_request:!0===B.confirm_workshop_request,confirm_information_use:!0===B.confirm_information_use,signature_method:W,..."typed_name"===W?{typed_full_name:T.trim()}:{drawn_signature:null!=R?R:void 0}},r=(await s.sign(t,e)).data;r&&w(e=>e?{...e,current_authorisation:r,current_authorisation_matches_context:!0}:e),G(!0)}h(v.workshops.map(e=>{let{name:t,location:s}=e;return{name:t,location:s}}))}catch(e){if(s.isStaleError(e))try{let e=(await s.getContext(t)).data;w(e),P(Object.fromEntries(e.confirmations.map(e=>{let{key:t}=e;return[t,!0]}))),F(""),A(null),G(!1),M(!0),S("The request details changed. Review the refreshed authorisation and sign again.");return}catch(e){S(e instanceof Error?e.message:"We couldn’t refresh this authorisation.");return}S(e instanceof Error?e.message:"We couldn’t send this workshop request.")}finally{C(!1)}};return y?(0,r.jsx)("div",{className:"flex flex-1 items-center justify-center text-sm font-bold text-slate-500",children:"Loading authorisation…"}):v&&D?(0,r.jsxs)("div",{className:"mx-auto flex min-h-full w-full max-w-lg flex-col pb-2 text-slate-950",children:[(0,r.jsx)(i.G,{onClick:l}),(0,r.jsx)("p",{className:"text-sm font-black uppercase tracking-[0.22em] text-blue-700",children:"Customer authorisation"}),(0,r.jsxs)("div",{className:"mt-3 flex items-center gap-4 roun
1ded-2xl border border-green-400 bg-gradient-to-r from-green-50 to-emerald-50 p-4 shadow-sm",children:[(0,r.jsx)("div",{className:"flex h-16 w-16 shrink-0 items-center justify-center rounded-full bg-cyan-50 text-blue-600",children:(0,r.jsxs)("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"none",className:"h-10 w-10",stroke:"currentColor",strokeWidth:"1.8",children:[(0,r.jsx)("path",{d:"M12 3 5.5 6v5.2c0 4.1 2.7 7.8 6.5 9.3 3.8-1.5 6.5-5.2 6.5-9.3V6L12 3Z"}),(0,r.jsx)("path",{d:"m9 12 2 2 4-4"})]})}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h1",{className:"text-lg font-extrabold leading-tight",children:"Workshops have asked for signed consent"}),(0,r.jsxs)("p",{className:"mt-1 text-sm font-medium leading-relaxed text-slate-600",children:["Your authorisation lets GlovBox collect service information to include in the ",j,"."]}),(0,r.jsxs)("p",{className:"mt-1 text-xs font-bold text-green-800",children:["Valid for ",v.valid_for_days," days"]})]})]}),(0,r.jsx)("p",{className:"mt-4 text-[11px] font-black uppercase tracking-[0.12em] text-slate-500",children:1===v.workshops.length?"Workshop we’ll contact":"Workshops we’ll contact"}),(0,r.jsx)("ul",{className:"mt-2 flex flex-wrap gap-2",children:v.workshops.map((e,t)=>(0,r.jsx)("li",{className:"rounded-full border border-blue-100 bg-blue-50 px-4 py-2 text-sm font-extrabold text-slate-900",children:e.name},"".concat(e.type,":").concat(e.name,":").concat(t)))}),v.current_authorisation&&!v.current_authorisation.is_valid&&(0,r.jsx)("p",{className:"mt-3 rounded-2xl bg-amber-50 p-3 text-sm font-semibold text-amber-800",children:"Your previous authorisation is no longer valid. Review the current details and create a new authorisation before sending this request."}),(0,r.jsxs)("dl",{className:"mt-3 space-y-3",children:[(0,r.jsxs)("div",{className:"rounded-2xl border border-slate-200 bg-white p-4 shadow-sm",children:[(0,r.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-4",children:[(0,r.jsxs)("div",{className:"flex min-w-0 flex-1 items-center gap-3.5",children:[(0,r.jsx)("dt",{className:"shrink-0",children:(0,r.jsx)(c.Es,{vehicleMake:D.make,size:"lg"})}),(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsx)("dd",{className:"text-base font-extrabold leading-snug text-slate-950",children:D.heading||D.make||"Vehicle"}),D.subtitle&&(0,r.jsx)("dd",{className:"mt-0.5 text-sm text-slate-500",children:D.subtitle})]})]}),(0,r.jsx)("dd",{className:"shrink-0",children:(0,r.jsxs)("span",{className:"inline-flex overflow-hidden rounded-xl shadow-lg shadow-slate-900/15",children:[(0,r.jsx)("span",{className:"flex items-center justify-center bg-slate-950 px-2.5 py-2 text-[10px] font-bold uppercase tracking-widest text-white [writing-mode:vertical-lr] [text-orientation:mixed]",children:v.registration_state}),(0,r.jsx)("span",{className:"bg-blue-700 px-4 py-2.5 text-2xl font-extrabold tracking-[0.1em] text-white",children:v.registration})]})})]}),(0,r.jsx)("dd",{className:"mt-4 border-t border-slate-100 pt-3",children:(0,r.jsxs)("span",{className:"inline-flex max-w-full items-center gap-2 rounded-full border border-blue-200 bg-blue-50 px-3 py-1 text-xs font-bold text-slate-800",children:[(0,r.jsx)("span",{className:"font-black text-blue-700",children:"VIN"}),(0,r.jsx)("span",{className:"truncate",children:D.vin||"Not recorded"})]})})]}),(0,r.jsxs)("div",{className:"rounded-2xl border border-slate-200 bg-white p-4 shadow-sm",children:[(0,r.jsxs)("dt",{className:"flex items-center gap-2.5 border-b border-slate-200 pb-3 text-sm font-extrabold",children:[(0,r.jsx)("span",{className:"flex h-10 w-10 items-center justify-center rounded-full bg-blue-50 text-blue-700",children:(0,r.jsxs)("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"currentColor",className:"h-6 w-6",children:[(0,r.jsx)("circle",{cx:"12",cy:"7",r:"4"}),(0,r.jsx)("path",{d:"M4.5 21v-2.5a7.5 7.5 0 0 1 15 0V21h-15Z"})]})}),"Customer details"]}),(0,r.jsxs)("dd",{className:"flex items-center gap-3 border-b border-slate-100 py-3.5 text-sm font-semibold text-slate-700",children:[(0,r.jsxs)("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",className:"h-5 w-5 shrink-0 text-slate-400",children:[(0,r.jsx)("circle",{cx:"12",cy:"7",r:"4"}),(0,r.jsx)("path",{d:"M4.5 21v-2a7.5 7.5 0 0 1 15 0v2"})]}),v.customer_display_name]}),(0,r.jsxs)("dd",{className:"flex items-center gap-3 border-b border-slate-100 py-3.5 text-sm font-semibold text-slate-700",children:[(0,r.jsx)("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",className:"h-5 w-5 shrink-0 text-slate-400",children:(0,r.jsx)("path",{d:"M6.6 3.8 9 3.2l2 5-1.8 1.5a15 15 0 0 0 5.1 5.1L15.8 13l5 2-.6 2.4a3 3 0 0 1-3.1 2.3C10 19.1 4.9 14 4.3 6.9a3 3 0 0 1 2.3-3.1Z"})}),D.phone||"Not recorded"]}),(0,r.jsxs)("dd",{className:"flex items-center gap-3 py-3.5 text-sm font-semibold text-slate-700",children:[(0,r.jsxs)("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",className:"h-5 w-5 shrink-0 text-slate-400",children:[(0,r.jsx)("rect",{x:"3",y:"5",width:"18",height:"14",rx:"2"}),(0,r.jsx)("path",{d:"m4 7 8 6 8-6"})]}),(0,r.jsx)("span",{className:"break-all",children:v.customer_email})]})]})]}),(0,r.jsxs)("div",{className:"mt-3 rounded-2xl border border-slate-200 bg-white shadow-sm",children:[(0,r.jsxs)("button",{type:"button",onClick:()=>M(e=>!e),"aria-expanded":L,className:"flex min-h-14 w-full items-center justify-between rounded-2xl bg-white px-4 py-4 text-left text-sm font-extrabold text-slate-800",children:[(0,r.jsx)("span",{children:L?"Hide authorisation details":"View authorisation details"}),(0,r.jsx)("span",{children:L?"⌃":"⌄"})]}),L&&(0,r.jsx)("div",{className:"border-t border-slate-200 px-4 pb-4 pt-3 text-sm font-medium leading-relaxed text-slate-600",children:(0,r.jsx)("p",{className:"whitespace-pre-line",children:function(e,t){let s=Array.from(new Set(t.filter(e=>"string"==typeof e).map(e=>
1e.trim()).filter(Boolean))).sort((e,t)=>t.length-e.length);if(!s.length)return[e];let a=RegExp("(".concat(s.map(d).join("|"),")"),"gi"),l=new Set(s.map(e=>e.toLocaleLowerCase()));return e.split(a).map((e,t)=>l.has(e.toLocaleLowerCase())?(0,r.jsx)("strong",{className:"font-extrabold text-slate-950",children:e},"".concat(e,":").concat(t)):e)}(D.wording,D.highlights)})})]}),(0,r.jsx)("div",{className:"mt-3 space-y-3 rounded-2xl border border-slate-200 bg-white p-4 shadow-sm",children:v.confirmations.map(e=>{let{key:t,label:s}=e;return(0,r.jsxs)("label",{className:"flex items-start gap-3 text-sm font-bold text-slate-800",children:[(0,r.jsx)("input",{type:"checkbox",checked:!0===B[t],onChange:e=>P(s=>({...s,[t]:e.target.checked})),className:"mt-0.5 h-5 w-5 appearance-none rounded border border-blue-600 bg-white checked:bg-blue-600 checked:after:block checked:after:text-center checked:after:text-sm checked:after:font-black checked:after:leading-[18px] checked:after:text-white checked:after:content-['✓']"}),(0,r.jsx)("span",{children:s})]},t)})}),!O&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("fieldset",{className:"mt-4",children:[(0,r.jsx)("legend",{className:"text-sm font-extrabold text-slate-900",children:"Choose your signature method"}),(0,r.jsx)("div",{className:"mt-2 grid grid-cols-2 gap-3",children:[["drawn_signature","Sign on glass"],["typed_name","Type full name"]].map(e=>{let[t,s]=e;return(0,r.jsx)("button",{type:"button",onClick:()=>E(t),"aria-pressed":W===t,className:"min-h-20 rounded-2xl border px-3 py-3 text-sm font-extrabold ".concat(W===t?"border-blue-600 bg-blue-50 text-blue-800 shadow-sm":"border-slate-200 bg-white text-slate-700"),children:s},t)})})]}),(0,r.jsxs)("div",{className:"mt-4 pb-2",children:["drawn_signature"===W?(0,r.jsx)(o,{value:R,onChange:A}):(0,r.jsxs)("label",{className:"block text-sm font-extrabold text-slate-700",children:["Full name",(0,r.jsx)("input",{value:T,onChange:e=>F(e.target.value),autoComplete:"name",className:"mt-2 h-14 w-full rounded-2xl border border-slate-300 px-4 text-base font-semibold outline-none focus:border-blue-600 focus:ring-4 focus:ring-blue-100"})]}),(0,r.jsx)("p",{className:"mt-2 text-xs font-medium text-slate-500",children:"Your signature will be added to your authorisation record."})]})]}),_&&(0,r.jsx)("p",{className:"mt-4 rounded-2xl bg-red-50 p-3 text-sm font-semibold text-red-700",children:_}),O&&!_&&(0,r.jsxs)("p",{className:"mt-4 rounded-2xl bg-green-50 p-3 text-sm font-semibold text-green-800",children:["Your authorisation is complete",v.current_authorisation?", signed ".concat(new Intl.DateTimeFormat("en-AU",{dateStyle:"medium"}).format(new Date(v.current_authorisation.signed_at))," and valid until ").concat(new Intl.DateTimeFormat("en-AU",{dateStyle:"medium"}).format(new Date(v.current_authorisation.expires_at))):"",". Continue to payment to send your request."]}),(0,r.jsxs)("div",{className:"mt-6 grid grid-cols-[1fr_2fr] gap-3 border-t border-slate-200 bg-white pb-3 pt-5",children:[(0,r.jsx)("button",{type:"button",onClick:l,className:"h-14 rounded-xl bg-slate-100 font-extrabold text-slate-900",children:"Back"}),(0,r.jsx)("button",{type:"button",onClick:q,disabled:!z,className:"h-14 rounded-xl bg-blue-700 px-3 text-base font-extrabold text-white shadow-lg hover:bg-blue-800 disabled:cursor-not-allowed disabled:bg-blue-300",children:N?O?"Continuing…":"Authorising…":O?"Continue to payment":"Authorise & continue"})]})]}):(0,r.jsxs)("div",{className:"mx-auto w-full max-w-md py-8",children:[(0,r.jsx)(i.G,{onClick:l}),(0,r.jsx)("p",{className:"mt-6 rounded-2xl bg-red-50 p-4 text-sm font-semibold text-red-700",children:_||"We couldn’t load this authorisation."}),(0,r.jsx)("button",{type:"button",onClick:n,className:"mt-4 w-full rounded-xl bg-blue-700 px-4 py-3 font-extrabold text-white",children:"Review customer details"})]})}},4855:(e,t,s)=>
1{s.d(t,{Og:()=>n,TS:()=>o,Wf:()=>a});var r=s(2848);async function a(e){var t,s;let a=new URLSearchParams;(null==(t=e.search)?void 0:t.trim())&&a.set("search",e.search.trim()),a.set("include_google",String(null==(s=e.includeGoogle)||s)),"number"==typeof e.lat&&"number"==typeof e.lng&&(a.set("lat",String(e.lat)),a.set("lng",String(e.lng)));let l="/api/core/workshops-search-list-all?".concat(a.toString()),n={Accept:"application/json",...(0,r.z5)()},o=await fetch(l,{headers:n}),i=await o.json();if(!o.ok){let e=Error((null==i?void 0:i.message)||"Failed to fetch workshops");throw e.statusCode=o.status,e}return i}async function l(e){let t={"Content-Type":"application/json",Accept:"application/json",...(0,r.z5)()},s=await fetch("/api/core/resolve-google-place",{method:"POST",headers:t,body:JSON.stringify({google_place_id:e})}),a=await s.json();if(!s.ok){let e=Error((null==a?void 0:a.message)||"Unable to link the selected Google workshop. Please try again.");throw e.statusCode=s.status,e}return a}async function n(e){return Promise.all(e.map(async e=>"google"===e.result_source&&e.google_place_id?(await l(e.google_place_id)).data.id:String(e.id)))}async function o(e){console.info("[seller-history-request] cURL command:\n"+function(e){var t;let s=(null==(t=window.location)?void 0:t.origin)?window.location.origin:"http://localhost:3000";return['curl -X POST "'.concat(s,'/api/vehicle-history-requests/seller" \\'),'  -H "Content-Type: application/json" \\','  -H "Accept: application/json" \\','  -H "Authorization: Bearer <ACCESS_TOKEN>" \\',"  --data-raw '".concat(JSON.stringify(e),"'")].join("\n")}(e));let t={"Content-Type":"application/json",Accept:"application/json",...(0,r.z5)()},s=await fetch("/api/vehicle-history-requests/seller",{method:"POST",headers:t,body:JSON.stringify(e)}),a=await s.json();if(!s.ok){console.error("[seller-history-request] API error response:",a);let e=Error((null==a?void 0:a.message)||"Failed to submit workshop authorization");throw e.statusCode=s.status,e.data=null==a?void 0:a.data,e}return a}},5957:(e,t,s)=>{s.d(t,{$:()=>a});var r=s(7876);function a(e){let{className:t="",type:s="button",children:a,...l}=e;return(0,r.jsx)("button",{type:s,...l,className:"w-full rounded-2xl bg-blue-700 px-4 py-4 text-lg font-extrabold text-white shadow-lg shadow-blue-700/25 transition-all hover:bg-blue-800 active:scale-[0.98] disabled:cursor-not-allowed disabled:opacity-50 ".concat(t),children:a})}},6629:(e,t,s)=>{s.d(t,{_9:()=>g,pq:()=>P,tn:()=>B});var r=s(7876),a=s(4232),l=s(4855),n=s(9508),o=s(8468),i=s(5957),c=s(2037),d=s(9200),u=s(7229),h=s(3867),m=s(2276);let x="text-[11px] font-black uppercase tracking-[0.12em] text-slate-500",p=["NSW","VIC","QLD","WA","SA","TAS","ACT","NT"],f=e=>{let t={},s=new Set;return e.forEach((e,r)=>{let a=h.W.safeParse(e);if(!a.success){var l,n;let e=a.error.flatten().fieldErrors;t[r]={workshop_name:null==(l=e.workshop_name)?void 0:l[0],state:null==(n=e.state)?void 0:n[0]}}let o="".concat(e.workshop_name.trim(),"-").concat(e.state).toLowerCase();s.has(o)&&(t[r]={...t[r],workshop_name:"This combination of workshop name and state is a duplicate."}),s.add(o)}),t},b=e=>Object.values(e).some(e=>e.workshop_name||e.state),g=(e,t)=>{let s=e.selected.filter(e=>{var t;return(null!=(t=e.result_source)?t:"internal")==="internal"}).map(e=>e.id),r=e.selected.filter(e=>{var t;return(null!=(t=e.result_source)?t:"internal")!=="internal"}).map(e=>({custom_workshop_name:e.workshop_name,custom_workshop_state:e.state_name||t})),a=e.customWorkshops.map(e=>({custom_workshop_name:e.workshop_name.trim(),custom_workshop_state:e.state})),l=Number(e.odometer.replace(/[^0-9.]/g,""));return{workshops:s,custom_workshops:[...r,...a],consent_granted:!0,consent_version:"pos-workshop-contact-v1",consent_source:"website",...e.odometer.trim()&&Number.isFinite(l)&&l>0?{odometer:l}:{}}},j=e=>{var t,s;return null!=(s=null!=(t=e.id)?t:e.google_place_id)?s:""},v=e=>{var t;return[e.address,null==(t=e.state)?void 0:t.name].filter(Boolean).join(", ")},w=e=>e<1?"".concat(Math.round(1e3*e)," m"):"".concat(e.toFixed(1)," km"),y=(e,t)=>{let[s,r]=(0,a.useState)(e);return(0,a.useEffect)(()=>{let s=setTimeout(()=>r(e),t);return()=>clearTimeout(s)},[e,t]),s},k=()=>(0,r.jsxs)("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",className:"h-6 w-6",children:[(0,r.jsx)("path",{d:"M12 3 5.5 6v5.2c0 4.1 2.7 7.8 6.5 9.3 3.8-1.5 6.5-5.2 6.5-9.3V6L12 3Z"}),(0,r.jsx)("path",{d:"m9 12 2 2 4-4"})]}),N=()=>(0,r.jsxs)("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",className:"h-[18px] w-[18px]",children:[(0,r.jsx)("circle",{cx:"11",cy:"11",r:"8"}),(0,r.jsx)("path",{d:"m21 21-4.3-4.3"})]}),C=()=>(0,r.jsxs)("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-3.5 w-3.5 shrink-0",children:[(0,r.jsx)("path",{d:"M17.657 16.657 13.414 20.9a2 2 0 0 1-2.827 0l-4.244-4.243a8 8 0 1 1 11.314 0z"}),(0,r.jsx)("circle",{cx:"12",cy:"11",r:"3"})]}),_=()=>(0,r.jsx)("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"
1currentColor",className:"h-3.5 w-3.5 shrink-0 text-amber-400",children:(0,r.jsx)("path",{d:"m12 2 2.9 6.1 6.7.9-4.9 4.6 1.2 6.7L12 17.8 6.1 20.9l1.2-6.7L2.4 9.6l6.7-.9L12 2Z"})}),S=()=>(0,r.jsx)("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",className:"h-4 w-4 shrink-0",children:(0,r.jsx)("path",{d:"M12 5v14M5 12h14"})}),L=()=>(0,r.jsx)("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"h-5 w-5",children:(0,r.jsx)("path",{d:"M4 7h16M9 7V5a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2m-8 0 .8 12.1A2 2 0 0 0 9.8 21h4.4a2 2 0 0 0 2-1.9L17 7"})}),M=()=>(0,r.jsxs)("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-3.5 w-3.5 shrink-0",children:[(0,r.jsx)("rect",{x:"4",y:"11",width:"16",height:"10",rx:"2"}),(0,r.jsx)("path",{d:"M8 11V7a4 4 0 0 1 8 0v4"})]}),B=async(e,t,s)=>{let{data:r}=await (0,n.aK)(e,g(t,s));return r};function P(e){var t,s,n,h,g;let{draftToken:B,regoState:P,vehicleRegistration:W,vehicleMake:E,vehicleModel:T,vehicleYear:F,vehicleDescriptor:R,vehicleBadgeUrl:A,initialValues:O,onBack:G,onNext:U,saveWorkshops:I,showConsent:z=!0,submitLabel:D="Use this workshop"}=e,[q,V]=(0,a.useState)(null!=(s=null==O?void 0:O.odometer)?s:""),[H,J]=(0,a.useState)(""),[Y,Z]=(0,a.useState)([]),[X,$]=(0,a.useState)(),[K,Q]=(0,a.useState)(!1),[ee,et]=(0,a.useState)(null!=(n=null==O?void 0:O.selected)?n:[]),[es,er]=(0,a.useState)(null!=(h=null==O?void 0:O.customWorkshops)?h:[]),[ea,el]=(0,a.useState)({}),[en,eo]=(0,a.useState)([]),[ei,ec]=(0,a.useState)(null==(g=null==O?void 0:O.consent)||g),[ed,eu]=(0,a.useState)(!1),[eh,em]=(0,a.useState)(null),[ex,ep]=(0,a.useState)(null),ef=y(H,350);(0,a.useEffect)(()=>{let e=!1;return(0,m.nP)().then(t=>{var s;if(e)return;let r=null==t?void 0:t.data;eo(Array.isArray(r)?r:null!=(s=null==r?void 0:r.results)?s:[])}).catch(()=>{e||eo([])}),()=>{e=!0}},[]),(0,a.useEffect)(()=>{"undefined"!=typeof navigator&&navigator.geolocation&&navigator.geolocation.getCurrentPosition(e=>ep({lat:e.coords.latitude,lng:e.coords.longitude}),()=>{},{enableHighAccuracy:!1,timeout:8e3,maximumAge:3e5})},[]),(0,a.useEffect)(()=>{let e=ef.trim();if(e.length<3){Z([]),$(void 0),Q(!1);return}let t=!1;return Q(!0),(0,l.Wf)({search:e,lat:null==ex?void 0:ex.lat,lng:null==ex?void 0:ex.lng}).then(e=>{var s,r,a;t||(Z(null!=(a=null==e||null==(s=e.data)?void 0:s.results)?a:[]),$(null==e||null==(r=e.data)?void 0:r.attribution))}).catch(()=>{t||(Z([]),$(void 0))}).finally(()=>{t||Q(!1)}),()=>{t=!0}},[ef,ex]);let eb=e=>{let t=j(e);if(!t)return;em(null);let s=ee.some(e=>e.id===t);et(r=>{var a;return s?r.filter(e=>e.id!==t):[...r,{id:t,workshop_name:e.workshop_name,address:e.address||void 0,state_name:(null==(a=e.state)?void 0:a.name)||void 0,result_source:e.result_source}]}),s||J("")},eg=ee.length>0||es.length>0,ej=H.trim(),ev=ej.length>=3,ew=K||ej!==ef.trim(),ey=(e,t,s)=>{em(null),er(r=>r.map((r,a)=>a===e?{...r,[t]:s}:r)),el(s=>s[e]?{...s,[e]:{...s[e],[t]:void 0}}:s)},ek=e=>{em(null),er(t=>t.filter((t,s)=>s!==e)),el({})},eN=()=>({odometer:q,selected:ee,customWorkshops:es,consent:ei}),eC=async()=>{if(!eg)return void em("Select at least one workshop to continue.");let e=f(es);if(el(e),b(e))return void em("Check the workshop details you entered.");if(z&&!ei)return void em("Please allow GlovBox to contact your workshop to continue.");let t=eN();if(!B)return void U(t);eu(!0),em(null);try{let e=await I(B,t,P);U(t,e)}catch(e){em(e instanceof Error?e.message:"We couldn’t save your workshops. Please try again.")}finally{eu(!1)}};return(0,r.jsxs)("div",{className:"mx-auto flex min-h-full w-full max-w-lg flex-col pb-2 text-slate-950",children:[(0,r.jsx)(o.G,{onClick:()=>G(eN()),className:"mb-0"}),W&&(0,r.jsx)(c.Hx,{vehicleRegistration:W,vehicleState:P,vehicleMake:E||"",vehicleModel:T,vehicleYear:F,vehicleDescriptor:R,vehicleBadgeUrl:A,specs:[],compact:!0}),(0,r.jsx)("p",{className:"mt-6 text-[11px] font-black uppercase tracking-[0.14em] text-blue-700",children:"Service history"}),(0,r.jsx)("h1",{className:"mt-1 ".concat(d.X),children:"Where's it serviced?"}),(0,r.jsx)("p",{className:"mt-1.5 ".concat(d.q),children:"This helps us verify your service history faster."}),(0,r.jsxs)("div",{className:"mt-6",children:[(0,r.jsx)("label",{className:x,htmlFor:"pos-odometer",children:"Current odometer reading"}),(0,r.jsxs)("div",{className:"relative mt-2",children:[(0,r.jsx)("input",{id:"pos-odometer",inputMode:"numeric",value:q,onChange:e=>V(e.target.value.replace(/[^0-9.,]/g,"")),placeholder:"e.g. 82000",className:"".concat((0,u.jb)(!1)," pr-14")}),(0,r.jsx)("span",{className:"pointer-events-none absolute right-6 top-1/2 -translate-y-1/2 text-base font-bold text-slate-400",children:"km"})]})]}),(0,r.jsxs)("div",{className:"mt-5",children:[(0,r.jsx)("label",{className:x,htmlFor:"pos-workshop-search",children:"Search for your workshop"}),(0,r.jsxs)("div",{className:"relative mt-2",children:[(0,r.jsx)("span",{className:"pointer-events-none absolute left-5 top-1/2 -translate-y-1/2 text-slate-400",children:(0,r.jsx)(N,{})}),(0,r.jsx)("input",{id:"pos-workshop-search",type:"text",autoComplete:"off",value:H,onChange:e=>J(e.target.value),placeholder:"Search by name or suburb",className:"".concat((0,u.jb)(!1)," pl-12")})]})]}),ee.length>0&&(0,r.jsx)("div",{className:"mt-3 flex flex-wrap gap-2",children:ee.map(e=>(0,r.jsxs)("span",{className:"inline-flex max-w-full items-center gap-1.5 rounded-lg border border-blue-100 bg-blue-50 py-1.5 pl-3 pr-2 text-xs font-bold text-blue-700",children:[(0,r.jsx)("span",{className:"truncate",children:e.workshop_name}),(0,r.jsx)("button",{type:"button",onClick:()=>et(t=>t.filter(t=>t.id!==e.id)),"aria-label":"Remove ".concat(e.workshop_name),className:"shrink-0 text-blue-400 hover:text-red-500",children:(0,r.jsx)("svg",{className:"h-3.5 w-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2.5",d:"M6 18 
118 6M6 6l12 12"})})})]},e.id))}),(0,r.jsx)("div",{className:ev?"mt-4":"",children:ev?ew?(0,r.jsx)("p",{className:"py-3 text-sm font-medium text-slate-400",children:"Searching…"}):Y.length>0?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("p",{className:"mb-2 text-[11px] font-bold text-slate-400",children:Y.length>25?"Showing ".concat(25," of ").concat(Y.length," workshops — keep typing to narrow it down"):"".concat(Y.length," workshop").concat(1===Y.length?"":"s"," found")}),(0,r.jsx)("div",{className:"space-y-2.5",children:Y.slice(0,25).map(e=>{let t=j(e),s=ee.some(e=>e.id===t),a="internal"===e.result_source,l=v(e),n="number"==typeof e.distance_km?e.distance_km:null;return(0,r.jsxs)("div",{className:"relative flex items-center gap-3 rounded-2xl border p-4 transition-colors ".concat(s?"border-blue-600 bg-blue-50/60":a?"border-blue-200 bg-blue-50/40":"border-slate-200 bg-white"),children:[(0,r.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,r.jsx)("p",{className:"truncate text-[15px] font-extrabold text-slate-950",children:e.workshop_name}),l&&(0,r.jsx)("p",{className:"mt-0.5 truncate text-xs font-medium text-slate-500",children:l}),(null!==n||"number"==typeof e.rating)&&(0,r.jsxs)("p",{className:"mt-1.5 flex flex-wrap items-center gap-x-3 gap-y-1 text-xs font-semibold text-slate-500",children:[null!==n&&(0,r.jsxs)("span",{className:"flex items-center gap-1",children:[(0,r.jsx)(C,{}),w(n)]}),"number"==typeof e.rating&&(0,r.jsxs)("span",{className:"flex items-center gap-1",children:[(0,r.jsx)(_,{}),e.rating.toFixed(1)]})]}),e.temporarily_unavailable&&(0,r.jsx)("p",{className:"mt-1 text-[11px] font-medium text-slate-400",children:"Workshop may currently be unavailable."})]}),(0,r.jsxs)("div",{className:"flex shrink-0 flex-col items-end gap-2 self-stretch ".concat(a?"justify-between":"justify-center"),children:[a&&(0,r.jsx)("span",{className:"rounded-md bg-blue-100 px-2 py-1 text-[10px] font-bold uppercase tracking-[0.06em] text-blue-700",children:"GB network"}),(0,r.jsx)("button",{type:"button",onClick:()=>eb(e),className:"rounded-xl border px-5 py-2 text-sm font-bold transition-colors ".concat(s?"border-blue-700 bg-blue-700 text-white hover:bg-blue-800":"border-blue-700 bg-white text-blue-700 hover:border-blue-800 hover:bg-blue-50 hover:text-blue-800"),children:s?"Chosen":"Choose"})]})]},t)})}),(null==X?void 0:X.google_maps_required)&&(0,r.jsxs)("div",{className:"mt-2 flex flex-wrap items-center gap-x-2 text-[11px] leading-4 text-slate-400",children:[(0,r.jsx)("span",{className:"font-semibold",children:"Powered by Google"}),null==(t=X.third_party)?void 0:t.map(e=>{let t=e.text||e.uri;return t?e.uri?(0,r.jsx)("a",{href:e.uri,target:"_blank",rel:"noreferrer",className:"underline hover:text-slate-600",children:t},"".concat(e.text,"-").concat(e.uri)):(0,r.jsx)("span",{children:t},t):null})]})]}):(0,r.jsxs)("div",{className:"py-3",children:[(0,r.jsx)("p",{className:"text-sm font-medium text-slate-400",children:"No workshops matched that search."}),(0,r.jsxs)("button",{type:"button",onClick:()=>{em(null),er(e=>[...e,{workshop_name:ej,state:""}]),J("")},className:"mt-3 flex w-full items-center justify-center gap-2 rounded-2xl border border-dashed border-blue-300 bg-blue-50/60 px-4 py-3 text-sm font-bold text-blue-700 transition-colors hover:bg-blue-50",children:[(0,r.jsx)(S,{}),(0,r.jsxs)("span",{className:"min-w-0 truncate",children:["Add “",ej,"” as my workshop"]})]})]}):null}),es.length>0&&(0,r.jsxs)("div",{className:"mt-5 border-t border-slate-200 pt-5",children:[(0,r.jsx)("p",{className:x,children:"Your workshop"}),(0,r.jsx)("div",{className:"mt-2 space-y-3",children:es.map((e,t)=>{var s,a,l,n,o,i;return(0,r.jsxs)("div",{className:"flex items-start gap-2",children:[(0,r.jsxs)("div",{className:"grid min-w-0 flex-1 grid-cols-1 gap-3 sm:grid-cols-2",children:[(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsx)("input",{value:e.workshop_name,onChange:e=>ey(t,"workshop_name",e.target.value),placeholder:"Enter workshop name","aria-label":"Workshop name",className:(0,u.jb)(!!(null==(s=ea[t])?void 0:s.workshop_name))}),(null==(a=ea[t])?void 0:a.workshop_name)&&(0,r.jsx)("p",{className:u.r1,children:null==(l=ea[t])?void 0:l.workshop_name})]}),(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsxs)("select",{value:e.state,onChange:e=>ey(t,"state",e.target.value),"aria-label":"Workshop state",className:(0,u.f8)(!!(null==(n=ea[t])?void 0:n.state)),children:[(0,r.jsx)("option",{value:"",children:"Select state"}),en.length>0?en.map(e=>(0,r.jsx)("option",{value:e.id,children:e.name||e.code},e.id)):p.map(e=>(0,r.jsx)("option",{value:e,children:e},e))]}),(null==(o=ea[t])?void 0:o.state)&&(0,r.jsx)("p",{className:u.r1,children:null==(i=ea[t])?void 0:i.state})]})]}),(0,r.jsx)("button",{type:"button",onClick:()=>ek(t),"aria-label":"Remove ".concat(e.workshop_name||"workshop"),className:"mt-4 shrink-0 text-slate-400 transition-colors hover:text-red-500",children:(0,r.jsx)(L,{})})]},t)})})]}),z&&(0,r.jsx)("div",{className:"mt-5 rounded-2xl border border-emerald-200 bg-emerald-50 p-4",children:(0,r.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,r.jsxs)("div",{className:"flex items-start gap-3",children:[(0,r.jsx)("span",{className:"text-emerald-600",children:(0,r.jsx)(k,{})}),(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-[13px] font-extrabold leading-snug text-slate-900",children:"Allow GlovBox to contact my workshop"}),(0,r.jsx)("p",{className:"mt-1 text-[11px] font-medium leading-relaxed text-slate-500",children:"I authorise GlovBo
1x to share my name, vehicle details and request details with the selected workshop or workshops so they can help confirm the service history for this report."})]})]}),(0,r.jsx)("button",{type:"button",role:"switch","aria-checked":ei,"aria-label":"Allow GlovBox to contact my workshop",onClick:()=>ec(e=>!e),className:"relative h-7 w-12 shrink-0 rounded-full transition-colors ".concat(ei?"bg-emerald-500":"bg-slate-300"),children:(0,r.jsx)("span",{className:"absolute top-0.5 h-6 w-6 rounded-full bg-white shadow transition-all ".concat(ei?"left-[22px]":"left-0.5")})})]})}),eh&&(0,r.jsx)("p",{className:"mt-4 rounded-2xl bg-red-50 p-3 text-sm font-semibold text-red-700",children:eh}),(0,r.jsxs)("div",{className:"mt-5",children:[(0,r.jsx)(i.$,{onClick:eC,disabled:ed,children:ed?"Saving…":D}),(0,r.jsxs)("p",{className:"mt-3 flex items-center justify-center gap-1.5 text-center text-[11px] font-medium text-slate-400",children:[(0,r.jsx)(M,{}),"Your personal and pricing details are always hidden."]}),(0,r.jsxs)("a",{href:"https://app.glovbox.com.au/privacy-statement",target:"_blank",rel:"noreferrer",className:"mt-1 flex items-center justify-center gap-1 text-[11px] font-bold text-blue-700 hover:text-blue-800",children:["Learn more about how GlovBox protects your details.",(0,r.jsx)("span",{"aria-hidden":"true",children:"›"})]})]})]})}},8133:(e,t,s)=>{s.d(t,{N:()=>k});var r=s(7876),a=s(8992),l=s(3810),n=s(3867),o=s(7229),i=s(4232),c=s(2044),d=s(2848);let u=e=>{let t=String(e||"").replace(/[^0-9]/g,"");return t.startsWith("61")&&(t=t.slice(2)),t.startsWith("0")&&(t=t.slice(1)),"+61".concat(t)};async function h(e){let{userId:t,lastName:s,phone:r}=e,a={"Content-Type":"application/json",Accept:"application/json",...(0,d.z5)()},l=await fetch("/api/users/".concat(t),{method:"PATCH",headers:a,body:JSON.stringify({last_name:s.trim(),phone_number:u(r)})}),n=await l.json();if(!l.ok){let e=Error((null==n?void 0:n.message)||"Failed to update user details");throw e.statusCode=l.status,e.data=null==n?void 0:n.data,e}return n}var m=s(8468),x=s(9200);let p=e=>{let{size:t=24,className:s,children:a}=e;return(0,r.jsx)("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:s,children:a})},f=e=>(0,r.jsxs)(p,{...e,children:[(0,r.jsx)("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),(0,r.jsx)("path",{d:"M14 2v6h6"}),(0,r.jsx)("path",{d:"M16 13H8"}),(0,r.jsx)("path",{d:"M16 17H8"}),(0,r.jsx)("path",{d:"M10 9H8"})]}),b=e=>(0,r.jsxs)(p,{...e,children:[(0,r.jsx)("rect",{x:"2",y:"4",width:"20",height:"16",rx:"2"}),(0,r.jsx)("path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7"})]}),g=e=>(0,r.jsxs)(p,{...e,children:[(0,r.jsx)("path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2"}),(0,r.jsx)("circle",{cx:"12",cy:"7",r:"4"})]}),j=e=>(0,r.jsx)(p,{...e,children:(0,r.jsx)("path",{d:"M9 12L11 14L15 9.99999M20 12C20 16.4611 14.54 19.6937 12.6414 20.683C12.4361 20.79 12.3334 20.8435 12.191 20.8712C12.08 20.8928 11.92 20.8928 11.809 20.8712C11.6666 20.8435 11.5639 20.79 11.3586 20.683C9.45996 19.6937 4 16.4611 4 12V8.21759C4 7.41808 4 7.01833 4.13076 6.6747C4.24627 6.37113 4.43398 6.10027 4.67766 5.88552C4.9535 5.64243 5.3278 5.50207 6.0764 5.22134L11.4382 3.21067C11.6461 3.13271 11.75 3.09373 11.857 3.07827C11.9518 3.06457 12.0482 3.06457 12.143 3.07827C12.25 3.09373 12.3539 3.13271 12.5618 3.21067L17.9236 5.22134C18.6722 5.50207 19.0465 5.64243 19.3223 5.88552C19.566 6.10027 19.7537 6.37113 19.8692 6.6747C20 7.01833 20 7.41808 20 8.21759V12Z"})}),v=[{icon:(0,r.jsx)(j,{size:20}),title:"Build trust",desc:"Help buyers feel confident."},{icon:(0,r.jsx)(e=>(0,r.jsxs)(p,{...e,children:[(0,r.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,r.jsx)("polyline",{points:"12 6 12 12 16 14"})]}),{size:20}),title:"Saves time",desc:"Everything in one easy report."},{icon:(0,r.jsx)(e=>(0,r.jsxs)(p,{...e,children:[(0,r.jsx)("circle",{cx:"18",cy:"5",r:"3"}),(0,r.jsx)("circle",{cx:"6",cy:"12",r:"3"}),(0,r.jsx)("circle",{cx:"18",cy:"19",r:"3"}),(0,r.jsx)("line",{x1:"8.59",y1:"13.51",x2:"15.42",y2:"17.49"}),(0,r.jsx)("line",{x1:"15.41",y1:"6.51",x2:"8.59",y2:"10.49"})]}),{size:20}),title:"Easy to share",desc:"Share instantly with buyers."}],w="block text-[11px] font-black uppercase tracking-[0.12em] text-slate-500 ml-1 mb-2",y=e=>"w-full box-border bg-slate-50 border rounded-xl pl-11 pr-3 py-3.5 text-base text-slate-900 outline-none focus:ring-2 focus:ring-blue-500/20 focus:border-blue-500 transition-all placeholder:text-slate-400 ".concat(e?"border-red-500":"border-slate-200"),k=e=>{var t,s,u;let{regoNumber:p,regoState:k,onBack:N,handleNext:C,heading:_="Your Proof of Service report",bannerTitle:S="Tell us where to send your report.",bannerSubtitle:L="It's free to start and only takes a few minutes.",phoneHelper:M="We'll only use this to send report updates or contact you about this request.",submitLabel:B="Start Your Proof of Service"}=e,[P,W]=(0,i.useState)(!1),[E,T]=(0,i.useState)(null),F=(0,i.useRef)(!1),{register:R,control:A,handleSubmit:O,formState:{errors:G}}=(0,a.mN)({resolver:(0,l.u)(n.LU),mode:"onChange",defaultValues:{firstName:"",lastName:"",email:"",ph
1one:""}}),U=async e=>{if(!F.current){F.current=!0;try{var t;W(!0),T(null);let s=await (0,c.Gh)({first_name:e.firstName,email:e.email,phone_number:e.phone,rego:p,state:k},"seller"),r=null==s?void 0:s.data;(null==r?void 0:r.tokens)&&(0,d.h_)(r.tokens);let a=null==r||null==(t=r.user)?void 0:t.id;a&&await h({userId:a,lastName:e.lastName,phone:e.phone}),C(s)}catch(e){T(e instanceof Error?e.message:"Something went wrong")}finally{F.current=!1,W(!1)}}};return(0,r.jsxs)("form",{onSubmit:O(U),className:"flex-1 px-2 py-2 overflow-y-auto flex flex-col",children:[N&&(0,r.jsx)(m.G,{onClick:N,className:"mb-4"}),(0,r.jsxs)("div",{className:"flex flex-col items-center text-center",children:[(0,r.jsx)("div",{className:"mb-5 flex h-16 w-16 items-center justify-center rounded-[1.25rem] bg-gradient-to-b from-[#2D4278] to-[#141F49] text-white shadow-lg shadow-slate-900/20",children:(0,r.jsx)(f,{size:30})}),(0,r.jsx)("h2",{className:x.X,children:_})]}),(0,r.jsxs)("div",{className:"mt-6 w-full flex items-start gap-3.5 rounded-2xl bg-indigo-50 px-4 py-4",children:[(0,r.jsx)("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-xl bg-indigo-100 text-blue-700",children:(0,r.jsx)(b,{size:20})}),(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-[15px] font-bold text-slate-900 leading-snug",children:S}),L&&(0,r.jsx)("p",{className:"mt-1 text-[13px] font-medium text-slate-500 leading-snug",children:L})]})]}),(0,r.jsx)("p",{className:"mt-6 mb-3 text-xs font-black uppercase tracking-[0.14em] text-blue-700",children:"Your details"}),(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:w,children:"First Name*"}),(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)("span",{className:"pointer-events-none absolute left-4 top-1/2 -translate-y-1/2 text-slate-400",children:(0,r.jsx)(g,{size:18})}),(0,r.jsx)("input",{type:"text",placeholder:"ex. John",...R("firstName"),className:y(!!G.firstName)})]}),(null==(t=G.firstName)?void 0:t.message)&&(0,r.jsx)("p",{className:o.r1,children:G.firstName.message})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:w,children:"Last Name*"}),(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)("span",{className:"pointer-events-none absolute left-4 top-1/2 -translate-y-1/2 text-slate-400",children:(0,r.jsx)(g,{size:18})}),(0,r.jsx)("input",{type:"text",placeholder:"ex. Wick",...R("lastName"),className:y(!!G.lastName)})]}),(null==(s=G.lastName)?void 0:s.message)&&(0,r.jsx)("p",{className:o.r1,children:G.lastName.message})]})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:w,children:"Email*"}),(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)("span",{className:"pointer-events-none absolute left-4 top-1/2 -translate-y-1/2 text-slate-400",children:(0,r.jsx)(b,{size:18})}),(0,r.jsx)("input",{type:"email",placeholder:"ex. [email protected]",...R("email"),className:y(!!G.email)})]}),(null==(u=G.email)?void 0:u.message)&&(0,r.jsx)("p",{className:o.r1,children:G.email.message})]}),(0,r.jsx)(a.xI,{name:"phone",control:A,render:e=>{var t;let{field:s}=e;return(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:w,children:"Phone Number*"}),(0,r.jsxs)("div",{className:"flex items-center gap-3 w-full box-border bg-slate-50 border rounded-xl px-4 py-3.5 focus-within:ring-2 focus-within:ring-blue-500/20 focus-within:border-blue-500 transition-all ".concat(G.phone?"border-red-500":"border-slate-200"),children:[(0,r.jsx)("span",{className:"shrink-0 pr-3 border-r border-slate-200 text-base font-semibold text-slate-500",children:"+61"}),(0,r.jsx)("input",{type:"tel",inputMode:"numeric",autoComplete:"tel-national",placeholder:"0412 345 678",value:s.value||"",onChange:e=>{let t=e.target.value.replace(/[^0-9]/g,"");t.startsWith("61")&&(t=t.slice(2)),s.onChange(t)},className:"w-full bg-transparent outline-none placeholder:text-slate-400 text-slate-900 text-base"})]}),(null==(t=G.phone)?void 0:t.message)&&(0,r.jsx)("p",{className:o.r1,children:G.phone.message})]})}}),(0,r.jsxs)("div",{className:"flex items-start gap-2.5",children:[(0,r.jsx)(j,{size:16,className:"mt-0.5 shrink-0 text-slate-400"}),(0,r.jsx)("p",{className:"text-[13px] font-medium text-slate-400 leading-snug",children:M})]}),E&&(0,r.jsx)("p",{className:"text-red-500 text-sm",children:E})]}),(0,r.jsx)("div",{className:"mt-7 grid grid-cols-3 gap-3",children:v.map(e=>(0,r.jsxs)("div",{className:"flex flex-col items-center gap-2 text-center",children:[(0,r.jsx)("div",{className:"flex h-12 w-12 items-center justify-center rounded-full bg-indigo-50 text-blue-700",children:e.icon}),(0,r.jsx)("p",{className:"text-sm font-black text-slate-900",children:e.title}),(0,r.jsx)("p",{className:"text-xs font-medium text-slate-400 leading-tight",children:e.desc})]},e.title))}),(0,r.jsxs)("div",{className:"mt-7 w-full",children:[(0,r.jsx)("button",{type:"submit",disabled:P,className:"w-full bg-blue-700 hover:bg-blue-800 text-white font-bold py-4 rounded-2xl shadow-xl shadow-blue-700/25 transition-all active:scale-[0.98] text-lg disabled:opacity-60 flex items-center justify-center gap-2.5",children:P?"Loading...":(0,r.jsxs)(r.Fragment,{children:[B,(0,r.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,r.jsx)("path",{d:"M5 12h14"}),(0,r.jsx)("path",{d:"m12 5 7 7-7 7"})]})]})}),(0,r.jsxs)("p",{className:"mt-4 flex items-center justify-center gap-2 text-[13px] font-medium text-slate-400",children:[(0,r.jsxs)("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,r.jsx)("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),(0,r.jsx)("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]}),"100% secure. Your information is safe with us."]})]})]})}},9508:(e,t,s)=>{s.d(t,{F4:()=>b,Ji:()=>p,O$:()=>k,Oo:()=>y,TS:()=>h,Un:()=>n,Zw:()=>u,aK:()=>m,cX:()=>g,db:()=>w,hG:()=>a,i_:()=>N,jL:()=>v,oc:()=>f,st:()=>o,xz:()=>x,yO:()=>j});var r=s(2848);let a=e=>!!e.expires_at&&Date.now()>=new Date(e.expires_at).getTime(),l={".jpg":"image/jpeg",".jpeg":"image/jpeg",".png":"image/png",".webp":"image/webp",".pdf":"application/pdf"},n=e=>{var t;return l[(null==(t=e.name.toLowerCase().match(/\.[^.]+$/))?void 0:t[0])||""]||null},o=e=>{for(let t of e){if(!n(t))throw Error("Choose a JPG, PNG, WebP or PDF file.");if(t.size>0x1400000)throw Error("".concat(t.name," is larger than the 20MB upload limit."))}};async function i(e){let t=await e.json().catch(()=>({}));if(!e.ok){let s=Error((null==t?void 0:t.message)||"Request failed");throw s.statusCode=e.status,s.data=null==t?void 0:t.data,s}return t}let c=()=>({"Content-Type":"application/json",Accept:"application/json",...(0,r.z5)()}),d="/api/prepaid-reports/direct-pos-drafts",u=async e=>i(await fetch("".concat(d),{method:"POST",headers:c(),body:JSON.stringify(e)})),h=async e=>i(await fetch("".concat(d,"/").concat(e),{method:"GET",headers:c()})),m=async(e,t)=>i(await fetch("".concat(d,"/").concat(e),{method:"PATCH",headers:c(),body:JSON.stringify(t)})),x=async e=>i(await fetch("".concat(d,"/").concat(e,"/claim"),{method:"POST",headers:c(),body:JSON.stringify({})})),p=async e=>i(await fetch("".concat(d,"/").concat(e,"/status"),{method:"GET",headers:c()})),f=async(e,t)=>i(await fetch("".concat(d,"/").concat(e,"/presigned-upload"),{method:"POST",headers:c(),body:JSON.stringify({receipts:t})})),b=async(e,t)=>{var s;let r=await fetch(e,{method:"PUT",headers:{"Content-Type":null!=(s=n(t))?s:t.type},body:t});if(!r.ok){let e=Error("Upload failed for ".concat(t.name));throw e.statusCode=r.status,e}},g=async e=>i(await fetch("".concat(d,"/").concat(e,"/submit-uploads"),{method:"POST",headers:c(),body:JSON.stringify({})})),j=async e=>i(await fetch("".concat(d,"/").concat(e,"/submit-workshop-request"),{method:"POST",headers:c(),body:JSON.stringify({})})),v=async e=>i(await fetch("".concat(d,"/").concat(e,"/workshop-authorisation"),{method:"GET",headers:c()})),w=async(e,t)=>i(await fetch("".concat(d,"/").concat(e,"/workshop-authorisation"),{method:"POST",headers:c(),body:JSON.stringify(t)})),y=async e=>i(await fetch("/api/reports/".concat(e,"/certificate"),{headers:c()})),k=async(e,t)=>{let{data:s}=await y(e),r=null==s?void 0:s.certificate_path;if(!r)throw Error("Your certificate PDF isn’t ready yet.");let a=await fetch(r);if(!a.ok)throw Error("We couldn’t download your certificate.");let l=URL.createObjectURL(await a.blob());try{let e=document.createElement("a");e.href=l,e.download=t,document.body.appendChild(e),e.click(),e.remove()}finally{URL.revokeObjectURL(l)}},N=e=>e instanceof Error&&400===e.statusCode&&e.message.includes("changed")}}]);

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.