1(()=>{"use strict";var e={1669:e=>{e.exports=jQuery}},t={};function a(n){var r=t[n];if(void 0!==r)return r.exports;var o=t[n]={exports:{}};return e[n](o,o.exports,a),o.exports}var n=a(1669);function r(e,t){if("buy_now"===e){const e=t?.closest?.(".edd_download_purchase_form");return e?e.querySelector(".edd-paypal-checkout-buy-now-error-wrapper"):null}return document.getElementById("edd-paypal-errors-wrap")}function o(e,t="checkout",a=null){const o=r(t,a);if(!o||!e)return;const d="string"==typeof e&&e.includes("<")?e:`<div class="edd-alert edd-alert-error"><p class="edd_error">${e}</p></div>`;o.innerHTML=d,void 0!==n&&n(document.body).trigger("edd_checkout_error",[d])}function d(e="checkout",t=null){const a=r(e,t);a&&(a.innerHTML="")}function i(){return document.getElementById("edd_purchase_form")}function s(e=i()){return Object.fromEntries(new FormData(e))}const l={fastlane:null,paymentComponent:null,isProcessing:!1,init:async function(){if(eddPayPalVars.clientToken&&document.getElementById("edd-fastlane-container"))try{this.fastlane=await paypal.Fastlane(),globalThis.eddPayPalFastlane=this.fastlane,await this.renderPaymentComponent(),await this.renderWatermark(),this.bindEmailLookup(),this.bindSubmitHandler(),this.showFastlaneUI()}catch(e){console.warn("PayPal Fastlane unavailable:",e),this.hideFastlaneUI()}},renderPaymentComponent:async function(){document.getElementById("edd-fastlane-card-container")&&(this.paymentComponent=await this.fastlane.FastlanePaymentComponent(),this.paymentComponent.render("#edd-fastlane-card-container"))},renderWatermark:async function(){document.getElementById("edd-fastlane-watermark")&&(await this.fastlane.FastlaneWatermarkComponent({includeAdditionalInfo:!0})).render("#edd-fastlane-watermark")},bindEmailLookup:function(){const e=document.getElementById("edd-email");if(!e)return;let t="";e.addEventListener("blur",(async()=>{const a=e.value.trim();if(a&&a!==t){t=a;try{const{customerContextId:e}=await this.fastlane.identity.lookupCustomerByEmail(a);if(e){const t=await this.fastlane.identity.triggerAuthenticationFlow(e);"succeeded"===t.authenticationState&&t.profileData&&this.applyProfileData(t.profileData)}}catch(e){console.warn("Fastlane identity lookup failed:",e)}}})),e.value.trim()&&e.dispatchEvent(new Event("blur"))},applyProfileData:function(e){if(e.name){const t=i(),a=t.querySelector('[name="edd_first"]')||document.getElementById("edd-first"),n=t.querySelector('[name="edd_last"]')||document.getElementById("edd-last");a&&e.name.firstName&&this.setFieldValue(a,e.name.firstName),n&&e.name.lastName&&this.setFieldValue(n,e.name.lastName)}},setFieldValue:function(e,t){e.value=t,e.dispatchEvent(new Event("input",{bubbles:!0})),e.dispatchEvent(new Event("change",{bubbles:!0}))},bindSubmitHandler:function(){const e=document.getElementById("edd-fastlane-submit");e&&e.addEventListener("click",(async e=>{if(e.preventDefault(),this.isProcessing)return;const t=document.getElementById("edd_purchase_form");if(!t||t.reportValidity()){this.isProcessing=!0,this.clearErrors(),this.showSpinner();try{const e=await this.paymentComponent.getPaymentToken(),t=e.id,a=e.paymentSource?.card?.authenticationInsight?.clientMetadataId??"",n=this.collectFormData(),r=await fetch(eddPayPalVars.restBase+"process-payment",{method:"POST",headers:{"Content-Type":"application/json","X-EDD-Cart-Token":eddPayPalVars.cartToken,"X-EDD-Cart-Timestamp":eddPayPalVars.cartTimestamp},body:JSON.stringify({payment_token:t,metadata_id:a,form_data:n})}),o=await r.json();if(r.ok&&o.redirect_url)return void(globalThis.location=o.redirect_url);const d=o.message??o.data?.message??eddPayPalVars.defaultError;this.showError(d)}catch(e){"FastlaneError"===e?.name||/user entered bad data/i.test(e?.message??"")?this.showError(eddPayPalVars.fastlaneValidationError??eddPayPalVars.defaultError):(console.error("Fastlane payment error:",e),this.showError(eddPayPalVars.defaultError))}finally{this.isProcessing=!1,this.hideSpinner()}}}))},collectFormData:function(){return s()},showFastlaneUI:function(){const e=document.getElementById("edd-fastlane-submit"),t=document.getElementById("edd-fastlane-divider");e&&(e.style.display=""),t&&(t.style.display="")},hideFastlaneUI:function(){const e=document.getElementById("edd-fastlane-container"),t=document.getElementById("edd-fastlane-divider");e&&(e.style.display="none"),t&&(t.style.display="none")},showSpinner:function(){const e=document.getElementById("edd-fastlane-spinner"),t=document.getElementById("edd-fastlane-submit");e&&(e.style.display=""),t&&(t.disabled=!0)},hideSpinner:function(){const e=document.getElementById("edd-fastlane-spinner"),t=document.getElementById("edd-fastlane-submit");e&&(e.style.display="none"),t&&(t.disabled=!1)},showError:function(e){o(e)},clearErrors:function(){d()}},c={walletType:"",containerId:"",startProcessing:function(){const e=document.getElementById("edd_purchase_submit")||document.getElementById(this.containerId)?.parentElement;e&&e.classList.add("edd-paypal-processing"),this.clearErrors(),this.showSpinner()},stopProcessing:function(){const e=document.getElementById("edd_purchase_submit")||document.getElementById(this.containerId)?.parentElement;e&&e.classList.remove("edd-paypal-processing"),this.hideSpinner()},showSpinner:function(){const e=document.getElementById("edd-paypal-spinner");e&&(e.style.display="block")},hideSpinner:function(){const e=document.getElementById("edd-paypal-spinner");e&&(e.style.display="none")},showError:function(e){o(e)},clearErrors:function(){d()},createPayPalOrder:async function(e){if(!e)return null;const t=new FormData(e);t.append("edd_paypal_wallet_type",this.walletType);const a=await fetch(edd_scripts.ajaxurl,{method:"POST",body:t}),n=await a.json(),r=n?.data?.paypal_order_id;return r?{orderId:r,total:n.data.total||"0.00",currency:n.data.currency||"USD"}:{error:this.extractErrorMessage(n)}},extractErrorMessage:function(e){return e&&"string"==typeof e.data?e.data:"string"==typeof e?e:""}
1,captureOrder:async function(e){const t=document.getElementById("edd_purchase_form"),a=t?.querySelector('input[name="edd_process_paypal_nonce"]'),n=t?.querySelector('input[name="edd-process-paypal-token"]'),r=new FormData;r.append("action",eddPayPalVars.approvalAction||"edd_capture_paypal_order"),r.append("paypal_order_id",e),a&&r.append("edd_process_paypal_nonce",a.value),n&&(r.append("token",n.dataset.token),r.append("timestamp",n.dataset.timestamp));const o=await fetch(edd_scripts.ajaxurl,{method:"POST",body:r}),d=await o.json();d?.success&&d.data?.redirect_url&&(globalThis.location=d.data.redirect_url)}},p={...c,walletType:"apple_pay",containerId:"edd-paypal-applepay-container",applepay:null,config:null,init:async function(){if(void 0===globalThis.paypal||"function"!=typeof globalThis.paypal.Applepay)return;if(void 0===globalThis.ApplePaySession||!globalThis.ApplePaySession.canMakePayments())return;const e=document.getElementById(this.containerId);if(e)try{if(this.applepay=paypal.Applepay(),this.config=await this.applepay.config(),!this.config.isEligible)return;this.renderButton(e)}catch(e){console.warn("EDD PayPal Apple Pay unavailable:",e)}},renderButton:function(e){const t=document.createElement("apple-pay-button");t.setAttribute("buttonstyle","black"),t.setAttribute("type","plain"),t.setAttribute("locale",this.normalizeLocale()),t.addEventListener("click",this.onClick.bind(this)),e.appendChild(t),e.style.display=""},normalizeLocale:function(){const e=(navigator.language||"en-US").replace("_","-");return e.includes("-")?e:`${e}-US`},onClick:async function(e){e.preventDefault();const t=document.getElementById("edd_purchase_form");if(t&&!t.reportValidity())return;let a;this.startProcessing();try{a=await this.createPayPalOrder(t)}catch(e){return console.error("Apple Pay createPayPalOrder failed:",e),this.stopProcessing(),void this.showError(eddPayPalVars.defaultError)}if(!a?.orderId)return this.stopProcessing(),void this.showError(a?.error||eddPayPalVars.defaultError);const n=new ApplePaySession(4,{countryCode:this.config.countryCode,currencyCode:a.currency||this.config.currencyCode,merchantCapabilities:this.config.merchantCapabilities,supportedNetworks:this.config.supportedNetworks,requiredBillingContactFields:["postalAddress","name"],requiredShippingContactFields:["email"],total:{label:this.getStoreName(),amount:a.total,type:"final"}});this.hideSpinner(),n.onvalidatemerchant=async e=>{try{const t=await this.applepay.validateMerchant({validationUrl:e.validationURL,displayName:this.getStoreName()});n.completeMerchantValidation(t.merchantSession)}catch(e){console.error("Apple Pay validateMerchant failed:",e),n.abort()}},n.onpaymentauthorized=async e=>{this.showSpinner();try{const t=await this.applepay.confirmOrder({orderId:a.orderId,token:e.payment.token,billingContact:e.payment.billingContact,shippingContact:e.payment.shippingContact});if("APPROVED"!==(t.approveApplePayPayment?.status||t.status))return n.completePayment(ApplePaySession.STATUS_FAILURE),this.stopProcessing(),void this.showError(eddPayPalVars.defaultError);n.completePayment(ApplePaySession.STATUS_SUCCESS),await this.captureOrder(a.orderId)}catch(e){console.error("Apple Pay payment failed:",e),n.completePayment(ApplePaySession.STATUS_FAILURE),this.stopProcessing(),this.showError(e?.message||eddPayPalVars.defaultError)}},n.oncancel=()=>{this.stopProcessing()},n.begin()},getStoreName:function(){return(eddPayPalVars.storeName||document.title||"Order").substring(0,64)}},u={...c,walletType:"google_pay",containerId:"edd-paypal-googlepay-container",googlepay:null,config:null,paymentsClient:null,init:async function(){if("undefined"==typeof paypal||"function"!=typeof paypal.Googlepay)return;const e=document.getElementById(this.containerId);if(e)try{if(this.googlepay=paypal.Googlepay(),this.config=await this.googlepay.config(),!this.config.isEligible)return;await this.loadGooglePayScript(),this.paymentsClient=new google.payments.api.PaymentsClient({environment:this.detectEnvironment()});const t=await this.paymentsClient.isReadyToPay({apiVersion:this.config.apiVersion,apiVersionMinor:this.config.apiVersionMinor,allowedPaymentMethods:this.config.allowedPaymentMethods});if(!t?.result)return;this.renderButton(e)}catch(e){console.warn("EDD PayPal Google Pay unavailable:",e)}},loadGooglePayScript:function(){return"undefined"!=typeof google&&google.payments?.api?.PaymentsClient?Promise.resolve():new Promise(((e,t)=>{const a=document.querySelector('script[src="https://pay.google.com/gp/p/js/pay.js"]');if(a)return a.addEventListener("load",e),void a.addEventListener("error",t);const n=document.createElement("script");n.src="https://pay.google.com/gp/p/js/pay.js",n.async=!0,n.onload=e,n.onerror=t,document.head.appendChild(n)}))},detectEnvironment:function(){return eddPayPalVars.isSandbox?"TEST":"PRODUCTION"},renderButton:function(e){const t=this.paymentsClient.createButton({onClick:this.onClick.bind(this),buttonColor:"black",buttonType:"pay",buttonSizeMode:"fill"});e.appendChild(t),e.style.display=""},onClick:async function(){const e=document.getElementById("edd_purchase_form");if(e&&!e.reportValidity())return;this.startProcessing();let t=!1;try{const a=await this.createPayPalOrder(e);if(!a?.orderId)return this.stopProcessing(),void this.showError(a?.error||eddPayPalVars.defaultError);const n={apiVersion:this.config.apiVersion,apiVersionMinor:this.config.apiVersionMinor,allowedPaymentMethods:this.config.allowedPaymentMethods,merchantInfo:{...this.config.merchantInfo,merchantName:eddPayPalVars.storeName},transactionInfo:{countryCode:this.config.countryCode,currencyCode:a.currency||this.config.currencyCode||"USD",totalPriceStatus:"FINAL",totalPrice:a.total}};this.hideSpinner();const r=await this.paymentsClient.loadPaymentData(n);t=!0,this.showSpinner();const o=await this.googlepay.confirmOrder({orderId:a.orderId,paymentMethodData:r.paymentMethodData});if("APPROVED"!==(o.status||o.googlePayConfirmation?.status))return console.warn("Google Pay confirmOrder did not approve:",o),this.stopProcessing(),void this.showError(eddPayPalVars.defaultError);await this.captureOrder(a.orderId)}catch(e){if("CANCELED"===e?.statusCode)return void this.stopProcessing();console.error("Google Pay payment failed:",e),this.stopProcessing(),t&&this.showError(e?.message||eddPayPalVars.defaultError)}}},y={cardField:null,eddOrderId:0,isProcessing:!1,init:async function(){if(!eddPayPalVars.unbrandedCard||!eddPayPalVars.clientToken)return;if("undefined"==typeof paypal||"function"!=typeof paypal.CardFields)return;const e=document.getElementById("edd-paypal-unbranded-card-container");if(e)try{if(this.cardField=paypal.CardFields({createOrder:this.createOrder.bind(this),onApprove:this.onApprove.bind(this),onError:this.onError.bind(this)}),!this.cardField.isEligible())return;this.cardField.NumberField().render("#edd-paypal-card-number"),this.cardField.ExpiryField().render("#edd-paypal-card-expiry"),this.cardField.CVVField().render("#edd-paypal-card-cvv"),this.bindSubmit(),e.style.display="";
1const t=document.getElementById("edd-paypal-unbranded-card-divider");t&&(t.style.display="")}catch(e){console.warn("EDD PayPal Unbranded Card unavailable:",e)}},bindSubmit:function(){const e=document.getElementById("edd-paypal-unbranded-card-submit");e&&e.addEventListener("click",(async e=>{if(e.preventDefault(),this.isProcessing)return;const t=document.getElementById("edd_purchase_form");if(!t||t.reportValidity()){this.isProcessing=!0,this.clearErrors(),this.showSpinner();try{await this.cardField.submit()}catch(e){console.error("Unbranded card submit failed:",e),this.showError(e?.message||eddPayPalVars.defaultError),this.isProcessing=!1,this.hideSpinner()}}}))},createOrder:async function(){const e=await this.postRest(eddPayPalVars.unbrandedCard.createUrl,{form_data:this.collectFormData()});if(!e||!e.id)throw new Error("No PayPal order ID returned.");return this.eddOrderId=e.edd_order_id||0,e.id},onApprove:async function(e){const t=await this.postRest(eddPayPalVars.unbrandedCard.captureUrl,{paypal_order_id:e.orderID,edd_order_id:this.eddOrderId});t&&t.redirect_url?globalThis.location=t.redirect_url:(t&&t.message&&this.showError(t.message),this.isProcessing=!1,this.hideSpinner())},onError:function(e){console.error("Unbranded card error:",e),this.showError(eddPayPalVars.defaultError),this.isProcessing=!1,this.hideSpinner()},postRest:async function(e,t){const a=await fetch(e,{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json","X-EDD-Cart-Token":eddPayPalVars.cartToken,"X-EDD-Cart-Timestamp":eddPayPalVars.cartTimestamp},body:JSON.stringify(t)});let n;try{n=await a.json()}catch(e){throw new Error(eddPayPalVars.defaultError)}if(!a.ok)throw new Error(n&&n.message?n.message:eddPayPalVars.defaultError);return n},collectFormData:function(){return s()},showSpinner:function(){const e=document.getElementById("edd-paypal-unbranded-card-spinner"),t=document.getElementById("edd-paypal-unbranded-card-submit");e&&(e.style.display=""),t&&(t.disabled=!0)},hideSpinner:function(){const e=document.getElementById("edd-paypal-unbranded-card-spinner"),t=document.getElementById("edd-paypal-unbranded-card-submit");e&&(e.style.display="none"),t&&(t.disabled=!1)},showError:function(e){o(e)},clearErrors:function(){d()}};function m(){return globalThis.eddCartLoadingState||(globalThis.eddCartLoadingState={active:new Map,sequence:0,hideTimer:null,overlay:null}),globalThis.eddCartLoadingState}function h(){const e=m();if(e.overlay)return e.overlay;const t=document.createElement("div");t.className="edd-cart-loading",t.setAttribute("role","status"),t.setAttribute("aria-live","polite"),t.hidden=!0;const a=document.createElement("span");a.className="edd-cart-loading__spinner",t.appendChild(a);const n=document.createElement("span");return n.className="edd-cart-loading__label screen-reader-text",n.textContent="undefined"!=typeof edd_global_vars&&edd_global_vars.purchase_loading||"Loading",t.appendChild(n),document.body.appendChild(t),e.overlay=t,t}function f(e){document.dispatchEvent(new CustomEvent("edd:loading-changed",{bubbles:!0,detail:{loading:e,count:m().active.size}}))}function g(e="unknown",{timeout:t=8e3}={}){const a=`${e}-${++m().sequence}`;return function(e,t,a){const n=m(),r=0===n.active.size,o=setTimeout((()=>{"undefined"!=typeof edd_global_vars&&edd_global_vars.showStoreErrors&&console.warn(`edd-cart-loading: token "${e}" timed out and was released.`),P(e)}),a);n.active.set(e,{source:t,timer:o}),r&&(function(){const e=m();clearTimeout(e.hideTimer),e.hideTimer=null,h().hidden=!1;const t=document.getElementById("edd_checkout_form_wrap");t&&t.setAttribute("aria-busy","true")}(),f(!0))}(a,e,t),a}function P(e){const t=m(),a=t.active.get(e);a&&(clearTimeout(a.timer),t.active.delete(e),0===t.active.size&&(clearTimeout(t.hideTimer),t.hideTimer=setTimeout((()=>{!function(){h().hidden=!0;const e=document.getElementById("edd_checkout_form_wrap");e&&e.removeAttribute("aria-busy")}(),f(!1)}),120)))}var E=a(1669);let b=null;const _={fastlane:{sdkGlobal:"Fastlane",module:l},apple_pay:{sdkGlobal:"Applepay",module:p},google_pay:{sdkGlobal:"Googlepay",module:u},unbranded_card:{sdkGlobal:"CardFields",module:y}};var w={isMounted:!1,startProcessing:function(){const e=document.getElementById("edd_purchase_submit")||document.getElementById("edd-paypal-container")?.parentElement;e&&e.classList.add("edd-paypal-processing");const t=document.getElementById("edd-paypal-spinner");t&&(t.style.display="block"),b||(b=g("paypal"))},stopProcessing:function(){const e=document.getElementById("edd_purchase_submit")||document.getElementById("edd-paypal-container")?.parentElement;e&&e.classList.remove("edd-paypal-processing");const t=document.getElementById("edd-paypal-spinner");t&&(t.style.display="none"),P(b),b=null},styleForFundingSource:function(e,t){var a=Object.assign({},e||{});return t!==paypal.FUNDING.PAYPAL&&delete a.label,"gold"===a.color&&(t===paypal.FUNDING.CARD?a.color="black":t===paypal.FUNDING.VENMO?a.color="blue":t===paypal.FUNDING.CREDIT&&(a.color="darkblue")),a},fundingSourceSlugs:function(){if(eddPayPalVars&&eddPayPalVars.fundingSlugMap)return eddPayPalVars.fundingSlugMap;var e={};return e[paypal.FUNDING.PAYPAL]="paypal",e[paypal.FUNDING.PAYLATER]="pay_later",e[paypal.FUNDING.CREDIT]="pay_later",e[paypal.FUNDING.VENMO]="venmo",e[payp
1al.FUNDING.CARD]="card",e},getEnabledMethods:function(e){var t=eddPayPalVars&&eddPayPalVars.enabledFundingSources||null,a=w.fundingSourceSlugs(),n=[];return Object.keys(a).forEach((function(e){if(!t||-1!==t.indexOf(e)){var r=a[e];-1===n.indexOf(r)&&n.push(r)}})),Object.keys(_).forEach((function(e){-1===n.indexOf(e)&&n.push(e)})),wp.hooks.applyFilters("edd.paypal.enabledMethods",n,{context:e,intent:eddPayPalVars.intent})},isMethodEnabled:function(e,t){return-1!==w.getEnabledMethods(t).indexOf(e)},init:function(){document.getElementById("edd-paypal-container")&&this.initButtons("#edd-paypal-container","checkout"),document.addEventListener("edd:cart-updated",(function(){const e=document.querySelector(".edd_cart_total .edd_cart_amount")?.dataset.total;if(void 0===e)return;const t=Number.parseFloat(e);w.maybeRefreshPageForTotal(t)}))},isPayPal:function(){return!!document.getElementById("edd-paypal-container")},maybeRefreshPageForTotal:function(e){w.isPayPal()&&(!w.isMounted&&e>0&&window.location.reload(),0===e&&window.location.reload())},setErrorHtml:function(e,t,a){"checkout"===t&&"undefined"!=typeof edd_global_vars&&edd_global_vars.checkout_error_anchor?o(a,"checkout"):"buy_now"===t&&o(a,"buy_now",e)},initButtons:function(e,t){w.isMounted=!0;var a=w.getButtonArgs(e,t),n=wp.hooks.applyFilters("edd.paypal.buttonArgs",a,{context:t,container:e,form:"checkout"===t?document.getElementById("edd_purchase_form"):e.closest(".edd_download_purchase_form"),intent:eddPayPalVars.intent}),r=[paypal.FUNDING.PAYPAL,paypal.FUNDING.PAYLATER,paypal.FUNDING.CREDIT,paypal.FUNDING.VENMO,paypal.FUNDING.CARD],o=w.getEnabledMethods(t),d=w.fundingSourceSlugs();if(r.filter((function(e){var t=d[e];return t&&-1!==o.indexOf(t)})).forEach((function(t){try{var a=Object.assign({},n,{fundingSource:t,style:w.styleForFundingSource(n.style,t)}),r=paypal.Buttons(a);r.isEligible()&&r.render(e)}catch(e){console.warn("EDD PayPal: failed to render funding source",t,e)}})),paypal.Messages&&eddPayPalVars.payLaterEnabled&&-1!==o.indexOf("pay_later")){const e=document.getElementById("edd-paypal-messages");e&&paypal.Messages({amount:eddPayPalVars.cartTotal||0,placement:"payment"}).render(e)}document.dispatchEvent(new CustomEvent("edd_paypal_buttons_mounted"))},getButtonArgs:function(e,t){var a="checkout"===t?document.getElementById("edd_purchase_form"):e.closest(".edd_download_purchase_form"),n="checkout"===t?a.querySelector("#edd-paypal-errors-wrap"):a.querySelector(".edd-paypal-checkout-buy-now-error-wrapper"),r="checkout"===t?document.getElementById("edd-paypal-spinner"):a.querySelector(".edd-paypal-spinner"),o=a.querySelector('input[name="edd_process_paypal_nonce"]'),d=a.querySelector('input[name="edd-process-paypal-token"]'),i="subscription"===eddPayPalVars.intent?"createSubscription":"createOrder",s=a.querySelectorAll("[required]"),l={onInit:function(e,t){t.disable(),a.checkValidity()&&t.enable(),s.forEach((function(e){e.addEventListener("change",(function(e){a.checkValidity()?t.enable():t.disable()}))}))},onClick:function(e,t){if(!a.reportValidity())return!1;n&&(n.innerHTML="")},onApprove:function(a,n){w.startProcessing();var r=new FormData;return r.append("action",eddPayPalVars.approvalAction),r.append("edd_process_paypal_nonce",o.value),r.append("token",d.getAttribute("data-token")),r.append("timestamp",d.getAttribute("data-timestamp")),a.orderID&&r.append("paypal_order_id",a.orderID),a.subscriptionID&&r.append("paypal_subscription_id",a.subscriptionID),fetch(edd_scripts.ajaxurl,{method:"POST",body:r}).then((function(e){return e.json()})).then((function(a){if(a.success&&a.data.redirect_url)window.location=a.data.redirect_url;else{w.stopProcessing();var r=a.data.message?a.data.message:eddPayPalVars.defaultError;if(w.setErrorHtml(e,t,r),a.data.retry)return n.restart()}}))},onError:function(a){w.stopProcessing(),w.setErrorHtml(e,t,a)},onCancel:function(e){w.stopProcessing();const t=new FormData;return t.append("action","edd_cancel_paypal_order"),fetch(edd_scripts.ajaxurl,{method:"POST",body:t}).then((function(e){return e.json()})).then((function(e){if(e.success){const t=e.data.nonces;Object.keys(t).forEach((function(e){var a=document.getElementById("edd-gateway-"+e);a&&a.setAttribute("data-"+e+"-nonce",t[e])}))}}))}};return eddPayPalVars.style&&(l.style=eddPayPalVars.style),l[i]=function(e,t){return r.style.display="block",n&&(n.innerHTML=""),fetch(edd_scripts.ajaxurl,{method:"POST",body:new FormData(a)}).then((function(e){return e.json()})).then((function(e){if(e.data&&e.data.paypal_order_id)return e.data.nonce&&(o.value=e.data.nonce),e.data.token&&(E(d).attr("data-token",e.data.token),E(d).attr("data-timestamp",e.data.timestamp)),e.data.paypal_order_id;var t=eddPayPalVars.defaultError;return e.data&&"string"==typeof e.data?t=e.data:"string"==typeof e&&(t=e),new Promise((function(e,a){a(t)}))}))},l}};globalThis.EDD_Fastlane=l,E(document.body).on("edd_gateway_loaded",(function(e,t){"paypal_commerce"===t&&(w.init(),"undefined"!=typeof paypal&&Object.keys(_).forEach((function(e){var t=_[e];"function"==typeof paypal[t.sdkGlobal]&&w.isMethodEnabled(e,"checkout")&&t.module.init(
1)})))})),E(document).ready((function(e){!function(){for(var e=document.querySelectorAll(".edd-paypal-checkout-buy-now"),t=0;t<e.length;t++){var a=e[t];if(!a.classList.contains("edd-free-download")){var n=a.closest(".edd_purchase_submit_wrapper");if(n&&"add_to_cart"!==a.closest("form").querySelector(".edd_action_input").value){n.innerHTML="";var r=document.createElement("div");r.classList.add("edd-paypal-checkout-buy-now-error-wrapper"),n.before(r);var o=document.createElement("span");o.classList.add("edd-paypal-spinner","edd-loading-ajax","edd-loading"),o.style.display="none",n.after(o),w.initButtons(n,"buy_now")}}}}()}))})();
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.