{"version":3,"file":"index.cjs","names":[],"sources":["../../src/index.tsx"],"sourcesContent":["import { Fragment } from 'react'\nimport { QueryClientProvider } from '@tanstack/react-query'\nimport { setupCoreRouterSsrQueryIntegration } from '@tanstack/router-ssr-query-core'\nimport type { RouterSsrQueryOptions } from '@tanstack/router-ssr-query-core'\nimport type { AnyRouter } from '@tanstack/react-router'\n\nexport type Options<TRouter extends AnyRouter> =\n  RouterSsrQueryOptions<TRouter> & {\n    wrapQueryClient?: boolean\n  }\n\nexport function setupRouterSsrQueryIntegration<TRouter extends AnyRouter>(\n  opts: Options<TRouter>,\n) {\n  setupCoreRouterSsrQueryIntegration(opts)\n\n  if (opts.wrapQueryClient === false) {\n    return\n  }\n  const OGWrap = opts.router.options.Wrap || Fragment\n\n  opts.router.options.Wrap = ({ children }) => {\n    return (\n      <QueryClientProvider client={opts.queryClient}>\n        <OGWrap>{children}</OGWrap>\n      </QueryClientProvider>\n    )\n  }\n}\n"],"mappings":";;;;;;AAWA,SAAgB,+BACd,MACA;CACA,CAAA,GAAA,gCAAA,oCAAmC,IAAI;CAEvC,IAAI,KAAK,oBAAoB,OAC3B;CAEF,MAAM,SAAS,KAAK,OAAO,QAAQ,QAAQ,MAAA;CAE3C,KAAK,OAAO,QAAQ,QAAQ,EAAE,eAAe;EAC3C,OACE,iBAAA,GAAA,kBAAA,KAAC,sBAAA,qBAAD;GAAqB,QAAQ,KAAK;aAChC,iBAAA,GAAA,kBAAA,KAAC,QAAD,EAAS,SAAiB,CAAA;EACP,CAAA;CAEzB;AACF"}