"use strict";const mutations=require("./mutations-10a18c83.js"),watchers=require("./watchers-b4c5fc51.js"),getters=require("./getters-ae03ef93.js"),maybeUpdateProcessor=()=>{var e,t;const s=[...getters.availableProcessors().map((({processor_type:e})=>e)),...getters.availableManualPaymentMethods().map((({id:e})=>e))];s.includes(watchers.state.id)||(null===(t=null===(e=null===window||void 0===window?void 0:window.wp)||void 0===e?void 0:e.hooks)||void 0===t?void 0:t.applyFilters)&&!window.wp.hooks.applyFilters("surecart_auto_select_payment_method",!0)||(watchers.state.id=(null==s?void 0:s.length)?null==s?void 0:s[0]:null)},maybeUpdateMethod=()=>{const e=(getters.availableMethodTypes()||[]).map((({id:e})=>e));"mollie"===(null===watchers.state||void 0===watchers.state?void 0:watchers.state.id)?e.includes(watchers.state.method)||(watchers.state.method=(null==e?void 0:e.length)?null==e?void 0:e[0]:null):watchers.state.method=null};mutations.onChange("checkout",(()=>{maybeUpdateProcessor(),maybeUpdateMethod()})),watchers.onChange("id",(()=>maybeUpdateProcessor())),getters.onChange("processors",(()=>maybeUpdateProcessor())),getters.onChange("disabled",(()=>maybeUpdateProcessor())),getters.onChange("methods",(()=>maybeUpdateMethod()));