PageSourceSearch

https://shop.barnsdalegardens.co.uk/cdn/shopifycloud/checkout-web/assets/c1/8498e76b.QkOh7Vlw.js

js barnsdalegardens.co.uk collected 2026-10-02 12:09:31 UTC 23,601 bytes, 1 lines download raw bytes

1import{a as e}from"./2c1ab0fe.GMbxnz74.js";import{ay as t,eQ as r,eR as a,eS as n,eT as i,cC as o,ag as s,eU as d,V as c,az as l,aB as u,ae as p}from"./4c290a1e.C6TDJ9Fn.js";import{h as m,e as h,g as y,p as g,b as f,o as P,t as b,c as v}from"./2255f8fa.BCU-NIF_.js";import{e as T}from"./05a2a9c8.BOU7FMWw.js";import"./app.CepNJbvh.js";class A extends Error{constructor(){super(...arguments),this.name="ReceiptError"}}function k(o,s={pollingTimeoutReached:!1,skipToThankYouPage:!1,waitingForPostPurchaseDone:!1}){if(m(o))return h(o);switch(o.__typename){case"ProcessingRemoteCheckoutsReceipt":return{status:"processing_remote_checkouts",id:o.id,pollAt:Date.now()+o.pollDelay+i,remoteCheckouts:(S=o.remoteCheckouts,S.map(t=>{switch(t.__typename){case"SubmittingRemoteCheckout":return{status:"submitting",shopId:t.shopId};case"SubmittedRemoteCheckout":return{status:"submitted",shopId:t.shopId};case"FailedRemoteCheckout":return{status:"failed",shopId:t.shopId};default:return e(t)}}))};case"ProcessedReceipt":{if(o.postPurchasePageRequested&&"NOT_READY"===o.postPurchaseVaultedPaymentMethodStatus&&!s.pollingTimeoutReached)return{status:"polling_for_order",id:o.id,token:o.token};const e={amount:parseFloat(o.purchaseOrder.totalAmountToPay.amount),currencyCode:o.purchaseOrder.totalAmountToPay.currencyCode},i=y(o.purchaseOrder.note);return{status:"processed",id:o.id,token:o.token,redirectUrl:o.redirectUrl||null,mapUrl:o.mapUrl??null,mapVisibility:o.mapVisibility,confirmationPage:{url:o.confirmationPage.url,shouldRedirect:o.confirmationPage.shouldRedirect},analytics:{checkoutCompletedEventId:o.analytics?.checkoutCompletedEventId||null,emitConversionEvent:o.analytics?.emitConversionEvent||!1},orderIdentity:{buyerIdentifier:o.orderIdentity.buyerIdentifier,id:o.orderIdentity.id},paymentDetails:{paymentCardBrand:o.paymentDetails?.paymentCardBrand,creditCardLastFourDigits:o.paymentDetails?.creditCardLastFourDigits,paymentAmount:o.paymentDetails?.paymentAmount?.amount,paymentCurrency:o.paymentDetails?.paymentAmount?.currencyCode,paymentGateway:o.paymentDetails?.paymentGateway,financialPendingReason:o.paymentDetails?.financialPendingReason,paymentDescriptor:o.paymentDetails?.paymentDescriptor,buyerActionInfo:o.paymentDetails?.buyerActionInfo??void 0,paymentIcon:o.paymentDetails?.paymentIcon,installmentDetails:o.paymentDetails?.installmentDetails??void 0},purchaseOrder:{email:O(o.purchaseOrder.buyerIdentity),phone:R(o.purchaseOrder.buyerIdentity),checkoutCompletionTarget:o.purchaseOrder.checkoutCompletionTarget,shippingAddress:M(o.purchaseOrder.delivery,o.completedRemoteCheckouts),billingAddress:C(o.purchaseOrder.payment,o.completedRemoteCheckouts),paymentLines:E(o.purchaseOrder.payment.paymentLines),deliveryNext:D(o.purchaseOrder.delivery,i,o.completedRemoteCheckouts),deliveryExpectations:(u=o.purchaseOrder.deliveryExpectations,u?{status:"filled",deliveryExpectationLines:u.map(e=>({deliveryOptionHandle:void 0,deliveryStrategyHandle:e.deliveryStrategyHandle,brandedPromise:e.brandedPromise?{name:e.brandedPromise.name,logoUrl:e.brandedPromise.logoUrl,handle:e.brandedPromise.handle,darkThemeLogoUrl:e.brandedPromise.darkThemeLogoUrl,lightThemeLogoUrl:e.brandedPromise.lightThemeLogoUrl}:void 0,minDeliveryDateTime:void 0,maxDeliveryDateTime:void 0,deliveryExpectationPresentmentTitle:e.deliveryExpectationPresentmentTitle,promiseProviderApiClientId:void 0,returnability:e.returnability?.returnable}))}:{status:"unavailable",deliveryExpectationLines:null}),paymentDue:g(o.purchaseOrder.payment,e),runningTotal:e,merchandiseLines:T(o.purchaseOrder.merchandise),totalTaxes:o.purchaseOrder.tax.totalTaxAmountV2?B(o.purchaseOrder.tax.totalTaxAmountV2):void 0,metafields:o.purchaseOrder.metafields,cartMetafields:o.purchaseOrder.cartMetafields},purchaseOrderNumber:o.poNumber??void 0,orderStatusPageUrl:o.orderStatusPageUrl,orderCreationStatus:(l=o.orderCreationStatus,"OrderCreationSucceeded"===l.__typename?{status:"created"}:{status:"processing"}),postPurchasePageUrl:o.postPurchasePageUrl,postPurchaseVaultingStatus:F(o.postPurchaseVaultedPaymentMethodStatus),postPurchasePageRequested:o.postPurchasePageRequested,shopPayArtifact:{optIn:o.purchaseOrder.shopPayArtifact?.optIn??void 0},shopAppLinksAndResources:{qrCodeUrl:o.shopAppLinksAndResources.qrCodeUrl,mobileUrl:o.shopAppLinksAndResources.mobileUrl,orderTrackingMobileUrl:o.shopAppLinksAndResources?.orderTrackingMobileUrl??void 0,canTrackOrderUpdates:o.shopAppLinksAndResources.canTrackOrderUpdates,shopInstallmentsViewSchedules:o.shopAppLinksAndResources.shopInstallmentsViewSchedules,installmentsHighlightEligible:o.shopAppLinksAndResources.installmentsHighlightEligible,shopInstallmentsMobileUrl:o.shopAppLinksAndResources.shopInstallmentsMobileUrl,mobileUrlAttributionPayload:o.shopAppLinksAndResources.mobileUrlAttributionPayload,shopAppEligible:o.shopAppLinksAndResources.shopAppEligible,payEscrowMayExist:Boolean(o.shopAppLinksAndResources.payEscrowMayExist),shopAppQrCodeKillswitch:o.shopAppLinksAndResources.shopAppQrCodeKillswitch,shopPayOrder:o.shopAppLinksAndResources.shopPayOrder,buyerHasShopApp:o.shopAppLinksAndResources?.buyerHasShopApp??void 0,buyerHasShopPay:o.shopAppLinksAndResources?.buyerHasShopPay??void 0,buyerHasOrderTrackingPush:o.shopAppLinksAndResources?.buyerHasOrderTrackingPush??void 0,orderTrackingPushCtaVariant:o.shopAppLinksAndResources?.orderTrackingPushCtaVariant??void 0,orderUpdateOptions:o.shopAppLinksAndResources.orderUpdateOptions,giveawayAmount:o.shopAppLinksAndResources.giveawayAmount?{amount:parseFloat(o.shopAppLinksAndResources.giveawayAmount.amount),currencyCode:o.shopAppLinksAndResources.giveawayAmount.currencyCode}:void 0},skipToThankYouPage:Boolean(s.skipToThankYouPage),waitingForPostPurchaseDone:!1,eligibleForMarketingOptIn:o.eligibleForMarketingOptIn,paymentExtensionBrand:o.paymentExtensionBrand,lpmDisclosure:o.lpmDisclosure??void 0,recurringTotals:n(o.purchaseOrder.recurringTotals),deferredTotal:a(o.purchaseOrder.deferredTotal??void 0),checkoutTotalBeforeTaxesAndShipping:o.purchaseOrder.checkoutTotalBeforeTaxesAndShipping?t(o.purchaseOrder.checkoutTotalBeforeTaxesAndShipping):void 0,checkoutTotal:t(o.purchaseOrder.checkoutTotal),checkoutTotalTaxes:o.purchaseOrder.checkoutTotalTaxes?t(o.purchaseOrder.checkoutTotalTaxes):void 0,taxes:b({...o.purchaseOrder.tax,totalTaxAmount:o.purchaseOrder.tax.totalTaxAmountV2??void 0}),legacyRepresentProductsAsFees:o.purchaseOrder.legacyRepresentProductsAsFees,totalSavings:t(o.purchaseOrder.totalSavings),subtotal:t(o.purchaseOrder.subtotalBeforeTaxesAndShipping),landedCostDetails:o.purchaseOrder.landedCostDetails?.incotermInformation??void 0,dutiesIncluded:o.purchaseOrder.dutiesIncluded??void 0,duties:(c=o.purchaseOrder.tax.totalDutyAmount,c?{status:"available_total",totalDuty:t(c)}:{status:"unavailable",reason:""}),paymentFlexibilityPaymentTermsTemplate:o.paymentFlexibilityPaymentTermsTemplate??void 0,optionalDuties:o.purchaseOrder.optionalDuties?P(o.purchaseOrder.optionalDuties):void 0,discountLines:(d=o.purchaseOrder.discounts,{lines:d.lines.map(V).filter(e=>Boolean(e))}),tipLines:(k=o.purchaseOrder.tip,k.tipLines.map(e=>({amount:t(e.amount)}))),hasOnlyDeferredShipping:o.purchaseOrder.hasOnlyDeferredShipping,acceptEmailMarketing:(v=o.purchaseOrder.buyerIdentity,G(v)??v.marketingConsent.some(e=>"PurchaseOrderEmailContactMethod"===e.__typename)),acceptSmsMarketing:N(o.purchaseOrder.buyerIdentity),smsMarketingPhone:H(o.purchaseOrder.buyerIdentity),note:o.purchaseOrder.note.message??void 0,paymentMethods:W(o.purchaseOrder.payment.paymentLines),customerId:o.customerId??void 0,isFirstOrder:o.isFirstOrder??void 0,isRedacted:o.isRedacted,buyerIdentity:o.purchaseOrder.buyerIdentity?f(o.purchaseOrder.buyerIdentity):void 0,subtotalAfterMerchandiseDiscounts:o.purchaseOrder.subtotalAfterMerchandiseDiscounts?t(o.purchaseOrder.subtotalAfterMerchandiseDiscounts):void 0,subtotalBeforeReductions:t(o.purchaseOrder.subtotalBeforeReductions),customAttributes:o.purchaseOrder.note?.customAttributes??void 0,legacySubtotalBeforeTaxesShippingAndFees:t(
1o.purchaseOrder.legacySubtotalBeforeTaxesShippingAndFees),legacyMerchandiseLinesAsFees:r(o.purchaseOrder.legacyAggregatedMerchandiseTermsAsFees),consolidatedProposedSubtotalBeforeTaxesAndShipping:o.consolidatedProposedSubtotalBeforeTaxesAndShipping?t(o.consolidatedProposedSubtotalBeforeTaxesAndShipping):void 0,completedRemoteCheckouts:j(o.completedRemoteCheckouts),remotePaymentDue:g(o.purchaseOrder.payment,o.consolidatedTotals?.runningTotal?t(o.consolidatedTotals.runningTotal):void 0),consolidatedTotals:o.consolidatedTotals?(p=o.consolidatedTotals,{total:t(p.runningTotal),runningTotal:t(p.runningTotal),subtotal:t(p.subtotalBeforeTaxesAndShipping),subtotalBeforeReductions:t(p.subtotalBeforeReductions),totalSavings:t(p.totalSavings),checkoutTotalTaxes:p.checkoutTotalTaxes?t(p.checkoutTotalTaxes):void 0,checkoutTotalBeforeTaxesAndShipping:p.checkoutTotalBeforeTaxesAndShipping?t(p.checkoutTotalBeforeTaxesAndShipping):void 0,checkoutTotal:p.checkoutTotal?t(p.checkoutTotal):void 0}):void 0,consolidatedTaxes:o.consolidatedTaxes?_(o.consolidatedTaxes,o.completedRemoteCheckouts):void 0,remoteMerchandiseDetails:K(o.completedRemoteCheckouts)}}default:throw new A(`Unknown receipt type: ${o.__typename}`)}var d,c,l,u,p,v,k,S}function O(e){const{contactMethod:t}=e;return"PurchaseOrderEmailContactMethod"===t?.__typename?t.email:void 0}function R(e){const{contactMethod:t}=e;return"PurchaseOrderSMSContactMethod"===t?.__typename?t.phoneNumber:void 0}function M(e,t){const r=e.deliveryLines.find(e=>e.destinationAddress)?.destinationAddress,a="StreetAddress"===r?.__typename?s(r):void 0;if(a)return a;const n=t?.find(e=>"SubmittedRemoteCheckout"===e.__typename)?.processedRemoteReceipt.remotePurchaseOrder.delivery.deliveryLines.find(e=>e.destinationAddress)?.destinationAddress;return"StreetAddress"===n?.__typename?s(n):void 0}function C(e,t){const r=e.billingAddress&&"address1"in e.billingAddress?e.billingAddress:void 0,a=e.paymentLines.find(e=>"WalletPaymentMethod"===e.paymentMethod.__typename);if(a)return function(e,t){if("WalletPaymentMethod"!==e?.paymentMethod?.__typename)return;if("FacebookPayWalletContent"===e?.paymentMethod?.walletContent.__typename)return;const r=e?.paymentMethod?.walletContent.billingAddress??t??void 0;return r?s(r):void 0}(a,r);const n=e.paymentLines.map(e=>e.paymentMethod).filter(e=>"billingAddress"in e),i=n.find(e=>e.billingAddress&&"address1"in e.billingAddress)?.billingAddress??r??void 0,o=i?s(i):void 0;if(o)return o;for(const d of t??[]){if("SubmittedRemoteCheckout"!==d.__typename)continue;const e=d.processedRemoteReceipt.remotePurchaseOrder.payment;for(const r of e.paymentLines){const e=r.paymentMethod,t="DirectPaymentMethod"===e.__typename?e.billingAddress:void 0;if(t&&"address1"in t)return s(t)}const t=e.billingAddress;if(t&&"address1"in t)return s(t)}}function S(e){if("PickupInStoreLocation"===e?.__typename||"PickupPointLocation"===e?.__typename){if("PickupPointLocation"===e?.__typename){const{name:t,carrierCode:r,carrierName:a,carrierLogoUrl:n,fromDeliveryOptionGenerator:i,address:o}=e;return{name:t,address:s(o),carrierName:a,carrierCode:r,carrierLogoUrl:n,fromDeliveryOptionGenerator:i,type:e?.__typename}}return{name:e.name,address:s(e.address),instructions:e.instructions,type:e?.__typename}}}function _(e,t){if(!t)return;const r=new Map;for(const a of t)"SubmittedRemoteCheckout"===a.__typename&&r.set(a.shopId,b({...a.processedRemoteReceipt.remotePurchaseOrder.tax,totalTaxAmount:a.processedRemoteReceipt.remotePurchaseOrder.tax.totalTaxAmountV2??void 0}));return{perShopTaxes:r,consolidatedTaxes:v(e)}}function I(e,r){if(e)return e.map(({amount:e,discountRecurringCycleLimit:a,excludeFromDeliveryOptionPrice:n,targetMerchandise:i,flatRateGroupId:o})=>({amount:t(e),discountRecurringCycleLimit:a??void 0,excludeFromDeliveryOptionPrice:n,targetMerchandiseLines:x(i,r),flatRateGroupId:o??void 0}))}function x(e,t){return e.reduce((e,r)=>{if("PurchaseOrderMerchandiseLine"!==r.__typename&&"PurchaseOrderBundleLineComponent"!==r.__typename)return e;const{stableId:a,merchandise:n,quantity:i}=r;if("ProductVariantSnapshot"===n.__typename){const r=Y(i),o=n.image?{...n.image,altText:n.image.altText||void 0}:void 0;return[...e,{id:n.variantId,digest:n.digest,title:n.productTitle,stableId:a,requiresShipping:!t&&(n.requiresShipping??!0),properties:u(n.properties),subtitle:n.title??void 0,sellingPlan:l(n.sellingPlan),quantity:r,image:o}]}return e},[])}function D(e,r,a){const n=e.deliveryLines.map(e=>function(e,r){const a={amountCombinabilityToken:e.deliveryStrategy.amountCombinabilityToken,deliveryPresentationGroupToken:e.deliveryStrategy.deliveryPresentationGroupToken,handle:e.deliveryStrategy.handle,title:e.deliveryStrategy.title,de
1scription:e.deliveryStrategy.description??void 0,cost:t(e.lineAmount),costAfterDiscounts:t(e.lineAmountAfterDiscounts),estimatedTimeInTransit:void 0,methodType:e.deliveryStrategy.methodType,brandedPromise:e.deliveryStrategy.brandedPromise,pickupLocation:S(e.deliveryStrategy.pickupLocation),deliveryPromisePresentmentTitle:e.deliveryStrategy.deliveryPromisePresentmentTitle,metafields:[],priceBreakdown:I(e.deliveryStrategy.deliveryStrategyBreakdown,r),deliveryPredictionEligible:!1};return a&&"NONE"!==a.methodType?{status:"available",methods:[a],selectedDeliveryMethodHandle:a.handle,type:e.groupType,targetMerchandiseLines:x(e.targetMerchandise,r),availableOn:e.availableOn}:{status:"not_required",type:e.groupType,targetMerchandiseLines:x(e.targetMerchandise,r)}}(e,r)),i=function(e){const r=e?.filter(e=>"SubmittedRemoteCheckout"===e.__typename);return r&&0!==r.length?r.flatMap(e=>e.processedRemoteReceipt.remotePurchaseOrder.delivery.deliveryLines.filter(e=>"NONE"!==e.deliveryStrategy.methodType).map(e=>function(e){return{status:"available",methods:[{cost:t(e.lineAmount),costAfterDiscounts:t(e.lineAmount),deliveryPredictionEligible:!1,estimatedTimeInTransit:void 0,handle:e.deliveryStrategy.handle,metafields:[],methodType:e.deliveryStrategy.methodType,title:e.deliveryStrategy.title}],selectedDeliveryMethodHandle:e.deliveryStrategy.handle,type:e.groupType,targetMerchandiseLines:(r=e.targetMerchandise,r.reduce((e,t)=>{if("PurchaseOrderMerchandiseLine"!==t.__typename)return e;const{stableId:r,merchandise:a,quantity:n}=t;if("ProductVariantSnapshot"===a.__typename){const t=Y(n);return[...e,{digest:a.digest,title:a.productTitle,stableId:r,requiresShipping:a.requiresShipping,properties:[],quantity:t}]}return e},[])),availableOn:e.availableOn};var r}(e))):[]}(a);return{status:"filled",lines:[...n,...i],splitShippingToggle:e.splitShippingToggle}}function L(e,t){const r="PurchaseOrderGiftCardPaymentMethod"===e.paymentMethod.__typename,a="PurchaseOrderGiftCardPaymentMethod"===t.paymentMethod.__typename;return r&&!a?-1:!r&&a?1:0}function E(e){return e.filter(e=>!e.due).sort(L).map(e=>({...w(e.paymentMethod),cost:B(e.amount),specialInstructions:e.postPaymentMessage??void 0}))}function B(e){if(null!=e)return{amount:parseFloat(e.amount),currencyCode:e.currencyCode}}function w(e){switch(e.__typename){case"DirectPaymentMethod":return{method:{type:"direct",sessionId:e.sessionId,paymentMethodIdentifier:e.paymentMethodIdentifier??"",brand:e.creditCard?.brand??void 0,creditCardLastFourDigits:e.creditCard?.lastDigits??void 0,vaultingAgreement:e.vaultingAgreement}};case"CustomerCreditCardPaymentMethod":return{method:{type:c.CreditCard,id:e.id,token:e.token,billingAddress:s(e.billingAddress),brand:e.brand,firstDigits:e.firstDigits??void 0,displayLastDigits:e.displayLastDigits,defaultPaymentMethod:e.defaultPaymentMethod,deletable:e.deletable,requiresCvvConfirmation:e.requiresCvvConfirmation}};case"PaymentOnDeliveryMethod":return{method:{type:"paymentOnDelivery",additionalDetails:e.additionalDetails??"",paymentInstructions:e.paymentInstructions??"",paymentMethodIdentifier:e.paymentMethodIdentifier??"",availablePresentmentCurrencies:[]}};case"PurchaseOrderGiftCardPaymentMethod":return{method:{type:"giftCard",code:e.code,balance:B(e.balance)}};case"WalletPaymentMethod":return{method:{type:"wallet",name:e.name,walletContent:U(e.walletContent)}};case"WalletsPlatformPaymentMethod":return{method:{type:"walletsPlatformPaymentMethod",name:e.name,walletParams:e.walletParams}};case"LocalPaymentMethod":return{method:{type:"local",paymentMethodIdentifier:e.paymentMethodIdentifier??"",name:e.name}};case"DeferredPaymentMethod":return{method:{type:"deferred"}};case"ManualPaymentMethod":return{method:{type:"manualPayment",name:e.name,id:e.id,additionalDetails:e.additionalDetails??"",paymentInstructions:e.paymentInstructions??"",paymentMethodIdentifier:e.paymentMethodIdentifier??"",availablePresentmentCurrencies:[]}};case"CustomPaymentMethod":return{method:{type:"customManualPayment",name:e.name,id:e.id,additionalDetails:e.additionalDetails??"",paymentInstructions:e.paymentInstructions??"",paymentMethodIdentifier:e.paymentMethodIdentifier??"",availablePresentmentCurrencies:[]}};case"PaypalBillingAgreementPaymentMethod":return{method:{type:c.PayPal,token:e.token,billingAddress:s(e.billingAddress)}};case"OffsitePaymentMethod":return{method:{type:"offsite",paymentMethodIdentifier:e.paymentMethodIdentifier??void 0,name:e.name}};case"RedeemablePaymentMethod":switch(e.redemptionSource){case"CUSTOM":case"SHOP_CASH":return{method:{type:"redeemable",redemptionSource:e.redemptionSource,redemptionContent:e.redemptionContent}};default:return{method:{type:"redeemable",redemptionSource:e.redemptionSource}}}case"CustomOnsitePaymentMethod":return{method:{type:"customOnsite",paymentMethodIdentifier:e.paymentMethodIdentifier??void 0,name:e.name}};case"BankPaymentInstrument":return{method:{type:"bank",paymentMethodIdentifier:e.paymentMethodIdentifier,lastDigits:e.lastDigits??"",bankName:e.bankName??""}};case"ShopWalletPaymentInstrument":return{method:{type:"shopWallet"}};default:return{method:{type:"other"}}}}function U(e){switch(e.__typename){case"ShopifyInstallmentsWalletContent":return{autoPayEnabled:e.autoPayEnabled,billingAddress:p(e.billingAddress),disclosureDetails:e.disclosureDetails,installmentsToken:e.installmentsToken,creditCardBrand:e.creditCard?.brand??void 0,creditCardLastFourDigits:e.creditCard?.lastDigits??void 0};case"ShopPayWalletContent":return{billingAddress:p(e.billingAddress),paymentMethod:e.paymentMethod,paymentAttributes:e.paymentAttributes,paymentMethodIdentifier:e.paymentMethodIdentifier}}}function F(e){switch(e){case"READY":return"ready";case"NOT_READY":return"notReady";case"EXPIRED":return"expired";case"DISABLED_FEATURE":return"disabled"}}function V(e){switch(e.discount.__typename){case"CustomDiscount":return{title:e.discount.title,de
1scription:e.discount.description??void 0,amount:t(e.lineAmount),allocations:q([...e.deliveryAllocations,...e.merchandiseAllocations]),discount:d(e.discount)};case"CodeDiscount":case"AutomaticDiscount":return{title:e.discount.title,amount:t(e.lineAmount),allocations:q([...e.deliveryAllocations,...e.merchandiseAllocations]),discount:d(e.discount)};case"DiscountCodeTrigger":return{title:e.discount.code,discount:d(e.discount)};default:return}}function q(e){return e.map(e=>({target:{index:e.index,amount:t(e.amount),stableId:e.stableId,type:e.targetType}}))}function N(e){return G(e)??e.marketingConsent.some(e=>"PurchaseOrderSMSContactMethod"===e.__typename)}function H(e){const t=e.marketingConsent.find(e=>"PurchaseOrderSMSContactMethod"===e.__typename);return t?.phoneNumber??""}function G(e){return"DecodedCustomerProfile"===e.customer?.__typename||"BusinessCustomerProfile"===e.customer?.__typename?e.customer.acceptsEmailMarketing:void 0}function W(e){const t=function(e){const t=e.map(e=>e.paymentMethod).find(e=>"LocalPaymentMethod"===e.__typename);if(t)return{type:"local",name:t.name,displayName:t.displayName??"",paymentMethodIdentifier:t.paymentMethodIdentifier??"",orderingIndex:Number.MAX_SAFE_INTEGER}}(e);return t?[t]:[]}function Y(e){return"number"==typeof e?e:"PurchaseOrderMerchandiseQuantityByItem"===e.__typename?e.items:0}function j(r){if(r)return r.map(r=>{switch(r.__typename){case"SubmittedRemoteCheckout":return{status:"submitted",shopId:r.shopId,checkoutSessionToken:r.checkoutSessionToken,orderIdentity:{id:r.processedRemoteReceipt.orderIdentity.id,buyerIdentifier:r.processedRemoteReceipt.orderIdentity.buyerIdentifier},orderStatusPageUrl:r.processedRemoteReceipt.orderStatusPageUrl,remotePurchaseOrder:{paymentLines:E(r.processedRemoteReceipt.remotePurchaseOrder.payment.paymentLines.filter(e=>"DirectPaymentMethod"===e.paymentMethod.__typename)),deliveryLines:(i=r.processedRemoteReceipt.remotePurchaseOrder.delivery.deliveryLines,i.filter(({deliveryStrategy:e})=>"NONE"!==e.methodType).map(({deliveryStrategy:{handle:e,title:r},lineAmount:a})=>({handle:e,title:r,lineAmount:t(a)}))),merchandiseLines:Q(r.processedRemoteReceipt.remotePurchaseOrder.merchandise.merchandiseLines),checkoutTotal:t(r.processedRemoteReceipt.remotePurchaseOrder.checkoutTotal),subtotalBeforeTaxesAndShipping:t(r.processedRemoteReceipt.remotePurchaseOrder.subtotalBeforeTaxesAndShipping),tax:r.processedRemoteReceipt.remotePurchaseOrder.tax.totalTaxAmountV2?B(r.processedRemoteReceipt.remotePurchaseOrder.tax.totalTaxAmountV2):void 0}};case"FailedRemoteCheckout":return{status:"failed",shopId:r.shopId,checkoutSessionToken:r.checkoutSessionToken,recoveryUrl:r.recoveryUrl,merchandiseLines:r.failedRemoteReceipt?Q(r.failedRemoteReceipt.remotePurchaseOrder.merchandise.merchandiseLines):(n=r.negotiatedProposal.merchandise,"FilledMerchandiseTerms"!==n.__typename?[]:n.merchandiseLines.map(e=>{if("ProductVariantMerchandise"!==e.merchandise.__typename&&"ContextualizedProductVariantMerchandise"!==e.merchandise.__typename)return;const r="ProposalMerchandiseQuantityByItem"===e.quantity?.__typename&&"IntValueConstraint"===e.quantity.items?.__typename?e.quantity.items.value:0;return{stableId:e.stableId,quantity:r,title:e.merchandise.subtitle??null,productTitle:e.merchandise.title,image:e.merchandise.image?{url:e.merchandise.image.url,...e.merchandise.image.altText&&{altText:e.merchandise.image.altText}}:null,price:t(e.totalAmount)}}).filter(e=>Boolean(e))),checkoutTotal:r.failedRemoteReceipt?t(r.failedRemoteReceipt.remotePurchaseOrder.checkoutTotal):(a=r.negotiatedProposal,"MoneyValueConstraint"===a.checkoutTotal?.__typename?t(a.checkoutTotal):t(a.runningTotal)),subtotalBeforeTaxesAndShipping:r.failedRemoteReceipt?t(r.failedRemoteReceipt.remotePurchaseOrder.subtotalBeforeTaxesAndShipping):t(r.negotiatedProposal.subtotalBeforeTaxesAndShipping),tax:r.failedRemoteReceipt?.remotePurchaseOrder.tax.totalTaxAmountV2?B(r.failedRemoteReceipt?.remotePurchaseOrder.tax.totalTaxAmountV2):z(r.negotiatedProposal)};default:return e(r)}var a,n,i})}function Q(e){return e.map(({quantity:{items:e},merchandise:r,stableId:a})=>({stableId:a,quantity:e,title:r.title??null,productTitle:r.productTitle,image:r.image?{url:r.image.url,altText:r.image.altText??void 0}:null,price:t(r.price)}))}function z(e){const t=b(e.tax);if("available_total"===t.status)return t.totalTax}function K(e){if(!e)return;const r=new Map,a=[];for(const n of e)"SubmittedRemoteCheckout"===n.__typename&&n.processedRemoteReceipt.remotePurchaseOrder.merchandise.merchandiseLines.forEac
1h(e=>{const i=t(e.merchandise.price);r.set(e.stableId,n.shopId),a.push({...e,lineAmount:{__typename:"Money",amount:o(i.amount*e.quantity.items).toString(),currencyCode:i.currencyCode},legacyFee:!1,lineAllocations:[],lineComponents:[]})});return{stableIdToShopId:r,mergedBuyerProposalMerchandise:{__typename:"PurchaseOrderMerchandiseTerms",merchandiseLines:a}}}export{k as receiptForUI};

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.