PageSourceSearch

https://shop.truckmountforums.com/cdn/shopifycloud/checkout-web/as…ks-useUnauthenticatedErrorModal.CzvtLqeY.js

js truckmountforums.com collected 2026-09-24 10:25:16 UTC 3,074 bytes, 2 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["component-PhoneNumberFormatter.6-emdPAH.js","exports-getCountryCallingCode.B1Uy0QN5.js"])))=>i.map(i=>d[i]);
2import{at as U,N as j,A as _,h as M,q as b,T as S,r as O}from"./esnext-vendor.D7ldIee_.js";import{j4 as V}from"./hydrate.ByRIsqvd.js";import{_ as $}from"./app.A60-IfPs.js";import{N as k,dx as H}from"./addresses-is-address-empty.-MuOhIyI.js";function A({accessibilityRole:e,...r}){const t=V(),s=t==null?"h1":`h${t}`;return U(s,{...r,role:e==="heading"?void 0:e})}let i=null,f=null;function D(e,r="",t,s){const[o,h]=j(({formatter:u,regionCode:a,phoneNumber:y},p)=>{switch(p.type){case"reset":return p.state;case"formatter":{const{PhoneNumberFormatter:c}=p,F=new c(a);return N(y,a,F,t)}case"phone":return N(p.phoneNumber,a,u)}},{phoneNumber:r,regionCode:e,loading:!0},({regionCode:u,phoneNumber:a})=>C(a,u,s,t));let{phoneNumber:m,regionCode:d,formatter:n}=o;const P=o.loading,v=_(r),l=_(e);if(v.current!==r||l.current!==e){const u=l.current!==e,a=/^\+\d/.test(r),y=!u&&a;v.current=r,l.current=e;const c=C(r,y?d??e:e,o.formatter);m=c.phoneNumber,d=c.regionCode,n=c.formatter,h({type:"reset",state:c})}M(()=>{let u=!0;return(async function(){if(n)return;const a=await I();u&&h({type:"formatter",PhoneNumberFormatter:a})})(),()=>{u=!1}},[n]);const g=b(u=>{n&&!/^\+\d/.test(u)&&n.updateRegionCode(e),h({type:"phone",phoneNumber:u})},[n,e]),w=b(u=>{n!=null&&(n.updateRegionCode(u),h({type:"phone",phoneNumber:`+${n.countryCode}${n.getNationalNumber(m)}`}))},[n,m]),E=S(()=>n==null?"+1":`+${n.getCountryCodeFromRegionCode(d??l.current)}`,[n,d]);return{loading:P,formattedNumber:m,formattedNumberValueObject:o.phoneNumberValueObject,regionCode:d,prefix:E,setPhoneNumber:g,selectCountry:w}}function I(){return f||(f=(async()=>{const{default:e}=await O(()=>$(()=>import("./component-PhoneNumberFormatter.6-emdPAH.js"),__vite__mapDeps([0,1])));return i=e,i})(),f)}function N(e,r,t,s){if(t==null)return{phoneNumber:e,phoneNumberValueObject:{value:e},regionCode:r,loading:!0};const o=t.format(e||(s?`+${t.countryCode}`:""));return{formatter:t,phoneNumber:o,phoneNumberValueObject:{value:o},regionCode:t?.regionCode,loading:!1}}function C(e,r,t,s){let o;return t?(t.updateRegionCode(r),o=t):o=i?new i(r):void 0,N(e,r,o,s)}var T=(e=>(e.Unknown="unknown",e.Rejected="rejected",e.Errored="errored",e.InvalidTermsCount="invalid_terms_count",e.InvalidRepaymentsCount="invalid_repayments_count",e.UserUnsynchronized="user_unsynchronized",e.InvalidShippingAddress="invalid_shipping_address",e))(T||{});function B(){const{observability:e,source:r,shopPay:t}=k();return{openModal:b(o=>{t.user.isUnauthenticatedUser.value?t.session.unstable_setUnauthenticatedErrorModal(o):e.error(new H("Cannot open an unauthenticated error modal outside of the unauthenticated flow",{groupingHash:"ShopPayError::UnauthenticatedErrorModal"}),{severity:"error",metadata:{source:{type:r.type},checkout:{token:r.checkoutSessionIdentifier||r.sourceId},event:{modalType:o.type,shopPayFlow:t.user.flow.value}}})},[e,r,t])}}export{A,T as I,B as a,D as u};

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.