PageSourceSearch

https://app.driversed.com/assets/index-BfnkjJUP.js

js driversed.com collected 2026-10-03 21:05:03 UTC 12,612 bytes, 2 lines download raw bytes

1import{D as n,g9 as ye,G as e,T as q,aa as k,ab as R,fp as L,fs as w,V as C,ga as xe,W as Se,U as K,z as g,gb as be,bG as ve,g5 as Ce,gc as Ne,g4 as je,gd as Ae,ge as Ie,bD as Ee,x as Pe,c8 as _e,Y as Te,ds as ke,a1 as Re,bW as we,as as Me,gf as Oe,gg as Z,L as De,gh as Fe,gi as Le,gj as Be,gk as Ve,gl as ze,gm as qe,a9 as Y,H as Ge,ao as We,$ as Ue,gn as $e,go as J,gp as He,gq as Ke,gr as Ze,g8 as Ye}from"./index-KlseSxxM.js";import{u as Je}from"./useComponentLog-uDD3pCTT.js";import{S as Xe}from"./chevron-left-9p9z3GkZ.js";import{O as X}from"./index-k2SGJLPO.js";import{N as Qe,a as Q}from"./NativeSelect-CBpLllZv.js";import{S as es}from"./radio-unselected-Dk9vK6I9.js";import{S as ss}from"./index-cKk-b6Kv.js";import"./chevron-CXyeUMiK.js";import"./index-D2CT-D8Y.js";(function(){try{var r=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};r.SENTRY_RELEASE={id:"[email protected]"};var i=new r.Error().stack;i&&(r._sentryDebugIds=r._sentryDebugIds||{},r._sentryDebugIds[i]="54ac0502-a9c2-4507-b4be-d0d8c23c4c7f",r._sentryDebugIdIdentifier="sentry-dbid-54ac0502-a9c2-4507-b4be-d0d8c23c4c7f")}catch{}})();const ee=(r,i=!1,a,m)=>r==="cert"?i?"purchase":"/purchase":r==="persistent"&&a==="RENEWAL"?i?"renewals":"/renewals":r==="persistent"?i?"addons":"/addons":r==="ace-mode-bundle"?i?"purchase.aceModeBun
1dle":m?`/purchase/ace-mode-bundle/${m}`:"/purchase/ace-mode-bundle":i?"practicetests":"/resource/practicetests",ts=/^\d{5}(-\d{4})?$/;function te(r){const i=r.trim();if(/^\d{9}$/.test(i))return`${i.slice(0,5)}-${i.slice(5)}`;const a=/^(\d{5})\s+(\d{4})$/.exec(i);return a?`${a[1]}-${a[2]}`:i}function z(r){return ts.test(te(r))}function rs(r){return r.replace(/[^\d-]/g,"")}const as={AL:"Alabama",AK:"Alaska",AS:"American Samoa",AZ:"Arizona",AR:"Arkansas",CA:"California",CO:"Colorado",CT:"Connecticut",DE:"Delaware",DC:"District Of Columbia",FM:"Federated States Of Micronesia",FL:"Florida",GA:"Georgia",GU:"Guam",HI:"Hawaii",ID:"Idaho",IL:"Illinois",IN:"Indiana",IA:"Iowa",KS:"Kansas",KY:"Kentucky",LA:"Louisiana",ME:"Maine",MH:"Marshall Islands",MD:"Maryland",MA:"Massachusetts",MI:"Michigan",MN:"Minnesota",MS:"Mississippi",MO:"Missouri",MT:"Montana",NE:"Nebraska",NV:"Nevada",NH:"New Hampshire",NJ:"New Jersey",NM:"New Mexico",NY:"New York",NC:"North Carolina",ND:"North Dakota",MP:"Northern Mariana Islands",OH:"Ohio",OK:"Oklahoma",OR:"Oregon",PW:"Palau",PA:"Pennsylvania",PR:"Puerto Rico",RI:"Rhode Island",SC:"South Carolina",SD:"South Dakota",TN:"Tennessee",TX:"Texas",UT:"Utah",VT:"Vermont",VI:"Virgin Islands",VA:"Virginia",WA:"Washington",WV:"West Virginia",WI:"Wisconsin",WY:"Wyoming"},is=Object.entries(as).map(r=>({value:r[0],key:r[1]})),ns=({address:r,apt:i,city:a,onChange:m,state:h,zip:u,focusTrigger:y,submitAttempted:o})=>{const[S,M]=n.useState(r||""),[d,O]=n.useState(i||""),[b,D]=n.useState(a||""),[p,j]=n.useState(h||""),[l,E]=n.useState(u||""),[f,P]=n.useState({street:!1,city:!1,state:!1,zip:!1}),x=t=>{P(B=>({...B,[t]:!0}))},_=n.useRef(null),v=n.useRef(!1);n.useEffect(()=>{const t=_.current?.querySelector("input");t&&(v.current=!0,t.focus())},[y]),n.useEffect(()=>{o&&x("zip")},[o]),n.useEffect(()=>{M(t=>t===(r||"")?t:r||""),O(t=>t===(i||"")?t:i||""),D(t=>t===(a||"")?t:a||""),j(t=>t===(h||"")?t:h||""),E(t=>t===(u||"")?t:u||"")},[r,i,a,h,u]),n.useEffect(()=>{m({addressStreet:S,addressApt:d,addressCity:b,complete:ye(S,b,p,l)&&z(l),addressState:p,addressPostal:l})},[S,d,b,p,l]);const T=l===""||!l,F=!T&&!z(l);return e.jsxs("div",{className:"address-entry-container",children:[e.jsx(q,{as:"h2",size:"xlarge",id:"address-entry-heading",children:"Enter your shipping address"}),e.jsxs("div",{id:"address-entry",className:"flex flex-col gap-4",children:[e.jsxs(k,{children:[e.jsx(R,{htmlFor:"address-entry-street-address",children:"Street Address"}),e.jsx("div",{ref:_,children:e.jsx(L,{id:"address-entry-street-address",name:"address-entry-street-address",value:S,onChange:t=>{M(t.target.value)},onMouseDown:()=>{v.current=!1},onKeyDown:()=>{v.current=!1},onBlur:()=>{if(v.current){v.current=!1;return}x("street")},required:!0,"aria-invalid":f.street&&S===""})}),f.street&&S===""&&e.jsx(w,{children:"Street address is required"})]}),e.jsxs(k,{children:[e.jsx(R,{htmlFor:"address-entry-apt",children:"Apartment, suite, etc. (optional)"}),e.jsx(L,{id:"address-entry-apt",name:"address-entry-apt",value:d,onChange:t=>{O(t.target.value)}})]}),e.jsxs(k,{children:[e.jsx(R,{htmlFor:"address-entry-city",children:"City"}),e.jsx(L,{id:"address-entry-city",name:"address-entry-city",value:b,onChange:t=>{D(t.target.value)},onBlur:()=>{x("city")},required:!0,"aria-invalid":f.city&&b===""}),f.city&&b===""&&e.jsx(w,{children:"City is required"})]}),e.jsxs("div",{className:"grid grid-cols-1 gap-4 tablet:grid-cols-2",children:[e.jsxs(k,{children:[e.jsx(R,{htmlFor:"address-entry-state-select",children:"State"}),e.jsxs(Qe,{"data-test":"addressStateSelect",id:"address-entry-state-select",name:"address-entry-state-select",value:p,onChange:t=>{j(t.target.value)},onBlur:()=>{x("state")},"aria-invalid":f.state&&(p==="0"||!p),children:[e.jsx(Q,{value:"",children:"Select your option..."}),is.map(t=>e.jsx(Q,{value:t.value,children:t.key},t.value))]}),f.state&&(p==="0"||!p)?e.jsx(w,{children:"State is required"}):null]}),e.jsxs(k,{children:[e.jsx(R,{htmlFor:"address-entry-zip",children:"Zip code"}),e.jsx(L,{id:"address-entry-zip",name:"address-entry-zip",value:l,onChange:t=>{E(rs(t.target.value))},onBlur:()=>{if(x("zip"),z(l)){const t=te(l);t!==l&&E(t)}},type:"text",inputMode:"numeric",autoComplete:"postal-code",required:!0,"aria-invalid":f.zip&&(T||F)}),f.zip&&T?e.jsx(w,{children:"Zip code is required"}):null,f.zip&&F?e.jsx(w,{children:"Enter a valid ZIP code (12345 or 12345-6789)."}):null]})]})]})]})},ds=({children:r,id:i,name:a,labelHtmlFor:m,label:h,checked:u})=>e.jsxs("div",{className:"mt-2 first:mt-0",children:[e.jsx("input",{checked:u,type:"radio",name:a,id:i,className:"peer opacity-0 absolute",readOnly:!0}),e.jsxs("label",{className:C(Se({variant:"paragraph-condensed",weight:"semibold"}),"relative flex items-center cursor-pointer","peer-focus-visible:[&_.radio-icon]:sha
1dow-focus-old peer-focus-visible:[&_.radio-icon]:rounded-full"),htmlFor:m,children:[u?e.jsx(xe,{width:24,height:24,"aria-hidden":!0,className:C("radio-icon inline-block w-[22px] h-[22px] mr-2 shrink-0","text-brand-1-old")}):e.jsx(es,{width:24,height:24,"aria-hidden":!0,className:C("radio-icon inline-block w-[22px] h-[22px] mr-2 shrink-0","text-content-regular")}),r??h]})]}),os=({className:r,heading:i,id:a,name:m,onChooseOption:h,options:u,value:y})=>e.jsxs("div",{className:`${r} price-option-wrapper`,children:[e.jsx(q,{as:"h2",size:"xlarge",children:i}),e.jsx("fieldset",{name:m??"price-chooser",onChange:o=>{h(o.target.id)},id:a,children:u?u.map(o=>e.jsx(ds,{checked:o._id===y,id:o._id,name:o._id,labelHtmlFor:o._id,children:e.jsxs(K,{as:"span",variant:"paragraph-condensed",weight:"semibold",children:[e.jsx(K,{as:"span",variant:"paragraph-condensed",weight:"extrabold",className:"text-content-subtle",children:Number.isNaN(Number(o.price))?o.price:`$${o.price.toFixed(2)}`})," ","- ",o.title]})},o._id)):null})]}),se={_id:"__debug_shipped__",title:"[Debug] Physical delivery (address entry)",price:0,type:"SHIPPING",is:{shipped:!0}},ls=(r,i)=>r==="practice-tests"?"/resource/practicetests":r==="persistent"&&!i?"/addons":"/dash/index",Ss=()=>{Je("PurchasePayment");const r=g(be),i=g(ve),a=g(Ce),m=g(Ne),h=g(je),u=g(Ae)??!1,y=g(Ie),o=g(Ee),[S,M]=n.useState(!1),d=Pe(),O=_e(),b=Te(),{urlParams:D}=r,{flow:p,productType:j}=D,l=y>0,E=g(ke),[f]=Re(),P=E&&f.get("debug")==="true",x=we();n.useEffect(()=>{const s=JSON.stringify({flow:x.flow,productType:x.productType});d(Me("Component Shown",{to:"purchasePayment.view",additional_info:s}))},[]);const _=g(Oe),v=n.useRef(!1),[T,F]=n.useState(0),[t,B]=n.useState(0),[re,ae]=n.useState(0);n.useEffect(()=>{const s=_.some(c=>c.type==="addressSuggestion"||c.type==="addressVerification");v.current&&!s&&!a.isAddressVerified&&F(c=>c+1),v.current=s},[_,a.isAddressVerified]);const A=n.useMemo(()=>{const s=h.milestoneData.deliveryList??[];return!P||s.some(c=>c?.is?.shipped)?s:[...s,se]},[P,h.milestoneData.deliveryList]),ie=P&&A.some(s=>s?._id==="__debug_shipped__"),[I,G]=n.useState({complete:!1,addressStreet:i.shippingStreet??"",addressApt:i.shippingApt??"",addressCity:i.shippingCity??"",addressState:i.shippingState??"",addressPostal:i.shippingPostal??""}),{enteredAddress:N}=a,W=n.useRef(!1);n.useEffect(()=>{if(!W.current){W.current=!0;return}G(s=>s.addressStreet===N.addressStreet&&s.addressApt===N.addressApt&&s.addressCity===N.addressCity&&s.addressState===N.addressState&&s.addressPostal===N.addressPostal?s:{...N})},[N]);const ne=s=>{d(J(s))},de=s=>{d(Ze(s))},oe=s=>{d(Ke(s))},V=o||S,U=s=>{V||d(Ye(s))},le=()=>{let s=!1;return V?!0:l&&(s=!a.order.creditCardInfo.complete,s)||u&&(s=!I.complete,s)?s:a.order.items.length===0&&Object.keys(a.order.shipping).length===0||a.hasAddressVerificationError&&p!=="timely"?!0:s},ce=s=>{if(s.preventDefault(),le()){u&&B(c=>c+1),l&&!a.order.creditCardInfo.complete&&ae(c=>c+1);return}d($e())},ue=s=>{if(V)return;l||d(J({}));const c=A.find(H=>H&&H._id===s);d(Z(c))},pe=s=>{G(s),d(He(s))},$=()=>typeof a.order.creditCardInfo.error<"u",he=()=>$()?a.order.creditCardInfo.error.message:null,me=h.milestoneData.productList?.length,fe=A.length,ge=s=>{d({type:We});const c=s==="timely";d({type:Ue,payload:{currentState:c?"dash.index":ee(s,!0,j,a.order.progressId)}}),b(c?"/dash/index":ee(s,!1,j,a.order.progressId),{replace:!0})};return n.useEffect(()=>{!a.order.shipping._id&&A.length&&d(Z(A[0])),d({type:De}),d({type:Fe}),d({type:Le}),d({type:Be}),d(Ve(ls(p,j)))},[]),n.useEffect(()=>()=>{ze(O.getState())._id===se._id&&d(qe())},[]),e.jsx("div",{className:"grit screen",id:"purchase-payment-container",children:e.jsxs("main",{className:C("mx-auto flex w-full max-w-[1100px] flex-col","min-h-full tablet:h-full","tablet:flex-row"),children:[e.jsxs("section",{className:C("flex w-full flex-col","grow tablet:h-auto tablet:max-w-[60%] tablet:grow-0","p-6 tablet:p-10 min-[1440px]:p-[4.5rem]"),children:[e.jsxs(Y,{type:"button",variant:"text-primary",onClick:()=>{ge(p??x.flow??"")},"data-test":"backToOffersButton",id:"back-to-offers-link",className:C("self-start shrink-0","h-auto max-h-none","mb-4"),children:[e.jsx(Xe,{"aria-hidden":"true",className:"size-4"}),"Back"]}),e.jsx(q,{as:"h1",size:"xlarge",id:"purchase-order-title","data-test":"purchaseOrderTitle",children:"Complete your order"}),e.jsxs("form",{onSubmit:ce,id:"purchase-form",className:p==="timely"?"padding-top flex flex-1 flex-col gap-4":"flex flex-1 flex-col gap-4",children:[ie?e.jsx("div",{"data-test":"debugDeliveryInjectionBanner",children:e.jsx(Ge,{variant:"warning",title:"Debug mode: synthetic delivery option injected",description:"No real shipping options exist for this user. A synthetic delivery option has been added so you can reach the address/verify step. This does not reflect a real order — no charge will occur."})}
1):null,fe?e.jsx(os,{id:"purchase-delivery-options",heading:"Choose your delivery method",options:A,onChooseOption:ue,value:a.order.shipping._id,className:C(me?"no-top-margin purchase-payment":"purchase-payment","mt-4")}):null,u?e.jsx(ns,{onChange:pe,address:I.addressStreet,apt:I.addressApt,city:I.addressCity,state:I.addressState,zip:I.addressPostal,focusTrigger:T,submitAttempted:t}):null,l?e.jsx(ss,{apiKey:window.aceConstants.TOKENS.stripe,onChange:ne,requestToken:a.requestStripeToken,onGetStripeToken:de,onGetStripeTokenError:oe,validateFieldsRequest:re,hasError:$(),errorMessage:he(),isComplete:a.order.creditCardInfo.complete,isAddressRequired:u,isPaymentInFlight:o,onWalletBusyChange:M,total:y}):null,e.jsx("div",{className:"flex items-center justify-end gap-4",children:e.jsx(Y,{"data-test":"completePurchaseButton",type:"submit",disabled:o,id:"complete-purchase-button",className:"min-w-[33%]",children:l?`Pay $${Number(y).toFixed(2)}`:"Submit"})}),e.jsx("div",{className:C("flex-1","-mx-6 -mb-6 mt-2 p-6","bg-background-secondary","tablet:hidden","[&>div]:mb-0"),children:e.jsx(X,{id:"inline-order-summary",className:"inline",items:m,total:y,showRemoveLink:p!=="timely",onRemoveItem:s=>{U(s)}})})]})]}),e.jsx("aside",{className:"hidden p-10 min-[1440px]:p-[4.5rem] tablet:block tablet:w-[40%] tablet:bg-background-secondary",children:e.jsx(X,{id:"vertical-order-summary",className:"vertical",items:m,total:y,showRemoveLink:p!=="timely",onRemoveItem:s=>{U(s)}})})]})})};export{Ss as default};
2//# sourceMappingURL=index-BfnkjJUP.js.map

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.