"use strict";const util=require("./util-b877b2bd.js"),index=require("./index-bcdafe6e.js"),utils=require("./utils-2e91d46c.js"),mutations=require("./mutations-10a18c83.js"),{processors:processors}=utils.getSerializedState(),{state:state,onChange:onChange,on:on,dispose:dispose}=index.createStore({processors:[],methods:[],manualPaymentMethods:[],disabled:{processors:[]},sortOrder:{processors:["stripe","paystack","paypal","mollie","mock"],manualPaymentMethods:[],paymentMethods:{mollie:["creditcard","paypal"]}},instances:{stripe:void 0},config:{stripe:{paymentElement:!1}},...processors},((e,s)=>JSON.stringify(e)!==JSON.stringify(s))),availableProcessors=()=>util.sortByArray(state.processors,"processor_type",state.sortOrder.processors).filter((e=>(null==e?void 0:e.live_mode)===("live"===(null===mutations.state||void 0===mutations.state?void 0:mutations.state.mode)))).filter((e=>!(state.disabled.processors||[]).includes(e.processor_type))).filter((e=>{var s;return!(null===(s=null===mutations.state||void 0===mutations.state?void 0:mutations.state.checkout)||void 0===s?void 0:s.reusable_payment_method_required)||!!(null==e?void 0:e.recurring_enabled)})).filter(((e,s,o)=>!o.some((e=>"mollie"===e.processor_type))||"mollie"===e.processor_type||"mock"===e.processor_type)),getProcessorByType=e=>availableProcessors().find((({processor_type:s})=>s===e)),getAvailableProcessor=e=>availableProcessors().find((({processor_type:s})=>s===e)),hasOtherAvailableCreditCardProcessor=e=>availableProcessors().some((({processor_type:s})=>s!==e&&"paypal"!==s&&"mock"!==s)),availableManualPaymentMethods=()=>util.sortByArray(state.manualPaymentMethods,"id",state.sortOrder.manualPaymentMethods).filter((e=>!(state.disabled.processors||[]).includes(null==e?void 0:e.id))).filter((e=>{var s;return!(null===(s=null===mutations.state||void 0===mutations.state?void 0:mutations.state.checkout)||void 0===s?void 0:s.reusable_payment_method_required)||!!(null==e?void 0:e.reusable)})),availableMethodTypes=()=>util.sortByArray(state.methods,"id",state.sortOrder.paymentMethods.mollie).filter((e=>{var s,o;return"applepay"!==e.id||(null===window||void 0===window?void 0:window.ApplePaySession)&&(null===(o=null===(s=null===window||void 0===window?void 0:window.ApplePaySession)||void 0===s?void 0:s.canMakePayments)||void 0===o?void 0:o.call(s))})),availableProcessorChoices=()=>[...availableProcessors(),...availableManualPaymentMethods()],hasMultipleProcessorChoices=()=>{var e;return(null===(e=availableProcessorChoices())||void 0===e?void 0:e.length)>1},availableMethodChoices=()=>[...availableMethodTypes(),...availableManualPaymentMethods(),getProcessorByType("mock")].filter(Boolean),hasMultipleMethodChoices=()=>{var e;return(null===(e=availableMethodChoices())||void 0===e?void 0:e.length)>1};exports.availableManualPaymentMethods=availableManualPaymentMethods,exports.availableMethodTypes=availableMethodTypes,exports.availableProcessors=availableProcessors,exports.getAvailableProcessor=getAvailableProcessor,exports.getProcessorByType=getProcessorByType,exports.hasMultipleMethodChoices=hasMultipleMethodChoices,exports.hasMultipleProcessorChoices=hasMultipleProcessorChoices,exports.hasOtherAvailableCreditCardProcessor=hasOtherAvailableCreditCardProcessor,exports.onChange=onChange,exports.state=state;