@eventcatalog/core 1.2.6 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (614) hide show
  1. package/.changeset/config.json +11 -0
  2. package/.github/CODEOWNERS +3 -0
  3. package/.github/ISSUE_TEMPLATE.md +1 -0
  4. package/.github/PULL_REQUEST_TEMPLATE.md +18 -0
  5. package/.github/funding.yml +1 -0
  6. package/.github/workflows/lint.yml +22 -0
  7. package/.github/workflows/release.yml +34 -0
  8. package/.github/workflows/verify-build.yml +27 -0
  9. package/.prettierignore +7 -0
  10. package/.prettierrc +10 -0
  11. package/CHANGELOG.md +10 -571
  12. package/LICENSE.md +21 -0
  13. package/README.md +192 -5
  14. package/astro.config.mjs +57 -0
  15. package/bin/dist/eventcatalog.cjs +3139 -0
  16. package/bin/dist/eventcatalog.d.cts +1 -0
  17. package/bin/dist/eventcatalog.d.ts +1 -0
  18. package/bin/dist/eventcatalog.js +3141 -0
  19. package/images/example.png +0 -0
  20. package/package.json +59 -52
  21. package/public/icons/github.svg +1 -0
  22. package/public/icons/x-twitter.svg +1 -0
  23. package/public/logo.png +0 -0
  24. package/public/slack-icon.svg +1 -0
  25. package/scripts/build-ci.js +22 -0
  26. package/scripts/catalog-to-astro-content-directory.js +188 -0
  27. package/scripts/default-files-for-collections/commands.md +8 -0
  28. package/scripts/default-files-for-collections/domains.md +8 -0
  29. package/scripts/default-files-for-collections/events.md +8 -0
  30. package/scripts/default-files-for-collections/services.md +8 -0
  31. package/scripts/default-files-for-collections/teams.md +11 -0
  32. package/scripts/default-files-for-collections/users.md +11 -0
  33. package/scripts/start-catalog-locally.js +23 -0
  34. package/scripts/watcher.js +53 -0
  35. package/src/components/DocsNavigation.astro +110 -0
  36. package/src/components/Header.astro +65 -0
  37. package/src/components/Lists/BasicList.tsx +59 -0
  38. package/src/components/Lists/OwnersList.tsx +101 -0
  39. package/src/components/Lists/PillList.tsx +67 -0
  40. package/src/components/Lists/VersionList.astro +29 -0
  41. package/src/components/MDX/Accordion/Accordion.astro +10 -0
  42. package/src/components/MDX/Accordion/Accordion.tsx +29 -0
  43. package/src/components/MDX/Accordion/AccordionGroup.astro +16 -0
  44. package/{components/Mdx → src/components/MDX}/Admonition.tsx +6 -5
  45. package/src/components/MDX/File.tsx +43 -0
  46. package/src/components/MDX/NodeGraph/DownloadButton.tsx +58 -0
  47. package/src/components/MDX/NodeGraph/NodeGraph.astro +82 -0
  48. package/src/components/MDX/NodeGraph/NodeGraph.tsx +135 -0
  49. package/src/components/MDX/NodeGraph/NodeGraphPortal.tsx +15 -0
  50. package/src/components/MDX/NodeGraph/Nodes/Command.tsx +74 -0
  51. package/src/components/MDX/NodeGraph/Nodes/Event.tsx +74 -0
  52. package/src/components/MDX/NodeGraph/Nodes/Service.tsx +83 -0
  53. package/src/components/MDX/OpenAPI/OpenAPI.tsx +35 -0
  54. package/src/components/MDX/Schema.tsx +45 -0
  55. package/src/components/MDX/components.tsx +24 -0
  56. package/src/components/Search.astro +108 -0
  57. package/src/components/Seo.astro +79 -0
  58. package/src/components/SideBars/DomainSideBar.astro +42 -0
  59. package/src/components/SideBars/MessageSideBar.astro +81 -0
  60. package/src/components/SideBars/ServiceSideBar.astro +93 -0
  61. package/src/components/Tables/DebouncedInput.tsx +32 -0
  62. package/src/components/Tables/Table.tsx +228 -0
  63. package/src/components/Tables/columns/DomainTableColumns.tsx +118 -0
  64. package/src/components/Tables/columns/MessageTableColumns.tsx +159 -0
  65. package/src/components/Tables/columns/ServiceTableColumns.tsx +162 -0
  66. package/src/components/Tables/columns/index.tsx +17 -0
  67. package/src/components/Tables/filters/custom-filters.ts +14 -0
  68. package/src/content/config.ts +119 -0
  69. package/src/env.d.ts +2 -0
  70. package/src/layouts/CustomDocsPageLayout.astro +100 -0
  71. package/src/layouts/DiscoverLayout.astro +120 -0
  72. package/src/layouts/DocsLayout.astro +59 -0
  73. package/src/layouts/PlainPage.astro +29 -0
  74. package/src/layouts/VisualiserLayout.astro +73 -0
  75. package/src/pages/discover/[type]/index.astro +36 -0
  76. package/src/pages/docs/[type]/[id]/[version]/index.astro +215 -0
  77. package/src/pages/docs/[type]/[id]/[version]/spec/index.astro +93 -0
  78. package/src/pages/docs/index.md +4 -0
  79. package/src/pages/docs/teams/[id]/index.astro +127 -0
  80. package/src/pages/docs/users/[id]/index.astro +132 -0
  81. package/src/pages/visualiser/[type]/[id]/[version]/index.astro +46 -0
  82. package/src/pages/visualiser/index.astro +25 -0
  83. package/src/remark-plugins/mermaid.ts +27 -0
  84. package/src/remark-plugins/remark-modified-time.mjs +9 -0
  85. package/src/types/index.ts +2 -0
  86. package/src/utils/collections/util.ts +22 -0
  87. package/src/utils/colors.ts +14 -0
  88. package/src/utils/commands/node-graph.ts +107 -0
  89. package/src/utils/commands.ts +60 -0
  90. package/src/utils/config/catalog.ts +2 -0
  91. package/src/utils/domains/domains.ts +50 -0
  92. package/src/utils/domains/node-graph.ts +60 -0
  93. package/src/utils/events/node-graph.ts +108 -0
  94. package/src/utils/events.ts +62 -0
  95. package/src/utils/example-remark-plugin.mjs +6 -0
  96. package/src/utils/messages.ts +7 -0
  97. package/src/utils/node-graph-utils/utils.ts +31 -0
  98. package/src/utils/services/node-graph.ts +133 -0
  99. package/src/utils/services/services.ts +88 -0
  100. package/src/utils/teams.ts +47 -0
  101. package/src/utils/users.ts +59 -0
  102. package/tailwind.config.mjs +24 -0
  103. package/tsconfig.json +11 -26
  104. package/.next/BUILD_ID +0 -1
  105. package/.next/build-manifest.json +0 -246
  106. package/.next/cache/.tsbuildinfo +0 -1
  107. package/.next/cache/config.json +0 -7
  108. package/.next/cache/eslint/.cache_1bay4w0 +0 -1
  109. package/.next/cache/next-server.js.nft.json +0 -1
  110. package/.next/cache/webpack/client-production/0.pack +0 -0
  111. package/.next/cache/webpack/client-production/index.pack +0 -0
  112. package/.next/cache/webpack/server-production/0.pack +0 -0
  113. package/.next/cache/webpack/server-production/index.pack +0 -0
  114. package/.next/export-detail.json +0 -1
  115. package/.next/export-marker.json +0 -1
  116. package/.next/images-manifest.json +0 -1
  117. package/.next/next-server.js.nft.json +0 -1
  118. package/.next/package.json +0 -1
  119. package/.next/prerender-manifest.json +0 -1
  120. package/.next/react-loadable-manifest.json +0 -2082
  121. package/.next/required-server-files.json +0 -1
  122. package/.next/routes-manifest.json +0 -1
  123. package/.next/server/chunks/109.js +0 -608
  124. package/.next/server/chunks/237.js +0 -109
  125. package/.next/server/chunks/267.js +0 -257
  126. package/.next/server/chunks/274.js +0 -32
  127. package/.next/server/chunks/29.js +0 -675
  128. package/.next/server/chunks/331.js +0 -750
  129. package/.next/server/chunks/362.js +0 -570
  130. package/.next/server/chunks/428.js +0 -84
  131. package/.next/server/chunks/50.js +0 -466
  132. package/.next/server/chunks/526.js +0 -159
  133. package/.next/server/chunks/537.js +0 -136
  134. package/.next/server/chunks/788.js +0 -162
  135. package/.next/server/chunks/797.js +0 -92
  136. package/.next/server/chunks/8.js +0 -173
  137. package/.next/server/chunks/854.js +0 -107
  138. package/.next/server/chunks/938.js +0 -140
  139. package/.next/server/chunks/944.js +0 -721
  140. package/.next/server/chunks/962.js +0 -13
  141. package/.next/server/chunks/97.js +0 -2829
  142. package/.next/server/chunks/992.js +0 -50
  143. package/.next/server/chunks/font-manifest.json +0 -1
  144. package/.next/server/font-manifest.json +0 -1
  145. package/.next/server/middleware-manifest.json +0 -6
  146. package/.next/server/pages/404.html +0 -12
  147. package/.next/server/pages/500.html +0 -12
  148. package/.next/server/pages/_app.js +0 -623
  149. package/.next/server/pages/_app.js.nft.json +0 -1
  150. package/.next/server/pages/_document.js +0 -120
  151. package/.next/server/pages/_document.js.nft.json +0 -1
  152. package/.next/server/pages/_error.js +0 -148
  153. package/.next/server/pages/_error.js.nft.json +0 -1
  154. package/.next/server/pages/domains/Orders/events/OrderComplete/logs.html +0 -1
  155. package/.next/server/pages/domains/Orders/events/OrderComplete/logs.json +0 -1
  156. package/.next/server/pages/domains/Orders/events/OrderComplete.html +0 -40
  157. package/.next/server/pages/domains/Orders/events/OrderComplete.json +0 -1
  158. package/.next/server/pages/domains/Orders/events/OrderConfirmed/logs.html +0 -1
  159. package/.next/server/pages/domains/Orders/events/OrderConfirmed/logs.json +0 -1
  160. package/.next/server/pages/domains/Orders/events/OrderConfirmed.html +0 -40
  161. package/.next/server/pages/domains/Orders/events/OrderConfirmed.json +0 -1
  162. package/.next/server/pages/domains/Orders/events/OrderCreated/logs.html +0 -1
  163. package/.next/server/pages/domains/Orders/events/OrderCreated/logs.json +0 -1
  164. package/.next/server/pages/domains/Orders/events/OrderCreated.html +0 -2
  165. package/.next/server/pages/domains/Orders/events/OrderCreated.json +0 -1
  166. package/.next/server/pages/domains/Orders/events/OrderRequested/logs.html +0 -1
  167. package/.next/server/pages/domains/Orders/events/OrderRequested/logs.json +0 -1
  168. package/.next/server/pages/domains/Orders/events/OrderRequested.html +0 -40
  169. package/.next/server/pages/domains/Orders/events/OrderRequested.json +0 -1
  170. package/.next/server/pages/domains/Orders/services/Orders Service.html +0 -2
  171. package/.next/server/pages/domains/Orders/services/Orders Service.json +0 -1
  172. package/.next/server/pages/domains/Orders.html +0 -2
  173. package/.next/server/pages/domains/Orders.json +0 -1
  174. package/.next/server/pages/domains/Shopping/events/AddedItemToCart/logs.html +0 -1
  175. package/.next/server/pages/domains/Shopping/events/AddedItemToCart/logs.json +0 -1
  176. package/.next/server/pages/domains/Shopping/events/AddedItemToCart/v/0.0.1.html +0 -59
  177. package/.next/server/pages/domains/Shopping/events/AddedItemToCart/v/0.0.1.json +0 -1
  178. package/.next/server/pages/domains/Shopping/events/AddedItemToCart/v/0.0.2.html +0 -66
  179. package/.next/server/pages/domains/Shopping/events/AddedItemToCart/v/0.0.2.json +0 -1
  180. package/.next/server/pages/domains/Shopping/events/AddedItemToCart.html +0 -65
  181. package/.next/server/pages/domains/Shopping/events/AddedItemToCart.json +0 -1
  182. package/.next/server/pages/domains/Shopping/events/RemovedItemFromCart/logs.html +0 -1
  183. package/.next/server/pages/domains/Shopping/events/RemovedItemFromCart/logs.json +0 -1
  184. package/.next/server/pages/domains/Shopping/events/RemovedItemFromCart.html +0 -48
  185. package/.next/server/pages/domains/Shopping/events/RemovedItemFromCart.json +0 -1
  186. package/.next/server/pages/domains/Shopping.html +0 -2
  187. package/.next/server/pages/domains/Shopping.json +0 -1
  188. package/.next/server/pages/domains/[domain]/events/[name]/logs.js +0 -345
  189. package/.next/server/pages/domains/[domain]/events/[name]/logs.js.nft.json +0 -1
  190. package/.next/server/pages/domains/[domain]/events/[name]/v/[version].js +0 -435
  191. package/.next/server/pages/domains/[domain]/events/[name]/v/[version].js.nft.json +0 -1
  192. package/.next/server/pages/domains/[domain]/events/[name].js +0 -354
  193. package/.next/server/pages/domains/[domain]/events/[name].js.nft.json +0 -1
  194. package/.next/server/pages/domains/[domain]/services/[name].js +0 -402
  195. package/.next/server/pages/domains/[domain]/services/[name].js.nft.json +0 -1
  196. package/.next/server/pages/domains/[domain].js +0 -549
  197. package/.next/server/pages/domains/[domain].js.nft.json +0 -1
  198. package/.next/server/pages/domains.html +0 -3
  199. package/.next/server/pages/domains.js +0 -576
  200. package/.next/server/pages/domains.js.nft.json +0 -1
  201. package/.next/server/pages/domains.json +0 -1
  202. package/.next/server/pages/events/PaymentProcessed/logs.html +0 -1
  203. package/.next/server/pages/events/PaymentProcessed/logs.json +0 -1
  204. package/.next/server/pages/events/PaymentProcessed.html +0 -44
  205. package/.next/server/pages/events/PaymentProcessed.json +0 -1
  206. package/.next/server/pages/events/ShipmentDelivered/logs.html +0 -1
  207. package/.next/server/pages/events/ShipmentDelivered/logs.json +0 -1
  208. package/.next/server/pages/events/ShipmentDelivered.html +0 -44
  209. package/.next/server/pages/events/ShipmentDelivered.json +0 -1
  210. package/.next/server/pages/events/ShipmentDispatched/logs.html +0 -1
  211. package/.next/server/pages/events/ShipmentDispatched/logs.json +0 -1
  212. package/.next/server/pages/events/ShipmentDispatched.html +0 -44
  213. package/.next/server/pages/events/ShipmentDispatched.json +0 -1
  214. package/.next/server/pages/events/ShipmentPrepared/logs.html +0 -1
  215. package/.next/server/pages/events/ShipmentPrepared/logs.json +0 -1
  216. package/.next/server/pages/events/ShipmentPrepared.html +0 -2
  217. package/.next/server/pages/events/ShipmentPrepared.json +0 -1
  218. package/.next/server/pages/events/[name]/logs.js +0 -263
  219. package/.next/server/pages/events/[name]/logs.js.nft.json +0 -1
  220. package/.next/server/pages/events/[name]/v/[version].js +0 -431
  221. package/.next/server/pages/events/[name]/v/[version].js.nft.json +0 -1
  222. package/.next/server/pages/events/[name].js +0 -354
  223. package/.next/server/pages/events/[name].js.nft.json +0 -1
  224. package/.next/server/pages/events.html +0 -11
  225. package/.next/server/pages/events.js +0 -789
  226. package/.next/server/pages/events.js.nft.json +0 -1
  227. package/.next/server/pages/events.json +0 -1
  228. package/.next/server/pages/index.html +0 -1
  229. package/.next/server/pages/index.js.nft.json +0 -1
  230. package/.next/server/pages/overview.html +0 -1
  231. package/.next/server/pages/overview.js +0 -240
  232. package/.next/server/pages/overview.js.nft.json +0 -1
  233. package/.next/server/pages/overview.json +0 -1
  234. package/.next/server/pages/services/Orders Service.html +0 -1
  235. package/.next/server/pages/services/Orders Service.json +0 -1
  236. package/.next/server/pages/services/Payment Service.html +0 -2
  237. package/.next/server/pages/services/Payment Service.json +0 -1
  238. package/.next/server/pages/services/Shipping Service.html +0 -2
  239. package/.next/server/pages/services/Shipping Service.json +0 -1
  240. package/.next/server/pages/services/[name].js +0 -319
  241. package/.next/server/pages/services/[name].js.nft.json +0 -1
  242. package/.next/server/pages/services.html +0 -4
  243. package/.next/server/pages/services.js +0 -741
  244. package/.next/server/pages/services.js.nft.json +0 -1
  245. package/.next/server/pages/services.json +0 -1
  246. package/.next/server/pages/users/[id].js +0 -475
  247. package/.next/server/pages/users/[id].js.nft.json +0 -1
  248. package/.next/server/pages/users/dboyne.html +0 -16
  249. package/.next/server/pages/users/dboyne.json +0 -1
  250. package/.next/server/pages/users/mSmith.html +0 -13
  251. package/.next/server/pages/users/mSmith.json +0 -1
  252. package/.next/server/pages/users.html +0 -1
  253. package/.next/server/pages/users.js.nft.json +0 -1
  254. package/.next/server/pages/visualiser.html +0 -16
  255. package/.next/server/pages/visualiser.js +0 -739
  256. package/.next/server/pages/visualiser.js.nft.json +0 -1
  257. package/.next/server/pages/visualiser.json +0 -1
  258. package/.next/server/pages-manifest.json +0 -23
  259. package/.next/server/webpack-runtime.js +0 -259
  260. package/.next/static/chunks/020d8314.2bae2f29ef0060e4.js +0 -1
  261. package/.next/static/chunks/1178-011609b6f3b123b3.js +0 -1
  262. package/.next/static/chunks/1476.eb11ab1feb4c5940.js +0 -1
  263. package/.next/static/chunks/1484.274df63eb11d9d68.js +0 -1
  264. package/.next/static/chunks/172-940ad0353b57ff98.js +0 -1
  265. package/.next/static/chunks/1750.a25eb3336a8c3a36.js +0 -1
  266. package/.next/static/chunks/2017.1b67898bd26fe157.js +0 -1
  267. package/.next/static/chunks/2027.80b01f1a7005a770.js +0 -1
  268. package/.next/static/chunks/2076.21cb0bf760a8055d.js +0 -1
  269. package/.next/static/chunks/2583.56889bb376087220.js +0 -1
  270. package/.next/static/chunks/2620-21775e17d8a6a407.js +0 -1
  271. package/.next/static/chunks/2765.dda8bae3343b6d41.js +0 -1
  272. package/.next/static/chunks/2edb282b-45c56c19221816df.js +0 -1
  273. package/.next/static/chunks/3082.62ff47793d562412.js +0 -1
  274. package/.next/static/chunks/3116-e9a578a270d9e013.js +0 -1
  275. package/.next/static/chunks/3260.00ac1405e82b8dd9.js +0 -1
  276. package/.next/static/chunks/3706.64742528652de3dd.js +0 -1
  277. package/.next/static/chunks/3ede58a6.ff6c02b372da8155.js +0 -1
  278. package/.next/static/chunks/4042.98f113bfbf744466.js +0 -1
  279. package/.next/static/chunks/4079.75a5db02e1a11105.js +0 -1
  280. package/.next/static/chunks/438.dea6dada9bd4b683.js +0 -1
  281. package/.next/static/chunks/4384-8a28a71e7e3b8d8a.js +0 -1
  282. package/.next/static/chunks/4637.6819aa53bf80d6ff.js +0 -1
  283. package/.next/static/chunks/4816.03f53c476d2a5924.js +0 -1
  284. package/.next/static/chunks/5048.73fa7a6d734ba5ef.js +0 -1
  285. package/.next/static/chunks/5202.6f686702cbb58a65.js +0 -1
  286. package/.next/static/chunks/5464.4c916df2382b5ba9.js +0 -1
  287. package/.next/static/chunks/5493-b00dc3d50ab46716.js +0 -1
  288. package/.next/static/chunks/5644.b4ffa0632405fc9f.js +0 -1
  289. package/.next/static/chunks/5a7b57ef.d0702578743545b0.js +0 -1
  290. package/.next/static/chunks/60.40ff539d26f28401.js +0 -1
  291. package/.next/static/chunks/6101.a35579324b3356df.js +0 -1
  292. package/.next/static/chunks/6194.045435de6d19fc72.js +0 -1
  293. package/.next/static/chunks/6772-fba69ba8e4fa1ef4.js +0 -1
  294. package/.next/static/chunks/6778.7885dc0a314c5a9c.js +0 -1
  295. package/.next/static/chunks/6790-f4527d80153a3e25.js +0 -1
  296. package/.next/static/chunks/7005-09e42f99859b8d03.js +0 -1
  297. package/.next/static/chunks/7109-c8d3fde4c3b6798e.js +0 -1
  298. package/.next/static/chunks/7195.2768b2bb31a65f2f.js +0 -1
  299. package/.next/static/chunks/7458.1de01a44cd67f6f0.js +0 -1
  300. package/.next/static/chunks/7f5d3f51-659399fe6f04b9eb.js +0 -1
  301. package/.next/static/chunks/8264-a1b0376ff4b3d4da.js +0 -1
  302. package/.next/static/chunks/828-ef0e36f29db31dde.js +0 -1
  303. package/.next/static/chunks/8341-b8d844d6f606aed5.js +0 -1
  304. package/.next/static/chunks/8720.e06d4cca843573db.js +0 -1
  305. package/.next/static/chunks/8785.1331b2a6d4be82c3.js +0 -1
  306. package/.next/static/chunks/8829-386c887227aab68c.js +0 -1
  307. package/.next/static/chunks/9054.ae9ffec47aacae76.js +0 -1
  308. package/.next/static/chunks/9097.1efc23284d82765c.js +0 -1
  309. package/.next/static/chunks/9231.af30fa4fedab9f01.js +0 -1
  310. package/.next/static/chunks/9497.49670ee9a8bd76f7.js +0 -1
  311. package/.next/static/chunks/9600.f70c0583d23764a8.js +0 -1
  312. package/.next/static/chunks/9822.0ad553e5c697208c.js +0 -1
  313. package/.next/static/chunks/9930.28415573db2b7806.js +0 -7
  314. package/.next/static/chunks/b9e0c7b4-52b02c0d4f161186.js +0 -1
  315. package/.next/static/chunks/d57e5a30-463f9ed8df724792.js +0 -1
  316. package/.next/static/chunks/eb6e03f4.2276f931f02e235c.js +0 -1
  317. package/.next/static/chunks/f4df0e03.56d1c15b5532ab26.js +0 -1
  318. package/.next/static/chunks/framework-6cc1bceeaaf75e91.js +0 -1
  319. package/.next/static/chunks/main-da37322a396d572a.js +0 -1
  320. package/.next/static/chunks/pages/_app-d40841fd52b70886.js +0 -1
  321. package/.next/static/chunks/pages/_error-c36fa6f7fd569cf6.js +0 -1
  322. package/.next/static/chunks/pages/domains/[domain]/events/[name]/logs-350f383eed1cf3f8.js +0 -1
  323. package/.next/static/chunks/pages/domains/[domain]/events/[name]/v/[version]-175a58a05deb2eda.js +0 -1
  324. package/.next/static/chunks/pages/domains/[domain]/events/[name]-7c7c2526e7d63883.js +0 -1
  325. package/.next/static/chunks/pages/domains/[domain]/services/[name]-f447208842a47b40.js +0 -1
  326. package/.next/static/chunks/pages/domains/[domain]-ea20e2daae1794fc.js +0 -1
  327. package/.next/static/chunks/pages/domains-71179cbdb719a0f8.js +0 -1
  328. package/.next/static/chunks/pages/events/[name]/logs-695c5b2cfd996539.js +0 -1
  329. package/.next/static/chunks/pages/events/[name]/v/[version]-af687afaafd7fd45.js +0 -1
  330. package/.next/static/chunks/pages/events/[name]-24bc568718357116.js +0 -1
  331. package/.next/static/chunks/pages/events-05ca59359ab07aa2.js +0 -1
  332. package/.next/static/chunks/pages/index-68062a10328e7d10.js +0 -1
  333. package/.next/static/chunks/pages/overview-68b31b232c5ef1ff.js +0 -1
  334. package/.next/static/chunks/pages/services/[name]-b59b95836832898e.js +0 -1
  335. package/.next/static/chunks/pages/services-2c63507ae596def3.js +0 -1
  336. package/.next/static/chunks/pages/users/[id]-7306f8a1d8a7012a.js +0 -1
  337. package/.next/static/chunks/pages/users-412f257b1de51363.js +0 -1
  338. package/.next/static/chunks/pages/visualiser-8474d03175cf9d12.js +0 -1
  339. package/.next/static/chunks/polyfills-c67a75d1b6f99dc8.js +0 -1
  340. package/.next/static/chunks/webpack-7e93d0cba2ccf996.js +0 -1
  341. package/.next/static/css/7e14b4dede1671ad.css +0 -1
  342. package/.next/static/css/94b9a747218712b2.css +0 -3
  343. package/.next/static/css/ae8abf3666c55019.css +0 -5
  344. package/.next/static/css/cc3c8fcadcf7a58b.css +0 -1
  345. package/.next/static/css/deb57cf90a65a90f.css +0 -1
  346. package/.next/static/css/ed97de5465a152bb.css +0 -1
  347. package/.next/static/rP51t_ISuRqZMVs4QvwfY/_buildManifest.js +0 -1
  348. package/.next/static/rP51t_ISuRqZMVs4QvwfY/_ssgManifest.js +0 -1
  349. package/.next/trace +0 -141
  350. package/bin/eventcatalog.js +0 -141
  351. package/components/BreadCrumbs.tsx +0 -50
  352. package/components/ContentView.tsx +0 -123
  353. package/components/Footer.tsx +0 -31
  354. package/components/Grids/DomainGrid.tsx +0 -61
  355. package/components/Grids/EventGrid.tsx +0 -102
  356. package/components/Grids/ServiceGrid.tsx +0 -84
  357. package/components/Grids/UserGrid.tsx +0 -55
  358. package/components/Header.tsx +0 -74
  359. package/components/Mdx/AsyncApiSpec.tsx +0 -25
  360. package/components/Mdx/Examples.tsx +0 -70
  361. package/components/Mdx/NodeGraph/GraphElements.tsx +0 -294
  362. package/components/Mdx/NodeGraph/GraphLayout.ts +0 -110
  363. package/components/Mdx/NodeGraph/Node.tsx +0 -15
  364. package/components/Mdx/NodeGraph/NodeGraph.tsx +0 -168
  365. package/components/Mdx/NodeGraph/__tests__/GraphElements.spec.ts +0 -102
  366. package/components/Mdx/NodeGraph/__tests__/GraphLayout.spec.ts +0 -115
  367. package/components/Mdx/NodeGraph/__tests__/__snapshots__/GraphElements.spec.ts.snap +0 -559
  368. package/components/Mdx/NodeGraph/__tests__/__snapshots__/GraphLayout.spec.ts.snap +0 -81
  369. package/components/Mdx/OpenApiSpec.tsx +0 -21
  370. package/components/Mdx/SchemaViewer/SchemaViewer.module.css +0 -5
  371. package/components/Mdx/SchemaViewer/SchemaViewer.tsx +0 -34
  372. package/components/Mermaid/index.tsx +0 -58
  373. package/components/NotFound/index.tsx +0 -40
  374. package/components/Sidebars/DomainSidebar.tsx +0 -55
  375. package/components/Sidebars/EventSidebar.tsx +0 -172
  376. package/components/Sidebars/ServiceSidebar.tsx +0 -128
  377. package/components/Sidebars/components/ExternalLinks.tsx +0 -28
  378. package/components/Sidebars/components/ItemList.tsx +0 -32
  379. package/components/Sidebars/components/Owners.tsx +0 -38
  380. package/components/Sidebars/components/Tags.tsx +0 -45
  381. package/components/SyntaxHighlighter.tsx +0 -42
  382. package/eventcatalog.config.js +0 -58
  383. package/eventcatalog.styles.css +0 -15
  384. package/hooks/EventCatalog.tsx +0 -54
  385. package/lib/__tests__/assets/domains/User/events/UserCreated/index.md +0 -20
  386. package/lib/__tests__/assets/domains/User/events/UserRemoved/examples/Basic.cs +0 -31
  387. package/lib/__tests__/assets/domains/User/events/UserRemoved/examples/Basic.js +0 -1
  388. package/lib/__tests__/assets/domains/User/events/UserRemoved/index.md +0 -16
  389. package/lib/__tests__/assets/domains/User/events/UserRemoved/schema.json +0 -4
  390. package/lib/__tests__/assets/domains/User/index.md +0 -16
  391. package/lib/__tests__/assets/domains/User/services/User Service/index.md +0 -19
  392. package/lib/__tests__/assets/events/AddedItemToCart/index.md +0 -25
  393. package/lib/__tests__/assets/events/EmailSent/index.md +0 -15
  394. package/lib/__tests__/assets/events/EventWithSchemaAndExamples/examples/Basic.cs +0 -31
  395. package/lib/__tests__/assets/events/EventWithSchemaAndExamples/examples/Basic.js +0 -1
  396. package/lib/__tests__/assets/events/EventWithSchemaAndExamples/index.md +0 -8
  397. package/lib/__tests__/assets/events/EventWithSchemaAndExamples/schema.json +0 -4
  398. package/lib/__tests__/assets/events/EventWithVersions/index.md +0 -10
  399. package/lib/__tests__/assets/events/EventWithVersions/versioned/0.0.1/index.md +0 -10
  400. package/lib/__tests__/assets/services/Basket Service/index.md +0 -26
  401. package/lib/__tests__/assets/services/Email Platform/index.md +0 -17
  402. package/lib/__tests__/assets/services/Payment Service/index.md +0 -7
  403. package/lib/__tests__/domains.spec.ts +0 -416
  404. package/lib/__tests__/events.spec.ts +0 -514
  405. package/lib/__tests__/file-reader.spec.ts +0 -69
  406. package/lib/__tests__/graphs.spec.ts +0 -88
  407. package/lib/__tests__/services.spec.ts +0 -268
  408. package/lib/analytics.ts +0 -30
  409. package/lib/domains.ts +0 -160
  410. package/lib/events.ts +0 -313
  411. package/lib/file-reader.ts +0 -76
  412. package/lib/graphs.ts +0 -92
  413. package/lib/services.ts +0 -126
  414. package/next-env.d.ts +0 -5
  415. package/next.config.js +0 -11
  416. package/out/404/index.html +0 -12
  417. package/out/404.html +0 -12
  418. package/out/_next/data/rP51t_ISuRqZMVs4QvwfY/domains/Orders/events/OrderComplete/logs.json +0 -1
  419. package/out/_next/data/rP51t_ISuRqZMVs4QvwfY/domains/Orders/events/OrderComplete.json +0 -1
  420. package/out/_next/data/rP51t_ISuRqZMVs4QvwfY/domains/Orders/events/OrderConfirmed/logs.json +0 -1
  421. package/out/_next/data/rP51t_ISuRqZMVs4QvwfY/domains/Orders/events/OrderConfirmed.json +0 -1
  422. package/out/_next/data/rP51t_ISuRqZMVs4QvwfY/domains/Orders/events/OrderCreated/logs.json +0 -1
  423. package/out/_next/data/rP51t_ISuRqZMVs4QvwfY/domains/Orders/events/OrderCreated.json +0 -1
  424. package/out/_next/data/rP51t_ISuRqZMVs4QvwfY/domains/Orders/events/OrderRequested/logs.json +0 -1
  425. package/out/_next/data/rP51t_ISuRqZMVs4QvwfY/domains/Orders/events/OrderRequested.json +0 -1
  426. package/out/_next/data/rP51t_ISuRqZMVs4QvwfY/domains/Orders/services/Orders Service.json +0 -1
  427. package/out/_next/data/rP51t_ISuRqZMVs4QvwfY/domains/Orders.json +0 -1
  428. package/out/_next/data/rP51t_ISuRqZMVs4QvwfY/domains/Shopping/events/AddedItemToCart/logs.json +0 -1
  429. package/out/_next/data/rP51t_ISuRqZMVs4QvwfY/domains/Shopping/events/AddedItemToCart/v/0.0.1.json +0 -1
  430. package/out/_next/data/rP51t_ISuRqZMVs4QvwfY/domains/Shopping/events/AddedItemToCart/v/0.0.2.json +0 -1
  431. package/out/_next/data/rP51t_ISuRqZMVs4QvwfY/domains/Shopping/events/AddedItemToCart.json +0 -1
  432. package/out/_next/data/rP51t_ISuRqZMVs4QvwfY/domains/Shopping/events/RemovedItemFromCart/logs.json +0 -1
  433. package/out/_next/data/rP51t_ISuRqZMVs4QvwfY/domains/Shopping/events/RemovedItemFromCart.json +0 -1
  434. package/out/_next/data/rP51t_ISuRqZMVs4QvwfY/domains/Shopping.json +0 -1
  435. package/out/_next/data/rP51t_ISuRqZMVs4QvwfY/domains.json +0 -1
  436. package/out/_next/data/rP51t_ISuRqZMVs4QvwfY/events/PaymentProcessed/logs.json +0 -1
  437. package/out/_next/data/rP51t_ISuRqZMVs4QvwfY/events/PaymentProcessed.json +0 -1
  438. package/out/_next/data/rP51t_ISuRqZMVs4QvwfY/events/ShipmentDelivered/logs.json +0 -1
  439. package/out/_next/data/rP51t_ISuRqZMVs4QvwfY/events/ShipmentDelivered.json +0 -1
  440. package/out/_next/data/rP51t_ISuRqZMVs4QvwfY/events/ShipmentDispatched/logs.json +0 -1
  441. package/out/_next/data/rP51t_ISuRqZMVs4QvwfY/events/ShipmentDispatched.json +0 -1
  442. package/out/_next/data/rP51t_ISuRqZMVs4QvwfY/events/ShipmentPrepared/logs.json +0 -1
  443. package/out/_next/data/rP51t_ISuRqZMVs4QvwfY/events/ShipmentPrepared.json +0 -1
  444. package/out/_next/data/rP51t_ISuRqZMVs4QvwfY/events.json +0 -1
  445. package/out/_next/data/rP51t_ISuRqZMVs4QvwfY/overview.json +0 -1
  446. package/out/_next/data/rP51t_ISuRqZMVs4QvwfY/services/Orders Service.json +0 -1
  447. package/out/_next/data/rP51t_ISuRqZMVs4QvwfY/services/Payment Service.json +0 -1
  448. package/out/_next/data/rP51t_ISuRqZMVs4QvwfY/services/Shipping Service.json +0 -1
  449. package/out/_next/data/rP51t_ISuRqZMVs4QvwfY/services.json +0 -1
  450. package/out/_next/data/rP51t_ISuRqZMVs4QvwfY/users/dboyne.json +0 -1
  451. package/out/_next/data/rP51t_ISuRqZMVs4QvwfY/users/mSmith.json +0 -1
  452. package/out/_next/data/rP51t_ISuRqZMVs4QvwfY/visualiser.json +0 -1
  453. package/out/_next/static/chunks/020d8314.2bae2f29ef0060e4.js +0 -1
  454. package/out/_next/static/chunks/1178-011609b6f3b123b3.js +0 -1
  455. package/out/_next/static/chunks/1476.eb11ab1feb4c5940.js +0 -1
  456. package/out/_next/static/chunks/1484.274df63eb11d9d68.js +0 -1
  457. package/out/_next/static/chunks/172-940ad0353b57ff98.js +0 -1
  458. package/out/_next/static/chunks/1750.a25eb3336a8c3a36.js +0 -1
  459. package/out/_next/static/chunks/2017.1b67898bd26fe157.js +0 -1
  460. package/out/_next/static/chunks/2027.80b01f1a7005a770.js +0 -1
  461. package/out/_next/static/chunks/2076.21cb0bf760a8055d.js +0 -1
  462. package/out/_next/static/chunks/2583.56889bb376087220.js +0 -1
  463. package/out/_next/static/chunks/2620-21775e17d8a6a407.js +0 -1
  464. package/out/_next/static/chunks/2765.dda8bae3343b6d41.js +0 -1
  465. package/out/_next/static/chunks/2edb282b-45c56c19221816df.js +0 -1
  466. package/out/_next/static/chunks/3082.62ff47793d562412.js +0 -1
  467. package/out/_next/static/chunks/3116-e9a578a270d9e013.js +0 -1
  468. package/out/_next/static/chunks/3260.00ac1405e82b8dd9.js +0 -1
  469. package/out/_next/static/chunks/3706.64742528652de3dd.js +0 -1
  470. package/out/_next/static/chunks/3ede58a6.ff6c02b372da8155.js +0 -1
  471. package/out/_next/static/chunks/4042.98f113bfbf744466.js +0 -1
  472. package/out/_next/static/chunks/4079.75a5db02e1a11105.js +0 -1
  473. package/out/_next/static/chunks/438.dea6dada9bd4b683.js +0 -1
  474. package/out/_next/static/chunks/4384-8a28a71e7e3b8d8a.js +0 -1
  475. package/out/_next/static/chunks/4637.6819aa53bf80d6ff.js +0 -1
  476. package/out/_next/static/chunks/4816.03f53c476d2a5924.js +0 -1
  477. package/out/_next/static/chunks/5048.73fa7a6d734ba5ef.js +0 -1
  478. package/out/_next/static/chunks/5202.6f686702cbb58a65.js +0 -1
  479. package/out/_next/static/chunks/5464.4c916df2382b5ba9.js +0 -1
  480. package/out/_next/static/chunks/5493-b00dc3d50ab46716.js +0 -1
  481. package/out/_next/static/chunks/5644.b4ffa0632405fc9f.js +0 -1
  482. package/out/_next/static/chunks/5a7b57ef.d0702578743545b0.js +0 -1
  483. package/out/_next/static/chunks/60.40ff539d26f28401.js +0 -1
  484. package/out/_next/static/chunks/6101.a35579324b3356df.js +0 -1
  485. package/out/_next/static/chunks/6194.045435de6d19fc72.js +0 -1
  486. package/out/_next/static/chunks/6772-fba69ba8e4fa1ef4.js +0 -1
  487. package/out/_next/static/chunks/6778.7885dc0a314c5a9c.js +0 -1
  488. package/out/_next/static/chunks/6790-f4527d80153a3e25.js +0 -1
  489. package/out/_next/static/chunks/7005-09e42f99859b8d03.js +0 -1
  490. package/out/_next/static/chunks/7109-c8d3fde4c3b6798e.js +0 -1
  491. package/out/_next/static/chunks/7195.2768b2bb31a65f2f.js +0 -1
  492. package/out/_next/static/chunks/7458.1de01a44cd67f6f0.js +0 -1
  493. package/out/_next/static/chunks/7f5d3f51-659399fe6f04b9eb.js +0 -1
  494. package/out/_next/static/chunks/8264-a1b0376ff4b3d4da.js +0 -1
  495. package/out/_next/static/chunks/828-ef0e36f29db31dde.js +0 -1
  496. package/out/_next/static/chunks/8341-b8d844d6f606aed5.js +0 -1
  497. package/out/_next/static/chunks/8720.e06d4cca843573db.js +0 -1
  498. package/out/_next/static/chunks/8785.1331b2a6d4be82c3.js +0 -1
  499. package/out/_next/static/chunks/8829-386c887227aab68c.js +0 -1
  500. package/out/_next/static/chunks/9054.ae9ffec47aacae76.js +0 -1
  501. package/out/_next/static/chunks/9097.1efc23284d82765c.js +0 -1
  502. package/out/_next/static/chunks/9231.af30fa4fedab9f01.js +0 -1
  503. package/out/_next/static/chunks/9497.49670ee9a8bd76f7.js +0 -1
  504. package/out/_next/static/chunks/9600.f70c0583d23764a8.js +0 -1
  505. package/out/_next/static/chunks/9822.0ad553e5c697208c.js +0 -1
  506. package/out/_next/static/chunks/9930.28415573db2b7806.js +0 -7
  507. package/out/_next/static/chunks/b9e0c7b4-52b02c0d4f161186.js +0 -1
  508. package/out/_next/static/chunks/d57e5a30-463f9ed8df724792.js +0 -1
  509. package/out/_next/static/chunks/eb6e03f4.2276f931f02e235c.js +0 -1
  510. package/out/_next/static/chunks/f4df0e03.56d1c15b5532ab26.js +0 -1
  511. package/out/_next/static/chunks/framework-6cc1bceeaaf75e91.js +0 -1
  512. package/out/_next/static/chunks/main-da37322a396d572a.js +0 -1
  513. package/out/_next/static/chunks/pages/_app-d40841fd52b70886.js +0 -1
  514. package/out/_next/static/chunks/pages/_error-c36fa6f7fd569cf6.js +0 -1
  515. package/out/_next/static/chunks/pages/domains/[domain]/events/[name]/logs-350f383eed1cf3f8.js +0 -1
  516. package/out/_next/static/chunks/pages/domains/[domain]/events/[name]/v/[version]-175a58a05deb2eda.js +0 -1
  517. package/out/_next/static/chunks/pages/domains/[domain]/events/[name]-7c7c2526e7d63883.js +0 -1
  518. package/out/_next/static/chunks/pages/domains/[domain]/services/[name]-f447208842a47b40.js +0 -1
  519. package/out/_next/static/chunks/pages/domains/[domain]-ea20e2daae1794fc.js +0 -1
  520. package/out/_next/static/chunks/pages/domains-71179cbdb719a0f8.js +0 -1
  521. package/out/_next/static/chunks/pages/events/[name]/logs-695c5b2cfd996539.js +0 -1
  522. package/out/_next/static/chunks/pages/events/[name]/v/[version]-af687afaafd7fd45.js +0 -1
  523. package/out/_next/static/chunks/pages/events/[name]-24bc568718357116.js +0 -1
  524. package/out/_next/static/chunks/pages/events-05ca59359ab07aa2.js +0 -1
  525. package/out/_next/static/chunks/pages/index-68062a10328e7d10.js +0 -1
  526. package/out/_next/static/chunks/pages/overview-68b31b232c5ef1ff.js +0 -1
  527. package/out/_next/static/chunks/pages/services/[name]-b59b95836832898e.js +0 -1
  528. package/out/_next/static/chunks/pages/services-2c63507ae596def3.js +0 -1
  529. package/out/_next/static/chunks/pages/users/[id]-7306f8a1d8a7012a.js +0 -1
  530. package/out/_next/static/chunks/pages/users-412f257b1de51363.js +0 -1
  531. package/out/_next/static/chunks/pages/visualiser-8474d03175cf9d12.js +0 -1
  532. package/out/_next/static/chunks/polyfills-c67a75d1b6f99dc8.js +0 -1
  533. package/out/_next/static/chunks/webpack-7e93d0cba2ccf996.js +0 -1
  534. package/out/_next/static/css/7e14b4dede1671ad.css +0 -1
  535. package/out/_next/static/css/94b9a747218712b2.css +0 -3
  536. package/out/_next/static/css/ae8abf3666c55019.css +0 -5
  537. package/out/_next/static/css/cc3c8fcadcf7a58b.css +0 -1
  538. package/out/_next/static/css/deb57cf90a65a90f.css +0 -1
  539. package/out/_next/static/css/ed97de5465a152bb.css +0 -1
  540. package/out/_next/static/rP51t_ISuRqZMVs4QvwfY/_buildManifest.js +0 -1
  541. package/out/_next/static/rP51t_ISuRqZMVs4QvwfY/_ssgManifest.js +0 -1
  542. package/out/domains/Orders/events/OrderComplete/index.html +0 -40
  543. package/out/domains/Orders/events/OrderComplete/logs/index.html +0 -1
  544. package/out/domains/Orders/events/OrderConfirmed/index.html +0 -40
  545. package/out/domains/Orders/events/OrderConfirmed/logs/index.html +0 -1
  546. package/out/domains/Orders/events/OrderCreated/index.html +0 -2
  547. package/out/domains/Orders/events/OrderCreated/logs/index.html +0 -1
  548. package/out/domains/Orders/events/OrderRequested/index.html +0 -40
  549. package/out/domains/Orders/events/OrderRequested/logs/index.html +0 -1
  550. package/out/domains/Orders/index.html +0 -2
  551. package/out/domains/Orders/services/Orders Service/index.html +0 -2
  552. package/out/domains/Shopping/events/AddedItemToCart/index.html +0 -65
  553. package/out/domains/Shopping/events/AddedItemToCart/logs/index.html +0 -1
  554. package/out/domains/Shopping/events/AddedItemToCart/v/0.0.1/index.html +0 -59
  555. package/out/domains/Shopping/events/AddedItemToCart/v/0.0.2/index.html +0 -66
  556. package/out/domains/Shopping/events/RemovedItemFromCart/index.html +0 -48
  557. package/out/domains/Shopping/events/RemovedItemFromCart/logs/index.html +0 -1
  558. package/out/domains/Shopping/index.html +0 -2
  559. package/out/domains/index.html +0 -3
  560. package/out/events/PaymentProcessed/index.html +0 -44
  561. package/out/events/PaymentProcessed/logs/index.html +0 -1
  562. package/out/events/ShipmentDelivered/index.html +0 -44
  563. package/out/events/ShipmentDelivered/logs/index.html +0 -1
  564. package/out/events/ShipmentDispatched/index.html +0 -44
  565. package/out/events/ShipmentDispatched/logs/index.html +0 -1
  566. package/out/events/ShipmentPrepared/index.html +0 -2
  567. package/out/events/ShipmentPrepared/logs/index.html +0 -1
  568. package/out/events/index.html +0 -11
  569. package/out/favicon.ico +0 -0
  570. package/out/index.html +0 -1
  571. package/out/logo-random.svg +0 -114
  572. package/out/logo.svg +0 -44
  573. package/out/opengraph.png +0 -0
  574. package/out/overview/index.html +0 -1
  575. package/out/services/Orders Service/index.html +0 -1
  576. package/out/services/Payment Service/index.html +0 -2
  577. package/out/services/Shipping Service/index.html +0 -2
  578. package/out/services/index.html +0 -4
  579. package/out/users/dboyne/index.html +0 -16
  580. package/out/users/index.html +0 -1
  581. package/out/users/mSmith/index.html +0 -13
  582. package/out/visualiser/index.html +0 -16
  583. package/pages/_app.tsx +0 -111
  584. package/pages/_document.tsx +0 -18
  585. package/pages/domains/[domain]/events/[name]/logs.tsx +0 -35
  586. package/pages/domains/[domain]/events/[name]/v/[version].tsx +0 -39
  587. package/pages/domains/[domain]/events/[name].tsx +0 -46
  588. package/pages/domains/[domain]/index.tsx +0 -137
  589. package/pages/domains/[domain]/services/[name].tsx +0 -42
  590. package/pages/domains.tsx +0 -210
  591. package/pages/events/[name]/logs.tsx +0 -177
  592. package/pages/events/[name]/v/[version].tsx +0 -38
  593. package/pages/events/[name].tsx +0 -223
  594. package/pages/events.tsx +0 -357
  595. package/pages/index.tsx +0 -56
  596. package/pages/overview.tsx +0 -89
  597. package/pages/services/[name].tsx +0 -164
  598. package/pages/services.tsx +0 -311
  599. package/pages/users/[id].tsx +0 -101
  600. package/pages/users.tsx +0 -43
  601. package/pages/visualiser.tsx +0 -322
  602. package/postcss.config.js +0 -6
  603. package/public/logo-random.svg +0 -114
  604. package/public/logo.svg +0 -44
  605. package/scripts/__tests__/assets/eventcatalog.config.js +0 -32
  606. package/scripts/__tests__/generate.spec.ts +0 -36
  607. package/scripts/generate.js +0 -28
  608. package/scripts/move-schemas-for-download.js +0 -80
  609. package/styles/Home.module.css +0 -116
  610. package/styles/globals.css +0 -85
  611. package/tailwind.config.js +0 -36
  612. package/types/index.ts +0 -7
  613. package/utils/random-bg.ts +0 -13
  614. /package/{lib/__tests__/assets/services/Payment Service/openapi.yaml → public/openapi.yml} +0 -0
