import{o as onChange}from"./mutations2.js";import{o as onChange$1,s as state}from"./watchers5.js";import{o as onChange$2,a as availableProcessors,b as availableManualPaymentMethods,c as availableMethodTypes}from"./getters5.js";const maybeUpdateProcessor=()=>{const e=[...availableProcessors().map((({processor_type:e})=>e)),...availableManualPaymentMethods().map((({id:e})=>e))];e.includes(state.id)||(state.id=(null==e?void 0:e.length)?null==e?void 0:e[0]:null)},maybeUpdateMethod=()=>{const e=(availableMethodTypes()||[]).map((({id:e})=>e));"mollie"===(null==state?void 0:state.id)?e.includes(state.method)||(state.method=(null==e?void 0:e.length)?null==e?void 0:e[0]:null):state.method=null};onChange("checkout",(()=>{maybeUpdateProcessor(),maybeUpdateMethod()})),onChange$1("id",(()=>maybeUpdateProcessor())),onChange$2("processors",(()=>maybeUpdateProcessor())),onChange$2("methods",(()=>maybeUpdateMethod()));