{"version":3,"file":"mergePropsContext.mjs","names":[],"sources":["../../../../../../../src/lib/propsContext/mergePropsContext.ts"],"sourcesContent":["import { isFlowComponentName } from \"@/lib/propsContext/isFlowComponentName\";\nimport type { PropsContext, WorkaroundType } from \"@/lib/propsContext/types\";\nimport { getPropsMerger } from \"@/lib/react/getPropsMerger\";\n\nconst merger = getPropsMerger({\n  mergeClassNames: false,\n  mergeEventHandler: true,\n});\n\nexport const mergePropsContext = (\n  firstContext: PropsContext = {},\n  secondContext: PropsContext = {},\n): PropsContext => {\n  const mergedComponentNames = Object.keys({\n    ...firstContext,\n    ...secondContext,\n  }).filter(isFlowComponentName);\n\n  return Object.fromEntries(\n    mergedComponentNames.map((componentName) => [\n      componentName,\n      merger<WorkaroundType>(\n        firstContext[componentName],\n        secondContext[componentName],\n      ),\n    ]),\n  );\n};\n\nexport default mergePropsContext;\n"],"mappings":";;;;;AAIA,IAAM,SAAS,eAAe;CAC5B,iBAAiB;CACjB,mBAAmB;AACrB,CAAC;AAED,IAAa,qBACX,eAA6B,CAAC,GAC9B,gBAA8B,CAAC,MACd;CACjB,MAAM,uBAAuB,OAAO,KAAK;EACvC,GAAG;EACH,GAAG;CACL,CAAC,CAAC,CAAC,OAAO,mBAAmB;CAE7B,OAAO,OAAO,YACZ,qBAAqB,KAAK,kBAAkB,CAC1C,eACA,OACE,aAAa,gBACb,cAAc,cAChB,CACF,CAAC,CACH;AACF"}