1import{j as e,r as p,u as V}from"./vendor-react-DfYGAhtm.js";import{m as c,G as M,g as I,x as j,a as U,B as N,b2 as _,b3 as B,t as L}from"./index-DsBgCU7r.js";import{u as O}from"./useAnalytics-HP01GbIH.js";import{S as H}from"./StepPageLayout-DdZUweau.js";import{g as k}from"./errors-BYKXB8DF.js";import{a as Y}from"./gadgetPolicyApi-C0LGK2Xi.js";import{o as Z,s as x,b as w,c as z,d as K,C as S}from"./vendor-forms-BP-7CbAP.js";import{S as v}from"./SelectField-B8rkxDSz.js";import{M as F}from"./constants-9aQr_m9y.js";import{V as C,T as g,a as f,G as W}from"./vendor-ui-DA_r9yXk.js";import{u as $}from"./useGadgetStepBreadcrumbs-BQrYEyhX.js";import{G as R}from"./routes-CNOe4p0Z.js";import"./ocrConfig-B-KSx9JM.js";import{g as q,G as Q,a as J,e as ee}from"./manualDeviceMappers-BKIysACn.js";import"./gadgetPostPaymentFlowConfig-ChCU4qBA.js";import"./vendor-icons-1odZwi-b.js";import"./vendor-state-BsBVN-fX.js";import"./DropdownPopover-KjBTPKBF.js";import"./stepBreadcrumbs-FCtSk5Kj.js";import"./LinkPaymentMethodOption-CuZHpNDU.js";import"./checkoutSessionStore-BRM5sYZN.js";const oe=["Apple","Samsung","Tecno","Infinix","itel","Xiaomi","Redmi","POCO","Oppo","Vivo","Realme","Huawei","Honor","Google","Nokia","Motorola","OnePlus","Sony","LG","Lenovo","Asus","Nothing","Fairphone","ZTE","Other"],ae={Apple:["iPhone 17 Pro Max","iPhone 17 Pro","iPhone 17 Air","iPhone 17","iPhone 16e","iPhone 16 Pro Max","iPhone 16 Pro","iPhone 16 Plus","iPhone 16","iPhone 15 Pro Max","iPhone 15 Pro","iPhone 15 Plus","iPhone 15","iPhone 14 Pro Max","iPhone 14 Pro","iPhone 14 Plus","iPhone 14","iPhone 13 Pro Max","iPhone 13 Pro","iPhone 13","iPhone 13 mini","iPhone 12 Pro Max","iPhone 12 Pro","iPhone 12","iPhone 12 mini","iPhone 11 Pro Max","iPhone 11 Pro","iPhone 11","iPhone SE (3rd generation)","iPhone SE (2nd generation)","iPhone XR","iPhone XS Max","iPhone XS","iPhone X"],Samsung:["Galaxy S26 Ultra","Galaxy S26+","Galaxy S26","Galaxy S25 Ultra","Galaxy S25+","Galaxy S25","Galaxy S25 FE","Galaxy S24 Ultra","Galaxy S24+","Galaxy S24","Galaxy S24 FE","Galaxy S23 Ultra","Galaxy S23+","Galaxy S23","Galaxy S23 FE","Galaxy S22 Ultra","Galaxy S22+","Galaxy S22","Galaxy Z Fold7","Galaxy Z Fold6","Galaxy Z Fold5","Galaxy Z Flip7","Galaxy Z Flip6","Galaxy Z Flip5","Galaxy A57","Galaxy A56","Galaxy A55","Galaxy A54","Galaxy A37","Galaxy A36","Galaxy A35","Galaxy A34","Galaxy A26","Galaxy A25","Galaxy A24","Galaxy A17","Galaxy A16","Galaxy A15","Galaxy A14","Galaxy A06","Galaxy A05s","Galaxy A05","Galaxy M56","Galaxy M55","Galaxy M35","Galaxy M15","Galaxy F56","Galaxy F55"],Tecno:["Camon 40 Premier","Camon 40 Pro","Camon 40","Camon 30 Premier","Camon 30 Pro","Camon 30","Camon 20 Pro","Camon 20","Spark 30 Pro+","Spark 30 Pro","Spark 30","Spark 25 Pro","Spark 25","Spark 20 Pro+","Spark 20 Pro","Spark 20","Spark Go 2","Spark Go","Phantom V Fold3","Phantom V Fold2","Phantom V Fold","Phantom V Flip3","Phantom V Flip2","Phantom V Flip","Phantom X2 Pro","Phantom X2","Pova 7 Ultra","Pova 7 Pro","Pova 7","Pova 6 Pro","Pova 6","Pova 5 Pro","Pova 5","Pop 9","Pop 8","Pop 7 Pro","Pop 7"],Infinix:["Note 50 Pro+","Note 50 Pro","Note 50","Note 40 Pro+","Note 40 Pro","Note 40","Note 30 Pro","Note 30","Hot 60 Pro+","Hot 60 Pro","Hot 60","Hot 50 Pro+","Hot 50 Pro","Hot 50","Hot 40 Pro","Hot 40","Hot 40i","Hot 30","Smart 9 Pro","Smart 9","Smart 8 Pro","Smart 8","Zero 50","Zero 40","Zero 30","GT 30 Pro","GT 20 Pro","GT 10 Pro"],itel:["S25 Ultra","S25","S24","S23+","S23","A90","A80","A70","A60s","A60","A56","P65","P55+","P55","P40+","P40","Vision 5","Vision 3 Plus","City 100","City 50"],Xiaomi:["15 Ultra","15T Pro","15T","15","14 Ultra","14T Pro","14T","14","13T Pro","13T","13 Ultra","13 Pro","13","Mix Fold 4","Mix Fold 3","Mix Flip 2","Mix Flip"],Redmi:["Note 15 Pro+","Note 15 Pro","Note 15","Note 14 Pro+","Note 14 Pro","Note 14","Note 13 Pro+","Note 13 Pro","Note 13","Note 12 Pro+","Note 12 Pro","Note 12","15C","14C","13C","A5","A4","A3","A2+","A2","K80","K70","Turbo 4","Turbo 3"],POCO:["F7 Ultra","F7 Pro","F7","F6 Pro","F6","X7 Pro","X7","X6 Pro","X6","M7 Pro","M7","M6 Pro","M6","C75","C65","C55"],Oppo:["Find X8 Ultra","Find X8 Pro","Find X8","Find X7 Ultra","Find X7","Find N5","Find N3","Find N3 Flip","Reno13 Pro","Reno13","Reno12 Pro","Reno12","Reno11 Pro","Reno11","Reno10 Pro+","Reno10 Pro","Reno10","A5 Pro","A3 Pro","A80","A60","A58","A40","A38","A18"],Vivo:["X200 Ultra","X200 Pro","X200","X100 Pro","X100","V50 Pro","V50","V40 Pro","V40","V30 Pro","V30","V29","Y300","Y200","Y100","Y36","Y29","Y28","Y27","Y19s","Y03","T3","T2"],Realme:["GT 7 Pro","GT 7","GT 6","GT 5 Pro","14 Pro+","14 Pro","14","13 Pro+","13 Pro","13","12 Pro+","12 Pro","12+","12","C75","C67","C65","C61","C55","C53","Narzo 8
10","Narzo 70","Narzo 60"],Huawei:["Pura 80 Ultra","Pura 80 Pro","Pura 80","Pura 70 Ultra","Pura 70 Pro","Pura 70","Mate 70 Pro","Mate 70","Mate 60 Pro","Mate 60","Mate X6","Mate X5","nova 13","nova 12","nova 11","nova 10","Y9a","Y7a"],Honor:["Magic7 Pro","Magic7","Magic6 Pro","Magic6","Magic V3","Magic V2","400 Pro","400","200 Pro","200","X9c","X9b","X8c","X8b","X7c","X7b","90 Lite","Play 50","Play 40"],Google:["Pixel 10 Pro XL","Pixel 10 Pro","Pixel 10","Pixel 10a","Pixel 9 Pro XL","Pixel 9 Pro","Pixel 9 Pro Fold","Pixel 9","Pixel 9a","Pixel 8 Pro","Pixel 8","Pixel 8a","Pixel 7 Pro","Pixel 7","Pixel 7a","Pixel 6 Pro","Pixel 6","Pixel 6a"],Nokia:["G60","G42","G22","G21","XR21","X30","X20","C32","C31","C22","C21 Plus","C12","215 4G","110 4G","105"],Motorola:["Edge 60 Pro","Edge 60 Fusion","Edge 50 Ultra","Edge 50 Pro","Edge 50 Fusion","Razr 60 Ultra","Razr 60","Razr 50 Ultra","Razr 50","G85","G55","G45","G35","G24","E15","E14"],OnePlus:["13T","13","12","12R","11","Nord 5","Nord 4","Nord 3","Nord CE 5","Nord CE 4","Nord CE 3","Open"],Sony:["Xperia 1 VII","Xperia 1 VI","Xperia 1 V","Xperia 5 V","Xperia 10 VII","Xperia 10 VI","Xperia 10 V"],LG:["Wing","Velvet","V60 ThinQ","G8 ThinQ","K62","K52","K42","K22"],Lenovo:["Legion Y90","Legion Phone Duel 2","Legion Phone Duel","K14 Plus","K13","A7"],Asus:["ROG Phone 9 Pro","ROG Phone 9","ROG Phone 8 Pro","ROG Phone 8","ROG Phone 7","Zenfone 12 Ultra","Zenfone 11 Ultra","Zenfone 10"],Nothing:["Phone (3)","Phone (3a) Pro","Phone (3a)","Phone (2a) Plus","Phone (2a)","Phone (2)","Phone (1)","CMF Phone 2 Pro","CMF Phone 1"],Fairphone:["Fairphone 6","Fairphone 5","Fairphone 4"],ZTE:["Axon 60 Ultra","Axon 50 Ultra","Axon 40 Ultra","Blade A75","Blade A73","Blade A54","Blade V50","Blade V40"]},X=r=>r.map(o=>({value:o,label:o})),re=()=>X(oe),ne=r=>{const o=ae[r.trim()];return o?X(o):[]},te={imeiNumber:"",brand:"",model:"",sumInsured:""},D=(r,o=1)=>x().transform(t=>t.trim()).pipe(x().min(o,r)),ie=Z({imeiNumber:x().transform(r=>r.replace(/\D/g,"")).pipe(x().min(15,"Enter a valid IMEI number (15â17 digits)").max(17,"Enter a valid IMEI number (15â17 digits)")),brand:D("Select the device brand"),model:D("Select or enter the device model"),sumInsured:x().transform(r=>r.replace(/\D/g,"")).superRefine((r,o)=>{const t=Number(r);
1if(!r||!Number.isFinite(t)||t<=0){o.addIssue({code:"custom",message:"Enter your device's value"});return}t<F&&o.addIssue({code:"custom",message:`Minimum sum insured is â¦${F.toLocaleString("en-NG")}`})})}),b=({label:r,error:o,children:t})=>e.jsxs(C,{gap:1.5,align:"stretch",w:"100%",minW:0,children:[e.jsx(g,{fontSize:"sm",fontWeight:"semibold",color:c.text.label,children:r}),t,o?e.jsx(g,{fontSize:"xs",color:c.error[500],children:o}):null]}),le=r=>r?`â¦${Number(r).toLocaleString("en-NG")}`:"",se=({value:r,onChange:o,onBlur:t,name:l,isDisabled:P=!1,hasError:m=!1,inputProps:i})=>e.jsx(M,{name:l,value:le(r),onBlur:t,disabled:P,inputMode:"numeric",placeholder:"Min. â¦100,000",hasError:m,onChange:n=>o(n.target.value.replace(/\D/g,"")),...i}),Pe=()=>e.jsxs(C,{gap:2,align:"stretch",children:[e.jsxs(g,{fontSize:{base:"2xl",md:"3xl"},fontWeight:"bold",lineHeight:"1.15",color:c.text.primary,children:["Tell us about"," ",e.jsx(g,{as:"span",color:c.text.orange,children:"Your Device"})]}),e.jsx(g,{fontSize:"md",color:c.text.info,lineHeight:"1.6",children:"We could not retrieve your device details automatically, so let's do this the manual way."})]}),E={h:"52px",bg:"white",border:`1px solid ${c.border.primary}`,_hover:{bg:"white"}},T={h:"52px",px:"15px",w:"100%"},de=({context:r,isSubmitting:o,onSubmit:t})=>{const{control:l,handleSubmit:P,setValue:m,formState:{errors:i}}=w({resolver:z(ie),mode:"onTouched",defaultValues:{...te,imeiNumber:r.imeiNumber.replace(/\D/g,"").slice(0,17),sumInsured:(r.sumInsured??"").replace(/\D/g,"")}}),n=K({control:l,name:"brand"}),G=p.useMemo(()=>re(),[]),y=p.useMemo(()=>ne(n),[n]),h=y.length===0,A=p.useRef(n);return p.useEffect(()=>{A.current!==n&&(A.current=n,m("model","",{shouldValidate:!1,shouldDirty:!0}))},[n,m]),e.jsx(f,{py:{base:4},children:e.jsx(f,{borderRadius:{base:"none",md:"3xl"},border:{base:"none",md:`1px solid ${c.border.primary}`},p:{base:0,md:10},w:"100%",boxShadow:{base:"none",md:"sm"},bg:"white",children:e.jsxs(C,{as:"form",onSubmit:P(t),gap:6,align:"stretch",children:[e.jsx(Pe,{}),e.jsxs(W,{templateColumns:{base:"1fr",sm:"1fr 1fr"},gap:4,children:[e.jsx(b,{label:"IMEI number",error:i.imeiNumber?.message,children:e.jsx(S,{name:"imeiNumber",control:l,render:({field:a})=>e.jsx(M,{inputMode:"numeric",placeholder:"15â17 digit IMEI",maxLength:17,hasError:!!i.imeiNumber,disabled:o,value:a.value,name:a.name,onBlur:a.onBlur,onChange:d=>a.onChange(d.target.value.replace(/\D/g,"").slice(0,17)),...E})})}),e.jsx(b,{label:"Brand",error:i.brand?.message,children:e.jsx(S,{name:"brand",control:l,render:({field:a})=>e.jsx(v,{options:G,value:a.value,onChange:a.onChange,onBlur:a.onBlur,placeholder:"Select brand",isDisabled:o,hasError:!!i.brand,searchable:!0,flip:!0,borderRadius:"full",triggerProps:T})})}),e.jsx(b,{label:"Model",error:i.model?.message,children:e.jsx(S,{name:"model",control:l,render:({field:a})=>h?e.jsx(M,{placeholder:n?"e.g. iPhone 15 Pro":"Select a brand first",hasError:!!i.model,disabled:o||!n,value:a.value,name:a.name,onBlur:a.onBlur,onChange:a.onChange,...E}):e.jsx(v,{options:y,value:a.value,onChange:a.onChange,onBlur:a.onBlur,placeholder:"Select model",isDisabled:o,hasError:!!i.model,searchable:!0,flip:!0,borderRadius:"full",triggerProps:T})})}),e.jsx(b,{label:"Device value (sum insured)",error:i.sumInsured?.message,children:e.jsx(S,{name:"sumInsured",control:l,render:({field:a})=>e.jsx(se,{value:a.value,onChange:a.onChange,onBlur:a.onBlur,name:a.name,isDisabled:o,hasError:!!i.sumInsured,inputProps:E})})})]}),e.jsx(I,{buttonType:"primary",text:"Continue",size:"lg",type:"submit",loading:o,disabled:o,w:"100%"})]})})})},Te=()=>{const{items:r}=$(),{navigate:o}=j(),t=V(),l=U(),{track:P}=O(),{createGadgetDevicePolicy:m,isLoading:i}=Y(),n=q(t.state),G=`/${R.VerifyImei}`;if(p.useEffect(()=>{n||o(G,{replace:!0})},[n,o,G]),p.useEffect(()=>{n&&P(N.SCREEN_MANUAL_ENTRY_STARTED,{product_type:"screen"})},[n,P]),!n)return null;const y=()=>{o(Q)},h=(a,d)=>{P(N.SCREEN_MANUAL_DEVICE_FAILED,{product_type:"screen"}),L.error(k(a)??d)},A=a=>{let d;try{d=J({form:a,context:n})}catch(u){h(u,"Please check your device details and try again.");return}m(d,{onSuccess:u=>{const s=ee(u);if(!u.success||!s?.id){h(u,"Could not create your gadget policy. Please try again.");return}P(N.SCREEN_MANUAL_DEVICE_CREATED,{product_type:"screen",device_brand:d.deviceDetails.brand,device_model:d.deviceDetails.model,device_type:"PHONE"}),l(_({id:s.id,ourReference:s.ourReference,policyNumber:s.policyNumber,status:s.status,createdAt:s.createdAt})),s.gadgetDetails&&l(B(s.gadgetDetails)),o(`/${R.SelectPlan}/${s.id}`)},onError:u=>{h(u,"Could not create your gadget policy. Please try again.")}})};return e.jsx(H,{items:r,onGoBack:y,contentMaxW:"800px",mobileContentOnly:!0,children:e.jsx(de,{context:n,isSubmitting:i,onSubmit:A})})};export{Te as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.