"use strict";var calculateBestSellingPlan=require("./calculateBestSellingPlan.js"),core=require("@gem-sdk/core");const findDefaultValue=e=>{let{validPlans:l,extractedSettings:t,currentVariant:a,plans:i}=e;if(t.defaultOptions){let e=l.find(e=>e.baseID===t.defaultOptions),a=l.find(e=>e.id===t.defaultOptions),i=e?.baseID??a?.baseID;if(i)return i}if(l.length>0){let e="number"==typeof a?.price?String(a.price):a?.price??void 0,t=core.convertDecimalToNumber(e)??0,i=calculateBestSellingPlan.findBestPlanFromList({plans:l,variantPrice:t});if(i)return i.baseID}return i[0]?.value};exports.findDefaultValue=findDefaultValue;
