PageSourceSearch

https://www.eightsleep.com/_next/static/chunks/81452-a54b3f25c3e0232d.js

js eightsleep.com collected 2026-09-24 17:35:04 UTC 23,293 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[81452],{8664:(e,t,r)=>{r.d(t,{DT:()=>a,FY:()=>n,Lk:()=>o,YR:()=>l});let a=e=>{if(e.includes(",")||/\.[a-zA-Z]$/.test(e))return!1;let t=RegExp("(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|\"(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21\\x23-\\x5b\\x5d-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])*\")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21-\\x5a\\x53-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])+)\\])");return null!=e.match(t)},n=e=>{let t=new RegExp(/^\+?[0-9-.() ]+$/);return e.length>=8&&null!=e.match(t)},o=e=>{let t=new RegExp(/[^\d]/g);return e.replace(t,"")},i=[".com",".net",".org",".edu",".gov",".ru",".de",".br",".uk",".jp",".fr",".it",".co",".dev"],l=e=>i.some(t=>e.endsWith(t))},30879:(e,t,r)=>{r.d(t,{J:()=>o});var a=r(89867),n=r(7648);let o=(e,t,r,o,i)=>{fetch("/api/dd",{method:"POST",body:JSON.stringify({key:e,title:t,text:r,tags:o,eventType:i}),headers:{"Content-Type":"application/json"}}).catch(e=>{(0,a.$4)((0,n.kG)(e),"Log DataDog")})}},32141:(e,t,r)=>{r.d(t,{u:()=>o});var a=r(12115),n=r(82767);function o(){return(0,a.useMemo)(()=>(0,n.Z)(),[])}},55335:(e,t,r)=>{r.d(t,{_:()=>n});var a=r(97174);async function n(e,t){try{var r;let n=(0,a.WR)();if(null===n)return;let{cart:o}=await e.store.cart.retrieve(t,{fields:"id,metadata"});await e.store.cart.update(t,{metadata:{...null!=(r=o.metadata)?r:{},eight_user_id:n}})}catch(e){console.error("[oms] stampAuthUserOnCart failed (non-fatal)",e)}}},66406:(e,t,r)=>{r.d(t,{H:()=>h,Dx:()=>y,w7:()=>_,x7:()=>v,dJ:()=>P,eF:()=>T});var a=r(75848),n=r(89673),o=r(78422),i=r(94427),l=r(94292),s=r(51780),d=r(55335),c=r(89481),u=r(8664),p=r(30879),m=r(7648),f=r(53001);class y extends Error{constructor(e){super("Your payment was processed but we could not finalize the order. Please contact support -- do not retry the payment."),this.name="OrderCompletionError",this.cause=e}}
1class h extends Error{constructor(e){super(e),this.name="CartCompletionDeclinedError"}}async function w(e,t,r,n){var o,i,l,s,d;let c=null==(o=t.payment_collection)?void 0:o.id,u=r.find(e=>(0,a.z2)(e.id));if(!c||!u)throw Error("Payment not ready. Please refresh and try again.");let p=await e.client.fetch("/store/payment-collections/custom/".concat(c,"/payment-sessions/"),{method:"POST",body:{provider_id:u.id,...n?{data:n}:{}}}),m=null==p||null==(d=p.payment_collection)||null==(s=d.payment_sessions)||null==(l=s[0])||null==(i=l.data)?void 0:i.client_secret;if(!m)throw Error("Failed to create payment session. Please try again.");return{clientSecret:m,paymentCollectionId:c}}async function _(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a="string"==typeof r.flow?r.flow:"unknown";try{await (0,d._)(e,t);let i=await e.client.fetch("/store/carts/".concat(t,"/custom-complete"),{method:"POST",query:{}});if("cart"===i.type){var n,o;throw new h(null!=(o=null==(n=i.error)?void 0:n.message)?o:"Cart completion failed")}return(0,p.J)(t,"Checkout - Cart Complete Succeeded",JSON.stringify({cartId:t,orderId:i.order.id,url:window.location.href,...r}),["checkout","cart-complete",a],"success"),i.order}catch(e){throw(0,p.J)(t,"Checkout - Cart Complete Failed",JSON.stringify({cartId:t,url:window.location.href,...r,error:(0,m.Jo)(e)}),["checkout","cart-complete",a],"error"),e}}function g(e){var t;if(!e.email||!(0,u.DT)(e.email))throw Error("Please enter a valid email address before paying.");if(!(0,l.K5)(e))throw Error("Please enter a complete shipping address before paying.");let r=e.metadata;if(null==r?void 0:r.is_gift){if(!r.gift_recipient_email||!(0,u.DT)(r.gift_recipient_email))throw Error("Please enter the gift recipient's email address.");if(e.email&&r.gift_recipient_email.toLowerCase()===e.email.toLowerCase())throw Error("Recipient email can't be the same as your email.");if(!r.gift_autopilot_payer)throw Error("Please choose who pays for autopilot.")}else if(null==(t=e.items)?void 0:t.some(c.vi))throw Error('Your cart includes a prepaid Autopilot gift plan. Please check "This is a gift" and enter the recipient\'s details before paying.')}async function P(e){var t,r,n,o,i;let{medusa:d,cart:c,paymentProviders:u}=e;if(g(c),!(0,l.K5)(c))throw Error("Please complete your shipping address before paying.");if((null!=(i=c.total)?i:0)<=0)throw Error("This order has nothing to pay — please complete it without PayPal.");let p=null==(t=c.payment_collection)?void 0:t.id,m=u.find(e=>(0,a.fl)(e.id));if(!p||!m)throw Error("PayPal is not configured for this cart.");let f=await d.client.fetch("/store/payment-collections/custom/".concat(p,"/payment-sessions/"),{method:"POST",body:{provider_id:m.id}}),y=null==f||null==(n=f.payment_collection)||null==(r=n.payment_sessions)?void 0:r.find(e=>e.provider_id===m.id),h=null==y||null==(o=y.data)?void 0:o.paypal_order_id;if("string"!=typeof h||!h)throw Error("Failed to start the PayPal payment. Please try again.");return(0,s.markPaymentRedirectStarted)(c.id),h}async function v(e,t){try{return await _(e,t.id,{flow:"paypal"})}catch(e){if(e instanceof h)throw e;throw new y(e)}}function E(e,t,r){let a=(0,n.nb)(window.location.pathname),o=new URL("".concat(a&&"us"!==a?"/".concat(a):"").concat(e),window.location.origin);for(let[e,a]of(o.searchParams.set("cart_id",t),Object.entries(r)))o.searchParams.set(e,a);return o.toString()}async function b(e){let{medusa:t,cart:r,paymentProviders:a}=e;if(!(0,i.fb)(r))throw Error("Please complete your billing address before paying.");if(!(0,l.K5)(r))throw Error("Please complete your shipping address before paying.");await (0,d._)(t,r.id);let{paymentCollectionId:n}=await w(t,r,a,{payment_method_types:["truemed"]}),o=await t.client.fetch("/store/truemed/payment-sessions",{method:"POST",body:{payment_collection_id:n,success_url:E("/checkout/truemed/return",r.id,{truemed_status:"success"}),failure_url:E("/checkout/truemed/return",r.id,{truemed_status:"failure"}),precreate_order:!0}});if("type"in o){var c,u;throw Error(null!=(u=null==(c=o.error)?void 0:c.message)?u:"A discount on your cart is no longer valid. Please review your total and try again.")}return(0,s.markPaymentRedirectStarted)(r.id),window.location.replace(o.redirect_url),{redirected:!0}}async function S(e){var t,r,a,n,o,i,c,u,p;let{medusa:m,cart:f,paymentProviders:y}=e;if(!(0,l.K5)(f))throw Error("Please complete your shipping address before paying.");let h=window.rvvupSdk;if(!h)throw Error("Zopa is still loading. Please wait a moment and try again.");await (0,d._)(m,f.id);let{paymentCollectionId:_}=await w(m,f,y,{payment_method_types:["zopa"]}),{checkoutId:g,token:P}=await m.client.fetch("/store/zopa/checkouts",{method:"POST",body:{payment_collection_id:_,success_url:E("/checkout/zopa/return",f.id,{zopa_status:"success"}),cancel_url:E("/checkout/zopa/return",f.id,{zopa_status:"cancel"}),pending_url:E("/checkout/zopa/return",f.id,{zopa_status:"pending"})}}),v=f.shipping_address,b=v?{name:[v.first_name,v.last_name].filter(
1Boolean).join(" ").trim(),line1:null!=(t=v.address_1)?t:"",...v.address_2?{line2:v.address_2}:{},city:null!=(r=v.city)?r:"",...v.province?{state:v.province}:{},...v.postal_code?{postcode:v.postal_code}:{},countryCode:(null!=(a=v.country_code)?a:"").toUpperCase(),...v.phone?{phoneNumber:v.phone}:{}}:void 0,S=await h.createPaymentMethod("ZOPA_RETAIL_FINANCE",{checkoutSessionKey:P,paymentRequest:{total:{amount:(null!=(n=f.total)?n:0).toFixed(2),currency:(null!=(o=f.currency_code)?o:"gbp").toUpperCase()},customer:{givenName:null!=(i=null==v?void 0:v.first_name)?i:void 0,surname:null!=(c=null==v?void 0:v.last_name)?c:void 0,email:null!=(u=f.email)?u:void 0,phoneNumber:null!=(p=null==v?void 0:v.phone)?p:void 0},...b?{billingAddress:b,shippingAddress:b}:{}}});return await new Promise((e,t)=>{function r(){clearTimeout(i)}function a(e){e.persisted&&(n(),window.location.reload())}function n(){clearTimeout(i),window.removeEventListener("pagehide",r),window.removeEventListener("pageshow",a)}function o(e,r){n(),(0,s.clearPaymentRedirect)(f.id),t(e instanceof Error?e:Error(r))}let i=setTimeout(()=>o(void 0,"Zopa is taking too long to respond. Please try again."),3e4);window.addEventListener("pagehide",r),window.addEventListener("pageshow",a),S.on("error",e=>o(e,"Zopa payment could not be started.")),S.on("beforePaymentAuth",async()=>{try{let{paymentSessionId:e}=await m.client.fetch("/store/zopa/checkouts/".concat(g,"/payment-sessions"),{method:"POST",body:{payment_collection_id:_,precreate_order:!0}});return{paymentSessionId:e}}catch(e){throw o(e,"Could not start your Zopa payment. Please try again."),e}}),S.on("ready",async()=>{try{if(!await S.canMakePayment())return void o(void 0,"Zopa Retail Finance is not available for this order.");(0,s.markPaymentRedirectStarted)(f.id),S.submit()}catch(e){o(e,"Zopa payment failed to start.")}})}),{redirected:!0}}async function C(e){let t,{stripe:r,medusa:n,cart:o,paymentProviders:d,selectedPaymentMethod:c}=e,u=(0,a.tM)(c);if(!u)throw Error("Unknown payment method");let p=(0,i.fb)(o);if(!p)throw Error("Please complete your billing address before paying.");if(!(0,l.K5)(o))throw Error("Please complete your shipping address before paying.");let{clientSecret:m}=await w(n,o,d,{payment_method_types:[u.stripePaymentType]}),{paymentMethod:f,error:y}=await (0,i.s3)(r,u.stripePaymentType,p);if(y||!f)throw Error((null==y?void 0:y.message)||"Failed to create payment method");(0,s.markPaymentRedirectStarted)(o.id);try{t=await r.confirmPayment({clientSecret:m,confirmParams:{return_url:E("/checkout/return",o.id,{}),payment_method:f.id}})}catch(e){throw(0,s.clearPaymentRedirect)(o.id),e}let{error:h}=t;if(h)throw(0,s.clearPaymentRedirect)(o.id),Error(h.message||"Payment failed");return{redirected:!0}}async function k(e){var t,r,a,i,d;let{medusa:c,cart:u,paymentProviders:p}=e;if(!(0,l.K5)(u))throw Error("Please complete your shipping address before paying.");let m=f.XZ;if(!m)throw Error("Affirm Canada is not configured in this environment.");let y=null==(t=u.payment_collection)?void 0:t.id,h=p.find(e=>"pp_eight_affirm_ca"===e.id);if(!y||!h)throw Error("Affirm Canada is not configured for this cart.");let w=null==(r=window.affirm)?void 0:r.checkout;if(!w)throw Error("Affirm is still loading. Please wait a moment and try again.");let _=await c.client.fetch("/store/payment-collections/custom/".concat(y,"/payment-sessions/"),{method:"POST",body:{provider_id:h.id}}),g=null==_||null==(i=_.payment_collection)||null==(a=i.payment_sessions)?void 0:a.find(e=>e.provider_id===h.id),P=null==g||null==(d=g.data)?void 0:d.session_nonce;if(!P)throw Error("Payment session is misconfigured (no nonce). Please refresh and try again.");return w(function(e,t){var r,a,i,l,s,d,c,u,p,m;let{publicKey:f,sessionNonce:y}=t;if(!y)throw Error("Affirm Canada checkout requires a session nonce — ship payment session is misconfigured.");let h=e.shipping_address;if(!h)throw Error("Shipping address is required for Affirm Canada checkout.");let w=(null!=(r=e.items)?r:[]).map(e=>{var t,r,a,n;return{sku:null!=(t=e.variant_sku)?t:e.id,item_url:window.location.origin,display_name:(null!=(a=null!=(r=e.product_title)?r:e.title)?a:"Item").slice(0,1024),unit_price:Math.round((null!=(n=e.unit_price)?n:0)*100),qty:e.quantity}}),_=e=>Math.round((null!=e?e:0)*100),g=function(e){var t,r;let a={};for(let n of null!=(t=e.items)?t:[]){let e=n.adjustments;if(null==e?void 0:e.length)for(let t of e){let e=!t.code||(0,o.f3)(t.code)?"Discount":(0,o.Dv)(t.code),n=Math.round((null!=(r=t.amount)?r:0)*100);n<=0||(a[e]?a[e].discount_amount+=n:a[e]={discount_amount:n,discount_display_name:e})}}return Object.keys(a).length?a:void 0}(e),P=(0,n.nb)(window.location.pathname),v=P&&"us"!==P?"/".concat(P):"",E=new URL("".concat(v,"/checkout/affirm-ca/return"),window.location.origin);return E.searchParams.set("cart_id",e.id),{merchant:{public_api_key:f,user_cancel_url:new URL("".concat(v,"/checkout"),window.location.origin).toString(),user_confirmation_url:E.toString(),user_confirmation_url_action:"GET",name:"Eight Sleep"},shipping:{name:{first:null!=(a=h.first_name)?a:"",last:null!=(i=h.last_name)?i:""},address:{street1:null!=(l=h.address_1)?l:"",street2:null!=(s=h.address_2)?s:"",city:null!=(d=h.city)?d:"",region1_code:null!=(c=h.province)?c:"",postal_code:null!=(u=h.postal_code)?u:"",country:"CAN"},phone_number:null!=(p=h.phone)?p:"",email:null!=(m=e.email)?m:""},items:w,...g?{discounts:g}:{},order_id:e.id,shipping_amount:_(e.shipping_total),tax_amount:_(e.tax_total),total:_(e.total),currency:"CAD",metadata:{medusa_session_nonce:y}}}(u,{publicKey:m,sessionNonce:P})),(0,s.markPaymentRedirectStarted)(u.id),w.post(),{redirected:!0}}async function A(e){var t,r;let a,{stripe:n,elements:o,medusa:i,cart:l,paymentProviders:d}=e;if(!o)throw Error("Payment form not ready. Please refresh and try again.");if((null==(t=l.items)?void 0:t.some(e=>e.requires_shipping))&&!(null==(r=l.shipping_methods)?void 0:r.length))throw Error("No shipping method selected. Please refresh the page and try again.");let{error:c}=await o.submit();if(c)throw Error(c.message||"Please complete your payment details");let{clientSecret:u}=await w(i,l,d,{payment_method_types:["card","link"]}),{paymentMethod:p,error:m}=await n.createPaymentMethod({elements:o});if(m)throw Error(m.message||"Failed to create payment method");(0,s.markPaymentRedirectStarted)(l.id);try{a=await n.confirmPayment({clientSecret:u,confirmParams:{return_url:E("/checkout/return",l.id,{}),payment_method:p.id},redirect:"if_required"})}catch(e){throw(0,s.clearPaymentRedirect)(l.id),e}let{paymentIntent:f,error:h}=a;if(h)throw(0,s.clearPaymentRedirect)(l.id),Error(h.message||"Payment failed");if(f&&"succeeded"!==f.status&&"requires_capture"!==f.status)throw(0,s.clearPaymentRedirect)(l.id),Error("Payment not completed (status: ".concat(f.status,"). Please try again."));try{let e=await _(i,l.id,{flow:"card"});return(0,s.clearPaymentRedirect)(l.id),{order:e}}catch(e){throw new y(e)}}
1async function M(e){return{order:await _(e.medusa,e.cart.id,{flow:"free"})}}async function T(e){g(e.cart);try{var t,r,n,o;if((null!=(t=e.cart.total)?t:0)<=0)return await M(e);if("truemed"===e.selectedPaymentMethod)return await b(e);if(r=e.cart,n=e.selectedPaymentMethod,"affirm"===n&&(null==(o=r.currency_code)?void 0:o.toLowerCase())==="cad")return await k(e);if("zopa"===e.selectedPaymentMethod)return await S(e);if("paypal"===e.selectedPaymentMethod)throw Error("PayPal payments are completed via the PayPal button.");if((0,a.Ib)(e.selectedPaymentMethod))return await C(e);return await A(e)}catch(t){throw(0,p.J)(e.cart.id,"Checkout - Payment Flow Error",JSON.stringify({cartId:e.cart.id,paymentMethod:e.selectedPaymentMethod,cartTotal:e.cart.total,isOrderCompletionError:t instanceof y,url:window.location.href,error:(0,m.Jo)(t)}),["checkout","payment"],"warning"),t}}},67099:(e,t,r)=>{r.d(t,{G:()=>o});var a=r(89867),n=r(7648);let o=(e,t)=>{try{window.history.replaceState(e,"",t)}catch(e){(0,a.$4)((0,n.kG)(e),"history.replaceState")}}},75848:(e,t,r)=>{r.d(t,{Ib:()=>l,aA:()=>o,fl:()=>d,kh:()=>c,tM:()=>i,z2:()=>s});let a={"":{bnpl:["affirm"],truemed:!0,zopa:!1,paypal:!1},us:{bnpl:["affirm"],truemed:!0,zopa:!1,paypal:!1},ca:{bnpl:["affirm"],truemed:!1,zopa:!1,paypal:!1},eu:{bnpl:["klarna"],truemed:!1,zopa:!1,paypal:!0},uk:{bnpl:["klarna"],truemed:!1,zopa:!0,paypal:!0},au:{bnpl:[],truemed:!1,zopa:!1,paypal:!0},se:{bnpl:[],truemed:!1,zopa:!1,paypal:!1},dk:{bnpl:[],truemed:!1,zopa:!1,paypal:!1},ae:{bnpl:[],truemed:!1,zopa:!1,paypal:!1},ch:{bnpl:[],truemed:!1,zopa:!1,paypal:!1},mx:{bnpl:[],truemed:!1,zopa:!1,paypal:!1},sa:{bnpl:[],truemed:!1,zopa:!1,paypal:!1},qa:{bnpl:[],truemed:!1,zopa:!1,paypal:!1},sg:{bnpl:[],truemed:!1,zopa:!1,paypal:!1},kw:{bnpl:[],truemed:!1,zopa:!1,paypal:!1},bh:{bnpl:[],truemed:!1,zopa:!1,paypal:!1}},n={affirm:{key:"affirm",displayName:"Affirm",stripePaymentType:"affirm",badge:"Pay over time",description:"You'll be redirected to Affirm to complete your purchase with monthly payments.",buttonLabel:"Continue with Affirm"},klarna:{key:"klarna",displayName:"Klarna",stripePaymentType:"klarna",badge:"Pay in 3",description:"You'll be redirected to Klarna to complete your purchase.",buttonLabel:"Continue with Klarna"}};function o(e,t){let r=a[e],o={card:{key:"card"},bnpl:r.bnpl.map(e=>n[e])};return r.truemed&&"pay-order"!==t.surface&&(o.truemed={key:"truemed",displayName:"HSA/FSA"}),r.zopa&&"pay-order"!==t.surface&&(o.zopa={key:"zopa",displayName:"Zopa"}),r.paypal&&"pay-order"!==t.surface&&(o.paypal={key:"paypal",dis
1playName:"PayPal"}),"pdp"===t.surface&&(o.fragile={key:"fragile"}),o}function i(e){return e in n?n[e]:void 0}function l(e){return e in n}function s(e){return!!(null==e?void 0:e.startsWith("pp_eight_stripe"))}function d(e){return"pp_eight_paypal"===e}let c=["eur","gbp","aud"]},78422:(e,t,r)=>{r.d(t,{C:()=>i,Dv:()=>o,f3:()=>n});var a=r(3105);function n(e){return!!(null==e?void 0:e.toLowerCase().startsWith("manual:"))}function o(e){return(0,a.Gl)(e.replace(/^coupon:/i,""))}function i(e){let t=new Set;for(let a of null!=e?e:[]){var r;for(let e of null!=(r=a.adjustments)?r:[]){if(!e.code||n(e.code))continue;let r=o(e.code);r&&t.add(r)}}return[...t]}},90143:(e,t,r)=>{function a(e,t){var r,a;return(null!=(r=null==e?void 0:e.length)?r:0)>50||(null!=(a=null==t?void 0:t.length)?a:0)>50}function n(e){var t;let r=(null!=e?e:"").trim().split(/\s+/).filter(Boolean);return{firstName:null!=(t=r[0])?t:"",lastName:r.slice(1).join(" ")}}function o(e,t){var r,a,n,o,i,l,s,d,c,u,p,m;return!e&&!t||!!e&&!!t&&(null!=(r=e.first_name)?r:"")===(null!=(a=t.first_name)?a:"")&&(null!=(n=e.last_name)?n:"")===(null!=(o=t.last_name)?o:"")&&(null!=(i=e.address_1)?i:"")===(null!=(l=t.address_1)?l:"")&&(null!=(s=e.city)?s:"")===(null!=(d=t.city)?d:"")&&(null!=(c=e.postal_code)?c:"")===(null!=(u=t.postal_code)?u:"")&&(null!=(p=e.country_code)?p:"")===(null!=(m=t.country_code)?m:"")}r.d(t,{CO:()=>o,F8:()=>n,ov:()=>a})},94292:(e,t,r)=>{r.d(t,{Ef:()=>o,Gp:()=>s,K5:()=>f,dq:()=>p,Lg:()=>m});let a={AF:"+93",AX:"+358",AL:"+355",DZ:"+213",AD:"+376",AO:"+244",AI:"+1",AG:"+1",AR:"+54",AM:"+374",AW:"+297",AC:"+247",AU:"+61",AT:"+43",AZ:"+994",BS:"+1",BH:"+973",BD:"+880",BB:"+1",BY:"+375",BE:"+32",BZ:"+501",BJ:"+229",BM:"+1",BT:"+975",BO:"+591",BA:"+387",BW:"+267",BR:"+55",IO:"+246",VG:"+1",BN:"+673",BG:"+359",BF:"+226",BI:"+257",KH:"+855",CM:"+237",CA:"+1",CV:"+238",BQ:"+599",KY:"+1",CF:"+236",TD:"+235",CL:"+56",CN:"+86",CO:"+57",KM:"+269",CG:"+242",CD:"+243",CK:"+682",CR:"+506",CI:"+225",HR:"+385",CW:"+599",CY:"+357",CZ:"+420",DK:"+45",DJ:"+253",DM:"+1",DO:"+1",EC:"+593",EG:"+20",SV:"+503",GQ:"+240",ER:"+291",EE:"+372",SZ:"+268",ET:"+251",FK:"+500",FO:"+298",FJ:"+679",FI:"+358",FR:"+33",GF:"+594",PF:"+689",GA:"+241",GM:"+220",GE:"+995",DE:"+49",GH:"+233",GI:"+350",GR:"+30",GL:"+299",GD:"+1",GP:"+590",GU:"+1",GT:"+502",GG:"+44",GN:"+224",GW:"+245",GY:"+592",HT:"+509",HN:"+504",HK:"+852",HU:"+36",IS:"+354",IN:"+91",ID:"+62",IQ:"+964",IE:"+353",IM:"+44",IL:"+972",IT:"+39",JM:"+1",JP:"+81",JE:"+44",JO:"+962",KZ:"+7",KE:"+254",KI:"+686",XK:"+383",KW:"+965",KG:"+996",LA:"+856",LV:"+371",LB:"+961",LS:"+266",LR:"+231",LY:"+218",LI:"+423",LT:"+370",LU:"+352",MO:"+853",MG:"+261",MW:"+265",MY:"+60",MV:"+960",ML:"+223",MT:"+356",MQ:"+596",MR:"+222",MU:"+230",YT:"+262",MX:"+52",MD:"+373",MC:"+377",MN:"+976",ME:"+382",MS:"+1",MA:"+212",MZ:"+258",MM:"+95",NA:"+264",NR:"+683",NP:"+977",NL:"+31",NC:"+687",NZ:"+64",NI:"+505",NE:"+227",NG:"+234",NU:"+683",MK:"+389",NO:"+47",OM:"+968",PK:"+92",PS:"+970",PA:"+507",PG:"+675",PY:"+595",PE:"+51",PH:"+63",PL:"+48",PT:"+351",PR:"+1",QA:"+974",RE:"+262",RO:"+40",RU:"+7",RW:"+250",WS:"+685",SM:"+378",ST:"+239",SA:"+966",SN:"+221",RS:"+381",SC:"+248",SL:"+232",SG:"+65",SX:"+1",SK:"+421",SI:"+386",SB:"+677",SO:"+252",ZA:"+27",KR:"+82",SS:"+211",ES:"+34",LK:"+94",BL:"+590",SH:"+290",KN:"+1",LC:"+1",MF:"+590",PM:"+590",VC:"+1",SD:"+249",SR:"+597",SJ:"+47",SE:"+46",CH:"+41",TW:"+886",TJ:"+992",TZ:"+255",TH:"+66",TL:"+670",TG:"+228",TK:"+690",TO:"+676",TT:"+1",TA:"+290",TN:"+216",TR:"+90",TM:"+993",TC:"+1",TV:"+688",UG:"+256",UA:"+380",AE:"+971",GB:"+44",US:"+1",UY:"+598",UZ:"+998",VU:"+678",VA:"+379",VE:"+58",VN:"+84",WF:"+681",EH:"+212",YE:"+967",ZM:"+260",ZW:"+263"};var n=r(90143);let o=["RO","MC","AE","SA","QA","KW","BH"],i=["AE"],l=["CY","GR","MT"];function s(e,t){if(!(null==e?void 0:e.length)||!t)return[];let r=t.toLowerCase(),a=new Set(l),n=new Set;for(let t of e){var o,i;if(t.currency_code.toLowerCase()===r)for(let e of null!=(o=t.countries)?o:[]){let t=null==(i=e.iso_2)?void 0:i.toUpperCase();t&&!a.has(t)&&n.add(t)}}return Array.from(n).sort()}let d=["AK","AS","AA","AE","AP","FM","GU","HI","MH","MP","PW","PR","VI"],c=["BG","HR","EE","HU","LV","LT","LU","RO","SK","SI"],u=/^(PO Box|P\.?O\.? Box|Parcel Locker|Parcel Lockup)/i;function p(e){return!!e&&d.includes(e.toUpperCase())}function m(e,t,r){var o;let{country:i,state:l,postal_code:s,line1:d,line2:m}=e.address;return(0,n.ov)(d,m)?"errors.addressLineTooLong":"US"===i&&p(l)?"errors.forbiddenStatesError":u.test(d.trim())||u.test(null!=(o=null==m?void 0:m.trim())?o:"")?"errors.poBoxError":"GB"===i.toUpperCase()&&/^(JE|GY|IM)\d/.test(s)?"errors.channelIslandsError":!function(e,t,r){if(!t||0===t.length||(null==r?void 0:r.toLowerCase())==="eur")return!0;let n=a[e.toUpperCase()];return!!n&&(t.startsWith("+")?t.startsWith(n):t.startsWith(n.replace("+","")))}(i,e.phone,r)?"errors.phoneError":"klarna"===t&&c.includes(i.toUpperCase())?"errors.klarnaUnsupportedError":null}function f(e){var t;let r=e.shipping_address;if(!r)return!1;let a=i.includes((null!=(t=r.country_code)?t:"").toUpperCase())?!!r.city||!!r.province:!!r.city;return!!(r.first_name&&r.last_name&&r.address_1&&a&&r.country_code&&r.phone)}},94427:(e,t,r)=>{function a(e){var t,r,a,n,o,i,l,s,d,c,u;let p=null!=(t=e.billing_address)?t:e.shipping_address;if(p)return{name:"".concat(null!=(r=p.first_name)?r:""," ").concat(null!=(a=p.last_name)?a:"").trim(),address:{city:null!=(n=p.city)?n:"",country:null!=(o=p.country_code)?o:"",line1:null!=(i=p.address_1)?i:"",line2:null!=(l=p.address_2)?l:"",postal_code:null!=(s=p.postal_code)?s:"",state:null!=(d=p.province)?d:""},email:null!=(c=e.email)?c:"",phone:null!=(u=p.phone)?u:""}}r.d(t,{Nq:()=>l,fb:()=>a,s3:()=>s});let n=new Set(["requires_capture","succeeded"]),o=new Set(["canceled","requires_payment_method"]),i=e=>new Promise(t=>setTimeout(t,e));async function l(e,t){var r,a;let l,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},d=null!=(r=s.intervalMs)?r:2e3,c=null!=(a=s.timeoutMs)?a:6e4,u=Date.now()+c;for(;;){try{let{paymentIntent:r}=await e.retrievePaymentIntent(t);if((l=null==r?void 0:r.status)&&n.has(l))return{outcome:"authorized",status:l};if(l&&o.has(l))return{outcome:"declined",status:l}}catch(e){}if(Date.now()+d>=u)return{outcome:"timeout",status:l};await i(d)}}function s(e,t,r){switch(t){case"affirm":return e.createPaymentMethod({type:"affirm",billing_details:r});case"klarna":var a,n;return e.createPaymentMethod({type:"klarna",billing_details:{...r,address:{...r.address,country:null!=(n=null==(a=r.address)?void 0:a.country)?n:""}}})}}}}]);

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.