"use strict";const t=t=>t?t.includes("/ProductVariant/")?t.split("/ProductVariant/")[1]||"":t:"",e=t=>t?t.includes("/Product/")?t.split("/Product/")[1]||"":t:"";exports.extractSellingPlanSettings=({sellingPlansSetting:i,currentVariant:s,product:d,isFromEvent:r=!1})=>{let a={sourceApp:void 0,group:void 0,defaultOptions:void 0};if(!i)return a;if(r&&s?.id){let r,a;if(d&&"baseID"in d&&d.baseID?(r=e(d.baseID),a=Object.keys(i)[0]):r="data"===(a=Object.keys(i)[0])&&i[a]?Object.keys(i[a])[0]:a,r){let e="data"===a?i.data:i[r],d="data"===a?e[r]:e;if(d){let e=t(s.id?.toString()||""),i=t(s.baseID||""),r=Object.keys(d).find(t=>t===s.id?.toString()||t===s.baseID||t===e||t===i||s.id?.toString()===t||s.baseID===t||s.id?.toString().includes(t)||s.baseID?.includes(t)||t.includes(e)||t.includes(i));if(r&&d[r]){let t=d[r];return{sourceApp:t?.sourceApp,group:t?.group,defaultOptions:t?.defaultOption}}}}}return a};
