1import{c as e,eT as o,a5 as a,W as r,oM as t,nl as n,af as s,aZ as i}from"./9dba8418.DInoCEzY.js";import{q as c,s as u,k as l}from"./2c1ab0fe.Bywc2Brn.js";import{Z as p,hP as d,fE as h,p as y}from"./164ad2e3.DHuJhR22.js";function f(){const{shopPay:o}=e();return o}const m=()=>{const{shop:{hasStorefront:o,partnerStorefrontUrl:a},observability:r,url:t}=e();return{replaceShopPayInHistory:c(e=>{"undefined"!=typeof window&&(e?window.location.replace(e):o?(r.log("shop_pay_in_history_storefront_redirected","[Shop Pay] Redirecting to storefront url, as replacementUrl is not provided"),window.location.replace(a??t.storefront())):(r.counter({name:"shop_pay_cannot_replace_browser_history",value:1}),r.log("shop_pay_cannot_replace_browser_history","[Shop Pay] Unable to replace Shop Pay in browser history",{replacementUrl:e,storefrontUrl:t.storefront()})))},[o,a,r,t])}};function _(){const{clearForcedCheckoutLayout:e}=p(o),{inMemoryAmazonPayParts:{serializedAmazonParams:n,buyerDetails:s}}=a(),i=c(()=>{e({wallet:r.AmazonPay}),t(n),s.value={loading:!1,error:!1,details:void 0}},[e,n,s]);return d({shouldResetCustomerInfo:!0,skipRedirect:!0,shouldRemovePaymentLine:!0,onClick:i})}function v(){const{isOnePage:o}=e().checkout.configuration.layout,a=n(),r=h();return c(()=>{o.value?r({shouldResetCustomerInfo:!0}):a()},[o,a,r])}const w=()=>{const{checkout:o}=e(),a=o.configuration.visibility.showAside,r=s(),t=y({base:!0,medium:!1}),n=u(a),i=u(t);return l(()=>!(n.value&&!i.value&&r.value))};var P=(e=>(e.Generic="generic",e.SignInFailed="sign_in_failed",e.ContinueWithShopPay="continue_with_shop_pay",e))(P||{});function b(){const{observability:o,source:a,shopPay:r}=e();return{openModal:c(e=>{r.user.isUnauthenticatedUser.value?r.session.unstable_setUnauthenticatedErrorModal(e):o.error(new i("Cannot open an unauthenticated error modal outside of the unauthenticated flow",{groupingHash:"ShopPayError::UnauthenticatedErrorModal"}),{severity:"error",metadata:{source:{type:a.type},checkout:{token:a.checkoutSessionIdentifier||a.sourceId},event:{modalType:e.type,shopPayFlow:r.user.flow.value}}})},[o,a,r])}}export{P as U,f as a,b,w as c,_ as d,v as e,m 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.