@@ -1,2829 +0,0 @@
1
- exports.id = 97;
2
- exports.ids = [97];
3
- exports.modules = {
4
-
5
- /***/ 8282:
6
- /***/ ((__unused_webpack_module, exports) => {
7
-
8
- "use strict";
9
- var __webpack_unused_export__;
10
-
11
- __webpack_unused_export__ = ({
12
- value: true
13
- });
14
- exports.Z = _asyncToGenerator;
15
- function _asyncToGenerator(fn) {
16
- return function() {
17
- var self = this, args = arguments;
18
- return new Promise(function(resolve, reject) {
19
- var gen = fn.apply(self, args);
20
- function _next(value) {
21
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
22
- }
23
- function _throw(err) {
24
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
25
- }
26
- _next(undefined);
27
- });
28
- };
29
- }
30
- function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
31
- try {
32
- var info = gen[key](arg);
33
- var value = info.value;
34
- } catch (error) {
35
- reject(error);
36
- return;
37
- }
38
- if (info.done) {
39
- resolve(value);
40
- } else {
41
- Promise.resolve(value).then(_next, _throw);
42
- }
43
- }
44
-
45
-
46
- /***/ }),
47
-
48
- /***/ 9419:
49
- /***/ ((__unused_webpack_module, exports) => {
50
-
51
- "use strict";
52
- var __webpack_unused_export__;
53
-
54
- __webpack_unused_export__ = ({
55
- value: true
56
- });
57
- exports.Z = _extends;
58
- function _extends() {
59
- return extends_.apply(this, arguments);
60
- }
61
- function extends_() {
62
- extends_ = Object.assign || function(target) {
63
- for(var i = 1; i < arguments.length; i++){
64
- var source = arguments[i];
65
- for(var key in source){
66
- if (Object.prototype.hasOwnProperty.call(source, key)) {
67
- target[key] = source[key];
68
- }
69
- }
70
- }
71
- return target;
72
- };
73
- return extends_.apply(this, arguments);
74
- }
75
-
76
-
77
- /***/ }),
78
-
79
- /***/ 3903:
80
- /***/ ((__unused_webpack_module, exports) => {
81
-
82
- "use strict";
83
- var __webpack_unused_export__;
84
-
85
- __webpack_unused_export__ = ({
86
- value: true
87
- });
88
- exports.Z = _interopRequireDefault;
89
- function _interopRequireDefault(obj) {
90
- return obj && obj.__esModule ? obj : {
91
- default: obj
92
- };
93
- }
94
-
95
-
96
- /***/ }),
97
-
98
- /***/ 199:
99
- /***/ ((__unused_webpack_module, exports) => {
100
-
101
- "use strict";
102
- var __webpack_unused_export__;
103
-
104
- __webpack_unused_export__ = ({
105
- value: true
106
- });
107
- exports.Z = _interopRequireWildcard;
108
- function _interopRequireWildcard(obj, nodeInterop) {
109
- if (!nodeInterop && obj && obj.__esModule) {
110
- return obj;
111
- }
112
- if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
113
- return {
114
- default: obj
115
- };
116
- }
117
- var cache = _getRequireWildcardCache(nodeInterop);
118
- if (cache && cache.has(obj)) {
119
- return cache.get(obj);
120
- }
121
- var newObj = {};
122
- var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
123
- for(var key in obj){
124
- if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
125
- var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
126
- if (desc && (desc.get || desc.set)) {
127
- Object.defineProperty(newObj, key, desc);
128
- } else {
129
- newObj[key] = obj[key];
130
- }
131
- }
132
- }
133
- newObj.default = obj;
134
- if (cache) {
135
- cache.set(obj, newObj);
136
- }
137
- return newObj;
138
- }
139
- function _getRequireWildcardCache(nodeInterop1) {
140
- if (typeof WeakMap !== "function") return null;
141
- var cacheBabelInterop = new WeakMap();
142
- var cacheNodeInterop = new WeakMap();
143
- return (_getRequireWildcardCache = function(nodeInterop) {
144
- return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
145
- })(nodeInterop1);
146
- }
147
-
148
-
149
- /***/ }),
150
-
151
- /***/ 5154:
152
- /***/ ((__unused_webpack_module, exports) => {
153
-
154
- "use strict";
155
- var __webpack_unused_export__;
156
-
157
- __webpack_unused_export__ = ({
158
- value: true
159
- });
160
- exports.Z = _objectWithoutPropertiesLoose;
161
- function _objectWithoutPropertiesLoose(source, excluded) {
162
- if (source == null) return {};
163
- var target = {};
164
- var sourceKeys = Object.keys(source);
165
- var key, i;
166
- for(i = 0; i < sourceKeys.length; i++){
167
- key = sourceKeys[i];
168
- if (excluded.indexOf(key) >= 0) continue;
169
- target[key] = source[key];
170
- }
171
- return target;
172
- }
173
-
174
-
175
- /***/ }),
176
-
177
- /***/ 3952:
178
- /***/ ((module, exports, __webpack_require__) => {
179
-
180
- "use strict";
181
-
182
- Object.defineProperty(exports, "__esModule", ({
183
- value: true
184
- }));
185
- exports.addBasePath = addBasePath;
186
- var _addPathPrefix = __webpack_require__(1751);
187
- var _normalizeTrailingSlash = __webpack_require__(583);
188
- const basePath = false || "";
189
- function addBasePath(path, required) {
190
- if (false) {}
191
- return (0, _normalizeTrailingSlash).normalizePathTrailingSlash((0, _addPathPrefix).addPathPrefix(path, basePath));
192
- }
193
- if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") {
194
- Object.defineProperty(exports.default, "__esModule", {
195
- value: true
196
- });
197
- Object.assign(exports.default, exports);
198
- module.exports = exports.default;
199
- } //# sourceMappingURL=add-base-path.js.map
200
-
201
-
202
- /***/ }),
203
-
204
- /***/ 4400:
205
- /***/ ((module, exports, __webpack_require__) => {
206
-
207
- "use strict";
208
-
209
- Object.defineProperty(exports, "__esModule", ({
210
- value: true
211
- }));
212
- exports.addLocale = void 0;
213
- var _normalizeTrailingSlash = __webpack_require__(583);
214
- const addLocale = (path, ...args)=>{
215
- if (false) {}
216
- return path;
217
- };
218
- exports.addLocale = addLocale;
219
- if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") {
220
- Object.defineProperty(exports.default, "__esModule", {
221
- value: true
222
- });
223
- Object.assign(exports.default, exports);
224
- module.exports = exports.default;
225
- } //# sourceMappingURL=add-locale.js.map
226
-
227
-
228
- /***/ }),
229
-
230
- /***/ 6497:
231
- /***/ ((module, exports) => {
232
-
233
- "use strict";
234
-
235
- Object.defineProperty(exports, "__esModule", ({
236
- value: true
237
- }));
238
- exports.detectDomainLocale = void 0;
239
- const detectDomainLocale = (...args)=>{
240
- if (false) {}
241
- };
242
- exports.detectDomainLocale = detectDomainLocale;
243
- if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") {
244
- Object.defineProperty(exports.default, "__esModule", {
245
- value: true
246
- });
247
- Object.assign(exports.default, exports);
248
- module.exports = exports.default;
249
- } //# sourceMappingURL=detect-domain-locale.js.map
250
-
251
-
252
- /***/ }),
253
-
254
- /***/ 5253:
255
- /***/ ((module, exports) => {
256
-
257
- "use strict";
258
-
259
- Object.defineProperty(exports, "__esModule", ({
260
- value: true
261
- }));
262
- exports.getDomainLocale = getDomainLocale;
263
- const basePath = (/* unused pure expression or super */ null && ( false || ""));
264
- function getDomainLocale(path, locale, locales, domainLocales) {
265
- if (false) {} else {
266
- return false;
267
- }
268
- }
269
- if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") {
270
- Object.defineProperty(exports.default, "__esModule", {
271
- value: true
272
- });
273
- Object.assign(exports.default, exports);
274
- module.exports = exports.default;
275
- } //# sourceMappingURL=get-domain-locale.js.map
276
-
277
-
278
- /***/ }),
279
-
280
- /***/ 7446:
281
- /***/ ((module, exports, __webpack_require__) => {
282
-
283
- "use strict";
284
-
285
- Object.defineProperty(exports, "__esModule", ({
286
- value: true
287
- }));
288
- exports.hasBasePath = hasBasePath;
289
- var _pathHasPrefix = __webpack_require__(4567);
290
- const basePath = false || "";
291
- function hasBasePath(path) {
292
- return (0, _pathHasPrefix).pathHasPrefix(path, basePath);
293
- }
294
- if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") {
295
- Object.defineProperty(exports.default, "__esModule", {
296
- value: true
297
- });
298
- Object.assign(exports.default, exports);
299
- module.exports = exports.default;
300
- } //# sourceMappingURL=has-base-path.js.map
301
-
302
-
303
- /***/ }),
304
-
305
- /***/ 7029:
306
- /***/ ((module, exports) => {
307
-
308
- "use strict";
309
-
310
- Object.defineProperty(exports, "__esModule", ({
311
- value: true
312
- }));
313
- exports["default"] = initHeadManager;
314
- exports.isEqualNode = isEqualNode;
315
- exports.DOMAttributeNames = void 0;
316
- function initHeadManager() {
317
- return {
318
- mountedInstances: new Set(),
319
- updateHead: (head)=>{
320
- const tags = {};
321
- head.forEach((h)=>{
322
- if (// it won't be inlined. In this case revert to the original behavior
323
- h.type === "link" && h.props["data-optimized-fonts"]) {
324
- if (document.querySelector(`style[data-href="${h.props["data-href"]}"]`)) {
325
- return;
326
- } else {
327
- h.props.href = h.props["data-href"];
328
- h.props["data-href"] = undefined;
329
- }
330
- }
331
- const components = tags[h.type] || [];
332
- components.push(h);
333
- tags[h.type] = components;
334
- });
335
- const titleComponent = tags.title ? tags.title[0] : null;
336
- let title = "";
337
- if (titleComponent) {
338
- const { children } = titleComponent.props;
339
- title = typeof children === "string" ? children : Array.isArray(children) ? children.join("") : "";
340
- }
341
- if (title !== document.title) document.title = title;
342
- [
343
- "meta",
344
- "base",
345
- "link",
346
- "style",
347
- "script"
348
- ].forEach((type)=>{
349
- updateElements(type, tags[type] || []);
350
- });
351
- }
352
- };
353
- }
354
- const DOMAttributeNames = {
355
- acceptCharset: "accept-charset",
356
- className: "class",
357
- htmlFor: "for",
358
- httpEquiv: "http-equiv",
359
- noModule: "noModule"
360
- };
361
- exports.DOMAttributeNames = DOMAttributeNames;
362
- function reactElementToDOM({ type , props }) {
363
- const el = document.createElement(type);
364
- for(const p in props){
365
- if (!props.hasOwnProperty(p)) continue;
366
- if (p === "children" || p === "dangerouslySetInnerHTML") continue;
367
- // we don't render undefined props to the DOM
368
- if (props[p] === undefined) continue;
369
- const attr = DOMAttributeNames[p] || p.toLowerCase();
370
- if (type === "script" && (attr === "async" || attr === "defer" || attr === "noModule")) {
371
- el[attr] = !!props[p];
372
- } else {
373
- el.setAttribute(attr, props[p]);
374
- }
375
- }
376
- const { children , dangerouslySetInnerHTML } = props;
377
- if (dangerouslySetInnerHTML) {
378
- el.innerHTML = dangerouslySetInnerHTML.__html || "";
379
- } else if (children) {
380
- el.textContent = typeof children === "string" ? children : Array.isArray(children) ? children.join("") : "";
381
- }
382
- return el;
383
- }
384
- function isEqualNode(oldTag, newTag) {
385
- if (oldTag instanceof HTMLElement && newTag instanceof HTMLElement) {
386
- const nonce = newTag.getAttribute("nonce");
387
- // Only strip the nonce if `oldTag` has had it stripped. An element's nonce attribute will not
388
- // be stripped if there is no content security policy response header that includes a nonce.
389
- if (nonce && !oldTag.getAttribute("nonce")) {
390
- const cloneTag = newTag.cloneNode(true);
391
- cloneTag.setAttribute("nonce", "");
392
- cloneTag.nonce = nonce;
393
- return nonce === oldTag.nonce && oldTag.isEqualNode(cloneTag);
394
- }
395
- }
396
- return oldTag.isEqualNode(newTag);
397
- }
398
- function updateElements(type, components) {
399
- const headEl = document.getElementsByTagName("head")[0];
400
- const headCountEl = headEl.querySelector("meta[name=next-head-count]");
401
- if (false) {}
402
- const headCount = Number(headCountEl.content);
403
- const oldTags = [];
404
- for(let i = 0, j = headCountEl.previousElementSibling; i < headCount; i++, j = (j == null ? void 0 : j.previousElementSibling) || null){
405
- var ref;
406
- if ((j == null ? void 0 : (ref = j.tagName) == null ? void 0 : ref.toLowerCase()) === type) {
407
- oldTags.push(j);
408
- }
409
- }
410
- const newTags = components.map(reactElementToDOM).filter((newTag)=>{
411
- for(let k = 0, len = oldTags.length; k < len; k++){
412
- const oldTag = oldTags[k];
413
- if (isEqualNode(oldTag, newTag)) {
414
- oldTags.splice(k, 1);
415
- return false;
416
- }
417
- }
418
- return true;
419
- });
420
- oldTags.forEach((t)=>{
421
- var ref;
422
- return (ref = t.parentNode) == null ? void 0 : ref.removeChild(t);
423
- });
424
- newTags.forEach((t)=>headEl.insertBefore(t, headCountEl));
425
- headCountEl.content = (headCount - oldTags.length + newTags.length).toString();
426
- }
427
- if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") {
428
- Object.defineProperty(exports.default, "__esModule", {
429
- value: true
430
- });
431
- Object.assign(exports.default, exports);
432
- module.exports = exports.default;
433
- } //# sourceMappingURL=head-manager.js.map
434
-
435
-
436
- /***/ }),
437
-
438
- /***/ 162:
439
- /***/ ((module, exports, __webpack_require__) => {
440
-
441
- "use strict";
442
-
443
- "client";
444
- Object.defineProperty(exports, "__esModule", ({
445
- value: true
446
- }));
447
- exports["default"] = void 0;
448
- var _interop_require_default = (__webpack_require__(3903)/* ["default"] */ .Z);
449
- var _object_without_properties_loose = (__webpack_require__(5154)/* ["default"] */ .Z);
450
- var _react = _interop_require_default(__webpack_require__(6689));
451
- var _router = __webpack_require__(9918);
452
- var _addLocale = __webpack_require__(4400);
453
- var _routerContext = __webpack_require__(4964);
454
- var _appRouterContext = __webpack_require__(3280);
455
- var _useIntersection = __webpack_require__(2030);
456
- var _getDomainLocale = __webpack_require__(5253);
457
- var _addBasePath = __webpack_require__(3952);
458
- "client";
459
- const prefetched = {};
460
- function prefetch(router, href, as, options) {
461
- if (true) return;
462
- if (!(0, _router).isLocalURL(href)) return;
463
- // Prefetch the JSON page if asked (only in the client)
464
- // We need to handle a prefetch error here since we may be
465
- // loading with priority which can reject but we don't
466
- // want to force navigation since this is only a prefetch
467
- Promise.resolve(router.prefetch(href, as, options)).catch((err)=>{
468
- if (false) {}
469
- });
470
- const curLocale = options && typeof options.locale !== "undefined" ? options.locale : router && router.locale;
471
- // Join on an invalid URI character
472
- prefetched[href + "%" + as + (curLocale ? "%" + curLocale : "")] = true;
473
- }
474
- function isModifiedEvent(event) {
475
- const { target } = event.currentTarget;
476
- return target && target !== "_self" || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey || event.nativeEvent && event.nativeEvent.which === 2;
477
- }
478
- function linkClicked(e, router, href, as, replace, shallow, scroll, locale, isAppRouter, prefetchEnabled) {
479
- const { nodeName } = e.currentTarget;
480
- // anchors inside an svg have a lowercase nodeName
481
- const isAnchorNodeName = nodeName.toUpperCase() === "A";
482
- if (isAnchorNodeName && (isModifiedEvent(e) || !(0, _router).isLocalURL(href))) {
483
- // ignore click for browser’s default behavior
484
- return;
485
- }
486
- e.preventDefault();
487
- const navigate = ()=>{
488
- // If the router is an NextRouter instance it will have `beforePopState`
489
- if ("beforePopState" in router) {
490
- router[replace ? "replace" : "push"](href, as, {
491
- shallow,
492
- locale,
493
- scroll
494
- });
495
- } else {
496
- // If `beforePopState` doesn't exist on the router it's the AppRouter.
497
- const method = replace ? "replace" : "push";
498
- router[method](href, {
499
- forceOptimisticNavigation: !prefetchEnabled
500
- });
501
- }
502
- };
503
- if (isAppRouter) {
504
- // @ts-expect-error startTransition exists.
505
- _react.default.startTransition(navigate);
506
- } else {
507
- navigate();
508
- }
509
- }
510
- const Link = /*#__PURE__*/ _react.default.forwardRef(function LinkComponent(props, forwardedRef) {
511
- if (false) {}
512
- let children;
513
- const { href: hrefProp , as: asProp , children: childrenProp , prefetch: prefetchProp , passHref , replace , shallow , scroll , locale , onClick , onMouseEnter , onTouchStart , legacyBehavior =Boolean(false) !== true } = props, restProps = _object_without_properties_loose(props, [
514
- "href",
515
- "as",
516
- "children",
517
- "prefetch",
518
- "passHref",
519
- "replace",
520
- "shallow",
521
- "scroll",
522
- "locale",
523
- "onClick",
524
- "onMouseEnter",
525
- "onTouchStart",
526
- "legacyBehavior"
527
- ]);
528
- children = childrenProp;
529
- if (legacyBehavior && (typeof children === "string" || typeof children === "number")) {
530
- children = /*#__PURE__*/ _react.default.createElement("a", null, children);
531
- }
532
- const p = prefetchProp !== false;
533
- let router = _react.default.useContext(_routerContext.RouterContext);
534
- // TODO-APP: type error. Remove `as any`
535
- const appRouter = _react.default.useContext(_appRouterContext.AppRouterContext);
536
- if (appRouter) {
537
- router = appRouter;
538
- }
539
- const { href , as } = _react.default.useMemo(()=>{
540
- const [resolvedHref, resolvedAs] = (0, _router).resolveHref(router, hrefProp, true);
541
- return {
542
- href: resolvedHref,
543
- as: asProp ? (0, _router).resolveHref(router, asProp) : resolvedAs || resolvedHref
544
- };
545
- }, [
546
- router,
547
- hrefProp,
548
- asProp
549
- ]);
550
- const previousHref = _react.default.useRef(href);
551
- const previousAs = _react.default.useRef(as);
552
- // This will return the first child, if multiple are provided it will throw an error
553
- let child;
554
- if (legacyBehavior) {
555
- if (false) {} else {
556
- child = _react.default.Children.only(children);
557
- }
558
- }
559
- const childRef = legacyBehavior ? child && typeof child === "object" && child.ref : forwardedRef;
560
- const [setIntersectionRef, isVisible, resetVisible] = (0, _useIntersection).useIntersection({
561
- rootMargin: "200px"
562
- });
563
- const setRef = _react.default.useCallback((el)=>{
564
- // Before the link getting observed, check if visible state need to be reset
565
- if (previousAs.current !== as || previousHref.current !== href) {
566
- resetVisible();
567
- previousAs.current = as;
568
- previousHref.current = href;
569
- }
570
- setIntersectionRef(el);
571
- if (childRef) {
572
- if (typeof childRef === "function") childRef(el);
573
- else if (typeof childRef === "object") {
574
- childRef.current = el;
575
- }
576
- }
577
- }, [
578
- as,
579
- childRef,
580
- href,
581
- resetVisible,
582
- setIntersectionRef
583
- ]);
584
- _react.default.useEffect(()=>{
585
- const shouldPrefetch = isVisible && p && (0, _router).isLocalURL(href);
586
- const curLocale = typeof locale !== "undefined" ? locale : router && router.locale;
587
- const isPrefetched = prefetched[href + "%" + as + (curLocale ? "%" + curLocale : "")];
588
- if (shouldPrefetch && !isPrefetched) {
589
- prefetch(router, href, as, {
590
- locale: curLocale
591
- });
592
- }
593
- }, [
594
- as,
595
- href,
596
- isVisible,
597
- locale,
598
- p,
599
- router
600
- ]);
601
- const childProps = {
602
- ref: setRef,
603
- onClick: (e)=>{
604
- if (false) {}
605
- if (!legacyBehavior && typeof onClick === "function") {
606
- onClick(e);
607
- }
608
- if (legacyBehavior && child.props && typeof child.props.onClick === "function") {
609
- child.props.onClick(e);
610
- }
611
- if (!e.defaultPrevented) {
612
- linkClicked(e, router, href, as, replace, shallow, scroll, locale, Boolean(appRouter), p);
613
- }
614
- },
615
- onMouseEnter: (e)=>{
616
- if (!legacyBehavior && typeof onMouseEnter === "function") {
617
- onMouseEnter(e);
618
- }
619
- if (legacyBehavior && child.props && typeof child.props.onMouseEnter === "function") {
620
- child.props.onMouseEnter(e);
621
- }
622
- // Check for not prefetch disabled in page using appRouter
623
- if (!(!p && appRouter)) {
624
- if ((0, _router).isLocalURL(href)) {
625
- prefetch(router, href, as, {
626
- priority: true
627
- });
628
- }
629
- }
630
- },
631
- onTouchStart: (e)=>{
632
- if (!legacyBehavior && typeof onTouchStart === "function") {
633
- onTouchStart(e);
634
- }
635
- if (legacyBehavior && child.props && typeof child.props.onTouchStart === "function") {
636
- child.props.onTouchStart(e);
637
- }
638
- // Check for not prefetch disabled in page using appRouter
639
- if (!(!p && appRouter)) {
640
- if ((0, _router).isLocalURL(href)) {
641
- prefetch(router, href, as, {
642
- priority: true
643
- });
644
- }
645
- }
646
- }
647
- };
648
- // If child is an <a> tag and doesn't have a href attribute, or if the 'passHref' property is
649
- // defined, we specify the current 'href', so that repetition is not needed by the user
650
- if (!legacyBehavior || passHref || child.type === "a" && !("href" in child.props)) {
651
- const curLocale = typeof locale !== "undefined" ? locale : router && router.locale;
652
- // we only render domain locales if we are currently on a domain locale
653
- // so that locale links are still visitable in development/preview envs
654
- const localeDomain = router && router.isLocaleDomain && (0, _getDomainLocale).getDomainLocale(as, curLocale, router.locales, router.domainLocales);
655
- childProps.href = localeDomain || (0, _addBasePath).addBasePath((0, _addLocale).addLocale(as, curLocale, router && router.defaultLocale));
656
- }
657
- return legacyBehavior ? /*#__PURE__*/ _react.default.cloneElement(child, childProps) : /*#__PURE__*/ _react.default.createElement("a", Object.assign({}, restProps, childProps), children);
658
- });
659
- var _default = Link;
660
- exports["default"] = _default;
661
- if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") {
662
- Object.defineProperty(exports.default, "__esModule", {
663
- value: true
664
- });
665
- Object.assign(exports.default, exports);
666
- module.exports = exports.default;
667
- } //# sourceMappingURL=link.js.map
668
-
669
-
670
- /***/ }),
671
-
672
- /***/ 583:
673
- /***/ ((module, exports, __webpack_require__) => {
674
-
675
- "use strict";
676
-
677
- Object.defineProperty(exports, "__esModule", ({
678
- value: true
679
- }));
680
- exports.normalizePathTrailingSlash = void 0;
681
- var _removeTrailingSlash = __webpack_require__(3297);
682
- var _parsePath = __webpack_require__(8854);
683
- const normalizePathTrailingSlash = (path)=>{
684
- if (!path.startsWith("/") || undefined) {
685
- return path;
686
- }
687
- const { pathname , query , hash } = (0, _parsePath).parsePath(path);
688
- if (true) {
689
- if (/\.[^/]+\/?$/.test(pathname)) {
690
- return `${(0, _removeTrailingSlash).removeTrailingSlash(pathname)}${query}${hash}`;
691
- } else if (pathname.endsWith("/")) {
692
- return `${pathname}${query}${hash}`;
693
- } else {
694
- return `${pathname}/${query}${hash}`;
695
- }
696
- }
697
- return `${(0, _removeTrailingSlash).removeTrailingSlash(pathname)}${query}${hash}`;
698
- };
699
- exports.normalizePathTrailingSlash = normalizePathTrailingSlash;
700
- if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") {
701
- Object.defineProperty(exports.default, "__esModule", {
702
- value: true
703
- });
704
- Object.assign(exports.default, exports);
705
- module.exports = exports.default;
706
- } //# sourceMappingURL=normalize-trailing-slash.js.map
707
-
708
-
709
- /***/ }),
710
-
711
- /***/ 4293:
712
- /***/ ((module, exports, __webpack_require__) => {
713
-
714
- "use strict";
715
-
716
- Object.defineProperty(exports, "__esModule", ({
717
- value: true
718
- }));
719
- exports.removeBasePath = removeBasePath;
720
- var _hasBasePath = __webpack_require__(7446);
721
- const basePath = false || "";
722
- function removeBasePath(path) {
723
- if (false) {}
724
- path = path.slice(basePath.length);
725
- if (!path.startsWith("/")) path = `/${path}`;
726
- return path;
727
- }
728
- if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") {
729
- Object.defineProperty(exports.default, "__esModule", {
730
- value: true
731
- });
732
- Object.assign(exports.default, exports);
733
- module.exports = exports.default;
734
- } //# sourceMappingURL=remove-base-path.js.map
735
-
736
-
737
- /***/ }),
738
-
739
- /***/ 2061:
740
- /***/ ((module, exports, __webpack_require__) => {
741
-
742
- "use strict";
743
-
744
- Object.defineProperty(exports, "__esModule", ({
745
- value: true
746
- }));
747
- exports.removeLocale = removeLocale;
748
- var _parsePath = __webpack_require__(8854);
749
- function removeLocale(path, locale) {
750
- if (false) {}
751
- return path;
752
- }
753
- if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") {
754
- Object.defineProperty(exports.default, "__esModule", {
755
- value: true
756
- });
757
- Object.assign(exports.default, exports);
758
- module.exports = exports.default;
759
- } //# sourceMappingURL=remove-locale.js.map
760
-
761
-
762
- /***/ }),
763
-
764
- /***/ 9071:
765
- /***/ ((module, exports) => {
766
-
767
- "use strict";
768
-
769
- Object.defineProperty(exports, "__esModule", ({
770
- value: true
771
- }));
772
- exports.cancelIdleCallback = exports.requestIdleCallback = void 0;
773
- const requestIdleCallback = typeof self !== "undefined" && self.requestIdleCallback && self.requestIdleCallback.bind(window) || function(cb) {
774
- let start = Date.now();
775
- return setTimeout(function() {
776
- cb({
777
- didTimeout: false,
778
- timeRemaining: function() {
779
- return Math.max(0, 50 - (Date.now() - start));
780
- }
781
- });
782
- }, 1);
783
- };
784
- exports.requestIdleCallback = requestIdleCallback;
785
- const cancelIdleCallback = typeof self !== "undefined" && self.cancelIdleCallback && self.cancelIdleCallback.bind(window) || function(id) {
786
- return clearTimeout(id);
787
- };
788
- exports.cancelIdleCallback = cancelIdleCallback;
789
- if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") {
790
- Object.defineProperty(exports.default, "__esModule", {
791
- value: true
792
- });
793
- Object.assign(exports.default, exports);
794
- module.exports = exports.default;
795
- } //# sourceMappingURL=request-idle-callback.js.map
796
-
797
-
798
- /***/ }),
799
-
800
- /***/ 1437:
801
- /***/ ((module, exports, __webpack_require__) => {
802
-
803
- "use strict";
804
-
805
- Object.defineProperty(exports, "__esModule", ({
806
- value: true
807
- }));
808
- exports.markAssetError = markAssetError;
809
- exports.isAssetError = isAssetError;
810
- exports.getClientBuildManifest = getClientBuildManifest;
811
- exports.createRouteLoader = createRouteLoader;
812
- var _interop_require_default = (__webpack_require__(3903)/* ["default"] */ .Z);
813
- var _getAssetPathFromRoute = _interop_require_default(__webpack_require__(9565));
814
- var _trustedTypes = __webpack_require__(4227);
815
- var _requestIdleCallback = __webpack_require__(9071);
816
- // 3.8s was arbitrarily chosen as it's what https://web.dev/interactive
817
- // considers as "Good" time-to-interactive. We must assume something went
818
- // wrong beyond this point, and then fall-back to a full page transition to
819
- // show the user something of value.
820
- const MS_MAX_IDLE_DELAY = 3800;
821
- function withFuture(key, map, generator) {
822
- let entry = map.get(key);
823
- if (entry) {
824
- if ("future" in entry) {
825
- return entry.future;
826
- }
827
- return Promise.resolve(entry);
828
- }
829
- let resolver;
830
- const prom = new Promise((resolve)=>{
831
- resolver = resolve;
832
- });
833
- map.set(key, entry = {
834
- resolve: resolver,
835
- future: prom
836
- });
837
- return generator ? generator() // eslint-disable-next-line no-sequences
838
- .then((value)=>(resolver(value), value)).catch((err)=>{
839
- map.delete(key);
840
- throw err;
841
- }) : prom;
842
- }
843
- function hasPrefetch(link) {
844
- try {
845
- link = document.createElement("link");
846
- return(// with relList.support
847
- !!window.MSInputMethodContext && !!document.documentMode || link.relList.supports("prefetch"));
848
- } catch (e) {
849
- return false;
850
- }
851
- }
852
- const canPrefetch = hasPrefetch();
853
- function prefetchViaDom(href, as, link) {
854
- return new Promise((res, rej)=>{
855
- const selector = `
856
- link[rel="prefetch"][href^="${href}"],
857
- link[rel="preload"][href^="${href}"],
858
- script[src^="${href}"]`;
859
- if (document.querySelector(selector)) {
860
- return res();
861
- }
862
- link = document.createElement("link");
863
- // The order of property assignment here is intentional:
864
- if (as) link.as = as;
865
- link.rel = `prefetch`;
866
- link.crossOrigin = undefined;
867
- link.onload = res;
868
- link.onerror = rej;
869
- // `href` should always be last:
870
- link.href = href;
871
- document.head.appendChild(link);
872
- });
873
- }
874
- const ASSET_LOAD_ERROR = Symbol("ASSET_LOAD_ERROR");
875
- function markAssetError(err) {
876
- return Object.defineProperty(err, ASSET_LOAD_ERROR, {});
877
- }
878
- function isAssetError(err) {
879
- return err && ASSET_LOAD_ERROR in err;
880
- }
881
- function appendScript(src, script) {
882
- return new Promise((resolve, reject)=>{
883
- script = document.createElement("script");
884
- // The order of property assignment here is intentional.
885
- // 1. Setup success/failure hooks in case the browser synchronously
886
- // executes when `src` is set.
887
- script.onload = resolve;
888
- script.onerror = ()=>reject(markAssetError(new Error(`Failed to load script: ${src}`)));
889
- // 2. Configure the cross-origin attribute before setting `src` in case the
890
- // browser begins to fetch.
891
- script.crossOrigin = undefined;
892
- // 3. Finally, set the source and inject into the DOM in case the child
893
- // must be appended for fetching to start.
894
- script.src = src;
895
- document.body.appendChild(script);
896
- });
897
- }
898
- // We wait for pages to be built in dev before we start the route transition
899
- // timeout to prevent an un-necessary hard navigation in development.
900
- let devBuildPromise;
901
- // Resolve a promise that times out after given amount of milliseconds.
902
- function resolvePromiseWithTimeout(p, ms, err) {
903
- return new Promise((resolve, reject)=>{
904
- let cancelled = false;
905
- p.then((r)=>{
906
- // Resolved, cancel the timeout
907
- cancelled = true;
908
- resolve(r);
909
- }).catch(reject);
910
- // We wrap these checks separately for better dead-code elimination in
911
- // production bundles.
912
- if (false) {}
913
- if (true) {
914
- (0, _requestIdleCallback).requestIdleCallback(()=>setTimeout(()=>{
915
- if (!cancelled) {
916
- reject(err);
917
- }
918
- }, ms));
919
- }
920
- });
921
- }
922
- function getClientBuildManifest() {
923
- if (self.__BUILD_MANIFEST) {
924
- return Promise.resolve(self.__BUILD_MANIFEST);
925
- }
926
- const onBuildManifest = new Promise((resolve)=>{
927
- // Mandatory because this is not concurrent safe:
928
- const cb = self.__BUILD_MANIFEST_CB;
929
- self.__BUILD_MANIFEST_CB = ()=>{
930
- resolve(self.__BUILD_MANIFEST);
931
- cb && cb();
932
- };
933
- });
934
- return resolvePromiseWithTimeout(onBuildManifest, MS_MAX_IDLE_DELAY, markAssetError(new Error("Failed to load client build manifest")));
935
- }
936
- function getFilesForRoute(assetPrefix, route) {
937
- if (false) {}
938
- return getClientBuildManifest().then((manifest)=>{
939
- if (!(route in manifest)) {
940
- throw markAssetError(new Error(`Failed to lookup route: ${route}`));
941
- }
942
- const allFiles = manifest[route].map((entry)=>assetPrefix + "/_next/" + encodeURI(entry));
943
- return {
944
- scripts: allFiles.filter((v)=>v.endsWith(".js")).map((v)=>(0, _trustedTypes).__unsafeCreateTrustedScriptURL(v)),
945
- css: allFiles.filter((v)=>v.endsWith(".css"))
946
- };
947
- });
948
- }
949
- function createRouteLoader(assetPrefix) {
950
- const entrypoints = new Map();
951
- const loadedScripts = new Map();
952
- const styleSheets = new Map();
953
- const routes = new Map();
954
- function maybeExecuteScript(src) {
955
- // With HMR we might need to "reload" scripts when they are
956
- // disposed and readded. Executing scripts twice has no functional
957
- // differences
958
- if (true) {
959
- let prom = loadedScripts.get(src.toString());
960
- if (prom) {
961
- return prom;
962
- }
963
- // Skip executing script if it's already in the DOM:
964
- if (document.querySelector(`script[src^="${src}"]`)) {
965
- return Promise.resolve();
966
- }
967
- loadedScripts.set(src.toString(), prom = appendScript(src));
968
- return prom;
969
- } else {}
970
- }
971
- function fetchStyleSheet(href) {
972
- let prom = styleSheets.get(href);
973
- if (prom) {
974
- return prom;
975
- }
976
- styleSheets.set(href, prom = fetch(href).then((res)=>{
977
- if (!res.ok) {
978
- throw new Error(`Failed to load stylesheet: ${href}`);
979
- }
980
- return res.text().then((text)=>({
981
- href: href,
982
- content: text
983
- }));
984
- }).catch((err)=>{
985
- throw markAssetError(err);
986
- }));
987
- return prom;
988
- }
989
- return {
990
- whenEntrypoint (route) {
991
- return withFuture(route, entrypoints);
992
- },
993
- onEntrypoint (route, execute) {
994
- (execute ? Promise.resolve().then(()=>execute()).then((exports1)=>({
995
- component: exports1 && exports1.default || exports1,
996
- exports: exports1
997
- }), (err)=>({
998
- error: err
999
- })) : Promise.resolve(undefined)).then((input)=>{
1000
- const old = entrypoints.get(route);
1001
- if (old && "resolve" in old) {
1002
- if (input) {
1003
- entrypoints.set(route, input);
1004
- old.resolve(input);
1005
- }
1006
- } else {
1007
- if (input) {
1008
- entrypoints.set(route, input);
1009
- } else {
1010
- entrypoints.delete(route);
1011
- }
1012
- // when this entrypoint has been resolved before
1013
- // the route is outdated and we want to invalidate
1014
- // this cache entry
1015
- routes.delete(route);
1016
- }
1017
- });
1018
- },
1019
- loadRoute (route, prefetch) {
1020
- return withFuture(route, routes, ()=>{
1021
- let devBuildPromiseResolve;
1022
- if (false) {}
1023
- return resolvePromiseWithTimeout(getFilesForRoute(assetPrefix, route).then(({ scripts , css })=>{
1024
- return Promise.all([
1025
- entrypoints.has(route) ? [] : Promise.all(scripts.map(maybeExecuteScript)),
1026
- Promise.all(css.map(fetchStyleSheet)),
1027
- ]);
1028
- }).then((res)=>{
1029
- return this.whenEntrypoint(route).then((entrypoint)=>({
1030
- entrypoint,
1031
- styles: res[1]
1032
- }));
1033
- }), MS_MAX_IDLE_DELAY, markAssetError(new Error(`Route did not complete loading: ${route}`))).then(({ entrypoint , styles })=>{
1034
- const res = Object.assign({
1035
- styles: styles
1036
- }, entrypoint);
1037
- return "error" in entrypoint ? entrypoint : res;
1038
- }).catch((err)=>{
1039
- if (prefetch) {
1040
- // we don't want to cache errors during prefetch
1041
- throw err;
1042
- }
1043
- return {
1044
- error: err
1045
- };
1046
- }).finally(()=>{
1047
- return devBuildPromiseResolve == null ? void 0 : devBuildPromiseResolve();
1048
- });
1049
- });
1050
- },
1051
- prefetch (route) {
1052
- // https://github.com/GoogleChromeLabs/quicklink/blob/453a661fa1fa940e2d2e044452398e38c67a98fb/src/index.mjs#L115-L118
1053
- // License: Apache 2.0
1054
- let cn;
1055
- if (cn = navigator.connection) {
1056
- // Don't prefetch if using 2G or if Save-Data is enabled.
1057
- if (cn.saveData || /2g/.test(cn.effectiveType)) return Promise.resolve();
1058
- }
1059
- return getFilesForRoute(assetPrefix, route).then((output)=>Promise.all(canPrefetch ? output.scripts.map((script)=>prefetchViaDom(script.toString(), "script")) : [])).then(()=>{
1060
- (0, _requestIdleCallback).requestIdleCallback(()=>this.loadRoute(route, true).catch(()=>{}));
1061
- }).catch(()=>{});
1062
- }
1063
- };
1064
- }
1065
- if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") {
1066
- Object.defineProperty(exports.default, "__esModule", {
1067
- value: true
1068
- });
1069
- Object.assign(exports.default, exports);
1070
- module.exports = exports.default;
1071
- } //# sourceMappingURL=route-loader.js.map
1072
-
1073
-
1074
- /***/ }),
1075
-
1076
- /***/ 747:
1077
- /***/ ((module, exports, __webpack_require__) => {
1078
-
1079
- "use strict";
1080
-
1081
- "client";
1082
- Object.defineProperty(exports, "__esModule", ({
1083
- value: true
1084
- }));
1085
- exports.handleClientScriptLoad = handleClientScriptLoad;
1086
- exports.initScriptLoader = initScriptLoader;
1087
- exports["default"] = void 0;
1088
- var _extends = (__webpack_require__(9419)/* ["default"] */ .Z);
1089
- var _interop_require_wildcard = (__webpack_require__(199)/* ["default"] */ .Z);
1090
- var _object_without_properties_loose = (__webpack_require__(5154)/* ["default"] */ .Z);
1091
- var _react = _interop_require_wildcard(__webpack_require__(6689));
1092
- var _headManagerContext = __webpack_require__(2796);
1093
- var _headManager = __webpack_require__(7029);
1094
- var _requestIdleCallback = __webpack_require__(9071);
1095
- "client";
1096
- const ScriptCache = new Map();
1097
- const LoadCache = new Set();
1098
- const ignoreProps = [
1099
- "onLoad",
1100
- "onReady",
1101
- "dangerouslySetInnerHTML",
1102
- "children",
1103
- "onError",
1104
- "strategy",
1105
- ];
1106
- const loadScript = (props)=>{
1107
- const { src , id , onLoad =()=>{} , onReady =null , dangerouslySetInnerHTML , children ="" , strategy ="afterInteractive" , onError , } = props;
1108
- const cacheKey = id || src;
1109
- // Script has already loaded
1110
- if (cacheKey && LoadCache.has(cacheKey)) {
1111
- return;
1112
- }
1113
- // Contents of this script are already loading/loaded
1114
- if (ScriptCache.has(src)) {
1115
- LoadCache.add(cacheKey);
1116
- // It is possible that multiple `next/script` components all have same "src", but has different "onLoad"
1117
- // This is to make sure the same remote script will only load once, but "onLoad" are executed in order
1118
- ScriptCache.get(src).then(onLoad, onError);
1119
- return;
1120
- }
1121
- /** Execute after the script first loaded */ const afterLoad = ()=>{
1122
- // Run onReady for the first time after load event
1123
- if (onReady) {
1124
- onReady();
1125
- }
1126
- // add cacheKey to LoadCache when load successfully
1127
- LoadCache.add(cacheKey);
1128
- };
1129
- const el = document.createElement("script");
1130
- const loadPromise = new Promise((resolve, reject)=>{
1131
- el.addEventListener("load", function(e) {
1132
- resolve();
1133
- if (onLoad) {
1134
- onLoad.call(this, e);
1135
- }
1136
- afterLoad();
1137
- });
1138
- el.addEventListener("error", function(e) {
1139
- reject(e);
1140
- });
1141
- }).catch(function(e) {
1142
- if (onError) {
1143
- onError(e);
1144
- }
1145
- });
1146
- if (dangerouslySetInnerHTML) {
1147
- el.innerHTML = dangerouslySetInnerHTML.__html || "";
1148
- afterLoad();
1149
- } else if (children) {
1150
- el.textContent = typeof children === "string" ? children : Array.isArray(children) ? children.join("") : "";
1151
- afterLoad();
1152
- } else if (src) {
1153
- el.src = src;
1154
- // do not add cacheKey into LoadCache for remote script here
1155
- // cacheKey will be added to LoadCache when it is actually loaded (see loadPromise above)
1156
- ScriptCache.set(src, loadPromise);
1157
- }
1158
- for (const [k, value] of Object.entries(props)){
1159
- if (value === undefined || ignoreProps.includes(k)) {
1160
- continue;
1161
- }
1162
- const attr = _headManager.DOMAttributeNames[k] || k.toLowerCase();
1163
- el.setAttribute(attr, value);
1164
- }
1165
- if (strategy === "worker") {
1166
- el.setAttribute("type", "text/partytown");
1167
- }
1168
- el.setAttribute("data-nscript", strategy);
1169
- document.body.appendChild(el);
1170
- };
1171
- function handleClientScriptLoad(props) {
1172
- const { strategy ="afterInteractive" } = props;
1173
- if (strategy === "lazyOnload") {
1174
- window.addEventListener("load", ()=>{
1175
- (0, _requestIdleCallback).requestIdleCallback(()=>loadScript(props));
1176
- });
1177
- } else {
1178
- loadScript(props);
1179
- }
1180
- }
1181
- function loadLazyScript(props) {
1182
- if (document.readyState === "complete") {
1183
- (0, _requestIdleCallback).requestIdleCallback(()=>loadScript(props));
1184
- } else {
1185
- window.addEventListener("load", ()=>{
1186
- (0, _requestIdleCallback).requestIdleCallback(()=>loadScript(props));
1187
- });
1188
- }
1189
- }
1190
- function addBeforeInteractiveToCache() {
1191
- const scripts = [
1192
- ...document.querySelectorAll('[data-nscript="beforeInteractive"]'),
1193
- ...document.querySelectorAll('[data-nscript="beforePageRender"]'),
1194
- ];
1195
- scripts.forEach((script)=>{
1196
- const cacheKey = script.id || script.getAttribute("src");
1197
- LoadCache.add(cacheKey);
1198
- });
1199
- }
1200
- function initScriptLoader(scriptLoaderItems) {
1201
- scriptLoaderItems.forEach(handleClientScriptLoad);
1202
- addBeforeInteractiveToCache();
1203
- }
1204
- function Script(props) {
1205
- const { id , src ="" , onLoad =()=>{} , onReady =null , strategy ="afterInteractive" , onError } = props, restProps = _object_without_properties_loose(props, [
1206
- "id",
1207
- "src",
1208
- "onLoad",
1209
- "onReady",
1210
- "strategy",
1211
- "onError"
1212
- ]);
1213
- // Context is available only during SSR
1214
- const { updateScripts , scripts , getIsSsr } = (0, _react).useContext(_headManagerContext.HeadManagerContext);
1215
- /**
1216
- * - First mount:
1217
- * 1. The useEffect for onReady executes
1218
- * 2. hasOnReadyEffectCalled.current is false, but the script hasn't loaded yet (not in LoadCache)
1219
- * onReady is skipped, set hasOnReadyEffectCalled.current to true
1220
- * 3. The useEffect for loadScript executes
1221
- * 4. hasLoadScriptEffectCalled.current is false, loadScript executes
1222
- * Once the script is loaded, the onLoad and onReady will be called by then
1223
- * [If strict mode is enabled / is wrapped in <OffScreen /> component]
1224
- * 5. The useEffect for onReady executes again
1225
- * 6. hasOnReadyEffectCalled.current is true, so entire effect is skipped
1226
- * 7. The useEffect for loadScript executes again
1227
- * 8. hasLoadScriptEffectCalled.current is true, so entire effect is skipped
1228
- *
1229
- * - Second mount:
1230
- * 1. The useEffect for onReady executes
1231
- * 2. hasOnReadyEffectCalled.current is false, but the script has already loaded (found in LoadCache)
1232
- * onReady is called, set hasOnReadyEffectCalled.current to true
1233
- * 3. The useEffect for loadScript executes
1234
- * 4. The script is already loaded, loadScript bails out
1235
- * [If strict mode is enabled / is wrapped in <OffScreen /> component]
1236
- * 5. The useEffect for onReady executes again
1237
- * 6. hasOnReadyEffectCalled.current is true, so entire effect is skipped
1238
- * 7. The useEffect for loadScript executes again
1239
- * 8. hasLoadScriptEffectCalled.current is true, so entire effect is skipped
1240
- */ const hasOnReadyEffectCalled = (0, _react).useRef(false);
1241
- (0, _react).useEffect(()=>{
1242
- const cacheKey = id || src;
1243
- if (!hasOnReadyEffectCalled.current) {
1244
- // Run onReady if script has loaded before but component is re-mounted
1245
- if (onReady && cacheKey && LoadCache.has(cacheKey)) {
1246
- onReady();
1247
- }
1248
- hasOnReadyEffectCalled.current = true;
1249
- }
1250
- }, [
1251
- onReady,
1252
- id,
1253
- src
1254
- ]);
1255
- const hasLoadScriptEffectCalled = (0, _react).useRef(false);
1256
- (0, _react).useEffect(()=>{
1257
- if (!hasLoadScriptEffectCalled.current) {
1258
- if (strategy === "afterInteractive") {
1259
- loadScript(props);
1260
- } else if (strategy === "lazyOnload") {
1261
- loadLazyScript(props);
1262
- }
1263
- hasLoadScriptEffectCalled.current = true;
1264
- }
1265
- }, [
1266
- props,
1267
- strategy
1268
- ]);
1269
- if (strategy === "beforeInteractive" || strategy === "worker") {
1270
- if (updateScripts) {
1271
- scripts[strategy] = (scripts[strategy] || []).concat([
1272
- _extends({
1273
- id,
1274
- src,
1275
- onLoad,
1276
- onReady,
1277
- onError
1278
- }, restProps),
1279
- ]);
1280
- updateScripts(scripts);
1281
- } else if (getIsSsr && getIsSsr()) {
1282
- // Script has already loaded during SSR
1283
- LoadCache.add(id || src);
1284
- } else if (getIsSsr && !getIsSsr()) {
1285
- loadScript(props);
1286
- }
1287
- }
1288
- return null;
1289
- }
1290
- Object.defineProperty(Script, "__nextScript", {
1291
- value: true
1292
- });
1293
- var _default = Script;
1294
- exports["default"] = _default;
1295
- if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") {
1296
- Object.defineProperty(exports.default, "__esModule", {
1297
- value: true
1298
- });
1299
- Object.assign(exports.default, exports);
1300
- module.exports = exports.default;
1301
- } //# sourceMappingURL=script.js.map
1302
-
1303
-
1304
- /***/ }),
1305
-
1306
- /***/ 4227:
1307
- /***/ ((module, exports) => {
1308
-
1309
- "use strict";
1310
-
1311
- Object.defineProperty(exports, "__esModule", ({
1312
- value: true
1313
- }));
1314
- exports.__unsafeCreateTrustedScriptURL = __unsafeCreateTrustedScriptURL;
1315
- /**
1316
- * Stores the Trusted Types Policy. Starts as undefined and can be set to null
1317
- * if Trusted Types is not supported in the browser.
1318
- */ let policy;
1319
- /**
1320
- * Getter for the Trusted Types Policy. If it is undefined, it is instantiated
1321
- * here or set to null if Trusted Types is not supported in the browser.
1322
- */ function getPolicy() {
1323
- if (typeof policy === "undefined" && "undefined" !== "undefined") { var ref; }
1324
- return policy;
1325
- }
1326
- function __unsafeCreateTrustedScriptURL(url) {
1327
- var ref;
1328
- return ((ref = getPolicy()) == null ? void 0 : ref.createScriptURL(url)) || url;
1329
- }
1330
- if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") {
1331
- Object.defineProperty(exports.default, "__esModule", {
1332
- value: true
1333
- });
1334
- Object.assign(exports.default, exports);
1335
- module.exports = exports.default;
1336
- } //# sourceMappingURL=trusted-types.js.map
1337
-
1338
-
1339
- /***/ }),
1340
-
1341
- /***/ 2030:
1342
- /***/ ((module, exports, __webpack_require__) => {
1343
-
1344
- "use strict";
1345
-
1346
- Object.defineProperty(exports, "__esModule", ({
1347
- value: true
1348
- }));
1349
- exports.useIntersection = useIntersection;
1350
- var _react = __webpack_require__(6689);
1351
- var _requestIdleCallback = __webpack_require__(9071);
1352
- const hasIntersectionObserver = typeof IntersectionObserver === "function";
1353
- const observers = new Map();
1354
- const idList = [];
1355
- function createObserver(options) {
1356
- const id = {
1357
- root: options.root || null,
1358
- margin: options.rootMargin || ""
1359
- };
1360
- const existing = idList.find((obj)=>obj.root === id.root && obj.margin === id.margin);
1361
- let instance;
1362
- if (existing) {
1363
- instance = observers.get(existing);
1364
- if (instance) {
1365
- return instance;
1366
- }
1367
- }
1368
- const elements = new Map();
1369
- const observer = new IntersectionObserver((entries)=>{
1370
- entries.forEach((entry)=>{
1371
- const callback = elements.get(entry.target);
1372
- const isVisible = entry.isIntersecting || entry.intersectionRatio > 0;
1373
- if (callback && isVisible) {
1374
- callback(isVisible);
1375
- }
1376
- });
1377
- }, options);
1378
- instance = {
1379
- id,
1380
- observer,
1381
- elements
1382
- };
1383
- idList.push(id);
1384
- observers.set(id, instance);
1385
- return instance;
1386
- }
1387
- function observe(element, callback, options) {
1388
- const { id , observer , elements } = createObserver(options);
1389
- elements.set(element, callback);
1390
- observer.observe(element);
1391
- return function unobserve() {
1392
- elements.delete(element);
1393
- observer.unobserve(element);
1394
- // Destroy observer when there's nothing left to watch:
1395
- if (elements.size === 0) {
1396
- observer.disconnect();
1397
- observers.delete(id);
1398
- const index = idList.findIndex((obj)=>obj.root === id.root && obj.margin === id.margin);
1399
- if (index > -1) {
1400
- idList.splice(index, 1);
1401
- }
1402
- }
1403
- };
1404
- }
1405
- function useIntersection({ rootRef , rootMargin , disabled }) {
1406
- const isDisabled = disabled || !hasIntersectionObserver;
1407
- const [visible, setVisible] = (0, _react).useState(false);
1408
- const [element, setElement] = (0, _react).useState(null);
1409
- (0, _react).useEffect(()=>{
1410
- if (hasIntersectionObserver) {
1411
- if (isDisabled || visible) return;
1412
- if (element && element.tagName) {
1413
- const unobserve = observe(element, (isVisible)=>isVisible && setVisible(isVisible), {
1414
- root: rootRef == null ? void 0 : rootRef.current,
1415
- rootMargin
1416
- });
1417
- return unobserve;
1418
- }
1419
- } else {
1420
- if (!visible) {
1421
- const idleCallback = (0, _requestIdleCallback).requestIdleCallback(()=>setVisible(true));
1422
- return ()=>(0, _requestIdleCallback).cancelIdleCallback(idleCallback);
1423
- }
1424
- }
1425
- }, [
1426
- element,
1427
- isDisabled,
1428
- rootMargin,
1429
- rootRef,
1430
- visible
1431
- ]);
1432
- const resetVisible = (0, _react).useCallback(()=>{
1433
- setVisible(false);
1434
- }, []);
1435
- return [
1436
- setElement,
1437
- visible,
1438
- resetVisible
1439
- ];
1440
- }
1441
- if ((typeof exports.default === "function" || typeof exports.default === "object" && exports.default !== null) && typeof exports.default.__esModule === "undefined") {
1442
- Object.defineProperty(exports.default, "__esModule", {
1443
- value: true
1444
- });
1445
- Object.assign(exports.default, exports);
1446
- module.exports = exports.default;
1447
- } //# sourceMappingURL=use-intersection.js.map
1448
-
1449
-
1450
- /***/ }),
1451
-
1452
- /***/ 9918:
1453
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
1454
-
1455
- "use strict";
1456
-
1457
- Object.defineProperty(exports, "__esModule", ({
1458
- value: true
1459
- }));
1460
- exports.matchesMiddleware = matchesMiddleware;
1461
- exports.isLocalURL = isLocalURL;
1462
- exports.interpolateAs = interpolateAs;
1463
- exports.resolveHref = resolveHref;
1464
- exports.createKey = createKey;
1465
- exports["default"] = void 0;
1466
- var _async_to_generator = (__webpack_require__(8282)/* ["default"] */ .Z);
1467
- var _extends = (__webpack_require__(9419)/* ["default"] */ .Z);
1468
- var _interop_require_default = (__webpack_require__(3903)/* ["default"] */ .Z);
1469
- var _interop_require_wildcard = (__webpack_require__(199)/* ["default"] */ .Z);
1470
- var _normalizeTrailingSlash = __webpack_require__(583);
1471
- var _removeTrailingSlash = __webpack_require__(3297);
1472
- var _routeLoader = __webpack_require__(1437);
1473
- var _script = __webpack_require__(747);
1474
- var _isError = _interop_require_wildcard(__webpack_require__(274));
1475
- var _denormalizePagePath = __webpack_require__(4406);
1476
- var _normalizeLocalePath = __webpack_require__(4014);
1477
- var _mitt = _interop_require_default(__webpack_require__(8020));
1478
- var _utils = __webpack_require__(9232);
1479
- var _isDynamic = __webpack_require__(1428);
1480
- var _parseRelativeUrl = __webpack_require__(1292);
1481
- var _querystring = __webpack_require__(979);
1482
- var _resolveRewrites = _interop_require_default(__webpack_require__(6052));
1483
- var _routeMatcher = __webpack_require__(4226);
1484
- var _routeRegex = __webpack_require__(5052);
1485
- var _formatUrl = __webpack_require__(3938);
1486
- var _detectDomainLocale = __webpack_require__(6497);
1487
- var _parsePath = __webpack_require__(8854);
1488
- var _addLocale = __webpack_require__(4400);
1489
- var _removeLocale = __webpack_require__(2061);
1490
- var _removeBasePath = __webpack_require__(4293);
1491
- var _addBasePath = __webpack_require__(3952);
1492
- var _hasBasePath = __webpack_require__(7446);
1493
- var _getNextPathnameInfo = __webpack_require__(5789);
1494
- var _formatNextPathnameInfo = __webpack_require__(299);
1495
- var _compareStates = __webpack_require__(6220);
1496
- var _isBot = __webpack_require__(1897);
1497
- function buildCancellationError() {
1498
- return Object.assign(new Error("Route Cancelled"), {
1499
- cancelled: true
1500
- });
1501
- }
1502
- function matchesMiddleware(options) {
1503
- return _matchesMiddleware.apply(this, arguments);
1504
- }
1505
- function _matchesMiddleware() {
1506
- _matchesMiddleware = _async_to_generator(function*(options) {
1507
- const matchers = yield Promise.resolve(options.router.pageLoader.getMiddleware());
1508
- if (!matchers) return false;
1509
- const { pathname: asPathname } = (0, _parsePath).parsePath(options.asPath);
1510
- // remove basePath first since path prefix has to be in the order of `/${basePath}/${locale}`
1511
- const cleanedAs = (0, _hasBasePath).hasBasePath(asPathname) ? (0, _removeBasePath).removeBasePath(asPathname) : asPathname;
1512
- const asWithBasePathAndLocale = (0, _addBasePath).addBasePath((0, _addLocale).addLocale(cleanedAs, options.locale));
1513
- // Check only path match on client. Matching "has" should be done on server
1514
- // where we can access more info such as headers, HttpOnly cookie, etc.
1515
- return matchers.some((m)=>new RegExp(m.regexp).test(asWithBasePathAndLocale));
1516
- });
1517
- return _matchesMiddleware.apply(this, arguments);
1518
- }
1519
- function stripOrigin(url) {
1520
- const origin = (0, _utils).getLocationOrigin();
1521
- return url.startsWith(origin) ? url.substring(origin.length) : url;
1522
- }
1523
- function omit(object, keys) {
1524
- const omitted = {};
1525
- Object.keys(object).forEach((key)=>{
1526
- if (!keys.includes(key)) {
1527
- omitted[key] = object[key];
1528
- }
1529
- });
1530
- return omitted;
1531
- }
1532
- function isLocalURL(url) {
1533
- // prevent a hydration mismatch on href for url with anchor refs
1534
- if (!(0, _utils).isAbsoluteUrl(url)) return true;
1535
- try {
1536
- // absolute urls can be local if they are on the same origin
1537
- const locationOrigin = (0, _utils).getLocationOrigin();
1538
- const resolved = new URL(url, locationOrigin);
1539
- return resolved.origin === locationOrigin && (0, _hasBasePath).hasBasePath(resolved.pathname);
1540
- } catch (_) {
1541
- return false;
1542
- }
1543
- }
1544
- function interpolateAs(route, asPathname, query) {
1545
- let interpolatedRoute = "";
1546
- const dynamicRegex = (0, _routeRegex).getRouteRegex(route);
1547
- const dynamicGroups = dynamicRegex.groups;
1548
- const dynamicMatches = (asPathname !== route ? (0, _routeMatcher).getRouteMatcher(dynamicRegex)(asPathname) : "") || // Fall back to reading the values from the href
1549
- // TODO: should this take priority; also need to change in the router.
1550
- query;
1551
- interpolatedRoute = route;
1552
- const params = Object.keys(dynamicGroups);
1553
- if (!params.every((param)=>{
1554
- let value = dynamicMatches[param] || "";
1555
- const { repeat , optional } = dynamicGroups[param];
1556
- // support single-level catch-all
1557
- // TODO: more robust handling for user-error (passing `/`)
1558
- let replaced = `[${repeat ? "..." : ""}${param}]`;
1559
- if (optional) {
1560
- replaced = `${!value ? "/" : ""}[${replaced}]`;
1561
- }
1562
- if (repeat && !Array.isArray(value)) value = [
1563
- value
1564
- ];
1565
- return (optional || param in dynamicMatches) && // Interpolate group into data URL if present
1566
- (interpolatedRoute = interpolatedRoute.replace(replaced, repeat ? value.map(// path delimiter escaped since they are being inserted
1567
- // into the URL and we expect URL encoded segments
1568
- // when parsing dynamic route params
1569
- (segment)=>encodeURIComponent(segment)).join("/") : encodeURIComponent(value)) || "/");
1570
- })) {
1571
- interpolatedRoute = "" // did not satisfy all requirements
1572
- ;
1573
- // n.b. We ignore this error because we handle warning for this case in
1574
- // development in the `<Link>` component directly.
1575
- }
1576
- return {
1577
- params,
1578
- result: interpolatedRoute
1579
- };
1580
- }
1581
- function resolveHref(router, href, resolveAs) {
1582
- // we use a dummy base url for relative urls
1583
- let base;
1584
- let urlAsString = typeof href === "string" ? href : (0, _formatUrl).formatWithValidation(href);
1585
- // repeated slashes and backslashes in the URL are considered
1586
- // invalid and will never match a Next.js page/file
1587
- const urlProtoMatch = urlAsString.match(/^[a-zA-Z]{1,}:\/\//);
1588
- const urlAsStringNoProto = urlProtoMatch ? urlAsString.slice(urlProtoMatch[0].length) : urlAsString;
1589
- const urlParts = urlAsStringNoProto.split("?");
1590
- if ((urlParts[0] || "").match(/(\/\/|\\)/)) {
1591
- console.error(`Invalid href passed to next/router: ${urlAsString}, repeated forward-slashes (//) or backslashes \\ are not valid in the href`);
1592
- const normalizedUrl = (0, _utils).normalizeRepeatedSlashes(urlAsStringNoProto);
1593
- urlAsString = (urlProtoMatch ? urlProtoMatch[0] : "") + normalizedUrl;
1594
- }
1595
- // Return because it cannot be routed by the Next.js router
1596
- if (!isLocalURL(urlAsString)) {
1597
- return resolveAs ? [
1598
- urlAsString
1599
- ] : urlAsString;
1600
- }
1601
- try {
1602
- base = new URL(urlAsString.startsWith("#") ? router.asPath : router.pathname, "http://n");
1603
- } catch (_) {
1604
- // fallback to / for invalid asPath values e.g. //
1605
- base = new URL("/", "http://n");
1606
- }
1607
- try {
1608
- const finalUrl = new URL(urlAsString, base);
1609
- finalUrl.pathname = (0, _normalizeTrailingSlash).normalizePathTrailingSlash(finalUrl.pathname);
1610
- let interpolatedAs = "";
1611
- if ((0, _isDynamic).isDynamicRoute(finalUrl.pathname) && finalUrl.searchParams && resolveAs) {
1612
- const query = (0, _querystring).searchParamsToUrlQuery(finalUrl.searchParams);
1613
- const { result , params } = interpolateAs(finalUrl.pathname, finalUrl.pathname, query);
1614
- if (result) {
1615
- interpolatedAs = (0, _formatUrl).formatWithValidation({
1616
- pathname: result,
1617
- hash: finalUrl.hash,
1618
- query: omit(query, params)
1619
- });
1620
- }
1621
- }
1622
- // if the origin didn't change, it means we received a relative href
1623
- const resolvedHref = finalUrl.origin === base.origin ? finalUrl.href.slice(finalUrl.origin.length) : finalUrl.href;
1624
- return resolveAs ? [
1625
- resolvedHref,
1626
- interpolatedAs || resolvedHref
1627
- ] : resolvedHref;
1628
- } catch (_1) {
1629
- return resolveAs ? [
1630
- urlAsString
1631
- ] : urlAsString;
1632
- }
1633
- }
1634
- function prepareUrlAs(router, url, as) {
1635
- // If url and as provided as an object representation,
1636
- // we'll format them into the string version here.
1637
- let [resolvedHref, resolvedAs] = resolveHref(router, url, true);
1638
- const origin = (0, _utils).getLocationOrigin();
1639
- const hrefHadOrigin = resolvedHref.startsWith(origin);
1640
- const asHadOrigin = resolvedAs && resolvedAs.startsWith(origin);
1641
- resolvedHref = stripOrigin(resolvedHref);
1642
- resolvedAs = resolvedAs ? stripOrigin(resolvedAs) : resolvedAs;
1643
- const preparedUrl = hrefHadOrigin ? resolvedHref : (0, _addBasePath).addBasePath(resolvedHref);
1644
- const preparedAs = as ? stripOrigin(resolveHref(router, as)) : resolvedAs || resolvedHref;
1645
- return {
1646
- url: preparedUrl,
1647
- as: asHadOrigin ? preparedAs : (0, _addBasePath).addBasePath(preparedAs)
1648
- };
1649
- }
1650
- function resolveDynamicRoute(pathname, pages) {
1651
- const cleanPathname = (0, _removeTrailingSlash).removeTrailingSlash((0, _denormalizePagePath).denormalizePagePath(pathname));
1652
- if (cleanPathname === "/404" || cleanPathname === "/_error") {
1653
- return pathname;
1654
- }
1655
- // handle resolving href for dynamic routes
1656
- if (!pages.includes(cleanPathname)) {
1657
- // eslint-disable-next-line array-callback-return
1658
- pages.some((page)=>{
1659
- if ((0, _isDynamic).isDynamicRoute(page) && (0, _routeRegex).getRouteRegex(page).re.test(cleanPathname)) {
1660
- pathname = page;
1661
- return true;
1662
- }
1663
- });
1664
- }
1665
- return (0, _removeTrailingSlash).removeTrailingSlash(pathname);
1666
- }
1667
- function getMiddlewareData(source, response, options) {
1668
- const nextConfig = {
1669
- basePath: options.router.basePath,
1670
- i18n: {
1671
- locales: options.router.locales
1672
- },
1673
- trailingSlash: Boolean(true)
1674
- };
1675
- const rewriteHeader = response.headers.get("x-nextjs-rewrite");
1676
- let rewriteTarget = rewriteHeader || response.headers.get("x-nextjs-matched-path");
1677
- const matchedPath = response.headers.get("x-matched-path");
1678
- if (matchedPath && !rewriteTarget && !matchedPath.includes("__next_data_catchall") && !matchedPath.includes("/_error") && !matchedPath.includes("/404")) {
1679
- // leverage x-matched-path to detect next.config.js rewrites
1680
- rewriteTarget = matchedPath;
1681
- }
1682
- if (rewriteTarget) {
1683
- if (rewriteTarget.startsWith("/")) {
1684
- const parsedRewriteTarget = (0, _parseRelativeUrl).parseRelativeUrl(rewriteTarget);
1685
- const pathnameInfo = (0, _getNextPathnameInfo).getNextPathnameInfo(parsedRewriteTarget.pathname, {
1686
- nextConfig,
1687
- parseData: true
1688
- });
1689
- let fsPathname = (0, _removeTrailingSlash).removeTrailingSlash(pathnameInfo.pathname);
1690
- return Promise.all([
1691
- options.router.pageLoader.getPageList(),
1692
- (0, _routeLoader).getClientBuildManifest(),
1693
- ]).then(([pages, { __rewrites: rewrites }])=>{
1694
- let as = (0, _addLocale).addLocale(pathnameInfo.pathname, pathnameInfo.locale);
1695
- if ((0, _isDynamic).isDynamicRoute(as) || !rewriteHeader && pages.includes((0, _normalizeLocalePath).normalizeLocalePath((0, _removeBasePath).removeBasePath(as), options.router.locales).pathname)) {
1696
- const parsedSource = (0, _getNextPathnameInfo).getNextPathnameInfo((0, _parseRelativeUrl).parseRelativeUrl(source).pathname, {
1697
- parseData: true
1698
- });
1699
- as = (0, _addBasePath).addBasePath(parsedSource.pathname);
1700
- parsedRewriteTarget.pathname = as;
1701
- }
1702
- if (false) {} else if (!pages.includes(fsPathname)) {
1703
- const resolvedPathname = resolveDynamicRoute(fsPathname, pages);
1704
- if (resolvedPathname !== fsPathname) {
1705
- fsPathname = resolvedPathname;
1706
- }
1707
- }
1708
- const resolvedHref = !pages.includes(fsPathname) ? resolveDynamicRoute((0, _normalizeLocalePath).normalizeLocalePath((0, _removeBasePath).removeBasePath(parsedRewriteTarget.pathname), options.router.locales).pathname, pages) : fsPathname;
1709
- if ((0, _isDynamic).isDynamicRoute(resolvedHref)) {
1710
- const matches = (0, _routeMatcher).getRouteMatcher((0, _routeRegex).getRouteRegex(resolvedHref))(as);
1711
- Object.assign(parsedRewriteTarget.query, matches || {});
1712
- }
1713
- return {
1714
- type: "rewrite",
1715
- parsedAs: parsedRewriteTarget,
1716
- resolvedHref
1717
- };
1718
- });
1719
- }
1720
- const src = (0, _parsePath).parsePath(source);
1721
- const pathname = (0, _formatNextPathnameInfo).formatNextPathnameInfo(_extends({}, (0, _getNextPathnameInfo).getNextPathnameInfo(src.pathname, {
1722
- nextConfig,
1723
- parseData: true
1724
- }), {
1725
- defaultLocale: options.router.defaultLocale,
1726
- buildId: ""
1727
- }));
1728
- return Promise.resolve({
1729
- type: "redirect-external",
1730
- destination: `${pathname}${src.query}${src.hash}`
1731
- });
1732
- }
1733
- const redirectTarget = response.headers.get("x-nextjs-redirect");
1734
- if (redirectTarget) {
1735
- if (redirectTarget.startsWith("/")) {
1736
- const src1 = (0, _parsePath).parsePath(redirectTarget);
1737
- const pathname1 = (0, _formatNextPathnameInfo).formatNextPathnameInfo(_extends({}, (0, _getNextPathnameInfo).getNextPathnameInfo(src1.pathname, {
1738
- nextConfig,
1739
- parseData: true
1740
- }), {
1741
- defaultLocale: options.router.defaultLocale,
1742
- buildId: ""
1743
- }));
1744
- return Promise.resolve({
1745
- type: "redirect-internal",
1746
- newAs: `${pathname1}${src1.query}${src1.hash}`,
1747
- newUrl: `${pathname1}${src1.query}${src1.hash}`
1748
- });
1749
- }
1750
- return Promise.resolve({
1751
- type: "redirect-external",
1752
- destination: redirectTarget
1753
- });
1754
- }
1755
- return Promise.resolve({
1756
- type: "next"
1757
- });
1758
- }
1759
- function withMiddlewareEffects(options) {
1760
- return matchesMiddleware(options).then((matches)=>{
1761
- if (matches && options.fetchData) {
1762
- return options.fetchData().then((data)=>getMiddlewareData(data.dataHref, data.response, options).then((effect)=>({
1763
- dataHref: data.dataHref,
1764
- cacheKey: data.cacheKey,
1765
- json: data.json,
1766
- response: data.response,
1767
- text: data.text,
1768
- effect
1769
- }))).catch((_err)=>{
1770
- /**
1771
- * TODO: Revisit this in the future.
1772
- * For now we will not consider middleware data errors to be fatal.
1773
- * maybe we should revisit in the future.
1774
- */ return null;
1775
- });
1776
- }
1777
- return null;
1778
- });
1779
- }
1780
- const manualScrollRestoration = (/* unused pure expression or super */ null && ( false && 0));
1781
- const SSG_DATA_NOT_FOUND = Symbol("SSG_DATA_NOT_FOUND");
1782
- function fetchRetry(url, attempts, options) {
1783
- return fetch(url, {
1784
- // Cookies are required to be present for Next.js' SSG "Preview Mode".
1785
- // Cookies may also be required for `getServerSideProps`.
1786
- //
1787
- // > `fetch` won’t send cookies, unless you set the credentials init
1788
- // > option.
1789
- // https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch
1790
- //
1791
- // > For maximum browser compatibility when it comes to sending &
1792
- // > receiving cookies, always supply the `credentials: 'same-origin'`
1793
- // > option instead of relying on the default.
1794
- // https://github.com/github/fetch#caveats
1795
- credentials: "same-origin",
1796
- method: options.method || "GET",
1797
- headers: Object.assign({}, options.headers, {
1798
- "x-nextjs-data": "1"
1799
- })
1800
- }).then((response)=>{
1801
- return !response.ok && attempts > 1 && response.status >= 500 ? fetchRetry(url, attempts - 1, options) : response;
1802
- });
1803
- }
1804
- const backgroundCache = {};
1805
- function handleSmoothScroll(fn) {
1806
- const htmlElement = document.documentElement;
1807
- const existing = htmlElement.style.scrollBehavior;
1808
- htmlElement.style.scrollBehavior = "auto";
1809
- fn();
1810
- htmlElement.style.scrollBehavior = existing;
1811
- }
1812
- function tryToParseAsJSON(text) {
1813
- try {
1814
- return JSON.parse(text);
1815
- } catch (error) {
1816
- return null;
1817
- }
1818
- }
1819
- function fetchNextData({ dataHref , inflightCache , isPrefetch , hasMiddleware , isServerRender , parseJSON , persistCache , isBackground , unstable_skipClientCache }) {
1820
- const { href: cacheKey } = new URL(dataHref, window.location.href);
1821
- var ref1;
1822
- const getData = (params)=>{
1823
- return fetchRetry(dataHref, isServerRender ? 3 : 1, {
1824
- headers: isPrefetch ? {
1825
- purpose: "prefetch"
1826
- } : {},
1827
- method: (ref1 = params == null ? void 0 : params.method) != null ? ref1 : "GET"
1828
- }).then((response)=>{
1829
- if (response.ok && (params == null ? void 0 : params.method) === "HEAD") {
1830
- return {
1831
- dataHref,
1832
- response,
1833
- text: "",
1834
- json: {},
1835
- cacheKey
1836
- };
1837
- }
1838
- return response.text().then((text)=>{
1839
- if (!response.ok) {
1840
- /**
1841
- * When the data response is a redirect because of a middleware
1842
- * we do not consider it an error. The headers must bring the
1843
- * mapped location.
1844
- * TODO: Change the status code in the handler.
1845
- */ if (hasMiddleware && [
1846
- 301,
1847
- 302,
1848
- 307,
1849
- 308
1850
- ].includes(response.status)) {
1851
- return {
1852
- dataHref,
1853
- response,
1854
- text,
1855
- json: {},
1856
- cacheKey
1857
- };
1858
- }
1859
- if (!hasMiddleware && response.status === 404) {
1860
- var ref;
1861
- if ((ref = tryToParseAsJSON(text)) == null ? void 0 : ref.notFound) {
1862
- return {
1863
- dataHref,
1864
- json: {
1865
- notFound: SSG_DATA_NOT_FOUND
1866
- },
1867
- response,
1868
- text,
1869
- cacheKey
1870
- };
1871
- }
1872
- }
1873
- const error = new Error(`Failed to load static props`);
1874
- /**
1875
- * We should only trigger a server-side transition if this was
1876
- * caused on a client-side transition. Otherwise, we'd get into
1877
- * an infinite loop.
1878
- */ if (!isServerRender) {
1879
- (0, _routeLoader).markAssetError(error);
1880
- }
1881
- throw error;
1882
- }
1883
- return {
1884
- dataHref,
1885
- json: parseJSON ? tryToParseAsJSON(text) : null,
1886
- response,
1887
- text,
1888
- cacheKey
1889
- };
1890
- });
1891
- }).then((data)=>{
1892
- if (!persistCache || "production" !== "production" || data.response.headers.get("x-middleware-cache") === "no-cache") {
1893
- delete inflightCache[cacheKey];
1894
- }
1895
- return data;
1896
- }).catch((err)=>{
1897
- delete inflightCache[cacheKey];
1898
- throw err;
1899
- });
1900
- };
1901
- // when skipping client cache we wait to update
1902
- // inflight cache until successful data response
1903
- // this allows racing click event with fetching newer data
1904
- // without blocking navigation when stale data is available
1905
- if (unstable_skipClientCache && persistCache) {
1906
- return getData({}).then((data)=>{
1907
- inflightCache[cacheKey] = Promise.resolve(data);
1908
- return data;
1909
- });
1910
- }
1911
- if (inflightCache[cacheKey] !== undefined) {
1912
- return inflightCache[cacheKey];
1913
- }
1914
- return inflightCache[cacheKey] = getData(isBackground ? {
1915
- method: "HEAD"
1916
- } : {});
1917
- }
1918
- function createKey() {
1919
- return Math.random().toString(36).slice(2, 10);
1920
- }
1921
- function handleHardNavigation({ url , router }) {
1922
- // ensure we don't trigger a hard navigation to the same
1923
- // URL as this can end up with an infinite refresh
1924
- if (url === (0, _addBasePath).addBasePath((0, _addLocale).addLocale(router.asPath, router.locale))) {
1925
- throw new Error(`Invariant: attempted to hard navigate to the same URL ${url} ${location.href}`);
1926
- }
1927
- window.location.href = url;
1928
- }
1929
- const getCancelledHandler = ({ route , router })=>{
1930
- let cancelled = false;
1931
- const cancel = router.clc = ()=>{
1932
- cancelled = true;
1933
- };
1934
- const handleCancelled = ()=>{
1935
- if (cancelled) {
1936
- const error = new Error(`Abort fetching component for route: "${route}"`);
1937
- error.cancelled = true;
1938
- throw error;
1939
- }
1940
- if (cancel === router.clc) {
1941
- router.clc = null;
1942
- }
1943
- };
1944
- return handleCancelled;
1945
- };
1946
- class Router {
1947
- reload() {
1948
- window.location.reload();
1949
- }
1950
- /**
1951
- * Go back in history
1952
- */ back() {
1953
- window.history.back();
1954
- }
1955
- /**
1956
- * Performs a `pushState` with arguments
1957
- * @param url of the route
1958
- * @param as masks `url` for the browser
1959
- * @param options object you can define `shallow` and other options
1960
- */ push(url, as, options = {}) {
1961
- if (false) {}
1962
- ({ url , as } = prepareUrlAs(this, url, as));
1963
- return this.change("pushState", url, as, options);
1964
- }
1965
- /**
1966
- * Performs a `replaceState` with arguments
1967
- * @param url of the route
1968
- * @param as masks `url` for the browser
1969
- * @param options object you can define `shallow` and other options
1970
- */ replace(url, as, options = {}) {
1971
- ({ url , as } = prepareUrlAs(this, url, as));
1972
- return this.change("replaceState", url, as, options);
1973
- }
1974
- change(method, url, as, options, forcedScroll) {
1975
- var _this = this;
1976
- return _async_to_generator(function*() {
1977
- if (!isLocalURL(url)) {
1978
- handleHardNavigation({
1979
- url,
1980
- router: _this
1981
- });
1982
- return false;
1983
- }
1984
- // WARNING: `_h` is an internal option for handing Next.js client-side
1985
- // hydration. Your app should _never_ use this property. It may change at
1986
- // any time without notice.
1987
- const isQueryUpdating = options._h;
1988
- const shouldResolveHref = isQueryUpdating || options._shouldResolveHref || (0, _parsePath).parsePath(url).pathname === (0, _parsePath).parsePath(as).pathname;
1989
- const nextState = _extends({}, _this.state);
1990
- // for static pages with query params in the URL we delay
1991
- // marking the router ready until after the query is updated
1992
- // or a navigation has occurred
1993
- const readyStateChange = _this.isReady !== true;
1994
- _this.isReady = true;
1995
- const isSsr = _this.isSsr;
1996
- if (!isQueryUpdating) {
1997
- _this.isSsr = false;
1998
- }
1999
- // if a route transition is already in progress before
2000
- // the query updating is triggered ignore query updating
2001
- if (isQueryUpdating && _this.clc) {
2002
- return false;
2003
- }
2004
- const prevLocale = nextState.locale;
2005
- if (false) { var ref; }
2006
- // marking route changes as a navigation start entry
2007
- if (_utils.ST) {
2008
- performance.mark("routeChange");
2009
- }
2010
- const { shallow =false , scroll =true } = options;
2011
- const routeProps = {
2012
- shallow
2013
- };
2014
- if (_this._inFlightRoute && _this.clc) {
2015
- if (!isSsr) {
2016
- Router.events.emit("routeChangeError", buildCancellationError(), _this._inFlightRoute, routeProps);
2017
- }
2018
- _this.clc();
2019
- _this.clc = null;
2020
- }
2021
- as = (0, _addBasePath).addBasePath((0, _addLocale).addLocale((0, _hasBasePath).hasBasePath(as) ? (0, _removeBasePath).removeBasePath(as) : as, options.locale, _this.defaultLocale));
2022
- const cleanedAs = (0, _removeLocale).removeLocale((0, _hasBasePath).hasBasePath(as) ? (0, _removeBasePath).removeBasePath(as) : as, nextState.locale);
2023
- _this._inFlightRoute = as;
2024
- const localeChange = prevLocale !== nextState.locale;
2025
- // If the url change is only related to a hash change
2026
- // We should not proceed. We should only change the state.
2027
- if (!isQueryUpdating && _this.onlyAHashChange(cleanedAs) && !localeChange) {
2028
- nextState.asPath = cleanedAs;
2029
- Router.events.emit("hashChangeStart", as, routeProps);
2030
- // TODO: do we need the resolved href when only a hash change?
2031
- _this.changeState(method, url, as, _extends({}, options, {
2032
- scroll: false
2033
- }));
2034
- if (scroll) {
2035
- _this.scrollToHash(cleanedAs);
2036
- }
2037
- try {
2038
- yield _this.set(nextState, _this.components[nextState.route], null);
2039
- } catch (err) {
2040
- if ((0, _isError).default(err) && err.cancelled) {
2041
- Router.events.emit("routeChangeError", err, cleanedAs, routeProps);
2042
- }
2043
- throw err;
2044
- }
2045
- Router.events.emit("hashChangeComplete", as, routeProps);
2046
- return true;
2047
- }
2048
- let parsed = (0, _parseRelativeUrl).parseRelativeUrl(url);
2049
- let { pathname , query } = parsed;
2050
- // The build manifest needs to be loaded before auto-static dynamic pages
2051
- // get their query parameters to allow ensuring they can be parsed properly
2052
- // when rewritten to
2053
- let pages, rewrites;
2054
- try {
2055
- [pages, { __rewrites: rewrites }] = yield Promise.all([
2056
- _this.pageLoader.getPageList(),
2057
- (0, _routeLoader).getClientBuildManifest(),
2058
- _this.pageLoader.getMiddleware(),
2059
- ]);
2060
- } catch (err1) {
2061
- // If we fail to resolve the page list or client-build manifest, we must
2062
- // do a server-side transition:
2063
- handleHardNavigation({
2064
- url: as,
2065
- router: _this
2066
- });
2067
- return false;
2068
- }
2069
- // If asked to change the current URL we should reload the current page
2070
- // (not location.reload() but reload getInitialProps and other Next.js stuffs)
2071
- // We also need to set the method = replaceState always
2072
- // as this should not go into the history (That's how browsers work)
2073
- // We should compare the new asPath to the current asPath, not the url
2074
- if (!_this.urlIsNew(cleanedAs) && !localeChange) {
2075
- method = "replaceState";
2076
- }
2077
- // we need to resolve the as value using rewrites for dynamic SSG
2078
- // pages to allow building the data URL correctly
2079
- let resolvedAs = as;
2080
- // url and as should always be prefixed with basePath by this
2081
- // point by either next/link or router.push/replace so strip the
2082
- // basePath from the pathname to match the pages dir 1-to-1
2083
- pathname = pathname ? (0, _removeTrailingSlash).removeTrailingSlash((0, _removeBasePath).removeBasePath(pathname)) : pathname;
2084
- // we don't attempt resolve asPath when we need to execute
2085
- // middleware as the resolving will occur server-side
2086
- const isMiddlewareMatch = yield matchesMiddleware({
2087
- asPath: as,
2088
- locale: nextState.locale,
2089
- router: _this
2090
- });
2091
- if (options.shallow && isMiddlewareMatch) {
2092
- pathname = _this.pathname;
2093
- }
2094
- if (shouldResolveHref && pathname !== "/_error") {
2095
- options._shouldResolveHref = true;
2096
- if (false) {} else {
2097
- parsed.pathname = resolveDynamicRoute(pathname, pages);
2098
- if (parsed.pathname !== pathname) {
2099
- pathname = parsed.pathname;
2100
- parsed.pathname = (0, _addBasePath).addBasePath(pathname);
2101
- if (!isMiddlewareMatch) {
2102
- url = (0, _formatUrl).formatWithValidation(parsed);
2103
- }
2104
- }
2105
- }
2106
- }
2107
- if (!isLocalURL(as)) {
2108
- if (false) {}
2109
- handleHardNavigation({
2110
- url: as,
2111
- router: _this
2112
- });
2113
- return false;
2114
- }
2115
- resolvedAs = (0, _removeLocale).removeLocale((0, _removeBasePath).removeBasePath(resolvedAs), nextState.locale);
2116
- let route = (0, _removeTrailingSlash).removeTrailingSlash(pathname);
2117
- let routeMatch = false;
2118
- if ((0, _isDynamic).isDynamicRoute(route)) {
2119
- const parsedAs1 = (0, _parseRelativeUrl).parseRelativeUrl(resolvedAs);
2120
- const asPathname = parsedAs1.pathname;
2121
- const routeRegex = (0, _routeRegex).getRouteRegex(route);
2122
- routeMatch = (0, _routeMatcher).getRouteMatcher(routeRegex)(asPathname);
2123
- const shouldInterpolate = route === asPathname;
2124
- const interpolatedAs = shouldInterpolate ? interpolateAs(route, asPathname, query) : {};
2125
- if (!routeMatch || shouldInterpolate && !interpolatedAs.result) {
2126
- const missingParams = Object.keys(routeRegex.groups).filter((param)=>!query[param]);
2127
- if (missingParams.length > 0 && !isMiddlewareMatch) {
2128
- if (false) {}
2129
- throw new Error((shouldInterpolate ? `The provided \`href\` (${url}) value is missing query values (${missingParams.join(", ")}) to be interpolated properly. ` : `The provided \`as\` value (${asPathname}) is incompatible with the \`href\` value (${route}). `) + `Read more: https://nextjs.org/docs/messages/${shouldInterpolate ? "href-interpolation-failed" : "incompatible-href-as"}`);
2130
- }
2131
- } else if (shouldInterpolate) {
2132
- as = (0, _formatUrl).formatWithValidation(Object.assign({}, parsedAs1, {
2133
- pathname: interpolatedAs.result,
2134
- query: omit(query, interpolatedAs.params)
2135
- }));
2136
- } else {
2137
- // Merge params into `query`, overwriting any specified in search
2138
- Object.assign(query, routeMatch);
2139
- }
2140
- }
2141
- if (!isQueryUpdating) {
2142
- Router.events.emit("routeChangeStart", as, routeProps);
2143
- }
2144
- try {
2145
- var ref2, ref3;
2146
- let routeInfo = yield _this.getRouteInfo({
2147
- route,
2148
- pathname,
2149
- query,
2150
- as,
2151
- resolvedAs,
2152
- routeProps,
2153
- locale: nextState.locale,
2154
- isPreview: nextState.isPreview,
2155
- hasMiddleware: isMiddlewareMatch
2156
- });
2157
- if ("route" in routeInfo && isMiddlewareMatch) {
2158
- pathname = routeInfo.route || route;
2159
- route = pathname;
2160
- if (!routeProps.shallow) {
2161
- query = Object.assign({}, routeInfo.query || {}, query);
2162
- }
2163
- const cleanedParsedPathname = (0, _hasBasePath).hasBasePath(parsed.pathname) ? (0, _removeBasePath).removeBasePath(parsed.pathname) : parsed.pathname;
2164
- if (routeMatch && pathname !== cleanedParsedPathname) {
2165
- Object.keys(routeMatch).forEach((key)=>{
2166
- if (routeMatch && query[key] === routeMatch[key]) {
2167
- delete query[key];
2168
- }
2169
- });
2170
- }
2171
- if ((0, _isDynamic).isDynamicRoute(pathname)) {
2172
- const prefixedAs = !routeProps.shallow && routeInfo.resolvedAs ? routeInfo.resolvedAs : (0, _addBasePath).addBasePath((0, _addLocale).addLocale(new URL(as, location.href).pathname, nextState.locale), true);
2173
- let rewriteAs = prefixedAs;
2174
- if ((0, _hasBasePath).hasBasePath(rewriteAs)) {
2175
- rewriteAs = (0, _removeBasePath).removeBasePath(rewriteAs);
2176
- }
2177
- if (false) {}
2178
- const routeRegex1 = (0, _routeRegex).getRouteRegex(pathname);
2179
- const curRouteMatch = (0, _routeMatcher).getRouteMatcher(routeRegex1)(rewriteAs);
2180
- if (curRouteMatch) {
2181
- Object.assign(query, curRouteMatch);
2182
- }
2183
- }
2184
- }
2185
- // If the routeInfo brings a redirect we simply apply it.
2186
- if ("type" in routeInfo) {
2187
- if (routeInfo.type === "redirect-internal") {
2188
- return _this.change(method, routeInfo.newUrl, routeInfo.newAs, options);
2189
- } else {
2190
- handleHardNavigation({
2191
- url: routeInfo.destination,
2192
- router: _this
2193
- });
2194
- return new Promise(()=>{});
2195
- }
2196
- }
2197
- let { error , props , __N_SSG , __N_SSP } = routeInfo;
2198
- const component = routeInfo.Component;
2199
- if (component && component.unstable_scriptLoader) {
2200
- const scripts = [].concat(component.unstable_scriptLoader());
2201
- scripts.forEach((script)=>{
2202
- (0, _script).handleClientScriptLoad(script.props);
2203
- });
2204
- }
2205
- // handle redirect on client-transition
2206
- if ((__N_SSG || __N_SSP) && props) {
2207
- if (props.pageProps && props.pageProps.__N_REDIRECT) {
2208
- // Use the destination from redirect without adding locale
2209
- options.locale = false;
2210
- const destination = props.pageProps.__N_REDIRECT;
2211
- // check if destination is internal (resolves to a page) and attempt
2212
- // client-navigation if it is falling back to hard navigation if
2213
- // it's not
2214
- if (destination.startsWith("/") && props.pageProps.__N_REDIRECT_BASE_PATH !== false) {
2215
- const parsedHref = (0, _parseRelativeUrl).parseRelativeUrl(destination);
2216
- parsedHref.pathname = resolveDynamicRoute(parsedHref.pathname, pages);
2217
- const { url: newUrl , as: newAs } = prepareUrlAs(_this, destination, destination);
2218
- return _this.change(method, newUrl, newAs, options);
2219
- }
2220
- handleHardNavigation({
2221
- url: destination,
2222
- router: _this
2223
- });
2224
- return new Promise(()=>{});
2225
- }
2226
- nextState.isPreview = !!props.__N_PREVIEW;
2227
- // handle SSG data 404
2228
- if (props.notFound === SSG_DATA_NOT_FOUND) {
2229
- let notFoundRoute;
2230
- try {
2231
- yield _this.fetchComponent("/404");
2232
- notFoundRoute = "/404";
2233
- } catch (_) {
2234
- notFoundRoute = "/_error";
2235
- }
2236
- routeInfo = yield _this.getRouteInfo({
2237
- route: notFoundRoute,
2238
- pathname: notFoundRoute,
2239
- query,
2240
- as,
2241
- resolvedAs,
2242
- routeProps: {
2243
- shallow: false
2244
- },
2245
- locale: nextState.locale,
2246
- isPreview: nextState.isPreview
2247
- });
2248
- if ("type" in routeInfo) {
2249
- throw new Error(`Unexpected middleware effect on /404`);
2250
- }
2251
- }
2252
- }
2253
- Router.events.emit("beforeHistoryChange", as, routeProps);
2254
- _this.changeState(method, url, as, options);
2255
- if (isQueryUpdating && pathname === "/_error" && ((ref2 = self.__NEXT_DATA__.props) == null ? void 0 : (ref3 = ref2.pageProps) == null ? void 0 : ref3.statusCode) === 500 && (props == null ? void 0 : props.pageProps)) {
2256
- // ensure statusCode is still correct for static 500 page
2257
- // when updating query information
2258
- props.pageProps.statusCode = 500;
2259
- }
2260
- var _route;
2261
- // shallow routing is only allowed for same page URL changes.
2262
- const isValidShallowRoute = options.shallow && nextState.route === ((_route = routeInfo.route) != null ? _route : route);
2263
- var _scroll;
2264
- const shouldScroll = (_scroll = options.scroll) != null ? _scroll : !options._h && !isValidShallowRoute;
2265
- const resetScroll = shouldScroll ? {
2266
- x: 0,
2267
- y: 0
2268
- } : null;
2269
- // the new state that the router gonna set
2270
- const upcomingRouterState = _extends({}, nextState, {
2271
- route,
2272
- pathname,
2273
- query,
2274
- asPath: cleanedAs,
2275
- isFallback: false
2276
- });
2277
- const upcomingScrollState = forcedScroll != null ? forcedScroll : resetScroll;
2278
- // for query updates we can skip it if the state is unchanged and we don't
2279
- // need to scroll
2280
- // https://github.com/vercel/next.js/issues/37139
2281
- const canSkipUpdating = options._h && !upcomingScrollState && !readyStateChange && !localeChange && (0, _compareStates).compareRouterStates(upcomingRouterState, _this.state);
2282
- if (!canSkipUpdating) {
2283
- yield _this.set(upcomingRouterState, routeInfo, upcomingScrollState).catch((e)=>{
2284
- if (e.cancelled) error = error || e;
2285
- else throw e;
2286
- });
2287
- if (error) {
2288
- if (!isQueryUpdating) {
2289
- Router.events.emit("routeChangeError", error, cleanedAs, routeProps);
2290
- }
2291
- throw error;
2292
- }
2293
- if (false) {}
2294
- if (!isQueryUpdating) {
2295
- Router.events.emit("routeChangeComplete", as, routeProps);
2296
- }
2297
- // A hash mark # is the optional last part of a URL
2298
- const hashRegex = /#.+$/;
2299
- if (shouldScroll && hashRegex.test(as)) {
2300
- _this.scrollToHash(as);
2301
- }
2302
- }
2303
- return true;
2304
- } catch (err11) {
2305
- if ((0, _isError).default(err11) && err11.cancelled) {
2306
- return false;
2307
- }
2308
- throw err11;
2309
- }
2310
- })();
2311
- }
2312
- changeState(method, url, as, options = {}) {
2313
- if (false) {}
2314
- if (method !== "pushState" || (0, _utils).getURL() !== as) {
2315
- this._shallow = options.shallow;
2316
- window.history[method]({
2317
- url,
2318
- as,
2319
- options,
2320
- __N: true,
2321
- key: this._key = method !== "pushState" ? this._key : createKey()
2322
- }, // Passing the empty string here should be safe against future changes to the method.
2323
- // https://developer.mozilla.org/en-US/docs/Web/API/History/replaceState
2324
- "", as);
2325
- }
2326
- }
2327
- handleRouteInfoError(err, pathname, query, as, routeProps, loadErrorFail) {
2328
- var _this = this;
2329
- return _async_to_generator(function*() {
2330
- console.error(err);
2331
- if (err.cancelled) {
2332
- // bubble up cancellation errors
2333
- throw err;
2334
- }
2335
- if ((0, _routeLoader).isAssetError(err) || loadErrorFail) {
2336
- Router.events.emit("routeChangeError", err, as, routeProps);
2337
- // If we can't load the page it could be one of following reasons
2338
- // 1. Page doesn't exists
2339
- // 2. Page does exist in a different zone
2340
- // 3. Internal error while loading the page
2341
- // So, doing a hard reload is the proper way to deal with this.
2342
- handleHardNavigation({
2343
- url: as,
2344
- router: _this
2345
- });
2346
- // Changing the URL doesn't block executing the current code path.
2347
- // So let's throw a cancellation error stop the routing logic.
2348
- throw buildCancellationError();
2349
- }
2350
- try {
2351
- let props;
2352
- const { page: Component , styleSheets } = yield _this.fetchComponent("/_error");
2353
- const routeInfo = {
2354
- props,
2355
- Component,
2356
- styleSheets,
2357
- err,
2358
- error: err
2359
- };
2360
- if (!routeInfo.props) {
2361
- try {
2362
- routeInfo.props = yield _this.getInitialProps(Component, {
2363
- err,
2364
- pathname,
2365
- query
2366
- });
2367
- } catch (gipErr) {
2368
- console.error("Error in error page `getInitialProps`: ", gipErr);
2369
- routeInfo.props = {};
2370
- }
2371
- }
2372
- return routeInfo;
2373
- } catch (routeInfoErr) {
2374
- return _this.handleRouteInfoError((0, _isError).default(routeInfoErr) ? routeInfoErr : new Error(routeInfoErr + ""), pathname, query, as, routeProps, true);
2375
- }
2376
- })();
2377
- }
2378
- getRouteInfo({ route: requestedRoute , pathname , query , as , resolvedAs , routeProps , locale , hasMiddleware , isPreview , unstable_skipClientCache }) {
2379
- var _this = this;
2380
- return _async_to_generator(function*() {
2381
- /**
2382
- * This `route` binding can change if there's a rewrite
2383
- * so we keep a reference to the original requested route
2384
- * so we can store the cache for it and avoid re-requesting every time
2385
- * for shallow routing purposes.
2386
- */ let route = requestedRoute;
2387
- try {
2388
- var ref, ref4, ref5;
2389
- const handleCancelled = getCancelledHandler({
2390
- route,
2391
- router: _this
2392
- });
2393
- let existingInfo = _this.components[route];
2394
- if (routeProps.shallow && existingInfo && _this.route === route) {
2395
- return existingInfo;
2396
- }
2397
- if (hasMiddleware) {
2398
- existingInfo = undefined;
2399
- }
2400
- let cachedRouteInfo = existingInfo && !("initial" in existingInfo) && "production" !== "development" ? existingInfo : undefined;
2401
- const fetchNextDataParams = {
2402
- dataHref: _this.pageLoader.getDataHref({
2403
- href: (0, _formatUrl).formatWithValidation({
2404
- pathname,
2405
- query
2406
- }),
2407
- skipInterpolation: true,
2408
- asPath: resolvedAs,
2409
- locale
2410
- }),
2411
- hasMiddleware: true,
2412
- isServerRender: _this.isSsr,
2413
- parseJSON: true,
2414
- inflightCache: _this.sdc,
2415
- persistCache: !isPreview,
2416
- isPrefetch: false,
2417
- unstable_skipClientCache
2418
- };
2419
- const data = yield withMiddlewareEffects({
2420
- fetchData: ()=>fetchNextData(fetchNextDataParams),
2421
- asPath: resolvedAs,
2422
- locale: locale,
2423
- router: _this
2424
- });
2425
- handleCancelled();
2426
- if ((data == null ? void 0 : (ref = data.effect) == null ? void 0 : ref.type) === "redirect-internal" || (data == null ? void 0 : (ref4 = data.effect) == null ? void 0 : ref4.type) === "redirect-external") {
2427
- return data.effect;
2428
- }
2429
- if ((data == null ? void 0 : (ref5 = data.effect) == null ? void 0 : ref5.type) === "rewrite") {
2430
- route = (0, _removeTrailingSlash).removeTrailingSlash(data.effect.resolvedHref);
2431
- pathname = data.effect.resolvedHref;
2432
- query = _extends({}, query, data.effect.parsedAs.query);
2433
- resolvedAs = (0, _removeBasePath).removeBasePath((0, _normalizeLocalePath).normalizeLocalePath(data.effect.parsedAs.pathname, _this.locales).pathname);
2434
- // Check again the cache with the new destination.
2435
- existingInfo = _this.components[route];
2436
- if (routeProps.shallow && existingInfo && _this.route === route && !hasMiddleware) {
2437
- // If we have a match with the current route due to rewrite,
2438
- // we can copy the existing information to the rewritten one.
2439
- // Then, we return the information along with the matched route.
2440
- return _extends({}, existingInfo, {
2441
- route
2442
- });
2443
- }
2444
- }
2445
- if (route === "/api" || route.startsWith("/api/")) {
2446
- handleHardNavigation({
2447
- url: as,
2448
- router: _this
2449
- });
2450
- return new Promise(()=>{});
2451
- }
2452
- const routeInfo = cachedRouteInfo || (yield _this.fetchComponent(route).then((res)=>({
2453
- Component: res.page,
2454
- styleSheets: res.styleSheets,
2455
- __N_SSG: res.mod.__N_SSG,
2456
- __N_SSP: res.mod.__N_SSP
2457
- })));
2458
- if (false) {}
2459
- const shouldFetchData = routeInfo.__N_SSG || routeInfo.__N_SSP;
2460
- const { props , cacheKey } = yield _this._getData(_async_to_generator(function*() {
2461
- if (shouldFetchData) {
2462
- const { json , cacheKey: _cacheKey } = (data == null ? void 0 : data.json) ? data : yield fetchNextData({
2463
- dataHref: _this.pageLoader.getDataHref({
2464
- href: (0, _formatUrl).formatWithValidation({
2465
- pathname,
2466
- query
2467
- }),
2468
- asPath: resolvedAs,
2469
- locale
2470
- }),
2471
- isServerRender: _this.isSsr,
2472
- parseJSON: true,
2473
- inflightCache: _this.sdc,
2474
- persistCache: !isPreview,
2475
- isPrefetch: false,
2476
- unstable_skipClientCache
2477
- });
2478
- return {
2479
- cacheKey: _cacheKey,
2480
- props: json || {}
2481
- };
2482
- }
2483
- return {
2484
- headers: {},
2485
- cacheKey: "",
2486
- props: yield _this.getInitialProps(routeInfo.Component, {
2487
- pathname,
2488
- query,
2489
- asPath: as,
2490
- locale,
2491
- locales: _this.locales,
2492
- defaultLocale: _this.defaultLocale
2493
- })
2494
- };
2495
- }));
2496
- // Only bust the data cache for SSP routes although
2497
- // middleware can skip cache per request with
2498
- // x-middleware-cache: no-cache as well
2499
- if (routeInfo.__N_SSP && fetchNextDataParams.dataHref) {
2500
- delete _this.sdc[cacheKey];
2501
- }
2502
- // we kick off a HEAD request in the background
2503
- // when a non-prefetch request is made to signal revalidation
2504
- if (!_this.isPreview && routeInfo.__N_SSG && "production" !== "development") {
2505
- fetchNextData(Object.assign({}, fetchNextDataParams, {
2506
- isBackground: true,
2507
- persistCache: false,
2508
- inflightCache: backgroundCache
2509
- })).catch(()=>{});
2510
- }
2511
- props.pageProps = Object.assign({}, props.pageProps);
2512
- routeInfo.props = props;
2513
- routeInfo.route = route;
2514
- routeInfo.query = query;
2515
- routeInfo.resolvedAs = resolvedAs;
2516
- _this.components[route] = routeInfo;
2517
- return routeInfo;
2518
- } catch (err) {
2519
- return _this.handleRouteInfoError((0, _isError).getProperError(err), pathname, query, as, routeProps);
2520
- }
2521
- })();
2522
- }
2523
- set(state, data, resetScroll) {
2524
- this.state = state;
2525
- return this.sub(data, this.components["/_app"].Component, resetScroll);
2526
- }
2527
- /**
2528
- * Callback to execute before replacing router state
2529
- * @param cb callback to be executed
2530
- */ beforePopState(cb) {
2531
- this._bps = cb;
2532
- }
2533
- onlyAHashChange(as) {
2534
- if (!this.asPath) return false;
2535
- const [oldUrlNoHash, oldHash] = this.asPath.split("#");
2536
- const [newUrlNoHash, newHash] = as.split("#");
2537
- // Makes sure we scroll to the provided hash if the url/hash are the same
2538
- if (newHash && oldUrlNoHash === newUrlNoHash && oldHash === newHash) {
2539
- return true;
2540
- }
2541
- // If the urls are change, there's more than a hash change
2542
- if (oldUrlNoHash !== newUrlNoHash) {
2543
- return false;
2544
- }
2545
- // If the hash has changed, then it's a hash only change.
2546
- // This check is necessary to handle both the enter and
2547
- // leave hash === '' cases. The identity case falls through
2548
- // and is treated as a next reload.
2549
- return oldHash !== newHash;
2550
- }
2551
- scrollToHash(as) {
2552
- const [, hash = ""] = as.split("#");
2553
- // Scroll to top if the hash is just `#` with no value or `#top`
2554
- // To mirror browsers
2555
- if (hash === "" || hash === "top") {
2556
- handleSmoothScroll(()=>window.scrollTo(0, 0));
2557
- return;
2558
- }
2559
- // Decode hash to make non-latin anchor works.
2560
- const rawHash = decodeURIComponent(hash);
2561
- // First we check if the element by id is found
2562
- const idEl = document.getElementById(rawHash);
2563
- if (idEl) {
2564
- handleSmoothScroll(()=>idEl.scrollIntoView());
2565
- return;
2566
- }
2567
- // If there's no element with the id, we check the `name` property
2568
- // To mirror browsers
2569
- const nameEl = document.getElementsByName(rawHash)[0];
2570
- if (nameEl) {
2571
- handleSmoothScroll(()=>nameEl.scrollIntoView());
2572
- }
2573
- }
2574
- urlIsNew(asPath) {
2575
- return this.asPath !== asPath;
2576
- }
2577
- /**
2578
- * Prefetch page code, you may wait for the data during page rendering.
2579
- * This feature only works in production!
2580
- * @param url the href of prefetched page
2581
- * @param asPath the as path of the prefetched page
2582
- */ prefetch(url, asPath = url, options = {}) {
2583
- var _this = this;
2584
- return _async_to_generator(function*() {
2585
- if (false) {}
2586
- let parsed = (0, _parseRelativeUrl).parseRelativeUrl(url);
2587
- let { pathname , query } = parsed;
2588
- if (false) {}
2589
- const pages = yield _this.pageLoader.getPageList();
2590
- let resolvedAs = asPath;
2591
- const locale = typeof options.locale !== "undefined" ? options.locale || undefined : _this.locale;
2592
- if (false) {}
2593
- parsed.pathname = resolveDynamicRoute(parsed.pathname, pages);
2594
- if ((0, _isDynamic).isDynamicRoute(parsed.pathname)) {
2595
- pathname = parsed.pathname;
2596
- parsed.pathname = pathname;
2597
- Object.assign(query, (0, _routeMatcher).getRouteMatcher((0, _routeRegex).getRouteRegex(parsed.pathname))((0, _parsePath).parsePath(asPath).pathname) || {});
2598
- url = (0, _formatUrl).formatWithValidation(parsed);
2599
- }
2600
- // Prefetch is not supported in development mode because it would trigger on-demand-entries
2601
- if (false) {}
2602
- const route = (0, _removeTrailingSlash).removeTrailingSlash(pathname);
2603
- yield Promise.all([
2604
- _this.pageLoader._isSsg(route).then((isSsg)=>{
2605
- return isSsg ? fetchNextData({
2606
- dataHref: _this.pageLoader.getDataHref({
2607
- href: url,
2608
- asPath: resolvedAs,
2609
- locale: locale
2610
- }),
2611
- isServerRender: false,
2612
- parseJSON: true,
2613
- inflightCache: _this.sdc,
2614
- persistCache: !_this.isPreview,
2615
- isPrefetch: true,
2616
- unstable_skipClientCache: options.unstable_skipClientCache || options.priority && !!true
2617
- }).then(()=>false) : false;
2618
- }),
2619
- _this.pageLoader[options.priority ? "loadPage" : "prefetch"](route),
2620
- ]);
2621
- })();
2622
- }
2623
- fetchComponent(route) {
2624
- var _this = this;
2625
- return _async_to_generator(function*() {
2626
- const handleCancelled = getCancelledHandler({
2627
- route,
2628
- router: _this
2629
- });
2630
- try {
2631
- const componentResult = yield _this.pageLoader.loadPage(route);
2632
- handleCancelled();
2633
- return componentResult;
2634
- } catch (err) {
2635
- handleCancelled();
2636
- throw err;
2637
- }
2638
- })();
2639
- }
2640
- _getData(fn) {
2641
- let cancelled = false;
2642
- const cancel = ()=>{
2643
- cancelled = true;
2644
- };
2645
- this.clc = cancel;
2646
- return fn().then((data)=>{
2647
- if (cancel === this.clc) {
2648
- this.clc = null;
2649
- }
2650
- if (cancelled) {
2651
- const err = new Error("Loading initial props cancelled");
2652
- err.cancelled = true;
2653
- throw err;
2654
- }
2655
- return data;
2656
- });
2657
- }
2658
- _getFlightData(dataHref) {
2659
- // Do not cache RSC flight response since it's not a static resource
2660
- return fetchNextData({
2661
- dataHref,
2662
- isServerRender: true,
2663
- parseJSON: false,
2664
- inflightCache: this.sdc,
2665
- persistCache: false,
2666
- isPrefetch: false
2667
- }).then(({ text })=>({
2668
- data: text
2669
- }));
2670
- }
2671
- getInitialProps(Component, ctx) {
2672
- const { Component: App } = this.components["/_app"];
2673
- const AppTree = this._wrapApp(App);
2674
- ctx.AppTree = AppTree;
2675
- return (0, _utils).loadGetInitialProps(App, {
2676
- AppTree,
2677
- Component,
2678
- router: this,
2679
- ctx
2680
- });
2681
- }
2682
- get route() {
2683
- return this.state.route;
2684
- }
2685
- get pathname() {
2686
- return this.state.pathname;
2687
- }
2688
- get query() {
2689
- return this.state.query;
2690
- }
2691
- get asPath() {
2692
- return this.state.asPath;
2693
- }
2694
- get locale() {
2695
- return this.state.locale;
2696
- }
2697
- get isFallback() {
2698
- return this.state.isFallback;
2699
- }
2700
- get isPreview() {
2701
- return this.state.isPreview;
2702
- }
2703
- constructor(pathname1, query1, as1, { initialProps , pageLoader , App , wrapApp , Component , err , subscription , isFallback , locale , locales , defaultLocale , domainLocales , isPreview }){
2704
- // Server Data Cache
2705
- this.sdc = {};
2706
- this.isFirstPopStateEvent = true;
2707
- this._key = createKey();
2708
- this.onPopState = (e)=>{
2709
- const { isFirstPopStateEvent } = this;
2710
- this.isFirstPopStateEvent = false;
2711
- const state = e.state;
2712
- if (!state) {
2713
- // We get state as undefined for two reasons.
2714
- // 1. With older safari (< 8) and older chrome (< 34)
2715
- // 2. When the URL changed with #
2716
- //
2717
- // In the both cases, we don't need to proceed and change the route.
2718
- // (as it's already changed)
2719
- // But we can simply replace the state with the new changes.
2720
- // Actually, for (1) we don't need to nothing. But it's hard to detect that event.
2721
- // So, doing the following for (1) does no harm.
2722
- const { pathname , query } = this;
2723
- this.changeState("replaceState", (0, _formatUrl).formatWithValidation({
2724
- pathname: (0, _addBasePath).addBasePath(pathname),
2725
- query
2726
- }), (0, _utils).getURL());
2727
- return;
2728
- }
2729
- // __NA is used to identify if the history entry can be handled by the app-router.
2730
- if (state.__NA) {
2731
- window.location.reload();
2732
- return;
2733
- }
2734
- if (!state.__N) {
2735
- return;
2736
- }
2737
- // Safari fires popstateevent when reopening the browser.
2738
- if (isFirstPopStateEvent && this.locale === state.options.locale && state.as === this.asPath) {
2739
- return;
2740
- }
2741
- let forcedScroll;
2742
- const { url , as , options , key } = state;
2743
- if (false) {}
2744
- this._key = key;
2745
- const { pathname: pathname1 } = (0, _parseRelativeUrl).parseRelativeUrl(url);
2746
- // Make sure we don't re-render on initial load,
2747
- // can be caused by navigating back from an external site
2748
- if (this.isSsr && as === (0, _addBasePath).addBasePath(this.asPath) && pathname1 === (0, _addBasePath).addBasePath(this.pathname)) {
2749
- return;
2750
- }
2751
- // If the downstream application returns falsy, return.
2752
- // They will then be responsible for handling the event.
2753
- if (this._bps && !this._bps(state)) {
2754
- return;
2755
- }
2756
- this.change("replaceState", url, as, Object.assign({}, options, {
2757
- shallow: options.shallow && this._shallow,
2758
- locale: options.locale || this.defaultLocale,
2759
- // @ts-ignore internal value not exposed on types
2760
- _h: 0
2761
- }), forcedScroll);
2762
- };
2763
- // represents the current component key
2764
- const route = (0, _removeTrailingSlash).removeTrailingSlash(pathname1);
2765
- // set up the component cache (by route keys)
2766
- this.components = {};
2767
- // We should not keep the cache, if there's an error
2768
- // Otherwise, this cause issues when when going back and
2769
- // come again to the errored page.
2770
- if (pathname1 !== "/_error") {
2771
- this.components[route] = {
2772
- Component,
2773
- initial: true,
2774
- props: initialProps,
2775
- err,
2776
- __N_SSG: initialProps && initialProps.__N_SSG,
2777
- __N_SSP: initialProps && initialProps.__N_SSP
2778
- };
2779
- }
2780
- this.components["/_app"] = {
2781
- Component: App,
2782
- styleSheets: []
2783
- };
2784
- // Backwards compat for Router.router.events
2785
- // TODO: Should be remove the following major version as it was never documented
2786
- this.events = Router.events;
2787
- this.pageLoader = pageLoader;
2788
- // if auto prerendered and dynamic route wait to update asPath
2789
- // until after mount to prevent hydration mismatch
2790
- const autoExportDynamic = (0, _isDynamic).isDynamicRoute(pathname1) && self.__NEXT_DATA__.autoExport;
2791
- this.basePath = false || "";
2792
- this.sub = subscription;
2793
- this.clc = null;
2794
- this._wrapApp = wrapApp;
2795
- // make sure to ignore extra popState in safari on navigating
2796
- // back from external site
2797
- this.isSsr = true;
2798
- this.isLocaleDomain = false;
2799
- this.isReady = !!(self.__NEXT_DATA__.gssp || self.__NEXT_DATA__.gip || self.__NEXT_DATA__.appGip && !self.__NEXT_DATA__.gsp || !autoExportDynamic && !self.location.search && !false);
2800
- if (false) {}
2801
- this.state = {
2802
- route,
2803
- pathname: pathname1,
2804
- query: query1,
2805
- asPath: autoExportDynamic ? pathname1 : as1,
2806
- isPreview: !!isPreview,
2807
- locale: false ? 0 : undefined,
2808
- isFallback
2809
- };
2810
- this._initialMatchesMiddlewarePromise = Promise.resolve(false);
2811
- if (false) {}
2812
- }
2813
- }
2814
- Router.events = (0, _mitt).default();
2815
- exports["default"] = Router; //# sourceMappingURL=router.js.map
2816
-
2817
-
2818
- /***/ }),
2819
-
2820
- /***/ 9097:
2821
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
2822
-
2823
- module.exports = __webpack_require__(162)
2824
-
2825
-
2826
- /***/ })
2827
-
2828
- };
2829
- ;