{"version":3,"file":"wrapGetStaticPropsWithSentry.js","sources":["../../../../src/common/pages-router-instrumentation/wrapGetStaticPropsWithSentry.ts"],"sourcesContent":["import type { GetStaticProps } from 'next';\nimport { isBuild } from '../utils/isBuild';\nimport { callDataFetcherTraced, withErrorInstrumentation } from '../utils/wrapperUtils';\n\ntype Props = { [key: string]: unknown };\n\n/**\n * Create a wrapped version of the user's exported `getStaticProps` function\n *\n * @param origGetStaticProps The user's `getStaticProps` function\n * @param parameterizedRoute The page's parameterized route\n * @returns A wrapped version of the function\n */\nexport function wrapGetStaticPropsWithSentry(\n origGetStaticPropsa: GetStaticProps,\n _parameterizedRoute: string,\n): GetStaticProps {\n return new Proxy(origGetStaticPropsa, {\n apply: async (wrappingTarget, thisArg, args: Parameters>) => {\n if (isBuild()) {\n return wrappingTarget.apply(thisArg, args);\n }\n\n const errorWrappedGetStaticProps = withErrorInstrumentation(wrappingTarget);\n return callDataFetcherTraced(errorWrappedGetStaticProps, args);\n },\n });\n}\n"],"names":["isBuild","withErrorInstrumentation","callDataFetcherTraced"],"mappings":";;;;;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,4BAA4B;AAC5C,EAAE,mBAAmB;AACrB,EAAE,mBAAmB;AACrB,EAAyB;AACzB,EAAE,OAAO,IAAI,KAAK,CAAC,mBAAmB,EAAE;AACxC,IAAI,KAAK,EAAE,OAAO,cAAc,EAAE,OAAO,EAAE,IAAI,KAAwC;AACvF,MAAM,IAAIA,eAAO,EAAE,EAAE;AACrB,QAAQ,OAAO,cAAc,CAAC,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC;AAClD,MAAM;;AAEN,MAAM,MAAM,0BAAA,GAA6BC,qCAAwB,CAAC,cAAc,CAAC;AACjF,MAAM,OAAOC,kCAAqB,CAAC,0BAA0B,EAAE,IAAI,CAAC;AACpE,IAAI,CAAC;AACL,GAAG,CAAC;AACJ;;;;"}