PageSourceSearch

https://www.princessauto.com/_next/static/chunks/8644.1da8a476edc65d42.js

js princessauto.com collected 2026-09-25 18:54:08 UTC 10,436 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8644],{3108:(e,t,a)=>{"use strict";a.d(t,{HG:()=>i,rp:()=>r,x0:()=>l});let l=/[!@#$%^&*]/,r=/^[A-Za-z0-9!@#$%^&*]*$/,s=[{id:"length",translationKey:"passwordGuidelines.atLeast8",test:e=>e.length>=8},{id:"uppercase",translationKey:"passwordGuidelines.uppercase",test:e=>/[A-Z]/.test(e)},{id:"lowercase",translationKey:"passwordGuidelines.lowercase",test:e=>/[a-z]/.test(e)},{id:"number",translationKey:"passwordGuidelines.number",test:e=>/[0-9]/.test(e)},{id:"special",translationKey:"passwordGuidelines.special",test:e=>l.test(e)},{id:"noInvalidChars",translationKey:"passwordGuidelines.noInvalidChars",test:e=>e.length>0&&r.test(e)}],i=e=>{let{password:t,translate:a}=e;return{rules:s.map(e=>({id:e.id,text:a(e.translationKey),isValid:e.test(t)}))}}},8644:(e,t,a)=>{"use strict";a.r(t),a.d(t,{TrackItemSidebar:()=>w});var l=a(54568),r=a(8534),s=a(72276),i=a(10790),n=a(83985),o=a(97066),d=a(7620),u=a(83631),c=a(24407),m=a(21531),g=a(41159),v=a(79437),p=a(30414),f=a(37142),_=a(55757),b=a(63771),h=a(28515),y=a(88180),k=a(40104),x=a(74680),S=a(52775),I=a.n(S);let w=()=>{var e;let t=(0,o.c)("trackItem.sidebar"),a=(0,o.c)(),S=(0,g.jL)(),{addNotification:w}=(0,m.E)(),{isOpen:j,isLoading:C,productName:A,productLink:N,selectedVariantImage:z,selectedProductOptions:L,isComingSoon:T,handleClose:E,productId:K,variantId:q}=(()=>{var e,t,a,l,r,s,i,n,o,u;let c=(0,g.GV)(v.nn),m=(0,g.GV)(v.O_),p=(0,g.GV)(v.Y6),f=(0,g.jL)(),_=(0,y.G)({mode:"language"}),[S,I]=(0,d.useState)(null),[w,j]=(0,d.useState)(null),[C,A]=(0,d.useState)(!1),N=null!=(i=null==S||null==(t=S.variants.edges)||null==(e=t.find(e=>{let{node:t}=e;return t.entityId===p}))?void 0:e.node)?i:null,z=(0,b.c)((null==S?void 0:S.metafields.edges)||[],(null==N?void 0:N.metafields.edges)||[],"displayName_".concat(_)),L=S?(0,h.v)(S,w,_):"",T=null!=(o=null!=(n=null==w?void 0:w.defaultImage)?n:null==N?void 0:N.defaultImage)?o:null==S?void 0:S.defaultImage,E=null==S||null==(a=S.metafields)?void 0:a.edges,K=null!=(u=null==S||null==(r=S.variants)||null==(l=r.edges)?void 0:l.map(e=>{let{node:t}=e;return t}))?u:[],{isComingSoon:q}=(0,x.Mh)({productStatus:(0,x.Ke)(E),skuStatus:(0,x.ZT)(K,p,"skuStatus"),variantArrivalDate:(0,x.aR)(K,p),productArrivalDate:(0,x.by)(E)}),D={};return(null==N||null==(s=N.options)?void 0:s.edges)&&N.options.edges.forEac
1h(e=>{var t,a,l,r;let{node:s}=e;s.displayName&&(null==(r=s.values)||null==(l=r.edges)||null==(a=l[0])||null==(t=a.node)?void 0:t.label)&&(D[s.displayName]=s.values.edges[0].node.label)}),(0,d.useEffect)(()=>{(async()=>{if(c&&m){A(!0);try{let e=await f(k.ky.endpoints.fetchProductDetailsById.initiate(m,{forceRefetch:!1}));e.data&&I(e.data)}catch(e){console.error("Failed to fetch product details:",e)}finally{A(!1)}}else c||(I(null),j(null),A(!1))})()},[c,m,f]),(0,d.useEffect)(()=>{(async()=>{if((null==N?void 0:N.sku)&&c)try{let e=await f(k.ky.endpoints.fetchProductDetailsBySKU.initiate(N.sku,{forceRefetch:!1}));e.data&&j(e.data)}catch(e){console.error("Failed to fetch variant details:",e)}else j(null)})()},[null==N?void 0:N.sku,c,f]),{isOpen:c,isLoading:C,productName:z,productLink:L,selectedVariantImage:T,selectedProductOptions:D,isComingSoon:q,handleClose:()=>{f((0,v.B1)())},productId:m,variantId:p}})(),D=!(0,n.useMediaQuery)("(min-width: ".concat(s.aSD,")")),V=(0,d.useMemo)(()=>c.z.object({email:(0,f.jJ)(a)}),[a]),{control:G,handleSubmit:O,formState:R,reset:M}=(0,u.mN)({resolver:(0,r.u)(V),mode:"onBlur",defaultValues:{email:""}}),Z=(0,d.useCallback)(async e=>{if(!K)return;let t=await (0,p.i)({productId:String(K),variantId:q?String(q):null,email:e.email,addNotification:w,translate:a});("success"===t.handled||"alreadyTracking"===t.handled)&&(M(),S((0,v.B1)()))},[K,q,w,S,M,a]),B=(0,d.useCallback)(()=>{M(),E()},[M,E]),P=t(T?"product.comingSoon.label":"product.outOfStock.label");return(0,l.jsx)(n.Sidebar,{isOpen:j,onClose:B,title:(0,l.jsxs)("div",{className:I()["track-item-sidebar__title"],children:[(0,l.jsx)(i.LetterSolid,{}),(0,l.jsx)("h5",{children:t("title.label")})]}),lockScroll:!0,footer:(0,l.jsxs)("div",{className:I()["track-item-sidebar__footer"],children:[(0,l.jsx)(n.Button,{size:"lg",variant:"secondary",type:"button",onClick:B,children:t("button.cancel.label")}),(0,l.jsx)(n.Button,{size:"lg",variant:"primary",type:"submit",form:"track-item-form",IconLeft:i.LetterOutline,disabled:C||R.isSubmitting,children:t(D?"button.track.label":"button.trackThisItem.label")})]}),children:(0,l.jsxs)("div",{className:I()["track-item-sidebar__content"],children:[(0,l.jsx)(n.LoadingOverlayMask,{isLoading:C}),(0,l.jsxs)("div",{className:I()["track-item-sidebar__content__product-container"],children:[(0,l.jsx)(n.EngagementProductCard,{productName:A,productLink:N,imageSrc:null!=(e=null==z?void 0:z.url)?e:"/images/default-img.svg",imageAlt:null==z?void 0:z.altText,selectedProductOptions:L,isOutOfStock:!0,enableOutOfStockLabel:!0,outOfStockLabel:P}),(0,l.jsx)(n.Divider,{type:"tertiary"})]}),(0,l.jsxs)("form",{id:"track-item-form",className:I()["track-item-sidebar__content__form"],onSubmit:O(Z),children:[(0,l.jsx)(n.InputLabel,{label:t("form.requiredFields.label"),required:!0,asteriskAtStart:!0,htmlFor:"email"}),(0,l.jsx)(_.L,{name:"email",type:"email",control:G,label:a("form.email.label"),required:!0})]})]})})};w.displayName="TrackItemSidebar"},30494:(e,t,a)=>{"use strict";a.d(t,{USER_POSTAL_CODE_STORAGE_KEY:()=>s,i:()=>n,q:()=>i});var l=a(7620);let r="AIzaSyDs6QPbSIpuoIh0XihQXZnD_ZNzGY-Ktc0",s="user_postal_code",i=/^[A-Za-z]\d[A-Za-z]\s?\d[A-Za-z]\d$/,n=()=>{let[e,t]=(0,l.useState)({storageValue:"",currentValue:"",error:!1}),a=(0,l.useCallback)(e=>{let a=e.trim().toUpperCase();if(!i.test(a))return!1;t({error:!1,currentValue:a,storageValue:a});try{window.sessionStorage.setItem(s,a)}catch(e){console.error(e,"er")}return!0},[t]),n=(0,l.useCallback)(a=>{i.test(a)?t({...e,currentValue:a,error:!1}):t({...e,currentValue:a,error:!0})},[e,t]);return(0,l.useEffect)(()=>{let l=window.sessionStorage.getItem(s);if(l)return void t({...e,storageValue:l});navigator.geolocation&&r&&navigator.geolocation.getCurrentPosition(async e=>{try{var t,l,s,n,o;let{latitude:d,longitude:u}=e.coords,c="".concat("https://maps.googleapis.com/maps/api/geocode/json","?latlng=").concat(d,",").concat(u,"&result_type=postal_code&key=").concat(r),m=await fetch(c,{method:"GET",mode:"cors",referrerPolicy:"origin",headers:{"Accept-Language":"en-CA,fr-CA;q=0.9"}}),g=await m.json(),v=null==g||null==(s=g.results)||null==(l=s[0])||null==(t=l.address_components)?void 0:t.find(e=>Array.isArray(e.types)&&e.types.includes("postal_code")),p=(null!=(o=null!=(n=null==v?void 0:v.long_name)?n:null==v?void 0:v.short_name)?o:"").toString().toUpperCase();p&&i.test(p)&&a(p)}catch(e){console.error(e,"er")}})},[]),(0,l.useMemo)(()=>({postalCodeState:e,setStorageValue:a,setCurrentValue:n}),[e,a,n])}},37142:(e,t,a)=>{"use strict";a.d(t,{jJ:()=>u,il:()=>o,Cb:()=>d,dw:()=>p,K8:()=>c,BK:()=>v,H3:()=>g,Fw:()=>m});var l=a(24407),r=a(3108);let s=e=>{let t=(e||"").replace(/\D/g,"");return 10!==t.length||t.startsWith("0")||t.startsWith("1")?{valid:!1,normalized:t,messageKey:"phone.validationMessage.INVALID"}:{valid:!0,normalized:t}};var i=a(30494);let n=RegExp("^(?!\\.)(?!.*\\.\\.)[\\p{L}\\p{N}._'+-]+@[\\p{L}\\p{N}-]+(\\.[\\p{L}\\p{N}-]+)+$","u"),o=e=>l.z.string().min(1,{message:null==e?void 0:e("form.firstName.validation.required")}).max(50,{message:null==e?void 0:e("form.firstName.validation.max")}),d=e=>l.z.string().min(1,{message:null==e?void 0:e("form.lastName.validation.required")}).max(50,{message:null==e?void 0:e("form.lastName.validation.max")}),u=e=>l.z.string().min(1,{message:null==e?void 0:e("form.email.validation.required")}).refine(e=>0===e.length||n.test(e),{message:null==e?void 0:e("form.email.validation.invalid")}),c=e=>l.z.string().min(8,{message:e("form.password.validation.min")}).regex(/[A-Z]/,{message:e("form.password.validation.uppercase")}).regex(/[a-z]/,{message:e("form.password.validation.lowercase")}).regex(/[0-9]/,{message:e("form.password.validation.number")}).regex(r.x0,{message:e("form.password.validation.special")}).regex(r.rp,{message:e("form.password.validation.invalidCharacters")}),m=e=>l.z.boolean().refine(e=>!0===e,{message:e("form.termsAndConditions.validation.required")}),g=e=>l.z.string().min(1,{message:null==e?void 0:e("form.postalCode.validation.required")}).regex(/^[A-Za-z0-9\s]*$/,{message:null==e?void 0:e("form.postalCode.validation.special")}).regex(i.q,{message:null==e?void 0:e("form.postalCode.validation.invalid")}),v=(e,t)=>
1l.z.string().min(1,{message:e(null!=t?t:"form.phone.validation.required")}).transform(e=>e.replaceAll(/\D/g,"")).superRefine((t,a)=>{let r=s(t);if(!r.valid){var i;a.addIssue({code:l.z.ZodIssueCode.custom,message:e(null!=(i=r.messageKey)?i:"phone.validationMessage.INVALID")})}}),p=e=>l.z.string().optional().transform(e=>(null==e?void 0:e.replaceAll(/\D/g,""))||"").superRefine((t,a)=>{if(t&&t.length>0){let i=s(t);if(!i.valid){var r;a.addIssue({code:l.z.ZodIssueCode.custom,message:e(null!=(r=i.messageKey)?r:"phone.validationMessage.INVALID")})}}})},52775:e=>{e.exports={"track-item-sidebar__title":"styles_track-item-sidebar__title__Famzu","track-item-sidebar__content":"styles_track-item-sidebar__content__S6TBo","track-item-sidebar__content__product-container":"styles_track-item-sidebar__content__product-container__W_kWT","track-item-sidebar__content__form":"styles_track-item-sidebar__content__form__j6sRv","track-item-sidebar__footer":"styles_track-item-sidebar__footer__dMsN6"}},55757:(e,t,a)=>{"use strict";a.d(t,{L:()=>o});var l=a(54568),r=a(83985),s=a(7620),i=a(83631);let n=e=>{let{errorMessage:t,delayErrorMs:a,label:i,nativeRequired:n,...o}=e,[d,u]=(0,s.useState)(!!t),c=(0,s.useRef)(null),m=!!t;(0,s.useEffect)(()=>(c.current&&(globalThis.clearTimeout(c.current),c.current=null),m)?!a||a<=0?void u(!0):(c.current=globalThis.setTimeout(()=>{u(!0),c.current=null},a),()=>{c.current&&(globalThis.clearTimeout(c.current),c.current=null)}):void u(!1),[m,a]);let g=d&&m?"error":void 0,v=d&&m?t:void 0;return(0,l.jsx)(r.TextField,{...o,label:i,validationMessage:v,nativeRequired:n,state:g})},o=e=>{let{control:t,name:a,label:r,delayErrorMs:s,...o}=e;return(0,l.jsx)(i.xI,{name:a,control:t,render:e=>{let{field:t,fieldState:{error:a}}=e;return(0,l.jsx)(n,{...o,...t,label:r,errorMessage:null==a?void 0:a.message,delayErrorMs:s,nativeRequired:o.nativeRequired})}})}}}]);

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.