@prismicio/next 2.3.3-pr.154.9869eec → 2.3.3-pr.154.99ba5da

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 (158) hide show
  1. package/dist/PrismicNextImage.cjs +6 -5
  2. package/dist/PrismicNextImage.cjs.map +1 -1
  3. package/dist/PrismicNextImage.d.cts +5 -4
  4. package/dist/PrismicNextImage.d.cts.map +1 -1
  5. package/dist/PrismicNextImage.d.ts +5 -4
  6. package/dist/PrismicNextImage.d.ts.map +1 -1
  7. package/dist/PrismicNextImage.js +5 -4
  8. package/dist/PrismicNextImage.js.map +1 -1
  9. package/dist/PrismicNextLink.cjs +3 -2
  10. package/dist/PrismicNextLink.cjs.map +1 -1
  11. package/dist/PrismicNextLink.d.cts +8 -11
  12. package/dist/PrismicNextLink.d.cts.map +1 -1
  13. package/dist/PrismicNextLink.d.ts +7 -10
  14. package/dist/PrismicNextLink.d.ts.map +1 -1
  15. package/dist/PrismicNextLink.js +2 -1
  16. package/dist/PrismicNextLink.js.map +1 -1
  17. package/dist/PrismicPreview.cjs +2 -2
  18. package/dist/PrismicPreview.cjs.map +1 -1
  19. package/dist/PrismicPreview.d.cts +2 -2
  20. package/dist/PrismicPreview.d.cts.map +1 -1
  21. package/dist/PrismicPreview.d.ts +2 -2
  22. package/dist/PrismicPreview.d.ts.map +1 -1
  23. package/dist/PrismicPreview.js +1 -1
  24. package/dist/PrismicPreview.js.map +1 -1
  25. package/dist/PrismicPreviewClient.cjs +0 -1
  26. package/dist/PrismicPreviewClient.cjs.map +1 -1
  27. package/dist/PrismicPreviewClient.js.map +1 -1
  28. package/dist/SliceSimulator.cjs +3 -2
  29. package/dist/SliceSimulator.cjs.map +1 -1
  30. package/dist/SliceSimulator.d.cts +0 -1
  31. package/dist/SliceSimulator.d.cts.map +1 -1
  32. package/dist/SliceSimulator.d.ts +0 -1
  33. package/dist/SliceSimulator.d.ts.map +1 -1
  34. package/dist/SliceSimulator.js +2 -1
  35. package/dist/SliceSimulator.js.map +1 -1
  36. package/dist/SliceSimulatorWrapper.cjs +0 -1
  37. package/dist/SliceSimulatorWrapper.cjs.map +1 -1
  38. package/dist/SliceSimulatorWrapper.js.map +1 -1
  39. package/dist/_virtual/_rolldown/runtime.cjs +1 -1
  40. package/dist/cacheTagPrismicPages.cjs +1 -1
  41. package/dist/cacheTagPrismicPages.cjs.map +1 -1
  42. package/dist/cacheTagPrismicPages.d.cts +0 -1
  43. package/dist/cacheTagPrismicPages.d.cts.map +1 -1
  44. package/dist/cacheTagPrismicPages.d.ts +0 -1
  45. package/dist/cacheTagPrismicPages.d.ts.map +1 -1
  46. package/dist/cacheTagPrismicPages.js.map +1 -1
  47. package/dist/createLocaleRedirect.cjs.map +1 -1
  48. package/dist/createLocaleRedirect.d.cts.map +1 -1
  49. package/dist/createLocaleRedirect.d.ts.map +1 -1
  50. package/dist/createLocaleRedirect.js.map +1 -1
  51. package/dist/enableAutoPreviews.cjs.map +1 -1
  52. package/dist/enableAutoPreviews.d.cts +2 -2
  53. package/dist/enableAutoPreviews.d.cts.map +1 -1
  54. package/dist/enableAutoPreviews.d.ts +2 -2
  55. package/dist/enableAutoPreviews.d.ts.map +1 -1
  56. package/dist/enableAutoPreviews.js.map +1 -1
  57. package/dist/exitPreview.cjs +0 -1
  58. package/dist/exitPreview.cjs.map +1 -1
  59. package/dist/exitPreview.d.cts.map +1 -1
  60. package/dist/exitPreview.d.ts.map +1 -1
  61. package/dist/exitPreview.js.map +1 -1
  62. package/dist/getPreviewRef.cjs +0 -1
  63. package/dist/getPreviewRef.cjs.map +1 -1
  64. package/dist/getPreviewRef.d.cts.map +1 -1
  65. package/dist/getPreviewRef.d.ts.map +1 -1
  66. package/dist/getPreviewRef.js.map +1 -1
  67. package/dist/getPrismicCacheTags.cjs +4 -2
  68. package/dist/getPrismicCacheTags.cjs.map +1 -1
  69. package/dist/getPrismicCacheTags.d.cts +0 -1
  70. package/dist/getPrismicCacheTags.d.cts.map +1 -1
  71. package/dist/getPrismicCacheTags.d.ts +0 -1
  72. package/dist/getPrismicCacheTags.d.ts.map +1 -1
  73. package/dist/getPrismicCacheTags.js +4 -2
  74. package/dist/getPrismicCacheTags.js.map +1 -1
  75. package/dist/getSlices.cjs +1 -1
  76. package/dist/getSlices.cjs.map +1 -1
  77. package/dist/getSlices.d.cts +0 -1
  78. package/dist/getSlices.d.cts.map +1 -1
  79. package/dist/getSlices.d.ts +0 -1
  80. package/dist/getSlices.d.ts.map +1 -1
  81. package/dist/getSlices.js.map +1 -1
  82. package/dist/imgixLoader.cjs +0 -1
  83. package/dist/imgixLoader.cjs.map +1 -1
  84. package/dist/imgixLoader.d.cts +0 -1
  85. package/dist/imgixLoader.d.cts.map +1 -1
  86. package/dist/imgixLoader.d.ts +0 -1
  87. package/dist/imgixLoader.d.ts.map +1 -1
  88. package/dist/imgixLoader.js.map +1 -1
  89. package/dist/lib/devMsg.cjs.map +1 -1
  90. package/dist/lib/devMsg.js.map +1 -1
  91. package/dist/lib/resolveDefaultExport.cjs.map +1 -1
  92. package/dist/lib/resolveDefaultExport.js.map +1 -1
  93. package/dist/package.cjs +1 -1
  94. package/dist/package.js +1 -1
  95. package/dist/pages/PrismicPreview.cjs +1 -1
  96. package/dist/pages/PrismicPreview.cjs.map +1 -1
  97. package/dist/pages/PrismicPreview.d.cts +2 -2
  98. package/dist/pages/PrismicPreview.d.cts.map +1 -1
  99. package/dist/pages/PrismicPreview.d.ts +2 -2
  100. package/dist/pages/PrismicPreview.d.ts.map +1 -1
  101. package/dist/pages/PrismicPreview.js.map +1 -1
  102. package/dist/pages/SliceSimulator.cjs +0 -1
  103. package/dist/pages/SliceSimulator.cjs.map +1 -1
  104. package/dist/pages/SliceSimulator.d.cts +0 -1
  105. package/dist/pages/SliceSimulator.d.cts.map +1 -1
  106. package/dist/pages/SliceSimulator.d.ts +0 -1
  107. package/dist/pages/SliceSimulator.d.ts.map +1 -1
  108. package/dist/pages/SliceSimulator.js.map +1 -1
  109. package/dist/pages/enableAutoPreviews.cjs.map +1 -1
  110. package/dist/pages/enableAutoPreviews.d.cts +2 -2
  111. package/dist/pages/enableAutoPreviews.d.cts.map +1 -1
  112. package/dist/pages/enableAutoPreviews.d.ts +2 -2
  113. package/dist/pages/enableAutoPreviews.d.ts.map +1 -1
  114. package/dist/pages/enableAutoPreviews.js.map +1 -1
  115. package/dist/pages/exitPreview.cjs.map +1 -1
  116. package/dist/pages/exitPreview.d.cts +0 -1
  117. package/dist/pages/exitPreview.d.cts.map +1 -1
  118. package/dist/pages/exitPreview.d.ts +0 -1
  119. package/dist/pages/exitPreview.d.ts.map +1 -1
  120. package/dist/pages/exitPreview.js.map +1 -1
  121. package/dist/pages/redirectToPreviewURL.cjs.map +1 -1
  122. package/dist/pages/redirectToPreviewURL.d.cts +2 -2
  123. package/dist/pages/redirectToPreviewURL.d.cts.map +1 -1
  124. package/dist/pages/redirectToPreviewURL.d.ts +2 -2
  125. package/dist/pages/redirectToPreviewURL.d.ts.map +1 -1
  126. package/dist/pages/redirectToPreviewURL.js.map +1 -1
  127. package/dist/pages/setPreviewData.cjs +0 -1
  128. package/dist/pages/setPreviewData.cjs.map +1 -1
  129. package/dist/pages/setPreviewData.d.cts +1 -5
  130. package/dist/pages/setPreviewData.d.cts.map +1 -1
  131. package/dist/pages/setPreviewData.d.ts +1 -5
  132. package/dist/pages/setPreviewData.d.ts.map +1 -1
  133. package/dist/pages/setPreviewData.js.map +1 -1
  134. package/dist/pages/types.d.cts +0 -1
  135. package/dist/pages/types.d.cts.map +1 -1
  136. package/dist/pages/types.d.ts +0 -1
  137. package/dist/pages/types.d.ts.map +1 -1
  138. package/dist/redirectToPreviewURL.cjs +0 -1
  139. package/dist/redirectToPreviewURL.cjs.map +1 -1
  140. package/dist/redirectToPreviewURL.d.cts +2 -2
  141. package/dist/redirectToPreviewURL.d.cts.map +1 -1
  142. package/dist/redirectToPreviewURL.d.ts +2 -2
  143. package/dist/redirectToPreviewURL.d.ts.map +1 -1
  144. package/dist/redirectToPreviewURL.js.map +1 -1
  145. package/dist/revalidatePrismicPages.cjs +4 -2
  146. package/dist/revalidatePrismicPages.cjs.map +1 -1
  147. package/dist/revalidatePrismicPages.d.cts.map +1 -1
  148. package/dist/revalidatePrismicPages.d.ts.map +1 -1
  149. package/dist/revalidatePrismicPages.js +4 -1
  150. package/dist/revalidatePrismicPages.js.map +1 -1
  151. package/dist/types.d.cts +0 -1
  152. package/dist/types.d.cts.map +1 -1
  153. package/dist/types.d.ts +0 -1
  154. package/dist/types.d.ts.map +1 -1
  155. package/package.json +15 -15
  156. package/src/PrismicNextImage.tsx +5 -5
  157. package/src/PrismicNextLink.tsx +2 -2
  158. package/src/PrismicPreview.tsx +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"PrismicPreviewClient.js","names":["cookie","prismicCookie"],"sources":["../src/PrismicPreviewClient.tsx"],"sourcesContent":["\"use client\"\n\nimport { cookie as prismicCookie } from \"@prismicio/client\"\nimport { useRouter } from \"next/navigation\"\nimport type { FC } from \"react\"\nimport { useEffect } from \"react\"\n\ntype PrismicPreviewClientProps = {\n\trepositoryName: string\n\tisDraftMode: boolean\n\tupdatePreviewURL?: string\n\texitPreviewURL?: string\n}\n\nexport const PrismicPreviewClient: FC<PrismicPreviewClientProps> = (props) => {\n\tconst {\n\t\trepositoryName,\n\t\tisDraftMode,\n\t\tupdatePreviewURL = \"/api/preview\",\n\t\texitPreviewURL = \"/api/exit-preview\",\n\t} = props\n\n\tconst { refresh } = useRouter()\n\n\tuseEffect(() => {\n\t\tconst controller = new AbortController()\n\n\t\twindow.addEventListener(\"prismicPreviewStart\", onUpdate, {\n\t\t\tsignal: controller.signal,\n\t\t})\n\t\twindow.addEventListener(\"prismicPreviewUpdate\", onUpdate, {\n\t\t\tsignal: controller.signal,\n\t\t})\n\t\twindow.addEventListener(\"prismicPreviewEnd\", onEnd, {\n\t\t\tsignal: controller.signal,\n\t\t})\n\n\t\tconst cookie = decodeURIComponent(getPrismicPreviewCookie(window.document.cookie) ?? \"\")\n\t\t// A raw ref, or the toolbar's JSON cookie with a preview for this repository.\n\t\tconst hasActiveCookie =\n\t\t\tcookie !== \"\" &&\n\t\t\t(!cookie.startsWith(\"{\") || cookie.includes(`\"${repositoryName}.prismic.io\"`))\n\n\t\t// Start previews that did not go through `updatePreviewURL`, like\n\t\t// share links, and restart after a preview ended in another tab.\n\t\tif (hasActiveCookie && !isDraftMode) {\n\t\t\tstart()\n\t\t}\n\n\t\tfunction start() {\n\t\t\t// We check `opaqueredirect` because we don't care if\n\t\t\t// the redirect was successful or not. As long as it\n\t\t\t// redirects, we know the endpoint exists and draft mode\n\t\t\t// is active.\n\t\t\tglobalThis\n\t\t\t\t.fetch(updatePreviewURL, {\n\t\t\t\t\tredirect: \"manual\",\n\t\t\t\t\tsignal: controller.signal,\n\t\t\t\t})\n\t\t\t\t.then((res) => {\n\t\t\t\t\tif (res.type !== \"opaqueredirect\") {\n\t\t\t\t\t\tconsole.error(\n\t\t\t\t\t\t\t`[<PrismicPreview>] Failed to start the preview using \"${updatePreviewURL}\". Does it exist?`,\n\t\t\t\t\t\t)\n\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\n\t\t\t\t\t// A soft refresh cannot leave Next.js's not-found boundary, which renders this tag.\n\t\t\t\t\tif (document.querySelector('meta[name=\"robots\"][content=\"noindex\"]')) {\n\t\t\t\t\t\twindow.location.reload()\n\t\t\t\t\t} else {\n\t\t\t\t\t\trefresh()\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t\t.catch(() => {\n\t\t\t\t\t// noop\n\t\t\t\t})\n\t\t}\n\n\t\tfunction onUpdate(event: Event) {\n\t\t\tevent.preventDefault()\n\t\t\tif (isDraftMode) {\n\t\t\t\trefresh()\n\t\t\t} else {\n\t\t\t\tstart()\n\t\t\t}\n\t\t}\n\n\t\tfunction onEnd(event: Event) {\n\t\t\tevent.preventDefault()\n\t\t\tglobalThis\n\t\t\t\t.fetch(exitPreviewURL, { signal: controller.signal })\n\t\t\t\t.then((res) => {\n\t\t\t\t\tif (!res.ok) {\n\t\t\t\t\t\tconsole.error(\n\t\t\t\t\t\t\t`[<PrismicPreview>] Failed to exit Preview Mode using the \"${exitPreviewURL}\" API endpoint. Does it exist?`,\n\t\t\t\t\t\t)\n\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\n\t\t\t\t\trefresh()\n\t\t\t\t})\n\t\t\t\t.catch(() => {\n\t\t\t\t\t// noop\n\t\t\t\t})\n\t\t}\n\n\t\treturn () => controller.abort()\n\t}, [repositoryName, isDraftMode, updatePreviewURL, exitPreviewURL, refresh])\n\n\treturn null\n}\n\n/**\n * Returns the value of a cookie from a given cookie store.\n *\n * @param cookieJar - The stringified cookie store from which to read the cookie.\n * @returns The value of the cookie, if it exists.\n */\nfunction getPrismicPreviewCookie(cookieJar: string): string | undefined {\n\tfunction readValue(value: string): string {\n\t\treturn value.replace(/%3B/g, \";\")\n\t}\n\n\tconst cookies = cookieJar.split(\"; \")\n\n\tlet value: string | undefined\n\n\tfor (const cookie of cookies) {\n\t\tconst parts = cookie.split(\"=\")\n\t\tconst name = readValue(parts[0]).replace(/%3D/g, \"=\")\n\n\t\tif (name === prismicCookie.preview) {\n\t\t\tvalue = readValue(parts.slice(1).join(\"=\"))\n\t\t\tcontinue\n\t\t}\n\t}\n\n\treturn value\n}\n"],"mappings":";;;;;AAcA,MAAa,wBAAuD,UAAU;CAC7E,MAAM,EACL,gBACA,aACA,mBAAmB,gBACnB,iBAAiB,wBACd;CAEJ,MAAM,EAAE,YAAY,WAAW;AAE/B,iBAAgB;EACf,MAAM,aAAa,IAAI,iBAAiB;AAExC,SAAO,iBAAiB,uBAAuB,UAAU,EACxD,QAAQ,WAAW,QACnB,CAAC;AACF,SAAO,iBAAiB,wBAAwB,UAAU,EACzD,QAAQ,WAAW,QACnB,CAAC;AACF,SAAO,iBAAiB,qBAAqB,OAAO,EACnD,QAAQ,WAAW,QACnB,CAAC;EAEF,MAAM,SAAS,mBAAmB,wBAAwB,OAAO,SAAS,OAAO,IAAI,GAAG;AAQxF,MALC,WAAW,OACV,CAAC,OAAO,WAAW,IAAI,IAAI,OAAO,SAAS,IAAI,eAAe,cAAc,KAIvD,CAAC,YACvB,QAAO;EAGR,SAAS,QAAQ;AAKhB,cACE,MAAM,kBAAkB;IACxB,UAAU;IACV,QAAQ,WAAW;IACnB,CAAC,CACD,MAAM,QAAQ;AACd,QAAI,IAAI,SAAS,kBAAkB;AAClC,aAAQ,MACP,yDAAyD,iBAAiB,mBAC1E;AAED;;AAID,QAAI,SAAS,cAAc,6CAAyC,CACnE,QAAO,SAAS,QAAQ;QAExB,UAAS;KAET,CACD,YAAY,GAEX;;EAGJ,SAAS,SAAS,OAAc;AAC/B,SAAM,gBAAgB;AACtB,OAAI,YACH,UAAS;OAET,QAAO;;EAIT,SAAS,MAAM,OAAc;AAC5B,SAAM,gBAAgB;AACtB,cACE,MAAM,gBAAgB,EAAE,QAAQ,WAAW,QAAQ,CAAC,CACpD,MAAM,QAAQ;AACd,QAAI,CAAC,IAAI,IAAI;AACZ,aAAQ,MACP,6DAA6D,eAAe,gCAC5E;AAED;;AAGD,aAAS;KACR,CACD,YAAY,GAEX;;AAGJ,eAAa,WAAW,OAAO;IAC7B;EAAC;EAAgB;EAAa;EAAkB;EAAgB;EAAQ,CAAC;AAE5E,QAAO;;;;;;;;AASR,SAAS,wBAAwB,WAAuC;CACvE,SAAS,UAAU,OAAuB;AACzC,SAAO,MAAM,QAAQ,QAAQ,IAAI;;CAGlC,MAAM,UAAU,UAAU,MAAM,KAAK;CAErC,IAAI;AAEJ,MAAK,MAAMA,YAAU,SAAS;EAC7B,MAAM,QAAQA,SAAO,MAAM,IAAI;AAG/B,MAFa,UAAU,MAAM,GAAG,CAAC,QAAQ,QAAQ,IAAI,KAExCC,OAAc,SAAS;AACnC,WAAQ,UAAU,MAAM,MAAM,EAAE,CAAC,KAAK,IAAI,CAAC;AAC3C;;;AAIF,QAAO"}
