{"version":3,"file":"index.js","names":["isReactServerComponentOrFunction","React","WithServerSideProps","Component","serverOnlyProps","rest","passedProps","propsWithServerOnlyProps","_jsx"],"sources":["../../../src/elements/WithServerSideProps/index.tsx"],"sourcesContent":["import type { WithServerSidePropsComponent } from 'payload'\n\nimport { isReactServerComponentOrFunction } from 'payload/shared'\nimport React from 'react'\n\nexport const WithServerSideProps: WithServerSidePropsComponent = ({\n Component,\n serverOnlyProps,\n ...rest\n}) => {\n if (Component) {\n const WithServerSideProps: React.FC = (passedProps) => {\n const propsWithServerOnlyProps = {\n ...passedProps,\n ...(isReactServerComponentOrFunction(Component) ? (serverOnlyProps ?? {}) : {}),\n }\n\n return \n }\n\n return WithServerSideProps(rest)\n }\n\n return null\n}\n"],"mappings":";AAEA,SAASA,gCAAgC,QAAQ;AACjD,OAAOC,KAAA,MAAW;AAElB,OAAO,MAAMC,mBAAA,GAAoDA,CAAC;EAChEC,SAAS;EACTC,eAAe;EACf,GAAGC;AAAA,CACJ;EACC,IAAIF,SAAA,EAAW;IACb,MAAMD,mBAAA,GAAiCI,WAAA;MACrC,MAAMC,wBAAA,GAA2B;QAC/B,GAAGD,WAAW;QACd,IAAIN,gCAAA,CAAiCG,SAAA,IAAcC,eAAA,IAAmB,CAAC,IAAK,CAAC,CAAC;MAChF;MAEA,oBAAOI,IAAA,CAACL,SAAA;QAAW,GAAGI;;IACxB;IAEA,OAAOL,mBAAA,CAAoBG,IAAA;EAC7B;EAEA,OAAO;AACT","ignoreList":[]}