PageSourceSearch

https://jaxonlane.com/cdn/shopifycloud/checkout-web/assets/c1/d22d2b80.CPLrR--0.js

js jaxonlane.com collected 2026-10-03 20:54:39 UTC 11,712 bytes, 1 lines download raw bytes

1import{s as e,T as t,x as s,l as n,m as o}from"./2c1ab0fe.GMbxnz74.js";import{S as r,dy as i,b8 as d,dz as a,dA as c,ah as u,c2 as l,dB as p,J as f,dC as m,dD as g}from"./4c290a1e.DMQ9xOwP.js";import{s as y}from"./74835653.DeaMa2xw.js";import{u as h}from"./29034f35.DARWjbfB.js";import{cm as b,e2 as v,e3 as A,w,cV as $}from"./164ad2e3.B4L1MRYB.js";import{A as I}from"./60a453ce.Cg9T1Gj2.js";function S(e){return new Promise((t,s)=>{v(e.approvalScopes,I.CustomerPersonalData)||s(new i(`Extension ${e.id} at target \`${e.extensionPoint.target}\` is missing required access to read customer personal data.`)),t()})}function k(e,t,s){switch(!0){case e instanceof i:q(e,t);break;case e instanceof d:if("persisted"===t.type)q(e,t);else{const{extensionPoint:{target:n}}=t;s(new d(`[${n}] ${e.message}`))}break;default:s(e)}}function q(e,t){const s=`[${t.extensionPoint.target}] ${e.name}: ${e.message}`;console.error(s)}function C(e){if("object"!=typeof e)throw new d("formattedAddress must be an object: received type "+typeof e);const t=P(e);if(t.length)throw new d(t.join("; "));return e}function P(e){const t=[],{address1:s,address2:n,city:o,company:r,provinceCode:i,zip:d,countryCode:c,latitude:u,longitude:l}=e;return s&&!T(s)&&t.push(`address1 must be a non-empty string: received type ${typeof s} in formattedAddress`),n&&!T(n)&&t.push(`address2 must be a non-empty string: received type ${typeof n} in formattedAddress`),o&&!T(o)&&t.push(`city must be a non-empty string: received type ${typeof o} in formattedAddress`),r&&!T(r)&&t.push(`company must be a non-empty string: received type ${typeof r} in formattedAddress`),i&&!T(i)&&t.push(`provinceCode must be a non-empty string: received type ${typeof i} in formattedAddress`),d&&!T(d)&&t.push(`zip must be a non-empty string: received type ${typeof d} in formattedAddress`),c&&!a(c)&&t.push(`countryCode must be a valid alpha-2 country code: received "${c}" in formattedAddress`),u&&("number"!=typeof u?t.push(`latitude must be a number: received type ${typeof u} in formattedAddress`):(u<-90||u>90)&&t.push(`latitude must be between -90 and 90: received ${u} in formattedAddress`)),l&&("number"!=typeof l?t.push(`longitude must be a number: received type ${typeof l} in formattedAddress`):(l<-180||l>180)&&t.push(`longitude must be between -180 and 180: received ${l} in formattedAddress`)),t}function T(e){return("string"==typeof e||e instanceof String)&&e.trim().length>0}function x(e){return e?.length?e.sort(E):[{offset:0,length:0}]}function E(e,t){return e.offset-t.offset}const R="address_clobber";function j(e){try{return e()}catch{return}}function z({addressType:i,countryCode:a,field:v,initialAddressQuery:I="",provider:q="autocomplete-service",allowAllCountries:E}){const{i18n:{locale:z},observability:L,userEvents:O,shop:N,source:U,checkout:{address:D}}=r(),{id:G}=N,[Q,B]=s(I),[V,F]=s(Q),[X,J]=s(!1),[H,K]=s([]),[W,Y]=s([]),Z=n(!1),[ee,te]=s(M(U.sourceId)),{geolocation:se}=b(),{search:ne,fetchAddress:oe}=h(),re=$(),{details:ie}=u(a),de=l(),ae=null!==D.extendedAddressMode.get(a),ce="pickup"===i?"google":void 0,ue=n(void 0);ue.current??=function({addressType:e,field:t,log:s,now:n=Date.now}){let o,r,i=0,d=0,a=0,c=0,u=!1,l=20,p=20;const f=(n,o)=>s(R,`${R}: ${n}`,{kind:n,addressType:e??"unknown",field:t??"unknown",...o});return{recordQuery(e){e!==o&&(o=e,c+=1)},resetPredictionContext(){r=void 0,u=!1},startPredictionRequest:()=>[c,++i,n()],recordPredictionResponse([e,t,s],o){const i=t<d,a=d;d=Math.max(d,t),r=e,u=i,i&&0!==l&&(l-=1,f("prediction-race",{latestAppliedPredictionGeneration:a,predictionCount:o,queryChangedSinceRequest:e!==c,requestGeneration:t,responseAgeMs:Math.max(0,n()-s)}))},startAddressRequest:()=>[c,++a,u||void 0!==r&&r!==c,n()],recordAddressResponse([e,t,s,o]){const r=t!==a,i=e!==c;(r||i||s)&&0!==p&&(p-=1,f("address-race",{latestRequestGeneration:a,newerSelectionStarted:r,queryChangedSinceSelection:i,requestGeneration:t,responseAgeMs:Math.max(0,n()-o),selectedFromStalePredictionResponse:s}))}}}({addressType:i,field:v,log:(e,t,s)=>L.log(e,t,s)});const le=ue.current,pe=w("purchase.address-autocomplete.suggest"),fe=t(()=>pe.map(p),[pe]),me=function(s){const n=A(s),o=t(()=>s[0],[s]);return e((e,t)=>o?new Promise((s,r)=>{t.aborted&&r(new c(t.reason)),S(o).then(()=>n({signal:t,target:{...e}})).then(e=>e?.suggestions||[]).then(e=>function(e){const t=[];if(!Array.isArray(e))throw new d("An array of address suggestions must be defined");const s=e.slice(0,5);for(const[n,{id:o,label:r,matchedSubstrings:i,formattedAddress:a}]of s.entries()){if(T(r)||t.push(`label is required and must be a non-empty string: received ${typeof r} in suggestions[${n}
1]`),o&&!T(o)&&t.push(`id must be a non-empty string: received ${typeof o} in suggestions[${n}]`),i)if(Array.isArray(i))for(const[e,{offset:s,length:o}]of i.entries())"number"!=typeof s&&t.push(`offset must be a number: received type ${typeof s} in matchedSubstrings[${e}] for suggestions[${n}]`),"number"!=typeof o&&t.push(`length must be a number: received type ${typeof o} in matchedSubstrings[${e}] for suggestions[${n}]`);else t.push(`matchedSubstrings must be an array: received type ${typeof i} in suggestions[${n}]`);if(a)if("object"==typeof a){const e=P(a);for(const s of e)t.push(`${s} for suggestions[${n}]`)}else t.push(`formattedAddress must be an object: received type ${typeof a} in suggestions[${n}]`);if(t.length)throw new d(t.join("; "))}return s}(e)).then(e=>function(e){return e.map((e,t)=>{const{id:s,label:n,matchedSubstrings:o,formattedAddress:r}=e;return{internalId:`extension-suggestion-${t}`,matchedSubstrings:x(o),label:n,...s&&{id:s},...r&&{formattedAddress:r}}})}(e)).then(e=>s(e)).catch(e=>{k(e,o,r),s([])}),t.addEventListener("abort",()=>{r(new c(t.reason))})}):Promise.resolve([]),[n,o])}(fe),ge=t(()=>fe.length>0,[fe]),ye=w("purchase.address-autocomplete.format-suggestion"),he=t(()=>ye.map(p),[ye]),be=function(s){const n=A(s),o=t(()=>s[0],[s]),r=w("purchase.address-autocomplete.suggest"),i=t(()=>r.length>0,[r]);return e(e=>o?new Promise((t,s)=>{(function(e){return new Promise((t,s)=>{e?t():s(new d("A purchase.address-autocomplete.suggest extension is required for a purchase.address-autocomplete.format-suggestion extension"))})})(i).then(()=>S(o)).then(()=>{const{internalId:t,...s}=e;return n({target:{selectedSuggestion:s}})}).then(e=>{t({formattedAddress:C(e?.formattedAddress||{})})}).catch(e=>{k(e,o,s),t({formattedAddress:{}})})}):Promise.resolve({formattedAddress:{}}),[n,o,i])}(he),ve=t(()=>he.length>0,[he]),Ae=e((e,t,s,n)=>{const o=de.value.defaultAttributes?.uniqToken||"";O.monorailEvent({schemaId:"checkout_autocomplete_suggestion/5.1",payload:{shopId:parseInt(f(G),10),checkoutToken:U.checkoutSessionIdentifier||"",uniqueToken:o,provider:t[0]?.completionService??"",context:"shipping"===e?"Shipping address":"Billing address",territoryCode:a??se.country.code,locale:z,query:s,sessionToken:ee,requestProvider:n,requestLatitude:se.coordinates?.latitude,requestLongitude:se.coordinates?.longitude,addressIds:t.map(e=>e.addressId)}})},[a,se.country.code,z,ee,G,U.checkoutSessionIdentifier,de.value.defaultAttributes?.uniqToken,O,se.coordinates]),we=t(()=>ge&&v&&_(i),[v,i,ge]),$e=t(()=>we||E||y(a||se.country.code),[E,a,se.country.code,we]);o(()=>{const e=setTimeout(()=>{re&&F(Q)},300);return()=>{clearTimeout(e)}},[re,Q]),o(()=>{j(()=>le.recordQuery(I)),B(I)},[I,le]),o(()=>{$e||K([])},[$e]);const Ie=n(a);o(()=>{Ie.current!==a&&void 0!==Ie.current&&(K([]),Y([]),Z.current=!1),Ie.current=a},[a]);const Se=function(t){const{observability:s}=r(),{geolocation:n}=b();return e(async(e,o,r)=>{const i=await t(e,o,r);return s.histogram({name:"prediction_duration",value:i.duration.end-i.duration.start,attributes:{buyerCountry:n.country.code}}),i.data},[t,s,n.country.code])}(ne);o(()=>{let e=!1;if($e&&X){if(we&&_(i)){const t=new AbortController;return async function({query:t,field:s,signal:n}){if(!t||"string"!=typeof t||t.length<=1)return j(()=>le.resetPredictionContext()),Y([]),void K([]);try{const o=j(()=>le.startPredictionRequest()),r=await me({value:t,field:function(e){switch(e){case"address1":case"streetName":return"address1";case"postalCode":return"zip";default:throw new m(`Unknown Address Autocomplete field: ${e}`)}}(s),selectedCountryCode:a},n);re.current&&!e&&(o&&j(()=>le.recordPredictionResponse(o,r.length)),Y(r),K(function(e){return e.map(({label:e,matchedSubstrings:t,internalId:s})=>({addressId:s,completionService:"AUTOCOMPLETE_EXTENSION",description:e,matchedSubstrings:t}))}(r)))}catch(o){if(o instanceof m&&L.error(o),"local"===fe[0].type){if(!(o instanceof c))throw o;console.warn("AddressAutocompleteSignalAbortedError: ",o.message)}}}({query:V,field:v,signal:t.signal}),()=>{e=!0,t.abort("The query was debounced")}}!async function(t){try{if(!t||"string"!=typeof t||t.length<=1)return j(()=>le.resetPredictionContext()),void K([]);const s=j(()=>le.startPredictionRequest()),n=await Se(t,{locale:z,countryCode:a??se.country.code,location:se.coordinates,requestToken:ee,shopId:f(G),sourceId:U.sourceId||"",checkoutSessionIdentifier:U.checkoutSessionIdentifier||""},ce);re.current&&!e&&(s&&j(()=>le.recordPredictionResponse(s,n.length)),K(n),!Z.current&&_(i)&&(Ae(i,n,t,ce),Z.current=!0))}catch(s){console.warn(`Unable to fetch predictions: ${s}`),re.current&&!e&&K([])}}(V)}return()=>{e=!0}},[a,V,z,ee,Ae]);const ke=e((e,t,s,n,o)=>{const r=ie?.zones.find(e=>e.code===t.zoneCode)?.name||void 0,i=de.value.defaultAttributes?.uniqToken,d=s.findIndex(t=>t.addressId===e)+1;O.monorailEvent({schemaId:"checkout_autocomplete_selection/6.2",payload:{shopId:parseInt(f(G),10),checkoutToken:U.checkoutSessionIdentifier||"",uniqueToken:i,address1:t.address1,address2:t.address2,city:t.city,zone:r,latitude:t.coordinates?.latitude,longitude:t.coordinates?.longitude,zip:t.postalCode,territoryCode:a??se.country.code,position:d,query:V,context:"shipping"===n?"Shipping address":"Billing address",locale:z,sessionToken:o,requestLatitude:se.coordinates?.latitude,requestLongitude:se.coordinates?.longitude}})},[ie,de.value.defaultAttributes?.uniqToken,G,U.checkoutSessionIdentifier,a,se.country.code,se.coordinates,V,z,O]),qe=e(async(e,t,s,n)=>{const o=j(()=>le.startAddressRequest());try{let r,a;
1if("AUTOCOMPLETE_EXTENSION"===t)r=await async function(e){const t=function(e){const t=W.find(t=>t.internalId===e);return t||L.error(new g("Could not find selected suggestion in extension suggestions.")),t}(e);return s=t?.formattedAddress||await async function(e){if(ve&&e)return(await be(e)).formattedAddress;const t=new d("The address fields could not be auto-populated. Please provide a `formattedAddress` for the selected suggestion or implement the `purchase.address-autocomplete.format-suggestion` extension.");console.error(`${t.name}: ${t.message}`)}(t),{address1:s?.address1,address2:s?.address2,city:s?.city,company:s?.company,zoneCode:s?.provinceCode,postalCode:s?.zip,coordinates:s?.latitude&&s?.longitude?{latitude:s.latitude,longitude:s.longitude}:void 0};var s}(e);else{const n=ee;r=await oe(e,{locale:z,requestToken:ee,completionService:t,shopId:f(G),sourceId:U.sourceId||"",checkoutSessionIdentifier:U.checkoutSessionIdentifier||"",extendedFields:!s&&ae}),a=n,re.current&&(te(M(U.sourceId)),_(i)&&ke(e,r,H,i,n))}re.current&&(o&&j(()=>le.recordAddressResponse(o)),n(r,a))}catch(r){if(r instanceof d)throw r;console.warn(`Unable to select prediction: ${r}`)}},[z,ee,G,U.sourceId,U.checkoutSessionIdentifier,oe,re,i,ke,H,ve,W,be,L,ae,le]),Ce=e((e,t=!0)=>{j(()=>le.recordQuery(e)),B(e),J(t)},[le]);return{value:Q,debouncedValue:V,setValue:Ce,predictions:H,selectPrediction:qe,provider:q}}function M(e){return`${e}-${Date.now()}`}function _(e){return"billing"===e||"shipping"===e}export{z 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.