1
+ {"version":3,"file":"PrismicPreviewClient.js","names":["cookie","prismicCookie"],"sources":["../src/PrismicPreviewClient.tsx"],"sourcesContent":["\"use client\"\n\nimport { cookie as prismicCookie } from \"@prismicio/client\"\nimport { useRouter } from \"next/navigation\"\nimport type { FC } from \"react\"\nimport { useEffect } from \"react\"\n\ntype PrismicPreviewClientProps = {\n\trepositoryName: string\n\tisDraftMode: boolean\n\tupdatePreviewURL?: string\n\texitPreviewURL?: string\n}\n\nexport const PrismicPreviewClient: FC<PrismicPreviewClientProps> = (props) => {\n\tconst {\n\t\trepositoryName,\n\t\tisDraftMode,\n\t\tupdatePreviewURL = \"/api/preview\",\n\t\texitPreviewURL = \"/api/exit-preview\",\n\t} = props\n\n\tconst { refresh } = useRouter()\n\n\tuseEffect(() => {\n\t\tconst controller = new AbortController()\n\n\t\twindow.addEventListener(\"prismicPreviewStart\", onUpdate, {\n\t\t\tsignal: controller.signal,\n\t\t})\n\t\twindow.addEventListener(\"prismicPreviewUpdate\", onUpdate, {\n\t\t\tsignal: controller.signal,\n\t\t})\n\t\twindow.addEventListener(\"prismicPreviewEnd\", onEnd, {\n\t\t\tsignal: controller.signal,\n\t\t})\n\n\t\tconst cookie = decodeURIComponent(getPrismicPreviewCookie(window.document.cookie) ?? \"\")\n\t\t// A raw ref, or the toolbar's JSON cookie with a preview for this repository.\n\t\tconst hasActiveCookie =\n\t\t\tcookie !== \"\" &&\n\t\t\t(!cookie.startsWith(\"{\") || cookie.includes(`\"${repositoryName}.prismic.io\"`))\n\n\t\t// Start previews that did not go through `updatePreviewURL`, like\n\t\t// share links, and restart after a preview ended in another tab.\n\t\tif (hasActiveCookie && !isDraftMode) {\n\t\t\tstart()\n\t\t}\n\n\t\tfunction start() {\n\t\t\t// We check `opaqueredirect` because we don't care if\n\t\t\t// the redirect was successful or not. As long as it\n\t\t\t// redirects, we know the endpoint exists and draft mode\n\t\t\t// is active.\n\t\t\tglobalThis\n\t\t\t\t.fetch(updatePreviewURL, {\n\t\t\t\t\tredirect: \"manual\",\n\t\t\t\t\tsignal: controller.signal,\n\t\t\t\t})\n\t\t\t\t.then((res) => {\n\t\t\t\t\tif (res.type !== \"opaqueredirect\") {\n\t\t\t\t\t\tconsole.error(\n\t\t\t\t\t\t\t`[<PrismicPreview>] Failed to start the preview using \"${updatePreviewURL}\". Does it exist?`,\n\t\t\t\t\t\t)\n\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\n\t\t\t\t\t// A soft refresh cannot leave Next.js's not-found boundary, which renders this tag.\n\t\t\t\t\tif (document.querySelector('meta[name=\"robots\"][content=\"noindex\"]')) {\n\t\t\t\t\t\twindow.location.reload()\n\t\t\t\t\t} else {\n\t\t\t\t\t\trefresh()\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t\t.catch(() => {\n\t\t\t\t\t// noop\n\t\t\t\t})\n\t\t}\n\n\t\tfunction onUpdate(event: Event) {\n\t\t\tevent.preventDefault()\n\t\t\tif (isDraftMode) {\n\t\t\t\trefresh()\n\t\t\t} else {\n\t\t\t\tstart()\n\t\t\t}\n\t\t}\n\n\t\tfunction onEnd(event: Event) {\n\t\t\tevent.preventDefault()\n\t\t\tglobalThis\n\t\t\t\t.fetch(exitPreviewURL, { signal: controller.signal })\n\t\t\t\t.then((res) => {\n\t\t\t\t\tif (!res.ok) {\n\t\t\t\t\t\tconsole.error(\n\t\t\t\t\t\t\t`[<PrismicPreview>] Failed to exit Preview Mode using the \"${exitPreviewURL}\" API endpoint. Does it exist?`,\n\t\t\t\t\t\t)\n\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\n\t\t\t\t\trefresh()\n\t\t\t\t})\n\t\t\t\t.catch(() => {\n\t\t\t\t\t// noop\n\t\t\t\t})\n\t\t}\n\n\t\treturn () => controller.abort()\n\t}, [repositoryName, isDraftMode, updatePreviewURL, exitPreviewURL, refresh])\n\n\treturn null\n}\n\n/**\n * Returns the value of a cookie from a given cookie store.\n *\n * @param cookieJar - The stringified cookie store from which to read the cookie.\n * @returns The value of the cookie, if it exists.\n */\nfunction getPrismicPreviewCookie(cookieJar: string): string | undefined {\n\tfunction readValue(value: string): string {\n\t\treturn value.replace(/%3B/g, \";\")\n\t}\n\n\tconst cookies = cookieJar.split(\"; \")\n\n\tlet value: string | undefined\n\n\tfor (const cookie of cookies) {\n\t\tconst parts = cookie.split(\"=\")\n\t\tconst name = readValue(parts[0]).replace(/%3D/g, \"=\")\n\n\t\tif (name === prismicCookie.preview) {\n\t\t\tvalue = readValue(parts.slice(1).join(\"=\"))\n\t\t\tcontinue\n\t\t}\n\t}\n\n\treturn value\n}\n"],"mappings":";;;;;AAcA,MAAa,wBAAuD,UAAU;CAC7E,MAAM,EACL,gBACA,aACA,mBAAmB,gBACnB,iBAAiB,wBACd;CAEJ,MAAM,EAAE,YAAY,UAAU;CAE9B,gBAAgB;EACf,MAAM,aAAa,IAAI,gBAAgB;EAEvC,OAAO,iBAAiB,uBAAuB,UAAU,EACxD,QAAQ,WAAW,OACpB,CAAC;EACD,OAAO,iBAAiB,wBAAwB,UAAU,EACzD,QAAQ,WAAW,OACpB,CAAC;EACD,OAAO,iBAAiB,qBAAqB,OAAO,EACnD,QAAQ,WAAW,OACpB,CAAC;EAED,MAAM,SAAS,mBAAmB,wBAAwB,OAAO,SAAS,MAAM,KAAK,EAAE;EAQvF,IALC,WAAW,OACV,CAAC,OAAO,WAAW,GAAG,KAAK,OAAO,SAAS,IAAI,eAAe,aAAa,MAItD,CAAC,aACvB,MAAM;EAGP,SAAS,QAAQ;GAKhB,WACE,MAAM,kBAAkB;IACxB,UAAU;IACV,QAAQ,WAAW;GACpB,CAAC,CAAC,CACD,MAAM,QAAQ;IACd,IAAI,IAAI,SAAS,kBAAkB;KAClC,QAAQ,MACP,yDAAyD,iBAAiB,kBAC3E;KAEA;IACD;IAGA,IAAI,SAAS,cAAc,4CAAwC,GAClE,OAAO,SAAS,OAAO;SAEvB,QAAQ;GAEV,CAAC,CAAC,CACD,YAAY,CAEb,CAAC;EACH;EAEA,SAAS,SAAS,OAAc;GAC/B,MAAM,eAAe;GACrB,IAAI,aACH,QAAQ;QAER,MAAM;EAER;EAEA,SAAS,MAAM,OAAc;GAC5B,MAAM,eAAe;GACrB,WACE,MAAM,gBAAgB,EAAE,QAAQ,WAAW,OAAO,CAAC,CAAC,CACpD,MAAM,QAAQ;IACd,IAAI,CAAC,IAAI,IAAI;KACZ,QAAQ,MACP,6DAA6D,eAAe,+BAC7E;KAEA;IACD;IAEA,QAAQ;GACT,CAAC,CAAC,CACD,YAAY,CAEb,CAAC;EACH;EAEA,aAAa,WAAW,MAAM;CAC/B,GAAG;EAAC;EAAgB;EAAa;EAAkB;EAAgB;CAAO,CAAC;CAE3E,OAAO;AACR;;;;;;;AAQA,SAAS,wBAAwB,WAAuC;CACvE,SAAS,UAAU,OAAuB;EACzC,OAAO,MAAM,QAAQ,QAAQ,GAAG;CACjC;CAEA,MAAM,UAAU,UAAU,MAAM,IAAI;CAEpC,IAAI;CAEJ,KAAK,MAAMA,YAAU,SAAS;EAC7B,MAAM,QAAQA,SAAO,MAAM,GAAG;EAG9B,IAFa,UAAU,MAAM,EAAE,CAAC,CAAC,QAAQ,QAAQ,GAE1C,MAAMC,OAAc,SAAS;GACnC,QAAQ,UAAU,MAAM,MAAM,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC;GAC1C;EACD;CACD;CAEA,OAAO;AACR"}
@@ -7,7 +7,7 @@ let react = require("react");
7
7
  let react_jsx_runtime = require("react/jsx-runtime");
8
8
  let _prismicio_simulator_kit = require("@prismicio/simulator/kit");
9
9
  let lz_string = require("lz-string");
10
- lz_string = require_runtime.__toESM(lz_string);
10
+ lz_string = require_runtime.__toESM(lz_string, 1);
11
11
  //#region src/SliceSimulator.tsx
12
12
  const STATE_PARAMS_KEY = "state";
13
13
  const simulatorManager = new _prismicio_simulator_kit.SimulatorManager();
