Preview: client-segment.js.map
Size: 2.99 KB
/var/www/uibuilder.cmshelp.dk/httpdocs/node_modules/next/dist/client/components/client-segment.js.map
{"version":3,"sources":["../../../src/client/components/client-segment.tsx"],"sourcesContent":["'use client'\n\nimport { InvariantError } from '../../shared/lib/invariant-error'\n\nimport type { Params } from '../../server/request/params'\n\n/**\n * When the Page is a client component we send the params to this client wrapper\n * where they are turned into dynamically tracked values before being passed to the actual Segment component.\n *\n * additionally we may send a promise representing params. We don't ever use this passed\n * value but it can be necessary for the sender to send a Promise that doesn't resolve in certain situations\n * such as when dynamicIO is enabled. It is up to the caller to decide if the promises are needed.\n */\nexport function ClientSegmentRoot({\n Component,\n slots,\n params,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n promise,\n}: {\n Component: React.ComponentType<any>\n slots: { [key: string]: React.ReactNode }\n params: Params\n promise?: Promise<any>\n}) {\n if (typeof window === 'undefined') {\n const { workAsyncStorage } =\n require('../../server/app-render/work-async-storage.external') as typeof import('../../server/app-render/work-async-storage.external')\n\n let clientParams: Promise<Params>\n // We are going to instrument the searchParams prop with tracking for the\n // appropriate context. We wrap differently in prerendering vs rendering\n const store = workAsyncStorage.getStore()\n if (!store) {\n throw new InvariantError(\n 'Expected workStore to exist when handling params in a client segment such as a Layout or Template.'\n )\n }\n\n const { createParamsFromClient } =\n require('../../server/request/params') as typeof import('../../server/request/params')\n clientParams = createParamsFromClient(params, store)\n\n return <Component {...slots} params={clientParams} />\n } else {\n const { createRenderParamsFromClient } =\n require('../request/params.browser') as typeof import('../request/params.browser')\n const clientParams = createRenderParamsFromClient(params)\n return <Component {...slots} params={clientParams} />\n }\n}\n"],"names":["ClientSegmentRoot","Component","slots","params","promise","window","workAsyncStorage","require","clientParams","store","getStore","InvariantError","createParamsFromClient","createRenderParamsFromClient"],"mappings":"AAAA;;;;;+BAcgBA;;;eAAAA;;;;gCAZe;AAYxB,SAASA,kBAAkB,KAWjC;IAXiC,IAAA,EAChCC,SAAS,EACTC,KAAK,EACLC,MAAM,EACN,6DAA6D;IAC7DC,OAAO,EAMR,GAXiC;IAYhC,IAAI,OAAOC,WAAW,aAAa;QACjC,MAAM,EAAEC,gBAAgB,EAAE,GACxBC,QAAQ;QAEV,IAAIC;QACJ,yEAAyE;QACzE,wEAAwE;QACxE,MAAMC,QAAQH,iBAAiBI,QAAQ;QACvC,IAAI,CAACD,OAAO;YACV,MAAM,qBAEL,CAFK,IAAIE,8BAAc,CACtB,uGADI,qBAAA;uBAAA;4BAAA;8BAAA;YAEN;QACF;QAEA,MAAM,EAAEC,sBAAsB,EAAE,GAC9BL,QAAQ;QACVC,eAAeI,uBAAuBT,QAAQM;QAE9C,qBAAO,qBAACR;YAAW,GAAGC,KAAK;YAAEC,QAAQK;;IACvC,OAAO;QACL,MAAM,EAAEK,4BAA4B,EAAE,GACpCN,QAAQ;QACV,MAAMC,eAAeK,6BAA6BV;QAClD,qBAAO,qBAACF;YAAW,GAAGC,KAAK;YAAEC,QAAQK;;IACvC;AACF"}
Directory Contents
Dirs: 7 × Files: 120