import{m as e,t as n}from"./2c1ab0fe.Dbn2KvkT.js";import{d as t,J as i,W as o,a4 as r,aK as s}from"./4b4bc88f.z1yoAwwH.js";import{fF as d,hZ as a}from"./164ad2e3.FTBuhkTQ.js";function u(){const{checkout:{negotiator:n}}=t(),r=n.parts.paymentLines;return e(()=>{const[e]=i(r.value,[o.BuyWithPrime]);return e})}function c(){const e=t().checkout.latestReceipt.value?.id,{persistedAmazonSignal:i}=r(),o=n(()=>{d(i,{receiptIdForAupError:e,receiptIdForPaymentDecline:e})},[i,e]);return a({shouldResetCustomerInfo:!0,onClick:o})}var f=(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))(f||{});const p="pickup-locations-modal",l=/Shop App\/[^/]+\/(?:iOS|Android)\//i;function m(e){return/Android/i.test(e)?"android":"ios"}function w(e=("undefined"==typeof window?"":window.navigator.userAgent),n,t){return t&&"web"!==t?m(e):n&&"WEB"!==n?/android/i.test(n)?"android":"ios":l.test(e)||"undefined"!=typeof window&&window.ReactNativeWebView?m(e):"web"}function h(e){return/iPad/i.test(e)||/Android/i.test(e)&&!/Mobile/i.test(e)||function(e){if(!/Macintosh/i.test(e))return!1;if("undefined"==typeof window||!window.navigator)return!1;const n=window.navigator.maxTouchPoints;return"number"==typeof n&&n>1}(e)}function v(e=("undefined"==typeof window?"":window.navigator.userAgent),n,t){return"web"!==w(e,n,t)?function(e){return/iPad|Macintosh|Linux; Android/i.test(e)}(e)&&h(e)?"tablet":"mobile":h(e)?"tablet":function(e){return/iPhone|iPod/i.test(e)||/Android/i.test(e)&&/Mobile/i.test(e)}(e)?"mobile":"desktop"}function b(e,n,t,i={}){const{embedPlatform:o,shopAppSurface:r}=i;return{...s(e,n,t),platform:w(void 0,o,r),deviceType:v(void 0,o,r)}}function y(e){for(const n of e)if("not_required"!==n.status)for(const e of n.methods)if(e.handle===n.selectedDeliveryMethodHandle)return e}export{f as I,p as P,u as a,y as f,b as g,c as u};