@@ -18,7 +18,8 @@ const simulatorManager = new _prismicio_simulator_kit.SimulatorManager();
18
18
  const SliceSimulator = ({ children, background, zIndex, className }) => {
19
19
  const [message, setMessage] = (0, react.useState)(() => (0, _prismicio_simulator_kit.getDefaultMessage)());
20
20
  const router = (0, next_navigation_js.useRouter)();
21
- const hasSlices = require_getSlices.getSlices(typeof window !== "undefined" ? new URL(window.location.href).searchParams.get(STATE_PARAMS_KEY) : void 0).length > 0;
21
+ const state = typeof window !== "undefined" ? new URL(window.location.href).searchParams.get(STATE_PARAMS_KEY) : void 0;
22
+ const hasSlices = require_getSlices.getSlices(state).length > 0;
22
23
  (0, react.useEffect)(() => {
23
24
  simulatorManager.state.on(_prismicio_simulator_kit.StateEventType.Slices, (newSlices) => {
24
25
  const url = new URL(window.location.href);
@@ -1 +1 @@
1
- {"version":3,"file":"SliceSimulator.cjs","names":["SimulatorManager","getSlices","StateEventType","lzString","SliceSimulatorWrapper"],"sources":["../src/SliceSimulator.tsx"],"sourcesContent":["\"use client\"\n\nimport { SimulatorManager, StateEventType, getDefaultMessage } from \"@prismicio/simulator/kit\"\nimport type { SliceSimulatorProps as BaseSliceSimulatorProps } from \"@prismicio/simulator/kit\"\nimport lzString from \"lz-string\"\nimport { useRouter } from \"next/navigation\"\nimport { useEffect, useState } from \"react\"\nimport type { FC, ReactNode } from \"react\"\n\nimport { getSlices } from \"./getSlices\"\nimport { SliceSimulatorWrapper } from \"./SliceSimulatorWrapper\"\n\nconst STATE_PARAMS_KEY = \"state\"\n\nconst simulatorManager = new SimulatorManager()\n\n/** Parameters provided to the Slice Simulator page. */\nexport type SliceSimulatorParams = {\n\tsearchParams: Promise<{\n\t\tstate?: string\n\t}>\n}\n\nexport type SliceSimulatorProps = BaseSliceSimulatorProps & {\n\tchildren: ReactNode\n\tclassName?: string\n}\n\n/**\n * Simulate slices in isolation. The slice simulator enables live slice development in Slice Machine\n * and live previews in the Page Builder.\n */\nexport const SliceSimulator: FC<SliceSimulatorProps> = ({\n\tchildren,\n\tbackground,\n\tzIndex,\n\tclassName,\n}) => {\n\tconst [message, setMessage] = useState(() => getDefaultMessage())\n\tconst router = useRouter()\n\n\tconst state =\n\t\ttypeof window !== \"undefined\"\n\t\t\t? new URL(window.location.href).searchParams.get(STATE_PARAMS_KEY)\n\t\t\t: undefined\n\tconst hasSlices = getSlices(state).length > 0\n\n\tuseEffect(() => {\n\t\tsimulatorManager.state.on(\n\t\t\tStateEventType.Slices,\n\t\t\t(newSlices) => {\n\t\t\t\tconst url = new URL(window.location.href)\n\t\t\t\turl.searchParams.set(\n\t\t\t\t\tSTATE_PARAMS_KEY,\n\t\t\t\t\tlzString.compressToEncodedURIComponent(JSON.stringify(newSlices)),\n\t\t\t\t)\n\n\t\t\t\twindow.history.replaceState(null, \"\", url)\n\t\t\t\t// Wait until the next tick to prevent URL state race conditions.\n\t\t\t\tsetTimeout(() => router.refresh(), 0)\n\t\t\t},\n\t\t\t\"simulator-slices\",\n\t\t)\n\t\tsimulatorManager.state.on(\n\t\t\tStateEventType.Message,\n\t\t\t(newMessage) => setMessage(newMessage),\n\t\t\t\"simulator-message\",\n\t\t)\n\n\t\tsimulatorManager.init()\n\n\t\treturn () => {\n\t\t\tsimulatorManager.state.off(StateEventType.Slices, \"simulator-slices\")\n\n\t\t\tsimulatorManager.state.off(StateEventType.Message, \"simulator-message\")\n\t\t}\n\t}, [router])\n\n\treturn (\n\t\t<SliceSimulatorWrapper\n\t\t\tmessage={message}\n\t\t\thasSlices={hasSlices}\n\t\t\tbackground={background}\n\t\t\tzIndex={zIndex}\n\t\t\tclassName={className}\n\t\t>\n\t\t\t{children}\n\t\t</SliceSimulatorWrapper>\n\t)\n}\n"],"mappings":";;;;;;;;;;;AAYA,MAAM,mBAAmB;AAEzB,MAAM,mBAAmB,IAAIA,yBAAAA,kBAAkB;;;;;AAkB/C,MAAa,kBAA2C,EACvD,UACA,YACA,QACA,gBACK;CACL,MAAM,CAAC,SAAS,eAAA,GAAA,MAAA,iBAAA,GAAA,yBAAA,oBAAgD,CAAC;CACjE,MAAM,UAAA,GAAA,mBAAA,YAAoB;CAM1B,MAAM,YAAYC,kBAAAA,UAHjB,OAAO,WAAW,cACf,IAAI,IAAI,OAAO,SAAS,KAAK,CAAC,aAAa,IAAI,iBAAiB,GAChE,KAAA,EAC8B,CAAC,SAAS;AAE5C,EAAA,GAAA,MAAA,iBAAgB;AACf,mBAAiB,MAAM,GACtBC,yBAAAA,eAAe,SACd,cAAc;GACd,MAAM,MAAM,IAAI,IAAI,OAAO,SAAS,KAAK;AACzC,OAAI,aAAa,IAChB,kBACAC,UAAAA,QAAS,8BAA8B,KAAK,UAAU,UAAU,CAAC,CACjE;AAED,UAAO,QAAQ,aAAa,MAAM,IAAI,IAAI;AAE1C,oBAAiB,OAAO,SAAS,EAAE,EAAE;KAEtC,mBACA;AACD,mBAAiB,MAAM,GACtBD,yBAAAA,eAAe,UACd,eAAe,WAAW,WAAW,EACtC,oBACA;AAED,mBAAiB,MAAM;AAEvB,eAAa;AACZ,oBAAiB,MAAM,IAAIA,yBAAAA,eAAe,QAAQ,mBAAmB;AAErE,oBAAiB,MAAM,IAAIA,yBAAAA,eAAe,SAAS,oBAAoB;;IAEtE,CAAC,OAAO,CAAC;AAEZ,QACC,iBAAA,GAAA,kBAAA,KAACE,8BAAAA,uBAAD;EACU;EACE;EACC;EACJ;EACG;EAEV;EACsB,CAAA"}
1
+ {"version":3,"file":"SliceSimulator.cjs","names":["SimulatorManager","useState","getDefaultMessage","useRouter","getSlices","StateEventType","lzString","SliceSimulatorWrapper"],"sources":["../src/SliceSimulator.tsx"],"sourcesContent":["\"use client\"\n\nimport { SimulatorManager, StateEventType, getDefaultMessage } from \"@prismicio/simulator/kit\"\nimport type { SliceSimulatorProps as BaseSliceSimulatorProps } from \"@prismicio/simulator/kit\"\nimport lzString from \"lz-string\"\nimport { useRouter } from \"next/navigation\"\nimport { useEffect, useState } from \"react\"\nimport type { FC, ReactNode } from \"react\"\n\nimport { getSlices } from \"./getSlices\"\nimport { SliceSimulatorWrapper } from \"./SliceSimulatorWrapper\"\n\nconst STATE_PARAMS_KEY = \"state\"\n\nconst simulatorManager = new SimulatorManager()\n\n/** Parameters provided to the Slice Simulator page. */\nexport type SliceSimulatorParams = {\n\tsearchParams: Promise<{\n\t\tstate?: string\n\t}>\n}\n\nexport type SliceSimulatorProps = BaseSliceSimulatorProps & {\n\tchildren: ReactNode\n\tclassName?: string\n}\n\n/**\n * Simulate slices in isolation. The slice simulator enables live slice development in Slice Machine\n * and live previews in the Page Builder.\n */\nexport const SliceSimulator: FC<SliceSimulatorProps> = ({\n\tchildren,\n\tbackground,\n\tzIndex,\n\tclassName,\n}) => {\n\tconst [message, setMessage] = useState(() => getDefaultMessage())\n\tconst router = useRouter()\n\n\tconst state =\n\t\ttypeof window !== \"undefined\"\n\t\t\t? new URL(window.location.href).searchParams.get(STATE_PARAMS_KEY)\n\t\t\t: undefined\n\tconst hasSlices = getSlices(state).length > 0\n\n\tuseEffect(() => {\n\t\tsimulatorManager.state.on(\n\t\t\tStateEventType.Slices,\n\t\t\t(newSlices) => {\n\t\t\t\tconst url = new URL(window.location.href)\n\t\t\t\turl.searchParams.set(\n\t\t\t\t\tSTATE_PARAMS_KEY,\n\t\t\t\t\tlzString.compressToEncodedURIComponent(JSON.stringify(newSlices)),\n\t\t\t\t)\n\n\t\t\t\twindow.history.replaceState(null, \"\", url)\n\t\t\t\t// Wait until the next tick to prevent URL state race conditions.\n\t\t\t\tsetTimeout(() => router.refresh(), 0)\n\t\t\t},\n\t\t\t\"simulator-slices\",\n\t\t)\n\t\tsimulatorManager.state.on(\n\t\t\tStateEventType.Message,\n\t\t\t(newMessage) => setMessage(newMessage),\n\t\t\t\"simulator-message\",\n\t\t)\n\n\t\tsimulatorManager.init()\n\n\t\treturn () => {\n\t\t\tsimulatorManager.state.off(StateEventType.Slices, \"simulator-slices\")\n\n\t\t\tsimulatorManager.state.off(StateEventType.Message, \"simulator-message\")\n\t\t}\n\t}, [router])\n\n\treturn (\n\t\t<SliceSimulatorWrapper\n\t\t\tmessage={message}\n\t\t\thasSlices={hasSlices}\n\t\t\tbackground={background}\n\t\t\tzIndex={zIndex}\n\t\t\tclassName={className}\n\t\t>\n\t\t\t{children}\n\t\t</SliceSimulatorWrapper>\n\t)\n}\n"],"mappings":";;;;;;;;;;;AAYA,MAAM,mBAAmB;AAEzB,MAAM,mBAAmB,IAAIA,yBAAAA,iBAAiB;;;;;AAkB9C,MAAa,kBAA2C,EACvD,UACA,YACA,QACA,gBACK;CACL,MAAM,CAAC,SAAS,eAAA,GAAcC,MAAAA,SAAAA,QAAAA,GAAeC,yBAAAA,kBAAAA,CAAkB,CAAC;CAChE,MAAM,UAAA,GAASC,mBAAAA,UAAAA,CAAU;CAEzB,MAAM,QACL,OAAO,WAAW,cACf,IAAI,IAAI,OAAO,SAAS,IAAI,CAAC,CAAC,aAAa,IAAI,gBAAgB,IAC/D,KAAA;CACJ,MAAM,YAAYC,kBAAAA,UAAU,KAAK,CAAC,CAAC,SAAS;CAE5C,CAAA,GAAA,MAAA,UAAA,OAAgB;EACf,iBAAiB,MAAM,GACtBC,yBAAAA,eAAe,SACd,cAAc;GACd,MAAM,MAAM,IAAI,IAAI,OAAO,SAAS,IAAI;GACxC,IAAI,aAAa,IAChB,kBACAC,UAAAA,QAAS,8BAA8B,KAAK,UAAU,SAAS,CAAC,CACjE;GAEA,OAAO,QAAQ,aAAa,MAAM,IAAI,GAAG;GAEzC,iBAAiB,OAAO,QAAQ,GAAG,CAAC;EACrC,GACA,kBACD;EACA,iBAAiB,MAAM,GACtBD,yBAAAA,eAAe,UACd,eAAe,WAAW,UAAU,GACrC,mBACD;EAEA,iBAAiB,KAAK;EAEtB,aAAa;GACZ,iBAAiB,MAAM,IAAIA,yBAAAA,eAAe,QAAQ,kBAAkB;GAEpE,iBAAiB,MAAM,IAAIA,yBAAAA,eAAe,SAAS,mBAAmB;EACvE;CACD,GAAG,CAAC,MAAM,CAAC;CAEX,OACC,iBAAA,GAAA,kBAAA,IAAA,CAACE,8BAAAA,uBAAD;EACU;EACE;EACC;EACJ;EACG;EAEV;CACqB,CAAA;AAEzB"}
@@ -1,6 +1,5 @@
1
1
  import { FC, ReactNode } from "react";
2
2
  import { SliceSimulatorProps } from "@prismicio/simulator/kit";
3
-
4
3
  //#region src/SliceSimulator.d.ts
5
4
  /** Parameters provided to the Slice Simulator page. */
6
5
  type SliceSimulatorParams = {
@@ -1 +1 @@
1
- {"version":3,"file":"SliceSimulator.d.cts","names":[],"sources":["../src/SliceSimulator.tsx"],"mappings":";;;;;KAiBY,oBAAA;EACX,YAAA,EAAc,OAAA;IACb,KAAA;EAAA;AAAA;AAAA,KAIU,qBAAA,GAAsB,mBAAA;EACjC,QAAA,EAAU,SAAA;EACV,SAAA;AAAA;;AAFD;;;cASa,cAAA,EAAgB,EAAA,CAAG,qBAAA"}
1
+ {"version":3,"file":"SliceSimulator.d.cts","names":[],"sources":["../src/SliceSimulator.tsx"],"mappings":";;;;KAiBY;EACX,cAAc;IACb;;;KAIU,wBAAsB;EACjC,UAAU;EACV;;;;;;cAOY,gBAAgB,GAAG"}
@@ -1,6 +1,5 @@
1
1
  import { FC, ReactNode } from "react";
2
2
  import { SliceSimulatorProps } from "@prismicio/simulator/kit";
3
-
4
3
  //#region src/SliceSimulator.d.ts
5
4
  /** Parameters provided to the Slice Simulator page. */
6
5
  type SliceSimulatorParams = {
@@ -1 +1 @@
1
- {"version":3,"file":"SliceSimulator.d.ts","names":[],"sources":["../src/SliceSimulator.tsx"],"mappings":";;;;;KAiBY,oBAAA;EACX,YAAA,EAAc,OAAA;IACb,KAAA;EAAA;AAAA;AAAA,KAIU,qBAAA,GAAsB,mBAAA;EACjC,QAAA,EAAU,SAAA;EACV,SAAA;AAAA;;AAFD;;;cASa,cAAA,EAAgB,EAAA,CAAG,qBAAA"}
1
+ {"version":3,"file":"SliceSimulator.d.ts","names":[],"sources":["../src/SliceSimulator.tsx"],"mappings":";;;;KAiBY;EACX,cAAc;IACb;;;KAIU,wBAAsB;EACjC,UAAU;EACV;;;;;;cAOY,gBAAgB,GAAG"}
@@ -16,7 +16,8 @@ const simulatorManager = new SimulatorManager();
16
16
  const SliceSimulator = ({ children, background, zIndex, className }) => {
17
17
  const [message, setMessage] = useState(() => getDefaultMessage());
18
18
  const router = useRouter();
19
- const hasSlices = getSlices(typeof window !== "undefined" ? new URL(window.location.href).searchParams.get(STATE_PARAMS_KEY) : void 0).length > 0;
19
+ const state = typeof window !== "undefined" ? new URL(window.location.href).searchParams.get(STATE_PARAMS_KEY) : void 0;
20
+ const hasSlices = getSlices(state).length > 0;
20
21
  useEffect(() => {
21
22
  simulatorManager.state.on(StateEventType.Slices, (newSlices) => {
22
23
  const url = new URL(window.location.href);
@@ -1 +1 @@
1
- {"version":3,"file":"SliceSimulator.js","names":[],"sources":["../src/SliceSimulator.tsx"],"sourcesContent":["\"use client\"\n\nimport { SimulatorManager, StateEventType, getDefaultMessage } from \"@prismicio/simulator/kit\"\nimport type { SliceSimulatorProps as BaseSliceSimulatorProps } from \"@prismicio/simulator/kit\"\nimport lzString from \"lz-string\"\nimport { useRouter } from \"next/navigation\"\nimport { useEffect, useState } from \"react\"\nimport type { FC, ReactNode } from \"react\"\n\nimport { getSlices } from \"./getSlices\"\nimport { SliceSimulatorWrapper } from \"./SliceSimulatorWrapper\"\n\nconst STATE_PARAMS_KEY = \"state\"\n\nconst simulatorManager = new SimulatorManager()\n\n/** Parameters provided to the Slice Simulator page. */\nexport type SliceSimulatorParams = {\n\tsearchParams: Promise<{\n\t\tstate?: string\n\t}>\n}\n\nexport type SliceSimulatorProps = BaseSliceSimulatorProps & {\n\tchildren: ReactNode\n\tclassName?: string\n}\n\n/**\n * Simulate slices in isolation. The slice simulator enables live slice development in Slice Machine\n * and live previews in the Page Builder.\n */\nexport const SliceSimulator: FC<SliceSimulatorProps> = ({\n\tchildren,\n\tbackground,\n\tzIndex,\n\tclassName,\n}) => {\n\tconst [message, setMessage] = useState(() => getDefaultMessage())\n\tconst router = useRouter()\n\n\tconst state =\n\t\ttypeof window !== \"undefined\"\n\t\t\t? new URL(window.location.href).searchParams.get(STATE_PARAMS_KEY)\n\t\t\t: undefined\n\tconst hasSlices = getSlices(state).length > 0\n\n\tuseEffect(() => {\n\t\tsimulatorManager.state.on(\n\t\t\tStateEventType.Slices,\n\t\t\t(newSlices) => {\n\t\t\t\tconst url = new URL(window.location.href)\n\t\t\t\turl.searchParams.set(\n\t\t\t\t\tSTATE_PARAMS_KEY,\n\t\t\t\t\tlzString.compressToEncodedURIComponent(JSON.stringify(newSlices)),\n\t\t\t\t)\n\n\t\t\t\twindow.history.replaceState(null, \"\", url)\n\t\t\t\t// Wait until the next tick to prevent URL state race conditions.\n\t\t\t\tsetTimeout(() => router.refresh(), 0)\n\t\t\t},\n\t\t\t\"simulator-slices\",\n\t\t)\n\t\tsimulatorManager.state.on(\n\t\t\tStateEventType.Message,\n\t\t\t(newMessage) => setMessage(newMessage),\n\t\t\t\"simulator-message\",\n\t\t)\n\n\t\tsimulatorManager.init()\n\n\t\treturn () => {\n\t\t\tsimulatorManager.state.off(StateEventType.Slices, \"simulator-slices\")\n\n\t\t\tsimulatorManager.state.off(StateEventType.Message, \"simulator-message\")\n\t\t}\n\t}, [router])\n\n\treturn (\n\t\t<SliceSimulatorWrapper\n\t\t\tmessage={message}\n\t\t\thasSlices={hasSlices}\n\t\t\tbackground={background}\n\t\t\tzIndex={zIndex}\n\t\t\tclassName={className}\n\t\t>\n\t\t\t{children}\n\t\t</SliceSimulatorWrapper>\n\t)\n}\n"],"mappings":";;;;;;;;;AAYA,MAAM,mBAAmB;AAEzB,MAAM,mBAAmB,IAAI,kBAAkB;;;;;AAkB/C,MAAa,kBAA2C,EACvD,UACA,YACA,QACA,gBACK;CACL,MAAM,CAAC,SAAS,cAAc,eAAe,mBAAmB,CAAC;CACjE,MAAM,SAAS,WAAW;CAM1B,MAAM,YAAY,UAHjB,OAAO,WAAW,cACf,IAAI,IAAI,OAAO,SAAS,KAAK,CAAC,aAAa,IAAI,iBAAiB,GAChE,KAAA,EAC8B,CAAC,SAAS;AAE5C,iBAAgB;AACf,mBAAiB,MAAM,GACtB,eAAe,SACd,cAAc;GACd,MAAM,MAAM,IAAI,IAAI,OAAO,SAAS,KAAK;AACzC,OAAI,aAAa,IAChB,kBACA,SAAS,8BAA8B,KAAK,UAAU,UAAU,CAAC,CACjE;AAED,UAAO,QAAQ,aAAa,MAAM,IAAI,IAAI;AAE1C,oBAAiB,OAAO,SAAS,EAAE,EAAE;KAEtC,mBACA;AACD,mBAAiB,MAAM,GACtB,eAAe,UACd,eAAe,WAAW,WAAW,EACtC,oBACA;AAED,mBAAiB,MAAM;AAEvB,eAAa;AACZ,oBAAiB,MAAM,IAAI,eAAe,QAAQ,mBAAmB;AAErE,oBAAiB,MAAM,IAAI,eAAe,SAAS,oBAAoB;;IAEtE,CAAC,OAAO,CAAC;AAEZ,QACC,oBAAC,uBAAD;EACU;EACE;EACC;EACJ;EACG;EAEV;EACsB,CAAA"}
1
+ {"version":3,"file":"SliceSimulator.js","names":[],"sources":["../src/SliceSimulator.tsx"],"sourcesContent":["\"use client\"\n\nimport { SimulatorManager, StateEventType, getDefaultMessage } from \"@prismicio/simulator/kit\"\nimport type { SliceSimulatorProps as BaseSliceSimulatorProps } from \"@prismicio/simulator/kit\"\nimport lzString from \"lz-string\"\nimport { useRouter } from \"next/navigation\"\nimport { useEffect, useState } from \"react\"\nimport type { FC, ReactNode } from \"react\"\n\nimport { getSlices } from \"./getSlices\"\nimport { SliceSimulatorWrapper } from \"./SliceSimulatorWrapper\"\n\nconst STATE_PARAMS_KEY = \"state\"\n\nconst simulatorManager = new SimulatorManager()\n\n/** Parameters provided to the Slice Simulator page. */\nexport type SliceSimulatorParams = {\n\tsearchParams: Promise<{\n\t\tstate?: string\n\t}>\n}\n\nexport type SliceSimulatorProps = BaseSliceSimulatorProps & {\n\tchildren: ReactNode\n\tclassName?: string\n}\n\n/**\n * Simulate slices in isolation. The slice simulator enables live slice development in Slice Machine\n * and live previews in the Page Builder.\n */\nexport const SliceSimulator: FC<SliceSimulatorProps> = ({\n\tchildren,\n\tbackground,\n\tzIndex,\n\tclassName,\n}) => {\n\tconst [message, setMessage] = useState(() => getDefaultMessage())\n\tconst router = useRouter()\n\n\tconst state =\n\t\ttypeof window !== \"undefined\"\n\t\t\t? new URL(window.location.href).searchParams.get(STATE_PARAMS_KEY)\n\t\t\t: undefined\n\tconst hasSlices = getSlices(state).length > 0\n\n\tuseEffect(() => {\n\t\tsimulatorManager.state.on(\n\t\t\tStateEventType.Slices,\n\t\t\t(newSlices) => {\n\t\t\t\tconst url = new URL(window.location.href)\n\t\t\t\turl.searchParams.set(\n\t\t\t\t\tSTATE_PARAMS_KEY,\n\t\t\t\t\tlzString.compressToEncodedURIComponent(JSON.stringify(newSlices)),\n\t\t\t\t)\n\n\t\t\t\twindow.history.replaceState(null, \"\", url)\n\t\t\t\t// Wait until the next tick to prevent URL state race conditions.\n\t\t\t\tsetTimeout(() => router.refresh(), 0)\n\t\t\t},\n\t\t\t\"simulator-slices\",\n\t\t)\n\t\tsimulatorManager.state.on(\n\t\t\tStateEventType.Message,\n\t\t\t(newMessage) => setMessage(newMessage),\n\t\t\t\"simulator-message\",\n\t\t)\n\n\t\tsimulatorManager.init()\n\n\t\treturn () => {\n\t\t\tsimulatorManager.state.off(StateEventType.Slices, \"simulator-slices\")\n\n\t\t\tsimulatorManager.state.off(StateEventType.Message, \"simulator-message\")\n\t\t}\n\t}, [router])\n\n\treturn (\n\t\t<SliceSimulatorWrapper\n\t\t\tmessage={message}\n\t\t\thasSlices={hasSlices}\n\t\t\tbackground={background}\n\t\t\tzIndex={zIndex}\n\t\t\tclassName={className}\n\t\t>\n\t\t\t{children}\n\t\t</SliceSimulatorWrapper>\n\t)\n}\n"],"mappings":";;;;;;;;;AAYA,MAAM,mBAAmB;AAEzB,MAAM,mBAAmB,IAAI,iBAAiB;;;;;AAkB9C,MAAa,kBAA2C,EACvD,UACA,YACA,QACA,gBACK;CACL,MAAM,CAAC,SAAS,cAAc,eAAe,kBAAkB,CAAC;CAChE,MAAM,SAAS,UAAU;CAEzB,MAAM,QACL,OAAO,WAAW,cACf,IAAI,IAAI,OAAO,SAAS,IAAI,CAAC,CAAC,aAAa,IAAI,gBAAgB,IAC/D,KAAA;CACJ,MAAM,YAAY,UAAU,KAAK,CAAC,CAAC,SAAS;CAE5C,gBAAgB;EACf,iBAAiB,MAAM,GACtB,eAAe,SACd,cAAc;GACd,MAAM,MAAM,IAAI,IAAI,OAAO,SAAS,IAAI;GACxC,IAAI,aAAa,IAChB,kBACA,SAAS,8BAA8B,KAAK,UAAU,SAAS,CAAC,CACjE;GAEA,OAAO,QAAQ,aAAa,MAAM,IAAI,GAAG;GAEzC,iBAAiB,OAAO,QAAQ,GAAG,CAAC;EACrC,GACA,kBACD;EACA,iBAAiB,MAAM,GACtB,eAAe,UACd,eAAe,WAAW,UAAU,GACrC,mBACD;EAEA,iBAAiB,KAAK;EAEtB,aAAa;GACZ,iBAAiB,MAAM,IAAI,eAAe,QAAQ,kBAAkB;GAEpE,iBAAiB,MAAM,IAAI,eAAe,SAAS,mBAAmB;EACvE;CACD,GAAG,CAAC,MAAM,CAAC;CAEX,OACC,oBAAC,uBAAD;EACU;EACE;EACC;EACJ;EACG;EAEV;CACqB,CAAA;AAEzB"}
@@ -1,4 +1,3 @@
1
- require("./_virtual/_rolldown/runtime.cjs");
2
1
  let react_jsx_runtime = require("react/jsx-runtime");
3
2
  let _prismicio_simulator_kit = require("@prismicio/simulator/kit");
4
3
  //#region src/SliceSimulatorWrapper.tsx
@@ -1 +1 @@
1
- {"version":3,"file":"SliceSimulatorWrapper.cjs","names":["simulatorClass","simulatorRootClass","onClickHandler","disableEventHandler"],"sources":["../src/SliceSimulatorWrapper.tsx"],"sourcesContent":["import {\n\tdisableEventHandler,\n\tgetDefaultProps,\n\tonClickHandler,\n\tsimulatorClass,\n\tsimulatorRootClass,\n} from \"@prismicio/simulator/kit\"\nimport type { SliceSimulatorProps } from \"@prismicio/simulator/kit\"\nimport type { FC, ReactNode } from \"react\"\n\ntype SliceSimulatorWrapperProps = SliceSimulatorProps & {\n\tchildren: ReactNode\n\tclassName?: string\n\tmessage?: string\n\thasSlices: boolean\n}\n\n/** A wrapper for the slice simulator that isolates the given children from the page's layout. */\nexport const SliceSimulatorWrapper: FC<SliceSimulatorWrapperProps> = ({\n\tclassName,\n\tchildren,\n\tzIndex,\n\tbackground,\n\tmessage,\n\thasSlices,\n}) => {\n\tconst defaultProps = getDefaultProps()\n\n\treturn (\n\t\t<div\n\t\t\tclassName={[simulatorClass, className].filter(Boolean).join(\" \")}\n\t\t\tstyle={{\n\t\t\t\tzIndex: typeof zIndex === \"undefined\" ? defaultProps.zIndex : (zIndex ?? undefined),\n\t\t\t\tposition: \"fixed\",\n\t\t\t\ttop: 0,\n\t\t\t\tleft: 0,\n\t\t\t\twidth: \"100%\",\n\t\t\t\theight: \"100vh\",\n\t\t\t\toverflow: \"auto\",\n\t\t\t\tbackground:\n\t\t\t\t\ttypeof background === \"undefined\" ? defaultProps.background : (background ?? undefined),\n\t\t\t}}\n\t\t>\n\t\t\t{message ? (\n\t\t\t\t<article dangerouslySetInnerHTML={{ __html: message }} />\n\t\t\t) : hasSlices ? (\n\t\t\t\t<div\n\t\t\t\t\tid=\"root\"\n\t\t\t\t\tclassName={simulatorRootClass}\n\t\t\t\t\tonClickCapture={onClickHandler as unknown as React.MouseEventHandler}\n\t\t\t\t\tonSubmitCapture={disableEventHandler as unknown as React.FormEventHandler}\n\t\t\t\t>\n\t\t\t\t\t{children}\n\t\t\t\t</div>\n\t\t\t) : null}\n\t\t</div>\n\t)\n}\n"],"mappings":";;;;;AAkBA,MAAa,yBAAyD,EACrE,WACA,UACA,QACA,YACA,SACA,gBACK;CACL,MAAM,gBAAA,GAAA,yBAAA,kBAAgC;AAEtC,QACC,iBAAA,GAAA,kBAAA,KAAC,OAAD;EACC,WAAW,CAACA,yBAAAA,gBAAgB,UAAU,CAAC,OAAO,QAAQ,CAAC,KAAK,IAAI;EAChE,OAAO;GACN,QAAQ,OAAO,WAAW,cAAc,aAAa,SAAU,UAAU,KAAA;GACzE,UAAU;GACV,KAAK;GACL,MAAM;GACN,OAAO;GACP,QAAQ;GACR,UAAU;GACV,YACC,OAAO,eAAe,cAAc,aAAa,aAAc,cAAc,KAAA;GAC9E;YAEA,UACA,iBAAA,GAAA,kBAAA,KAAC,WAAD,EAAS,yBAAyB,EAAE,QAAQ,SAAS,EAAI,CAAA,GACtD,YACH,iBAAA,GAAA,kBAAA,KAAC,OAAD;GACC,IAAG;GACH,WAAWC,yBAAAA;GACX,gBAAgBC,yBAAAA;GAChB,iBAAiBC,yBAAAA;GAEhB;GACI,CAAA,GACH;EACC,CAAA"}
1
+ {"version":3,"file":"SliceSimulatorWrapper.cjs","names":["getDefaultProps","simulatorClass","simulatorRootClass","onClickHandler","disableEventHandler"],"sources":["../src/SliceSimulatorWrapper.tsx"],"sourcesContent":["import {\n\tdisableEventHandler,\n\tgetDefaultProps,\n\tonClickHandler,\n\tsimulatorClass,\n\tsimulatorRootClass,\n} from \"@prismicio/simulator/kit\"\nimport type { SliceSimulatorProps } from \"@prismicio/simulator/kit\"\nimport type { FC, ReactNode } from \"react\"\n\ntype SliceSimulatorWrapperProps = SliceSimulatorProps & {\n\tchildren: ReactNode\n\tclassName?: string\n\tmessage?: string\n\thasSlices: boolean\n}\n\n/** A wrapper for the slice simulator that isolates the given children from the page's layout. */\nexport const SliceSimulatorWrapper: FC<SliceSimulatorWrapperProps> = ({\n\tclassName,\n\tchildren,\n\tzIndex,\n\tbackground,\n\tmessage,\n\thasSlices,\n}) => {\n\tconst defaultProps = getDefaultProps()\n\n\treturn (\n\t\t<div\n\t\t\tclassName={[simulatorClass, className].filter(Boolean).join(\" \")}\n\t\t\tstyle={{\n\t\t\t\tzIndex: typeof zIndex === \"undefined\" ? defaultProps.zIndex : (zIndex ?? undefined),\n\t\t\t\tposition: \"fixed\",\n\t\t\t\ttop: 0,\n\t\t\t\tleft: 0,\n\t\t\t\twidth: \"100%\",\n\t\t\t\theight: \"100vh\",\n\t\t\t\toverflow: \"auto\",\n\t\t\t\tbackground:\n\t\t\t\t\ttypeof background === \"undefined\" ? defaultProps.background : (background ?? undefined),\n\t\t\t}}\n\t\t>\n\t\t\t{message ? (\n\t\t\t\t<article dangerouslySetInnerHTML={{ __html: message }} />\n\t\t\t) : hasSlices ? (\n\t\t\t\t<div\n\t\t\t\t\tid=\"root\"\n\t\t\t\t\tclassName={simulatorRootClass}\n\t\t\t\t\tonClickCapture={onClickHandler as unknown as React.MouseEventHandler}\n\t\t\t\t\tonSubmitCapture={disableEventHandler as unknown as React.FormEventHandler}\n\t\t\t\t>\n\t\t\t\t\t{children}\n\t\t\t\t</div>\n\t\t\t) : null}\n\t\t</div>\n\t)\n}\n"],"mappings":";;;;AAkBA,MAAa,yBAAyD,EACrE,WACA,UACA,QACA,YACA,SACA,gBACK;CACL,MAAM,gBAAA,GAAeA,yBAAAA,gBAAAA,CAAgB;CAErC,OACC,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;EACC,WAAW,CAACC,yBAAAA,gBAAgB,SAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;EAC/D,OAAO;GACN,QAAQ,OAAO,WAAW,cAAc,aAAa,SAAU,UAAU,KAAA;GACzE,UAAU;GACV,KAAK;GACL,MAAM;GACN,OAAO;GACP,QAAQ;GACR,UAAU;GACV,YACC,OAAO,eAAe,cAAc,aAAa,aAAc,cAAc,KAAA;EAC/E;EAEC,UAAA,UACA,iBAAA,GAAA,kBAAA,IAAA,CAAC,WAAD,EAAS,yBAAyB,EAAE,QAAQ,QAAQ,EAAI,CAAA,IACrD,YACH,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;GACC,IAAG;GACH,WAAWC,yBAAAA;GACX,gBAAgBC,yBAAAA;GAChB,iBAAiBC,yBAAAA;GAEhB;EACG,CAAA,IACF;CACA,CAAA;AAEP"}
@@ -1 +1 @@
1
- {"version":3,"file":"SliceSimulatorWrapper.js","names":[],"sources":["../src/SliceSimulatorWrapper.tsx"],"sourcesContent":["import {\n\tdisableEventHandler,\n\tgetDefaultProps,\n\tonClickHandler,\n\tsimulatorClass,\n\tsimulatorRootClass,\n} from \"@prismicio/simulator/kit\"\nimport type { SliceSimulatorProps } from \"@prismicio/simulator/kit\"\nimport type { FC, ReactNode } from \"react\"\n\ntype SliceSimulatorWrapperProps = SliceSimulatorProps & {\n\tchildren: ReactNode\n\tclassName?: string\n\tmessage?: string\n\thasSlices: boolean\n}\n\n/** A wrapper for the slice simulator that isolates the given children from the page's layout. */\nexport const SliceSimulatorWrapper: FC<SliceSimulatorWrapperProps> = ({\n\tclassName,\n\tchildren,\n\tzIndex,\n\tbackground,\n\tmessage,\n\thasSlices,\n}) => {\n\tconst defaultProps = getDefaultProps()\n\n\treturn (\n\t\t<div\n\t\t\tclassName={[simulatorClass, className].filter(Boolean).join(\" \")}\n\t\t\tstyle={{\n\t\t\t\tzIndex: typeof zIndex === \"undefined\" ? defaultProps.zIndex : (zIndex ?? undefined),\n\t\t\t\tposition: \"fixed\",\n\t\t\t\ttop: 0,\n\t\t\t\tleft: 0,\n\t\t\t\twidth: \"100%\",\n\t\t\t\theight: \"100vh\",\n\t\t\t\toverflow: \"auto\",\n\t\t\t\tbackground:\n\t\t\t\t\ttypeof background === \"undefined\" ? defaultProps.background : (background ?? undefined),\n\t\t\t}}\n\t\t>\n\t\t\t{message ? (\n\t\t\t\t<article dangerouslySetInnerHTML={{ __html: message }} />\n\t\t\t) : hasSlices ? (\n\t\t\t\t<div\n\t\t\t\t\tid=\"root\"\n\t\t\t\t\tclassName={simulatorRootClass}\n\t\t\t\t\tonClickCapture={onClickHandler as unknown as React.MouseEventHandler}\n\t\t\t\t\tonSubmitCapture={disableEventHandler as unknown as React.FormEventHandler}\n\t\t\t\t>\n\t\t\t\t\t{children}\n\t\t\t\t</div>\n\t\t\t) : null}\n\t\t</div>\n\t)\n}\n"],"mappings":";;;;AAkBA,MAAa,yBAAyD,EACrE,WACA,UACA,QACA,YACA,SACA,gBACK;CACL,MAAM,eAAe,iBAAiB;AAEtC,QACC,oBAAC,OAAD;EACC,WAAW,CAAC,gBAAgB,UAAU,CAAC,OAAO,QAAQ,CAAC,KAAK,IAAI;EAChE,OAAO;GACN,QAAQ,OAAO,WAAW,cAAc,aAAa,SAAU,UAAU,KAAA;GACzE,UAAU;GACV,KAAK;GACL,MAAM;GACN,OAAO;GACP,QAAQ;GACR,UAAU;GACV,YACC,OAAO,eAAe,cAAc,aAAa,aAAc,cAAc,KAAA;GAC9E;YAEA,UACA,oBAAC,WAAD,EAAS,yBAAyB,EAAE,QAAQ,SAAS,EAAI,CAAA,GACtD,YACH,oBAAC,OAAD;GACC,IAAG;GACH,WAAW;GACX,gBAAgB;GAChB,iBAAiB;GAEhB;GACI,CAAA,GACH;EACC,CAAA"}
1
+ {"version":3,"file":"SliceSimulatorWrapper.js","names":[],"sources":["../src/SliceSimulatorWrapper.tsx"],"sourcesContent":["import {\n\tdisableEventHandler,\n\tgetDefaultProps,\n\tonClickHandler,\n\tsimulatorClass,\n\tsimulatorRootClass,\n} from \"@prismicio/simulator/kit\"\nimport type { SliceSimulatorProps } from \"@prismicio/simulator/kit\"\nimport type { FC, ReactNode } from \"react\"\n\ntype SliceSimulatorWrapperProps = SliceSimulatorProps & {\n\tchildren: ReactNode\n\tclassName?: string\n\tmessage?: string\n\thasSlices: boolean\n}\n\n/** A wrapper for the slice simulator that isolates the given children from the page's layout. */\nexport const SliceSimulatorWrapper: FC<SliceSimulatorWrapperProps> = ({\n\tclassName,\n\tchildren,\n\tzIndex,\n\tbackground,\n\tmessage,\n\thasSlices,\n}) => {\n\tconst defaultProps = getDefaultProps()\n\n\treturn (\n\t\t<div\n\t\t\tclassName={[simulatorClass, className].filter(Boolean).join(\" \")}\n\t\t\tstyle={{\n\t\t\t\tzIndex: typeof zIndex === \"undefined\" ? defaultProps.zIndex : (zIndex ?? undefined),\n\t\t\t\tposition: \"fixed\",\n\t\t\t\ttop: 0,\n\t\t\t\tleft: 0,\n\t\t\t\twidth: \"100%\",\n\t\t\t\theight: \"100vh\",\n\t\t\t\toverflow: \"auto\",\n\t\t\t\tbackground:\n\t\t\t\t\ttypeof background === \"undefined\" ? defaultProps.background : (background ?? undefined),\n\t\t\t}}\n\t\t>\n\t\t\t{message ? (\n\t\t\t\t<article dangerouslySetInnerHTML={{ __html: message }} />\n\t\t\t) : hasSlices ? (\n\t\t\t\t<div\n\t\t\t\t\tid=\"root\"\n\t\t\t\t\tclassName={simulatorRootClass}\n\t\t\t\t\tonClickCapture={onClickHandler as unknown as React.MouseEventHandler}\n\t\t\t\t\tonSubmitCapture={disableEventHandler as unknown as React.FormEventHandler}\n\t\t\t\t>\n\t\t\t\t\t{children}\n\t\t\t\t</div>\n\t\t\t) : null}\n\t\t</div>\n\t)\n}\n"],"mappings":";;;;AAkBA,MAAa,yBAAyD,EACrE,WACA,UACA,QACA,YACA,SACA,gBACK;CACL,MAAM,eAAe,gBAAgB;CAErC,OACC,oBAAC,OAAD;EACC,WAAW,CAAC,gBAAgB,SAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;EAC/D,OAAO;GACN,QAAQ,OAAO,WAAW,cAAc,aAAa,SAAU,UAAU,KAAA;GACzE,UAAU;GACV,KAAK;GACL,MAAM;GACN,OAAO;GACP,QAAQ;GACR,UAAU;GACV,YACC,OAAO,eAAe,cAAc,aAAa,aAAc,cAAc,KAAA;EAC/E;EAEC,UAAA,UACA,oBAAC,WAAD,EAAS,yBAAyB,EAAE,QAAQ,QAAQ,EAAI,CAAA,IACrD,YACH,oBAAC,OAAD;GACC,IAAG;GACH,WAAW;GACX,gBAAgB;GAChB,iBAAiB;GAEhB;EACG,CAAA,IACF;CACA,CAAA;AAEP"}
@@ -15,7 +15,7 @@ var __copyProps = (to, from, except, desc) => {
15
15
  }
16
16
  return to;
17
17
  };
18
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
18
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", {
19
19
  value: mod,
20
20
  enumerable: true
21
21
  }) : target, mod));
@@ -1,7 +1,7 @@
1
1
  const require_runtime = require("./_virtual/_rolldown/runtime.cjs");
2
2
  const require_getPrismicCacheTags = require("./getPrismicCacheTags.cjs");
3
3
  let next_cache_js = require("next/cache.js");
4
- next_cache_js = require_runtime.__toESM(next_cache_js);
4
+ next_cache_js = require_runtime.__toESM(next_cache_js, 1);
5
5
  //#region src/cacheTagPrismicPages.ts
6
6
  /**
7
7
  * Tags the current cache entry with cache tags for a set of Prismic pages so they can be
@@ -1 +1 @@
1
- {"version":3,"file":"cacheTagPrismicPages.cjs","names":["getPrismicCacheTags"],"sources":["../src/cacheTagPrismicPages.ts"],"sourcesContent":["import type { PrismicDocument } from \"@prismicio/client\"\n// Namespace import: Next.js 15 has no `cacheTag`, and a named import would fail to link.\nimport * as nextCache from \"next/cache\"\n\nimport { getPrismicCacheTags } from \"./getPrismicCacheTags\"\n\n/**\n * Tags the current cache entry with cache tags for a set of Prismic pages so they can be\n * revalidated when their content changes.\n *\n * Linked documents (via content relationships) are tagged as well, so the cache entry is\n * revalidated when any of its nested documents change.\n *\n * @param pages - A set of Prismic pages used to tag the cache entry.\n * @experimental\n *\n * @see {@link https://nextjs.org/docs/app/api-reference/functions/cacheTag}\n */\nexport function cacheTagPrismicPages(pages: PrismicDocument[]): void {\n\tnextCache.cacheTag(...getPrismicCacheTags(pages))\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAkBA,SAAgB,qBAAqB,OAAgC;AACpE,eAAU,SAAS,GAAGA,4BAAAA,oBAAoB,MAAM,CAAC"}
1
+ {"version":3,"file":"cacheTagPrismicPages.cjs","names":["getPrismicCacheTags"],"sources":["../src/cacheTagPrismicPages.ts"],"sourcesContent":["import type { PrismicDocument } from \"@prismicio/client\"\n// Namespace import: Next.js 15 has no `cacheTag`, and a named import would fail to link.\nimport * as nextCache from \"next/cache\"\n\nimport { getPrismicCacheTags } from \"./getPrismicCacheTags\"\n\n/**\n * Tags the current cache entry with cache tags for a set of Prismic pages so they can be\n * revalidated when their content changes.\n *\n * Linked documents (via content relationships) are tagged as well, so the cache entry is\n * revalidated when any of its nested documents change.\n *\n * @param pages - A set of Prismic pages used to tag the cache entry.\n * @experimental\n *\n * @see {@link https://nextjs.org/docs/app/api-reference/functions/cacheTag}\n */\nexport function cacheTagPrismicPages(pages: PrismicDocument[]): void {\n\tnextCache.cacheTag(...getPrismicCacheTags(pages))\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAkBA,SAAgB,qBAAqB,OAAgC;CACpE,cAAU,SAAS,GAAGA,4BAAAA,oBAAoB,KAAK,CAAC;AACjD"}
@@ -1,5 +1,4 @@
1
1
  import { PrismicDocument } from "@prismicio/client";
2
-
3
2
  //#region src/cacheTagPrismicPages.d.ts
4
3
  /**
5
4
  * Tags the current cache entry with cache tags for a set of Prismic pages so they can be
@@ -1 +1 @@
1
- {"version":3,"file":"cacheTagPrismicPages.d.cts","names":[],"sources":["../src/cacheTagPrismicPages.ts"],"mappings":";;;;;AAkBA;;;;;;;;;;iBAAgB,oBAAA,CAAqB,KAAA,EAAO,eAAA"}
1
+ {"version":3,"file":"cacheTagPrismicPages.d.cts","names":[],"sources":["../src/cacheTagPrismicPages.ts"],"mappings":";;;;;;;;;;;;;;iBAkBgB,qBAAqB,OAAO"}
@@ -1,5 +1,4 @@
1
1
  import { PrismicDocument } from "@prismicio/client";
2
-
3
2
  //#region src/cacheTagPrismicPages.d.ts
4
3
  /**
5
4
  * Tags the current cache entry with cache tags for a set of Prismic pages so they can be
@@ -1 +1 @@
1
- {"version":3,"file":"cacheTagPrismicPages.d.ts","names":[],"sources":["../src/cacheTagPrismicPages.ts"],"mappings":";;;;;AAkBA;;;;;;;;;;iBAAgB,oBAAA,CAAqB,KAAA,EAAO,eAAA"}
1
+ {"version":3,"file":"cacheTagPrismicPages.d.ts","names":[],"sources":["../src/cacheTagPrismicPages.ts"],"mappings":";;;;;;;;;;;;;;iBAkBgB,qBAAqB,OAAO"}
@@ -1 +1 @@
1
- {"version":3,"file":"cacheTagPrismicPages.js","names":[],"sources":["../src/cacheTagPrismicPages.ts"],"sourcesContent":["import type { PrismicDocument } from \"@prismicio/client\"\n// Namespace import: Next.js 15 has no `cacheTag`, and a named import would fail to link.\nimport * as nextCache from \"next/cache\"\n\nimport { getPrismicCacheTags } from \"./getPrismicCacheTags\"\n\n/**\n * Tags the current cache entry with cache tags for a set of Prismic pages so they can be\n * revalidated when their content changes.\n *\n * Linked documents (via content relationships) are tagged as well, so the cache entry is\n * revalidated when any of its nested documents change.\n *\n * @param pages - A set of Prismic pages used to tag the cache entry.\n * @experimental\n *\n * @see {@link https://nextjs.org/docs/app/api-reference/functions/cacheTag}\n */\nexport function cacheTagPrismicPages(pages: PrismicDocument[]): void {\n\tnextCache.cacheTag(...getPrismicCacheTags(pages))\n}\n"],"mappings":";;;;;;;;;;;;;;;AAkBA,SAAgB,qBAAqB,OAAgC;AACpE,WAAU,SAAS,GAAG,oBAAoB,MAAM,CAAC"}
1
+ {"version":3,"file":"cacheTagPrismicPages.js","names":[],"sources":["../src/cacheTagPrismicPages.ts"],"sourcesContent":["import type { PrismicDocument } from \"@prismicio/client\"\n// Namespace import: Next.js 15 has no `cacheTag`, and a named import would fail to link.\nimport * as nextCache from \"next/cache\"\n\nimport { getPrismicCacheTags } from \"./getPrismicCacheTags\"\n\n/**\n * Tags the current cache entry with cache tags for a set of Prismic pages so they can be\n * revalidated when their content changes.\n *\n * Linked documents (via content relationships) are tagged as well, so the cache entry is\n * revalidated when any of its nested documents change.\n *\n * @param pages - A set of Prismic pages used to tag the cache entry.\n * @experimental\n *\n * @see {@link https://nextjs.org/docs/app/api-reference/functions/cacheTag}\n */\nexport function cacheTagPrismicPages(pages: PrismicDocument[]): void {\n\tnextCache.cacheTag(...getPrismicCacheTags(pages))\n}\n"],"mappings":";;;;;;;;;;;;;;;AAkBA,SAAgB,qBAAqB,OAAgC;CACpE,UAAU,SAAS,GAAG,oBAAoB,KAAK,CAAC;AACjD"}
@@ -1 +1 @@
1
- {"version":3,"file":"createLocaleRedirect.cjs","names":["devMsg"],"sources":["../src/createLocaleRedirect.ts"],"sourcesContent":["import { devMsg } from \"./lib/devMsg\"\n\n/**\n * @deprecated `createLocaleRedirect()` has been removed due to performance\n * issues.\n */\nexport function createLocaleRedirect(): never {\n\tthrow new Error(\n\t\t`createLocaleRedirect() has been removed due to performance issues. See ${devMsg(\n\t\t\t\"replace-createLocaleRedirect\",\n\t\t)} for more details.`,\n\t)\n}\n/**\n * @deprecated `createLocaleRedirect()` has been removed due to performance\n * issues.\n */\nexport type CreateLocaleRedirectConfig = never\n"],"mappings":";;;;;;AAMA,SAAgB,uBAA8B;AAC7C,OAAM,IAAI,MACT,0EAA0EA,eAAAA,OACzE,+BACA,CAAC,oBACF"}
1
+ {"version":3,"file":"createLocaleRedirect.cjs","names":["devMsg"],"sources":["../src/createLocaleRedirect.ts"],"sourcesContent":["import { devMsg } from \"./lib/devMsg\"\n\n/**\n * @deprecated `createLocaleRedirect()` has been removed due to performance\n * issues.\n */\nexport function createLocaleRedirect(): never {\n\tthrow new Error(\n\t\t`createLocaleRedirect() has been removed due to performance issues. See ${devMsg(\n\t\t\t\"replace-createLocaleRedirect\",\n\t\t)} for more details.`,\n\t)\n}\n/**\n * @deprecated `createLocaleRedirect()` has been removed due to performance\n * issues.\n */\nexport type CreateLocaleRedirectConfig = never\n"],"mappings":";;;;;;AAMA,SAAgB,uBAA8B;CAC7C,MAAM,IAAI,MACT,0EAA0EA,eAAAA,OACzE,8BACD,EAAE,mBACH;AACD"}
@@ -1 +1 @@
1
- {"version":3,"file":"createLocaleRedirect.d.cts","names":[],"sources":["../src/createLocaleRedirect.ts"],"mappings":";;AAMA;;;iBAAgB,oBAAA,CAAA;;AAWhB;;;KAAY,0BAAA"}
1
+ {"version":3,"file":"createLocaleRedirect.d.cts","names":[],"sources":["../src/createLocaleRedirect.ts"],"mappings":";;;;;iBAMgB;;;;;KAWJ"}
@@ -1 +1 @@
1
- {"version":3,"file":"createLocaleRedirect.d.ts","names":[],"sources":["../src/createLocaleRedirect.ts"],"mappings":";;AAMA;;;iBAAgB,oBAAA,CAAA;;AAWhB;;;KAAY,0BAAA"}
1
+ {"version":3,"file":"createLocaleRedirect.d.ts","names":[],"sources":["../src/createLocaleRedirect.ts"],"mappings":";;;;;iBAMgB;;;;;KAWJ"}
@@ -1 +1 @@
1
- {"version":3,"file":"createLocaleRedirect.js","names":[],"sources":["../src/createLocaleRedirect.ts"],"sourcesContent":["import { devMsg } from \"./lib/devMsg\"\n\n/**\n * @deprecated `createLocaleRedirect()` has been removed due to performance\n * issues.\n */\nexport function createLocaleRedirect(): never {\n\tthrow new Error(\n\t\t`createLocaleRedirect() has been removed due to performance issues. See ${devMsg(\n\t\t\t\"replace-createLocaleRedirect\",\n\t\t)} for more details.`,\n\t)\n}\n/**\n * @deprecated `createLocaleRedirect()` has been removed due to performance\n * issues.\n */\nexport type CreateLocaleRedirectConfig = never\n"],"mappings":";;;;;;AAMA,SAAgB,uBAA8B;AAC7C,OAAM,IAAI,MACT,0EAA0E,OACzE,+BACA,CAAC,oBACF"}
1
+ {"version":3,"file":"createLocaleRedirect.js","names":[],"sources":["../src/createLocaleRedirect.ts"],"sourcesContent":["import { devMsg } from \"./lib/devMsg\"\n\n/**\n * @deprecated `createLocaleRedirect()` has been removed due to performance\n * issues.\n */\nexport function createLocaleRedirect(): never {\n\tthrow new Error(\n\t\t`createLocaleRedirect() has been removed due to performance issues. See ${devMsg(\n\t\t\t\"replace-createLocaleRedirect\",\n\t\t)} for more details.`,\n\t)\n}\n/**\n * @deprecated `createLocaleRedirect()` has been removed due to performance\n * issues.\n */\nexport type CreateLocaleRedirectConfig = never\n"],"mappings":";;;;;;AAMA,SAAgB,uBAA8B;CAC7C,MAAM,IAAI,MACT,0EAA0E,OACzE,8BACD,EAAE,mBACH;AACD"}
@@ -1 +1 @@
1
- {"version":3,"file":"enableAutoPreviews.cjs","names":["getPreviewRef"],"sources":["../src/enableAutoPreviews.ts"],"sourcesContent":["import type { Client } from \"@prismicio/client\"\n\nimport { getPreviewRef } from \"./getPreviewRef\"\n\n/** Configuration for `enableAutoPreviews`. */\nexport type EnableAutoPreviewsConfig = {\n\t/** Prismic client with which automatic previews will be enabled. */\n\t// `Pick` is used to use the smallest possible subset of\n\t// `prismic.Client`. Doing this reduces the surface area for breaking\n\t// type changes.\n\tclient: Pick<Client, \"queryContentFromRef\" | \"enableAutoPreviewsFromReq\">\n}\n\n/**\n * Configures a Prismic client to automatically query draft content during a preview session.\n *\n * @param config - Configuration for the function.\n */\nexport function enableAutoPreviews(config: EnableAutoPreviewsConfig): void {\n\t// We use a function value so the cookie is checked on every\n\t// request. We don't have a static value to read from.\n\tconfig.client.queryContentFromRef(() => getPreviewRef())\n}\n"],"mappings":";;;;;;;AAkBA,SAAgB,mBAAmB,QAAwC;AAG1E,QAAO,OAAO,0BAA0BA,sBAAAA,eAAe,CAAC"}
1
+ {"version":3,"file":"enableAutoPreviews.cjs","names":["getPreviewRef"],"sources":["../src/enableAutoPreviews.ts"],"sourcesContent":["import type { Client } from \"@prismicio/client\"\n\nimport { getPreviewRef } from \"./getPreviewRef\"\n\n/** Configuration for `enableAutoPreviews`. */\nexport type EnableAutoPreviewsConfig = {\n\t/** Prismic client with which automatic previews will be enabled. */\n\t// `Pick` is used to use the smallest possible subset of\n\t// `prismic.Client`. Doing this reduces the surface area for breaking\n\t// type changes.\n\tclient: Pick<Client, \"queryContentFromRef\" | \"enableAutoPreviewsFromReq\">\n}\n\n/**\n * Configures a Prismic client to automatically query draft content during a preview session.\n *\n * @param config - Configuration for the function.\n */\nexport function enableAutoPreviews(config: EnableAutoPreviewsConfig): void {\n\t// We use a function value so the cookie is checked on every\n\t// request. We don't have a static value to read from.\n\tconfig.client.queryContentFromRef(() => getPreviewRef())\n}\n"],"mappings":";;;;;;;AAkBA,SAAgB,mBAAmB,QAAwC;CAG1E,OAAO,OAAO,0BAA0BA,sBAAAA,cAAc,CAAC;AACxD"}
@@ -1,9 +1,9 @@
1
1
  import { Client } from "@prismicio/client";
2
-
3
2
  //#region src/enableAutoPreviews.d.ts
4
3
  /** Configuration for `enableAutoPreviews`. */
5
4
  type EnableAutoPreviewsConfig = {
6
- /** Prismic client with which automatic previews will be enabled. */client: Pick<Client, "queryContentFromRef" | "enableAutoPreviewsFromReq">;
5
+ /** Prismic client with which automatic previews will be enabled. */
6
+ client: Pick<Client, "queryContentFromRef" | "enableAutoPreviewsFromReq">;
7
7
  };
8
8
  /**
9
9
  * Configures a Prismic client to automatically query draft content during a preview session.
@@ -1 +1 @@
1
- {"version":3,"file":"enableAutoPreviews.d.cts","names":[],"sources":["../src/enableAutoPreviews.ts"],"mappings":";;;;KAKY,wBAAA;EAAA,oEAKX,MAAA,EAAQ,IAAA,CAAK,MAAA;AAAA;;;;;;iBAQE,kBAAA,CAAmB,MAAA,EAAQ,wBAAA"}
1
+ {"version":3,"file":"enableAutoPreviews.d.cts","names":[],"sources":["../src/enableAutoPreviews.ts"],"mappings":";;;KAKY;;EAKX,QAAQ,KAAK;;;;;;;iBAQE,mBAAmB,QAAQ"}
@@ -1,9 +1,9 @@
1
1
  import { Client } from "@prismicio/client";
2
-
3
2
  //#region src/enableAutoPreviews.d.ts
4
3
  /** Configuration for `enableAutoPreviews`. */
5
4
  type EnableAutoPreviewsConfig = {
6
- /** Prismic client with which automatic previews will be enabled. */client: Pick<Client, "queryContentFromRef" | "enableAutoPreviewsFromReq">;
5
+ /** Prismic client with which automatic previews will be enabled. */
6
+ client: Pick<Client, "queryContentFromRef" | "enableAutoPreviewsFromReq">;
7
7
  };
8
8
  /**
9
9
  * Configures a Prismic client to automatically query draft content during a preview session.
@@ -1 +1 @@
1
- {"version":3,"file":"enableAutoPreviews.d.ts","names":[],"sources":["../src/enableAutoPreviews.ts"],"mappings":";;;;KAKY,wBAAA;EAAA,oEAKX,MAAA,EAAQ,IAAA,CAAK,MAAA;AAAA;;;;;;iBAQE,kBAAA,CAAmB,MAAA,EAAQ,wBAAA"}
1
+ {"version":3,"file":"enableAutoPreviews.d.ts","names":[],"sources":["../src/enableAutoPreviews.ts"],"mappings":";;;KAKY;;EAKX,QAAQ,KAAK;;;;;;;iBAQE,mBAAmB,QAAQ"}
@@ -1 +1 @@
1
- {"version":3,"file":"enableAutoPreviews.js","names":[],"sources":["../src/enableAutoPreviews.ts"],"sourcesContent":["import type { Client } from \"@prismicio/client\"\n\nimport { getPreviewRef } from \"./getPreviewRef\"\n\n/** Configuration for `enableAutoPreviews`. */\nexport type EnableAutoPreviewsConfig = {\n\t/** Prismic client with which automatic previews will be enabled. */\n\t// `Pick` is used to use the smallest possible subset of\n\t// `prismic.Client`. Doing this reduces the surface area for breaking\n\t// type changes.\n\tclient: Pick<Client, \"queryContentFromRef\" | \"enableAutoPreviewsFromReq\">\n}\n\n/**\n * Configures a Prismic client to automatically query draft content during a preview session.\n *\n * @param config - Configuration for the function.\n */\nexport function enableAutoPreviews(config: EnableAutoPreviewsConfig): void {\n\t// We use a function value so the cookie is checked on every\n\t// request. We don't have a static value to read from.\n\tconfig.client.queryContentFromRef(() => getPreviewRef())\n}\n"],"mappings":";;;;;;;AAkBA,SAAgB,mBAAmB,QAAwC;AAG1E,QAAO,OAAO,0BAA0B,eAAe,CAAC"}
1
+ {"version":3,"file":"enableAutoPreviews.js","names":[],"sources":["../src/enableAutoPreviews.ts"],"sourcesContent":["import type { Client } from \"@prismicio/client\"\n\nimport { getPreviewRef } from \"./getPreviewRef\"\n\n/** Configuration for `enableAutoPreviews`. */\nexport type EnableAutoPreviewsConfig = {\n\t/** Prismic client with which automatic previews will be enabled. */\n\t// `Pick` is used to use the smallest possible subset of\n\t// `prismic.Client`. Doing this reduces the surface area for breaking\n\t// type changes.\n\tclient: Pick<Client, \"queryContentFromRef\" | \"enableAutoPreviewsFromReq\">\n}\n\n/**\n * Configures a Prismic client to automatically query draft content during a preview session.\n *\n * @param config - Configuration for the function.\n */\nexport function enableAutoPreviews(config: EnableAutoPreviewsConfig): void {\n\t// We use a function value so the cookie is checked on every\n\t// request. We don't have a static value to read from.\n\tconfig.client.queryContentFromRef(() => getPreviewRef())\n}\n"],"mappings":";;;;;;;AAkBA,SAAgB,mBAAmB,QAAwC;CAG1E,OAAO,OAAO,0BAA0B,cAAc,CAAC;AACxD"}
@@ -1,4 +1,3 @@
1
- require("./_virtual/_rolldown/runtime.cjs");
2
1
  let _prismicio_client = require("@prismicio/client");
3
2
  //#region src/exitPreview.ts
4
3
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"exitPreview.cjs","names":["prismicCookie"],"sources":["../src/exitPreview.ts"],"sourcesContent":["import { cookie as prismicCookie } from \"@prismicio/client\"\n\n/**\n * Ends a Prismic preview session within a Next.js app. This function should be used in a Router\n * Handler.\n *\n * @example\n * \t;```typescript\n * \t// src/app/api/exit-preview/route.js\n *\n * \timport { exitPreview } from \"@prismicio/next\"\n *\n * \texport async function GET() {\n * \t\treturn await exitPreview()\n * \t}\n * \t```\n */\nexport async function exitPreview(): Promise<Response> {\n\t// Need this to avoid the following Next.js build-time error:\n\t// You're importing a component that needs next/headers. That only works\n\t// in a Server Component which is not supported in the pages/ directory.\n\tconst { cookies } = await import(\"next/headers\")\n\n\tconst cookieJar = await cookies()\n\tcookieJar.delete({ name: \"__prerender_bypass\", sameSite: \"none\", secure: true })\n\tcookieJar.delete({ name: prismicCookie.preview, sameSite: \"none\", secure: true })\n\n\t// `Cache-Control` header is used to prevent CDN-level caching.\n\treturn new Response(JSON.stringify({ success: true }), {\n\t\theaders: {\n\t\t\t\"Cache-Control\": \"no-store\",\n\t\t},\n\t})\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAiBA,eAAsB,cAAiC;CAItD,MAAM,EAAE,YAAY,MAAM,OAAO;CAEjC,MAAM,YAAY,MAAM,SAAS;AACjC,WAAU,OAAO;EAAE,MAAM;EAAsB,UAAU;EAAQ,QAAQ;EAAM,CAAC;AAChF,WAAU,OAAO;EAAE,MAAMA,kBAAAA,OAAc;EAAS,UAAU;EAAQ,QAAQ;EAAM,CAAC;AAGjF,QAAO,IAAI,SAAS,KAAK,UAAU,EAAE,SAAS,MAAM,CAAC,EAAE,EACtD,SAAS,EACR,iBAAiB,YACjB,EACD,CAAC"}
1
+ {"version":3,"file":"exitPreview.cjs","names":["prismicCookie"],"sources":["../src/exitPreview.ts"],"sourcesContent":["import { cookie as prismicCookie } from \"@prismicio/client\"\n\n/**\n * Ends a Prismic preview session within a Next.js app. This function should be used in a Router\n * Handler.\n *\n * @example\n * \t;```typescript\n * \t// src/app/api/exit-preview/route.js\n *\n * \timport { exitPreview } from \"@prismicio/next\"\n *\n * \texport async function GET() {\n * \t\treturn await exitPreview()\n * \t}\n * \t```\n */\nexport async function exitPreview(): Promise<Response> {\n\t// Need this to avoid the following Next.js build-time error:\n\t// You're importing a component that needs next/headers. That only works\n\t// in a Server Component which is not supported in the pages/ directory.\n\tconst { cookies } = await import(\"next/headers\")\n\n\tconst cookieJar = await cookies()\n\tcookieJar.delete({ name: \"__prerender_bypass\", sameSite: \"none\", secure: true })\n\tcookieJar.delete({ name: prismicCookie.preview, sameSite: \"none\", secure: true })\n\n\t// `Cache-Control` header is used to prevent CDN-level caching.\n\treturn new Response(JSON.stringify({ success: true }), {\n\t\theaders: {\n\t\t\t\"Cache-Control\": \"no-store\",\n\t\t},\n\t})\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAiBA,eAAsB,cAAiC;CAItD,MAAM,EAAE,YAAY,MAAM,OAAO;CAEjC,MAAM,YAAY,MAAM,QAAQ;CAChC,UAAU,OAAO;EAAE,MAAM;EAAsB,UAAU;EAAQ,QAAQ;CAAK,CAAC;CAC/E,UAAU,OAAO;EAAE,MAAMA,kBAAAA,OAAc;EAAS,UAAU;EAAQ,QAAQ;CAAK,CAAC;CAGhF,OAAO,IAAI,SAAS,KAAK,UAAU,EAAE,SAAS,KAAK,CAAC,GAAG,EACtD,SAAS,EACR,iBAAiB,WAClB,EACD,CAAC;AACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"exitPreview.d.cts","names":[],"sources":["../src/exitPreview.ts"],"mappings":";;AAiBA;;;;;;;;;;;;;;iBAAsB,WAAA,CAAA,GAAe,OAAA,CAAQ,QAAA"}
1
+ {"version":3,"file":"exitPreview.d.cts","names":[],"sources":["../src/exitPreview.ts"],"mappings":";;;;;;;;;;;;;;;;iBAiBsB,eAAe,QAAQ"}
@@ -1 +1 @@
1
- {"version":3,"file":"exitPreview.d.ts","names":[],"sources":["../src/exitPreview.ts"],"mappings":";;AAiBA;;;;;;;;;;;;;;iBAAsB,WAAA,CAAA,GAAe,OAAA,CAAQ,QAAA"}
1
+ {"version":3,"file":"exitPreview.d.ts","names":[],"sources":["../src/exitPreview.ts"],"mappings":";;;;;;;;;;;;;;;;iBAiBsB,eAAe,QAAQ"}
@@ -1 +1 @@
1
- {"version":3,"file":"exitPreview.js","names":["prismicCookie"],"sources":["../src/exitPreview.ts"],"sourcesContent":["import { cookie as prismicCookie } from \"@prismicio/client\"\n\n/**\n * Ends a Prismic preview session within a Next.js app. This function should be used in a Router\n * Handler.\n *\n * @example\n * \t;```typescript\n * \t// src/app/api/exit-preview/route.js\n *\n * \timport { exitPreview } from \"@prismicio/next\"\n *\n * \texport async function GET() {\n * \t\treturn await exitPreview()\n * \t}\n * \t```\n */\nexport async function exitPreview(): Promise<Response> {\n\t// Need this to avoid the following Next.js build-time error:\n\t// You're importing a component that needs next/headers. That only works\n\t// in a Server Component which is not supported in the pages/ directory.\n\tconst { cookies } = await import(\"next/headers\")\n\n\tconst cookieJar = await cookies()\n\tcookieJar.delete({ name: \"__prerender_bypass\", sameSite: \"none\", secure: true })\n\tcookieJar.delete({ name: prismicCookie.preview, sameSite: \"none\", secure: true })\n\n\t// `Cache-Control` header is used to prevent CDN-level caching.\n\treturn new Response(JSON.stringify({ success: true }), {\n\t\theaders: {\n\t\t\t\"Cache-Control\": \"no-store\",\n\t\t},\n\t})\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAiBA,eAAsB,cAAiC;CAItD,MAAM,EAAE,YAAY,MAAM,OAAO;CAEjC,MAAM,YAAY,MAAM,SAAS;AACjC,WAAU,OAAO;EAAE,MAAM;EAAsB,UAAU;EAAQ,QAAQ;EAAM,CAAC;AAChF,WAAU,OAAO;EAAE,MAAMA,OAAc;EAAS,UAAU;EAAQ,QAAQ;EAAM,CAAC;AAGjF,QAAO,IAAI,SAAS,KAAK,UAAU,EAAE,SAAS,MAAM,CAAC,EAAE,EACtD,SAAS,EACR,iBAAiB,YACjB,EACD,CAAC"}
1
+ {"version":3,"file":"exitPreview.js","names":["prismicCookie"],"sources":["../src/exitPreview.ts"],"sourcesContent":["import { cookie as prismicCookie } from \"@prismicio/client\"\n\n/**\n * Ends a Prismic preview session within a Next.js app. This function should be used in a Router\n * Handler.\n *\n * @example\n * \t;```typescript\n * \t// src/app/api/exit-preview/route.js\n *\n * \timport { exitPreview } from \"@prismicio/next\"\n *\n * \texport async function GET() {\n * \t\treturn await exitPreview()\n * \t}\n * \t```\n */\nexport async function exitPreview(): Promise<Response> {\n\t// Need this to avoid the following Next.js build-time error:\n\t// You're importing a component that needs next/headers. That only works\n\t// in a Server Component which is not supported in the pages/ directory.\n\tconst { cookies } = await import(\"next/headers\")\n\n\tconst cookieJar = await cookies()\n\tcookieJar.delete({ name: \"__prerender_bypass\", sameSite: \"none\", secure: true })\n\tcookieJar.delete({ name: prismicCookie.preview, sameSite: \"none\", secure: true })\n\n\t// `Cache-Control` header is used to prevent CDN-level caching.\n\treturn new Response(JSON.stringify({ success: true }), {\n\t\theaders: {\n\t\t\t\"Cache-Control\": \"no-store\",\n\t\t},\n\t})\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAiBA,eAAsB,cAAiC;CAItD,MAAM,EAAE,YAAY,MAAM,OAAO;CAEjC,MAAM,YAAY,MAAM,QAAQ;CAChC,UAAU,OAAO;EAAE,MAAM;EAAsB,UAAU;EAAQ,QAAQ;CAAK,CAAC;CAC/E,UAAU,OAAO;EAAE,MAAMA,OAAc;EAAS,UAAU;EAAQ,QAAQ;CAAK,CAAC;CAGhF,OAAO,IAAI,SAAS,KAAK,UAAU,EAAE,SAAS,KAAK,CAAC,GAAG,EACtD,SAAS,EACR,iBAAiB,WAClB,EACD,CAAC;AACF"}
@@ -1,4 +1,3 @@
1
- require("./_virtual/_rolldown/runtime.cjs");
2
1
  let _prismicio_client = require("@prismicio/client");
3
2
  //#region src/getPreviewRef.ts
4
3
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"getPreviewRef.cjs","names":["prismicCookie"],"sources":["../src/getPreviewRef.ts"],"sourcesContent":["import { cookie as prismicCookie } from \"@prismicio/client\"\n\n/**\n * Reads the Prismic preview ref for the current request when an active preview session exists.\n *\n * This is the read-side counterpart to `redirectToPreviewURL`, which writes the preview cookie. Use\n * it with Next.js Cache Components to read the ref _outside_ a cached function and pass it _in_ as\n * an argument so it becomes part of the cache key:\n *\n * @example\n * \t;```typescript\n * \timport { getPreviewRef } from \"@prismicio/next\"\n *\n * \tconst page = await fetchPage(uid, await getPreviewRef())\n * \t```\n *\n * @returns The active preview ref, or `undefined` if no preview session is active.\n * @experimental\n */\nexport async function getPreviewRef(): Promise<string | undefined> {\n\t// Need this to avoid the following Next.js build-time error:\n\t// You're importing a component that needs next/headers. That only works\n\t// in a Server Component which is not supported in the pages/ directory.\n\tconst { cookies, draftMode } = await import(\"next/headers\")\n\n\tlet isDraftModeEnabled = false\n\ttry {\n\t\tisDraftModeEnabled = (await draftMode()).isEnabled\n\t} catch {\n\t\t// `draftMode()` may have been called in a place that\n\t\t// does not have access to its async storage. This\n\t\t// occurs in places like `generateStaticParams()`. We\n\t\t// can ignore this case.\n\t\treturn\n\t}\n\tif (!isDraftModeEnabled) {\n\t\treturn\n\t}\n\n\tconst cookie = (await cookies()).get(prismicCookie.preview)?.value\n\tif (!cookie) {\n\t\treturn\n\t}\n\n\t// The toolbar's JSON cookie has a `preview` entry only while a preview is active.\n\tconst isInactiveCookie = cookie.startsWith(\"{\") && !cookie.includes('\"preview\"')\n\tif (isInactiveCookie) {\n\t\treturn\n\t}\n\n\treturn cookie\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAmBA,eAAsB,gBAA6C;CAIlE,MAAM,EAAE,SAAS,cAAc,MAAM,OAAO;CAE5C,IAAI,qBAAqB;AACzB,KAAI;AACH,wBAAsB,MAAM,WAAW,EAAE;SAClC;AAKP;;AAED,KAAI,CAAC,mBACJ;CAGD,MAAM,UAAU,MAAM,SAAS,EAAE,IAAIA,kBAAAA,OAAc,QAAQ,EAAE;AAC7D,KAAI,CAAC,OACJ;AAKD,KADyB,OAAO,WAAW,IAAI,IAAI,CAAC,OAAO,SAAS,cAAY,CAE/E;AAGD,QAAO"}
1
+ {"version":3,"file":"getPreviewRef.cjs","names":["prismicCookie"],"sources":["../src/getPreviewRef.ts"],"sourcesContent":["import { cookie as prismicCookie } from \"@prismicio/client\"\n\n/**\n * Reads the Prismic preview ref for the current request when an active preview session exists.\n *\n * This is the read-side counterpart to `redirectToPreviewURL`, which writes the preview cookie. Use\n * it with Next.js Cache Components to read the ref _outside_ a cached function and pass it _in_ as\n * an argument so it becomes part of the cache key:\n *\n * @example\n * \t;```typescript\n * \timport { getPreviewRef } from \"@prismicio/next\"\n *\n * \tconst page = await fetchPage(uid, await getPreviewRef())\n * \t```\n *\n * @returns The active preview ref, or `undefined` if no preview session is active.\n * @experimental\n */\nexport async function getPreviewRef(): Promise<string | undefined> {\n\t// Need this to avoid the following Next.js build-time error:\n\t// You're importing a component that needs next/headers. That only works\n\t// in a Server Component which is not supported in the pages/ directory.\n\tconst { cookies, draftMode } = await import(\"next/headers\")\n\n\tlet isDraftModeEnabled = false\n\ttry {\n\t\tisDraftModeEnabled = (await draftMode()).isEnabled\n\t} catch {\n\t\t// `draftMode()` may have been called in a place that\n\t\t// does not have access to its async storage. This\n\t\t// occurs in places like `generateStaticParams()`. We\n\t\t// can ignore this case.\n\t\treturn\n\t}\n\tif (!isDraftModeEnabled) {\n\t\treturn\n\t}\n\n\tconst cookie = (await cookies()).get(prismicCookie.preview)?.value\n\tif (!cookie) {\n\t\treturn\n\t}\n\n\t// The toolbar's JSON cookie has a `preview` entry only while a preview is active.\n\tconst isInactiveCookie = cookie.startsWith(\"{\") && !cookie.includes('\"preview\"')\n\tif (isInactiveCookie) {\n\t\treturn\n\t}\n\n\treturn cookie\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAmBA,eAAsB,gBAA6C;CAIlE,MAAM,EAAE,SAAS,cAAc,MAAM,OAAO;CAE5C,IAAI,qBAAqB;CACzB,IAAI;EACH,sBAAsB,MAAM,UAAU,EAAA,CAAG;CAC1C,QAAQ;EAKP;CACD;CACA,IAAI,CAAC,oBACJ;CAGD,MAAM,UAAU,MAAM,QAAQ,EAAA,CAAG,IAAIA,kBAAAA,OAAc,OAAO,CAAC,EAAE;CAC7D,IAAI,CAAC,QACJ;CAKD,IADyB,OAAO,WAAW,GAAG,KAAK,CAAC,OAAO,SAAS,aAAW,GAE9E;CAGD,OAAO;AACR"}
@@ -1 +1 @@
1
- {"version":3,"file":"getPreviewRef.d.cts","names":[],"sources":["../src/getPreviewRef.ts"],"mappings":";;AAmBA;;;;;;;;;;;;;;;;iBAAsB,aAAA,CAAA,GAAiB,OAAA"}
1
+ {"version":3,"file":"getPreviewRef.d.cts","names":[],"sources":["../src/getPreviewRef.ts"],"mappings":";;;;;;;;;;;;;;;;;;iBAmBsB,iBAAiB"}
@@ -1 +1 @@
1
- {"version":3,"file":"getPreviewRef.d.ts","names":[],"sources":["../src/getPreviewRef.ts"],"mappings":";;AAmBA;;;;;;;;;;;;;;;;iBAAsB,aAAA,CAAA,GAAiB,OAAA"}
1
+ {"version":3,"file":"getPreviewRef.d.ts","names":[],"sources":["../src/getPreviewRef.ts"],"mappings":";;;;;;;;;;;;;;;;;;iBAmBsB,iBAAiB"}
@@ -1 +1 @@
1
- {"version":3,"file":"getPreviewRef.js","names":["cookie","prismicCookie"],"sources":["../src/getPreviewRef.ts"],"sourcesContent":["import { cookie as prismicCookie } from \"@prismicio/client\"\n\n/**\n * Reads the Prismic preview ref for the current request when an active preview session exists.\n *\n * This is the read-side counterpart to `redirectToPreviewURL`, which writes the preview cookie. Use\n * it with Next.js Cache Components to read the ref _outside_ a cached function and pass it _in_ as\n * an argument so it becomes part of the cache key:\n *\n * @example\n * \t;```typescript\n * \timport { getPreviewRef } from \"@prismicio/next\"\n *\n * \tconst page = await fetchPage(uid, await getPreviewRef())\n * \t```\n *\n * @returns The active preview ref, or `undefined` if no preview session is active.\n * @experimental\n */\nexport async function getPreviewRef(): Promise<string | undefined> {\n\t// Need this to avoid the following Next.js build-time error:\n\t// You're importing a component that needs next/headers. That only works\n\t// in a Server Component which is not supported in the pages/ directory.\n\tconst { cookies, draftMode } = await import(\"next/headers\")\n\n\tlet isDraftModeEnabled = false\n\ttry {\n\t\tisDraftModeEnabled = (await draftMode()).isEnabled\n\t} catch {\n\t\t// `draftMode()` may have been called in a place that\n\t\t// does not have access to its async storage. This\n\t\t// occurs in places like `generateStaticParams()`. We\n\t\t// can ignore this case.\n\t\treturn\n\t}\n\tif (!isDraftModeEnabled) {\n\t\treturn\n\t}\n\n\tconst cookie = (await cookies()).get(prismicCookie.preview)?.value\n\tif (!cookie) {\n\t\treturn\n\t}\n\n\t// The toolbar's JSON cookie has a `preview` entry only while a preview is active.\n\tconst isInactiveCookie = cookie.startsWith(\"{\") && !cookie.includes('\"preview\"')\n\tif (isInactiveCookie) {\n\t\treturn\n\t}\n\n\treturn cookie\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAmBA,eAAsB,gBAA6C;CAIlE,MAAM,EAAE,SAAS,cAAc,MAAM,OAAO;CAE5C,IAAI,qBAAqB;AACzB,KAAI;AACH,wBAAsB,MAAM,WAAW,EAAE;SAClC;AAKP;;AAED,KAAI,CAAC,mBACJ;CAGD,MAAMA,YAAU,MAAM,SAAS,EAAE,IAAIC,OAAc,QAAQ,EAAE;AAC7D,KAAI,CAACD,SACJ;AAKD,KADyBA,SAAO,WAAW,IAAI,IAAI,CAACA,SAAO,SAAS,cAAY,CAE/E;AAGD,QAAOA"}
1
+ {"version":3,"file":"getPreviewRef.js","names":["cookie","prismicCookie"],"sources":["../src/getPreviewRef.ts"],"sourcesContent":["import { cookie as prismicCookie } from \"@prismicio/client\"\n\n/**\n * Reads the Prismic preview ref for the current request when an active preview session exists.\n *\n * This is the read-side counterpart to `redirectToPreviewURL`, which writes the preview cookie. Use\n * it with Next.js Cache Components to read the ref _outside_ a cached function and pass it _in_ as\n * an argument so it becomes part of the cache key:\n *\n * @example\n * \t;```typescript\n * \timport { getPreviewRef } from \"@prismicio/next\"\n *\n * \tconst page = await fetchPage(uid, await getPreviewRef())\n * \t```\n *\n * @returns The active preview ref, or `undefined` if no preview session is active.\n * @experimental\n */\nexport async function getPreviewRef(): Promise<string | undefined> {\n\t// Need this to avoid the following Next.js build-time error:\n\t// You're importing a component that needs next/headers. That only works\n\t// in a Server Component which is not supported in the pages/ directory.\n\tconst { cookies, draftMode } = await import(\"next/headers\")\n\n\tlet isDraftModeEnabled = false\n\ttry {\n\t\tisDraftModeEnabled = (await draftMode()).isEnabled\n\t} catch {\n\t\t// `draftMode()` may have been called in a place that\n\t\t// does not have access to its async storage. This\n\t\t// occurs in places like `generateStaticParams()`. We\n\t\t// can ignore this case.\n\t\treturn\n\t}\n\tif (!isDraftModeEnabled) {\n\t\treturn\n\t}\n\n\tconst cookie = (await cookies()).get(prismicCookie.preview)?.value\n\tif (!cookie) {\n\t\treturn\n\t}\n\n\t// The toolbar's JSON cookie has a `preview` entry only while a preview is active.\n\tconst isInactiveCookie = cookie.startsWith(\"{\") && !cookie.includes('\"preview\"')\n\tif (isInactiveCookie) {\n\t\treturn\n\t}\n\n\treturn cookie\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAmBA,eAAsB,gBAA6C;CAIlE,MAAM,EAAE,SAAS,cAAc,MAAM,OAAO;CAE5C,IAAI,qBAAqB;CACzB,IAAI;EACH,sBAAsB,MAAM,UAAU,EAAA,CAAG;CAC1C,QAAQ;EAKP;CACD;CACA,IAAI,CAAC,oBACJ;CAGD,MAAMA,YAAU,MAAM,QAAQ,EAAA,CAAG,IAAIC,OAAc,OAAO,CAAC,EAAE;CAC7D,IAAI,CAACD,UACJ;CAKD,IADyBA,SAAO,WAAW,GAAG,KAAK,CAACA,SAAO,SAAS,aAAW,GAE9E;CAGD,OAAOA;AACR"}
@@ -19,8 +19,10 @@ function getPrismicDocumentIDs(input) {
19
19
  if (typeof input !== "object" || input == null) return [];
20
20
  if (Array.isArray(input)) return input.flatMap((item) => getPrismicDocumentIDs(item));
21
21
  if ("id" in input && typeof input.id === "string") {
22
- if ("href" in input && typeof input.href === "string" && input.href.includes("/api/v2/documents/search?") || "link_type" in input && input.link_type === "Document") if ("data" in input && typeof input.data === "object" && input.data !== null) return [input.id, ...getPrismicDocumentIDs(input.data)];
23
- else return [input.id];
22
+ if ("href" in input && typeof input.href === "string" && input.href.includes("/api/v2/documents/search?") || "link_type" in input && input.link_type === "Document") {
23
+ if ("data" in input && typeof input.data === "object" && input.data !== null) return [input.id, ...getPrismicDocumentIDs(input.data)];
24
+ else return [input.id];
25
+ }
24
26
  }
25
27
  return Object.values(input).flatMap((input) => getPrismicDocumentIDs(input));
26
28
  }
@@ -1 +1 @@
1
- {"version":3,"file":"getPrismicCacheTags.cjs","names":[],"sources":["../src/getPrismicCacheTags.ts"],"sourcesContent":["import type { PrismicDocument } from \"@prismicio/client\"\n\nconst CACHE_TAG_PREFIX = \"prismic/\"\n\n/**\n * Generates cache tags for a set of Prismic pages. Tags for linked pages (e.g. a content\n * relationship) are included to ensure all related content can be revalidated.\n *\n * @param pages - A set of Prismic pages used to tag the function.\n * @experimental\n *\n * @see {@link https://nextjs.org/docs/app/api-reference/functions/cacheTag}\n */\nexport function getPrismicCacheTags(pages: PrismicDocument[]): string[] {\n\tconst ids = [...new Set(getPrismicDocumentIDs(pages))]\n\treturn ids.map((id) => buildPrismicCacheTag(id))\n}\n\nexport function buildPrismicCacheTag(id: string): string {\n\treturn `${CACHE_TAG_PREFIX}${id}`\n}\n\nfunction getPrismicDocumentIDs(input: unknown): string[] {\n\tif (typeof input !== \"object\" || input == null) return []\n\n\tif (Array.isArray(input)) return input.flatMap((item) => getPrismicDocumentIDs(item))\n\n\tif (\"id\" in input && typeof input.id === \"string\") {\n\t\t// Document\n\t\t// Content relationship or link\n\t\tif (\n\t\t\t(\"href\" in input &&\n\t\t\t\ttypeof input.href === \"string\" &&\n\t\t\t\tinput.href.includes(\"/api/v2/documents/search?\")) ||\n\t\t\t(\"link_type\" in input && input.link_type === \"Document\")\n\t\t) {\n\t\t\tif (\"data\" in input && typeof input.data === \"object\" && input.data !== null) {\n\t\t\t\treturn [input.id, ...getPrismicDocumentIDs(input.data)]\n\t\t\t} else {\n\t\t\t\treturn [input.id]\n\t\t\t}\n\t\t}\n\t}\n\n\treturn Object.values(input).flatMap((input) => getPrismicDocumentIDs(input))\n}\n"],"mappings":";AAEA,MAAM,mBAAmB;;;;;;;;;;AAWzB,SAAgB,oBAAoB,OAAoC;AAEvE,QADY,CAAC,GAAG,IAAI,IAAI,sBAAsB,MAAM,CAAC,CAAC,CAC3C,KAAK,OAAO,qBAAqB,GAAG,CAAC;;AAGjD,SAAgB,qBAAqB,IAAoB;AACxD,QAAO,GAAG,mBAAmB;;AAG9B,SAAS,sBAAsB,OAA0B;AACxD,KAAI,OAAO,UAAU,YAAY,SAAS,KAAM,QAAO,EAAE;AAEzD,KAAI,MAAM,QAAQ,MAAM,CAAE,QAAO,MAAM,SAAS,SAAS,sBAAsB,KAAK,CAAC;AAErF,KAAI,QAAQ,SAAS,OAAO,MAAM,OAAO;MAItC,UAAU,SACV,OAAO,MAAM,SAAS,YACtB,MAAM,KAAK,SAAS,4BAA4B,IAChD,eAAe,SAAS,MAAM,cAAc,WAE7C,KAAI,UAAU,SAAS,OAAO,MAAM,SAAS,YAAY,MAAM,SAAS,KACvE,QAAO,CAAC,MAAM,IAAI,GAAG,sBAAsB,MAAM,KAAK,CAAC;MAEvD,QAAO,CAAC,MAAM,GAAG;;AAKpB,QAAO,OAAO,OAAO,MAAM,CAAC,SAAS,UAAU,sBAAsB,MAAM,CAAC"}
1
+ {"version":3,"file":"getPrismicCacheTags.cjs","names":[],"sources":["../src/getPrismicCacheTags.ts"],"sourcesContent":["import type { PrismicDocument } from \"@prismicio/client\"\n\nconst CACHE_TAG_PREFIX = \"prismic/\"\n\n/**\n * Generates cache tags for a set of Prismic pages. Tags for linked pages (e.g. a content\n * relationship) are included to ensure all related content can be revalidated.\n *\n * @param pages - A set of Prismic pages used to tag the function.\n * @experimental\n *\n * @see {@link https://nextjs.org/docs/app/api-reference/functions/cacheTag}\n */\nexport function getPrismicCacheTags(pages: PrismicDocument[]): string[] {\n\tconst ids = [...new Set(getPrismicDocumentIDs(pages))]\n\treturn ids.map((id) => buildPrismicCacheTag(id))\n}\n\nexport function buildPrismicCacheTag(id: string): string {\n\treturn `${CACHE_TAG_PREFIX}${id}`\n}\n\nfunction getPrismicDocumentIDs(input: unknown): string[] {\n\tif (typeof input !== \"object\" || input == null) return []\n\n\tif (Array.isArray(input)) return input.flatMap((item) => getPrismicDocumentIDs(item))\n\n\tif (\"id\" in input && typeof input.id === \"string\") {\n\t\t// Document\n\t\t// Content relationship or link\n\t\tif (\n\t\t\t(\"href\" in input &&\n\t\t\t\ttypeof input.href === \"string\" &&\n\t\t\t\tinput.href.includes(\"/api/v2/documents/search?\")) ||\n\t\t\t(\"link_type\" in input && input.link_type === \"Document\")\n\t\t) {\n\t\t\tif (\"data\" in input && typeof input.data === \"object\" && input.data !== null) {\n\t\t\t\treturn [input.id, ...getPrismicDocumentIDs(input.data)]\n\t\t\t} else {\n\t\t\t\treturn [input.id]\n\t\t\t}\n\t\t}\n\t}\n\n\treturn Object.values(input).flatMap((input) => getPrismicDocumentIDs(input))\n}\n"],"mappings":";AAEA,MAAM,mBAAmB;;;;;;;;;;AAWzB,SAAgB,oBAAoB,OAAoC;CAEvE,OAAO,CADM,GAAG,IAAI,IAAI,sBAAsB,KAAK,CAAC,CAC3C,CAAC,CAAC,KAAK,OAAO,qBAAqB,EAAE,CAAC;AAChD;AAEA,SAAgB,qBAAqB,IAAoB;CACxD,OAAO,GAAG,mBAAmB;AAC9B;AAEA,SAAS,sBAAsB,OAA0B;CACxD,IAAI,OAAO,UAAU,YAAY,SAAS,MAAM,OAAO,CAAC;CAExD,IAAI,MAAM,QAAQ,KAAK,GAAG,OAAO,MAAM,SAAS,SAAS,sBAAsB,IAAI,CAAC;CAEpF,IAAI,QAAQ,SAAS,OAAO,MAAM,OAAO,UAItC;MAAA,UAAU,SACV,OAAO,MAAM,SAAS,YACtB,MAAM,KAAK,SAAS,2BAA2B,KAC/C,eAAe,SAAS,MAAM,cAAc,YAC5C;GACD,IAAI,UAAU,SAAS,OAAO,MAAM,SAAS,YAAY,MAAM,SAAS,MACvE,OAAO,CAAC,MAAM,IAAI,GAAG,sBAAsB,MAAM,IAAI,CAAC;QAEtD,OAAO,CAAC,MAAM,EAAE;EAElB;;CAGD,OAAO,OAAO,OAAO,KAAK,CAAC,CAAC,SAAS,UAAU,sBAAsB,KAAK,CAAC;AAC5E"}
@@ -1,5 +1,4 @@
1
1
  import { PrismicDocument } from "@prismicio/client";
2
-
3
2
  //#region src/getPrismicCacheTags.d.ts
4
3
  /**
5
4
  * Generates cache tags for a set of Prismic pages. Tags for linked pages (e.g. a content
@@ -1 +1 @@
1
- {"version":3,"file":"getPrismicCacheTags.d.cts","names":[],"sources":["../src/getPrismicCacheTags.ts"],"mappings":";;;;;AAaA;;;;;;;iBAAgB,mBAAA,CAAoB,KAAA,EAAO,eAAA"}
1
+ {"version":3,"file":"getPrismicCacheTags.d.cts","names":[],"sources":["../src/getPrismicCacheTags.ts"],"mappings":";;;;;;;;;;;iBAagB,oBAAoB,OAAO"}
@@ -1,5 +1,4 @@
1
1
  import { PrismicDocument } from "@prismicio/client";
2
-
3
2
  //#region src/getPrismicCacheTags.d.ts
4
3
  /**
5
4
  * Generates cache tags for a set of Prismic pages. Tags for linked pages (e.g. a content
@@ -1 +1 @@
1
- {"version":3,"file":"getPrismicCacheTags.d.ts","names":[],"sources":["../src/getPrismicCacheTags.ts"],"mappings":";;;;;AAaA;;;;;;;iBAAgB,mBAAA,CAAoB,KAAA,EAAO,eAAA"}
1
+ {"version":3,"file":"getPrismicCacheTags.d.ts","names":[],"sources":["../src/getPrismicCacheTags.ts"],"mappings":";;;;;;;;;;;iBAagB,oBAAoB,OAAO"}
@@ -19,8 +19,10 @@ function getPrismicDocumentIDs(input) {
19
19
  if (typeof input !== "object" || input == null) return [];
20
20
  if (Array.isArray(input)) return input.flatMap((item) => getPrismicDocumentIDs(item));
21
21
  if ("id" in input && typeof input.id === "string") {
22
- if ("href" in input && typeof input.href === "string" && input.href.includes("/api/v2/documents/search?") || "link_type" in input && input.link_type === "Document") if ("data" in input && typeof input.data === "object" && input.data !== null) return [input.id, ...getPrismicDocumentIDs(input.data)];
23
- else return [input.id];
22
+ if ("href" in input && typeof input.href === "string" && input.href.includes("/api/v2/documents/search?") || "link_type" in input && input.link_type === "Document") {
23
+ if ("data" in input && typeof input.data === "object" && input.data !== null) return [input.id, ...getPrismicDocumentIDs(input.data)];
24
+ else return [input.id];
25
+ }
24
26
  }
25
27
  return Object.values(input).flatMap((input) => getPrismicDocumentIDs(input));
26
28
  }
@@ -1 +1 @@
1
- {"version":3,"file":"getPrismicCacheTags.js","names":[],"sources":["../src/getPrismicCacheTags.ts"],"sourcesContent":["import type { PrismicDocument } from \"@prismicio/client\"\n\nconst CACHE_TAG_PREFIX = \"prismic/\"\n\n/**\n * Generates cache tags for a set of Prismic pages. Tags for linked pages (e.g. a content\n * relationship) are included to ensure all related content can be revalidated.\n *\n * @param pages - A set of Prismic pages used to tag the function.\n * @experimental\n *\n * @see {@link https://nextjs.org/docs/app/api-reference/functions/cacheTag}\n */\nexport function getPrismicCacheTags(pages: PrismicDocument[]): string[] {\n\tconst ids = [...new Set(getPrismicDocumentIDs(pages))]\n\treturn ids.map((id) => buildPrismicCacheTag(id))\n}\n\nexport function buildPrismicCacheTag(id: string): string {\n\treturn `${CACHE_TAG_PREFIX}${id}`\n}\n\nfunction getPrismicDocumentIDs(input: unknown): string[] {\n\tif (typeof input !== \"object\" || input == null) return []\n\n\tif (Array.isArray(input)) return input.flatMap((item) => getPrismicDocumentIDs(item))\n\n\tif (\"id\" in input && typeof input.id === \"string\") {\n\t\t// Document\n\t\t// Content relationship or link\n\t\tif (\n\t\t\t(\"href\" in input &&\n\t\t\t\ttypeof input.href === \"string\" &&\n\t\t\t\tinput.href.includes(\"/api/v2/documents/search?\")) ||\n\t\t\t(\"link_type\" in input && input.link_type === \"Document\")\n\t\t) {\n\t\t\tif (\"data\" in input && typeof input.data === \"object\" && input.data !== null) {\n\t\t\t\treturn [input.id, ...getPrismicDocumentIDs(input.data)]\n\t\t\t} else {\n\t\t\t\treturn [input.id]\n\t\t\t}\n\t\t}\n\t}\n\n\treturn Object.values(input).flatMap((input) => getPrismicDocumentIDs(input))\n}\n"],"mappings":";AAEA,MAAM,mBAAmB;;;;;;;;;;AAWzB,SAAgB,oBAAoB,OAAoC;AAEvE,QADY,CAAC,GAAG,IAAI,IAAI,sBAAsB,MAAM,CAAC,CAAC,CAC3C,KAAK,OAAO,qBAAqB,GAAG,CAAC;;AAGjD,SAAgB,qBAAqB,IAAoB;AACxD,QAAO,GAAG,mBAAmB;;AAG9B,SAAS,sBAAsB,OAA0B;AACxD,KAAI,OAAO,UAAU,YAAY,SAAS,KAAM,QAAO,EAAE;AAEzD,KAAI,MAAM,QAAQ,MAAM,CAAE,QAAO,MAAM,SAAS,SAAS,sBAAsB,KAAK,CAAC;AAErF,KAAI,QAAQ,SAAS,OAAO,MAAM,OAAO;MAItC,UAAU,SACV,OAAO,MAAM,SAAS,YACtB,MAAM,KAAK,SAAS,4BAA4B,IAChD,eAAe,SAAS,MAAM,cAAc,WAE7C,KAAI,UAAU,SAAS,OAAO,MAAM,SAAS,YAAY,MAAM,SAAS,KACvE,QAAO,CAAC,MAAM,IAAI,GAAG,sBAAsB,MAAM,KAAK,CAAC;MAEvD,QAAO,CAAC,MAAM,GAAG;;AAKpB,QAAO,OAAO,OAAO,MAAM,CAAC,SAAS,UAAU,sBAAsB,MAAM,CAAC"}
1
+ {"version":3,"file":"getPrismicCacheTags.js","names":[],"sources":["../src/getPrismicCacheTags.ts"],"sourcesContent":["import type { PrismicDocument } from \"@prismicio/client\"\n\nconst CACHE_TAG_PREFIX = \"prismic/\"\n\n/**\n * Generates cache tags for a set of Prismic pages. Tags for linked pages (e.g. a content\n * relationship) are included to ensure all related content can be revalidated.\n *\n * @param pages - A set of Prismic pages used to tag the function.\n * @experimental\n *\n * @see {@link https://nextjs.org/docs/app/api-reference/functions/cacheTag}\n */\nexport function getPrismicCacheTags(pages: PrismicDocument[]): string[] {\n\tconst ids = [...new Set(getPrismicDocumentIDs(pages))]\n\treturn ids.map((id) => buildPrismicCacheTag(id))\n}\n\nexport function buildPrismicCacheTag(id: string): string {\n\treturn `${CACHE_TAG_PREFIX}${id}`\n}\n\nfunction getPrismicDocumentIDs(input: unknown): string[] {\n\tif (typeof input !== \"object\" || input == null) return []\n\n\tif (Array.isArray(input)) return input.flatMap((item) => getPrismicDocumentIDs(item))\n\n\tif (\"id\" in input && typeof input.id === \"string\") {\n\t\t// Document\n\t\t// Content relationship or link\n\t\tif (\n\t\t\t(\"href\" in input &&\n\t\t\t\ttypeof input.href === \"string\" &&\n\t\t\t\tinput.href.includes(\"/api/v2/documents/search?\")) ||\n\t\t\t(\"link_type\" in input && input.link_type === \"Document\")\n\t\t) {\n\t\t\tif (\"data\" in input && typeof input.data === \"object\" && input.data !== null) {\n\t\t\t\treturn [input.id, ...getPrismicDocumentIDs(input.data)]\n\t\t\t} else {\n\t\t\t\treturn [input.id]\n\t\t\t}\n\t\t}\n\t}\n\n\treturn Object.values(input).flatMap((input) => getPrismicDocumentIDs(input))\n}\n"],"mappings":";AAEA,MAAM,mBAAmB;;;;;;;;;;AAWzB,SAAgB,oBAAoB,OAAoC;CAEvE,OAAO,CADM,GAAG,IAAI,IAAI,sBAAsB,KAAK,CAAC,CAC3C,CAAC,CAAC,KAAK,OAAO,qBAAqB,EAAE,CAAC;AAChD;AAEA,SAAgB,qBAAqB,IAAoB;CACxD,OAAO,GAAG,mBAAmB;AAC9B;AAEA,SAAS,sBAAsB,OAA0B;CACxD,IAAI,OAAO,UAAU,YAAY,SAAS,MAAM,OAAO,CAAC;CAExD,IAAI,MAAM,QAAQ,KAAK,GAAG,OAAO,MAAM,SAAS,SAAS,sBAAsB,IAAI,CAAC;CAEpF,IAAI,QAAQ,SAAS,OAAO,MAAM,OAAO,UAItC;MAAA,UAAU,SACV,OAAO,MAAM,SAAS,YACtB,MAAM,KAAK,SAAS,2BAA2B,KAC/C,eAAe,SAAS,MAAM,cAAc,YAC5C;GACD,IAAI,UAAU,SAAS,OAAO,MAAM,SAAS,YAAY,MAAM,SAAS,MACvE,OAAO,CAAC,MAAM,IAAI,GAAG,sBAAsB,MAAM,IAAI,CAAC;QAEtD,OAAO,CAAC,MAAM,EAAE;EAElB;;CAGD,OAAO,OAAO,OAAO,KAAK,CAAC,CAAC,SAAS,UAAU,sBAAsB,KAAK,CAAC;AAC5E"}
@@ -1,7 +1,7 @@
1
1
  const require_runtime = require("./_virtual/_rolldown/runtime.cjs");
2
2
  let _prismicio_simulator_kit = require("@prismicio/simulator/kit");
3
3
  let lz_string = require("lz-string");
4
- lz_string = require_runtime.__toESM(lz_string);
4
+ lz_string = require_runtime.__toESM(lz_string, 1);
5
5
  //#region src/getSlices.ts
6
6
  const getSlices = (state) => {
7
7
  return state ? JSON.parse(lz_string.default.decompressFromEncodedURIComponent(state)) : (0, _prismicio_simulator_kit.getDefaultSlices)();
@@ -1 +1 @@
1
- {"version":3,"file":"getSlices.cjs","names":["lzString"],"sources":["../src/getSlices.ts"],"sourcesContent":["import { getDefaultSlices } from \"@prismicio/simulator/kit\"\nimport type { StateEvents, StateEventType } from \"@prismicio/simulator/kit\"\nimport lzString from \"lz-string\"\n\nexport const getSlices = (state: string | null | undefined): StateEvents[StateEventType.Slices] => {\n\treturn state ? JSON.parse(lzString.decompressFromEncodedURIComponent(state)) : getDefaultSlices()\n}\n"],"mappings":";;;;;AAIA,MAAa,aAAa,UAAyE;AAClG,QAAO,QAAQ,KAAK,MAAMA,UAAAA,QAAS,kCAAkC,MAAM,CAAC,IAAA,GAAA,yBAAA,mBAAqB"}
1
+ {"version":3,"file":"getSlices.cjs","names":["lzString","getDefaultSlices"],"sources":["../src/getSlices.ts"],"sourcesContent":["import { getDefaultSlices } from \"@prismicio/simulator/kit\"\nimport type { StateEvents, StateEventType } from \"@prismicio/simulator/kit\"\nimport lzString from \"lz-string\"\n\nexport const getSlices = (state: string | null | undefined): StateEvents[StateEventType.Slices] => {\n\treturn state ? JSON.parse(lzString.decompressFromEncodedURIComponent(state)) : getDefaultSlices()\n}\n"],"mappings":";;;;;AAIA,MAAa,aAAa,UAAyE;CAClG,OAAO,QAAQ,KAAK,MAAMA,UAAAA,QAAS,kCAAkC,KAAK,CAAC,KAAA,GAAIC,yBAAAA,iBAAAA,CAAiB;AACjG"}
@@ -1,5 +1,4 @@
1
1
  import { StateEventType, StateEvents } from "@prismicio/simulator/kit";
2
-
3
2
  //#region src/getSlices.d.ts
4
3
  declare const getSlices: (state: string | null | undefined) => StateEvents[StateEventType.Slices];
5
4
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"getSlices.d.cts","names":[],"sources":["../src/getSlices.ts"],"mappings":";;;cAIa,SAAA,GAAa,KAAA,gCAAmC,WAAA,CAAY,cAAA,CAAe,MAAA"}
1
+ {"version":3,"file":"getSlices.d.cts","names":[],"sources":["../src/getSlices.ts"],"mappings":";;cAIa,YAAS,qCAAuC,YAAY,eAAe"}
@@ -1,5 +1,4 @@
1
1
  import { StateEventType, StateEvents } from "@prismicio/simulator/kit";
2
-
3
2
  //#region src/getSlices.d.ts
4
3
  declare const getSlices: (state: string | null | undefined) => StateEvents[StateEventType.Slices];
5
4
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"getSlices.d.ts","names":[],"sources":["../src/getSlices.ts"],"mappings":";;;cAIa,SAAA,GAAa,KAAA,gCAAmC,WAAA,CAAY,cAAA,CAAe,MAAA"}
1
+ {"version":3,"file":"getSlices.d.ts","names":[],"sources":["../src/getSlices.ts"],"mappings":";;cAIa,YAAS,qCAAuC,YAAY,eAAe"}
@@ -1 +1 @@
1
- {"version":3,"file":"getSlices.js","names":[],"sources":["../src/getSlices.ts"],"sourcesContent":["import { getDefaultSlices } from \"@prismicio/simulator/kit\"\nimport type { StateEvents, StateEventType } from \"@prismicio/simulator/kit\"\nimport lzString from \"lz-string\"\n\nexport const getSlices = (state: string | null | undefined): StateEvents[StateEventType.Slices] => {\n\treturn state ? JSON.parse(lzString.decompressFromEncodedURIComponent(state)) : getDefaultSlices()\n}\n"],"mappings":";;;AAIA,MAAa,aAAa,UAAyE;AAClG,QAAO,QAAQ,KAAK,MAAM,SAAS,kCAAkC,MAAM,CAAC,GAAG,kBAAkB"}
1
+ {"version":3,"file":"getSlices.js","names":[],"sources":["../src/getSlices.ts"],"sourcesContent":["import { getDefaultSlices } from \"@prismicio/simulator/kit\"\nimport type { StateEvents, StateEventType } from \"@prismicio/simulator/kit\"\nimport lzString from \"lz-string\"\n\nexport const getSlices = (state: string | null | undefined): StateEvents[StateEventType.Slices] => {\n\treturn state ? JSON.parse(lzString.decompressFromEncodedURIComponent(state)) : getDefaultSlices()\n}\n"],"mappings":";;;AAIA,MAAa,aAAa,UAAyE;CAClG,OAAO,QAAQ,KAAK,MAAM,SAAS,kCAAkC,KAAK,CAAC,IAAI,iBAAiB;AACjG"}
@@ -1,4 +1,3 @@
1
- require("./_virtual/_rolldown/runtime.cjs");
2
1
  let imgix_url_builder = require("imgix-url-builder");
3
2
  //#region src/imgixLoader.ts
4
3
  /**