emdash 1.3.1 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1338) hide show
  1. package/dist/action-token-SK8zyN7w.mjs +26 -0
  2. package/dist/action-token-SK8zyN7w.mjs.map +1 -0
  3. package/dist/activation-CGlyigmg.mjs +387 -0
  4. package/dist/activation-CGlyigmg.mjs.map +1 -0
  5. package/dist/adapters-D9a1PfqH.d.mts +173 -0
  6. package/dist/adapters-D9a1PfqH.d.mts.map +1 -0
  7. package/dist/after-32yNRvd2.mjs +99 -0
  8. package/dist/after-32yNRvd2.mjs.map +1 -0
  9. package/dist/allowed-origins-CEug-p0t.mjs +116 -0
  10. package/dist/allowed-origins-CEug-p0t.mjs.map +1 -0
  11. package/dist/api/route-utils.d.mts +4 -4
  12. package/dist/api/route-utils.mjs +52 -53
  13. package/dist/api/route-utils.mjs.map +1 -1
  14. package/dist/api/schemas/index.d.mts +1 -1
  15. package/dist/api/schemas/index.mjs +9 -9
  16. package/dist/api--PYoyeTo.mjs +5098 -0
  17. package/dist/api--PYoyeTo.mjs.map +1 -0
  18. package/dist/api-tokens-DqSlkDVI.mjs +9 -0
  19. package/dist/api-tokens-DqSlkDVI.mjs.map +1 -0
  20. package/dist/api-tokens-GNCsIegW.mjs +173 -0
  21. package/dist/api-tokens-GNCsIegW.mjs.map +1 -0
  22. package/dist/apply-DVnupNeS.mjs +1760 -0
  23. package/dist/apply-DVnupNeS.mjs.map +1 -0
  24. package/dist/approvals-DTtYSB27.mjs +460 -0
  25. package/dist/approvals-DTtYSB27.mjs.map +1 -0
  26. package/dist/artifact-fetch-DIh7iyOV.mjs +659 -0
  27. package/dist/artifact-fetch-DIh7iyOV.mjs.map +1 -0
  28. package/dist/artifacts-Dvdp2KK-.mjs +323 -0
  29. package/dist/artifacts-Dvdp2KK-.mjs.map +1 -0
  30. package/dist/astro/index.d.mts +14 -13
  31. package/dist/astro/index.d.mts.map +1 -1
  32. package/dist/astro/index.mjs +52 -12
  33. package/dist/astro/index.mjs.map +1 -1
  34. package/dist/astro/middleware/auth.d.mts +12 -11
  35. package/dist/astro/middleware/auth.d.mts.map +1 -1
  36. package/dist/astro/middleware/auth.mjs +13 -11
  37. package/dist/astro/middleware/auth.mjs.map +1 -1
  38. package/dist/astro/middleware/media-usage-write-fence.mjs +5 -5
  39. package/dist/astro/middleware/redirect.mjs +17 -17
  40. package/dist/astro/middleware/request-context.mjs +12 -7
  41. package/dist/astro/middleware/request-context.mjs.map +1 -1
  42. package/dist/astro/middleware/setup.mjs +1 -1
  43. package/dist/astro/middleware.d.mts +12 -11
  44. package/dist/astro/middleware.d.mts.map +1 -1
  45. package/dist/astro/middleware.mjs +116 -116
  46. package/dist/astro/routes/api/admin/allowed-domains/_domain_.mjs +13 -13
  47. package/dist/astro/routes/api/admin/allowed-domains/index.mjs +13 -13
  48. package/dist/astro/routes/api/admin/api-tokens/_id_.mjs +6 -6
  49. package/dist/astro/routes/api/admin/api-tokens/index.mjs +7 -7
  50. package/dist/astro/routes/api/admin/byline-fields/_slug_/usage.mjs +5 -5
  51. package/dist/astro/routes/api/admin/byline-fields/_slug_.mjs +15 -15
  52. package/dist/astro/routes/api/admin/byline-fields/index.mjs +15 -15
  53. package/dist/astro/routes/api/admin/byline-fields/reorder.mjs +15 -15
  54. package/dist/astro/routes/api/admin/bylines/_id_/index.mjs +23 -24
  55. package/dist/astro/routes/api/admin/bylines/_id_/index.mjs.map +1 -1
  56. package/dist/astro/routes/api/admin/bylines/_id_/translations.mjs +23 -24
  57. package/dist/astro/routes/api/admin/bylines/_id_/translations.mjs.map +1 -1
  58. package/dist/astro/routes/api/admin/bylines/index.mjs +23 -24
  59. package/dist/astro/routes/api/admin/bylines/index.mjs.map +1 -1
  60. package/dist/astro/routes/api/admin/comments/_id_/status.mjs +19 -19
  61. package/dist/astro/routes/api/admin/comments/_id_.mjs +8 -8
  62. package/dist/astro/routes/api/admin/comments/bulk.mjs +18 -18
  63. package/dist/astro/routes/api/admin/comments/counts.mjs +8 -8
  64. package/dist/astro/routes/api/admin/comments/index.mjs +18 -18
  65. package/dist/astro/routes/api/admin/core-update.mjs +7 -7
  66. package/dist/astro/routes/api/admin/hooks/exclusive/_hookName_.mjs +5 -5
  67. package/dist/astro/routes/api/admin/hooks/exclusive/index.mjs +4 -4
  68. package/dist/astro/routes/api/admin/media-usage/activation.mjs +20 -20
  69. package/dist/astro/routes/api/admin/media-usage/collection-deletions/index.mjs +21 -21
  70. package/dist/astro/routes/api/admin/media-usage/collection-deletions/retry.mjs +21 -21
  71. package/dist/astro/routes/api/admin/media-usage/progress.mjs +24 -24
  72. package/dist/astro/routes/api/admin/media-usage/repair.mjs +30 -30
  73. package/dist/astro/routes/api/admin/media-usage/work/index.mjs +21 -21
  74. package/dist/astro/routes/api/admin/media-usage/work/retry.mjs +21 -21
  75. package/dist/astro/routes/api/admin/oauth-clients/_id_.mjs +5 -5
  76. package/dist/astro/routes/api/admin/oauth-clients/index.mjs +5 -5
  77. package/dist/astro/routes/api/admin/plugins/_id_/disable.mjs +8 -8
  78. package/dist/astro/routes/api/admin/plugins/_id_/enable.mjs +8 -8
  79. package/dist/astro/routes/api/admin/plugins/_id_/index.mjs +74 -75
  80. package/dist/astro/routes/api/admin/plugins/_id_/index.mjs.map +1 -1
  81. package/dist/astro/routes/api/admin/plugins/_id_/mcp.mjs +6 -6
  82. package/dist/astro/routes/api/admin/plugins/_id_/settings.mjs +73 -74
  83. package/dist/astro/routes/api/admin/plugins/_id_/settings.mjs.map +1 -1
  84. package/dist/astro/routes/api/admin/plugins/_id_/uninstall.mjs +73 -74
  85. package/dist/astro/routes/api/admin/plugins/_id_/uninstall.mjs.map +1 -1
  86. package/dist/astro/routes/api/admin/plugins/_id_/update.mjs +84 -85
  87. package/dist/astro/routes/api/admin/plugins/_id_/update.mjs.map +1 -1
  88. package/dist/astro/routes/api/admin/plugins/index.mjs +74 -75
  89. package/dist/astro/routes/api/admin/plugins/index.mjs.map +1 -1
  90. package/dist/astro/routes/api/admin/plugins/marketplace/_id_/icon.mjs +6 -6
  91. package/dist/astro/routes/api/admin/plugins/marketplace/_id_/index.mjs +73 -74
  92. package/dist/astro/routes/api/admin/plugins/marketplace/_id_/index.mjs.map +1 -1
  93. package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.mjs +83 -84
  94. package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.mjs.map +1 -1
  95. package/dist/astro/routes/api/admin/plugins/marketplace/index.mjs +73 -74
  96. package/dist/astro/routes/api/admin/plugins/marketplace/index.mjs.map +1 -1
  97. package/dist/astro/routes/api/admin/plugins/registry/_id_/uninstall.mjs +73 -74
  98. package/dist/astro/routes/api/admin/plugins/registry/_id_/uninstall.mjs.map +1 -1
  99. package/dist/astro/routes/api/admin/plugins/registry/_id_/update.mjs +85 -86
  100. package/dist/astro/routes/api/admin/plugins/registry/_id_/update.mjs.map +1 -1
  101. package/dist/astro/routes/api/admin/plugins/registry/artifact.mjs +8 -8
  102. package/dist/astro/routes/api/admin/plugins/registry/install.mjs +75 -76
  103. package/dist/astro/routes/api/admin/plugins/registry/install.mjs.map +1 -1
  104. package/dist/astro/routes/api/admin/plugins/registry/publisher-handle.mjs +6 -6
  105. package/dist/astro/routes/api/admin/plugins/registry/verify.mjs +74 -75
  106. package/dist/astro/routes/api/admin/plugins/registry/verify.mjs.map +1 -1
  107. package/dist/astro/routes/api/admin/plugins/updates.mjs +73 -74
  108. package/dist/astro/routes/api/admin/plugins/updates.mjs.map +1 -1
  109. package/dist/astro/routes/api/admin/scheduled-policy-rejections/_collection_/_id_.mjs +5 -5
  110. package/dist/astro/routes/api/admin/themes/marketplace/_id_/index.mjs +73 -74
  111. package/dist/astro/routes/api/admin/themes/marketplace/_id_/index.mjs.map +1 -1
  112. package/dist/astro/routes/api/admin/themes/marketplace/_id_/thumbnail.mjs +6 -6
  113. package/dist/astro/routes/api/admin/themes/marketplace/index.mjs +73 -74
  114. package/dist/astro/routes/api/admin/themes/marketplace/index.mjs.map +1 -1
  115. package/dist/astro/routes/api/admin/transfer/_...path_.mjs +3 -3
  116. package/dist/astro/routes/api/admin/transfer/approvals/_id_/approve.mjs +40 -41
  117. package/dist/astro/routes/api/admin/transfer/approvals/_id_/approve.mjs.map +1 -1
  118. package/dist/astro/routes/api/admin/transfer/approvals/_id_/deny.mjs +40 -41
  119. package/dist/astro/routes/api/admin/transfer/approvals/_id_/deny.mjs.map +1 -1
  120. package/dist/astro/routes/api/admin/transfer/approvals/index.mjs +42 -43
  121. package/dist/astro/routes/api/admin/transfer/approvals/index.mjs.map +1 -1
  122. package/dist/astro/routes/api/admin/transfer/capabilities.mjs +42 -43
  123. package/dist/astro/routes/api/admin/transfer/capabilities.mjs.map +1 -1
  124. package/dist/astro/routes/api/admin/transfer/exports/_id_/advance.mjs +42 -43
  125. package/dist/astro/routes/api/admin/transfer/exports/_id_/advance.mjs.map +1 -1
  126. package/dist/astro/routes/api/admin/transfer/exports/_id_/archive.mjs +43 -44
  127. package/dist/astro/routes/api/admin/transfer/exports/_id_/archive.mjs.map +1 -1
  128. package/dist/astro/routes/api/admin/transfer/exports/_id_/files/_...path_.mjs +43 -44
  129. package/dist/astro/routes/api/admin/transfer/exports/_id_/files/_...path_.mjs.map +1 -1
  130. package/dist/astro/routes/api/admin/transfer/exports/_id_/index.mjs +42 -43
  131. package/dist/astro/routes/api/admin/transfer/exports/_id_/index.mjs.map +1 -1
  132. package/dist/astro/routes/api/admin/transfer/exports/_id_/manifest.mjs +43 -44
  133. package/dist/astro/routes/api/admin/transfer/exports/_id_/manifest.mjs.map +1 -1
  134. package/dist/astro/routes/api/admin/transfer/exports/index.mjs +44 -45
  135. package/dist/astro/routes/api/admin/transfer/exports/index.mjs.map +1 -1
  136. package/dist/astro/routes/api/admin/transfer/imports/_id_/abandon.mjs +42 -43
  137. package/dist/astro/routes/api/admin/transfer/imports/_id_/abandon.mjs.map +1 -1
  138. package/dist/astro/routes/api/admin/transfer/imports/_id_/advance.mjs +42 -43
  139. package/dist/astro/routes/api/admin/transfer/imports/_id_/advance.mjs.map +1 -1
  140. package/dist/astro/routes/api/admin/transfer/imports/_id_/analyze.mjs +44 -45
  141. package/dist/astro/routes/api/admin/transfer/imports/_id_/analyze.mjs.map +1 -1
  142. package/dist/astro/routes/api/admin/transfer/imports/_id_/cancel.mjs +42 -43
  143. package/dist/astro/routes/api/admin/transfer/imports/_id_/cancel.mjs.map +1 -1
  144. package/dist/astro/routes/api/admin/transfer/imports/_id_/execute.mjs +44 -45
  145. package/dist/astro/routes/api/admin/transfer/imports/_id_/execute.mjs.map +1 -1
  146. package/dist/astro/routes/api/admin/transfer/imports/_id_/files/_...path_.mjs +42 -43
  147. package/dist/astro/routes/api/admin/transfer/imports/_id_/files/_...path_.mjs.map +1 -1
  148. package/dist/astro/routes/api/admin/transfer/imports/_id_/index.mjs +42 -43
  149. package/dist/astro/routes/api/admin/transfer/imports/_id_/index.mjs.map +1 -1
  150. package/dist/astro/routes/api/admin/transfer/imports/_id_/missing.mjs +44 -45
  151. package/dist/astro/routes/api/admin/transfer/imports/_id_/missing.mjs.map +1 -1
  152. package/dist/astro/routes/api/admin/transfer/imports/_id_/plan.mjs +42 -43
  153. package/dist/astro/routes/api/admin/transfer/imports/_id_/plan.mjs.map +1 -1
  154. package/dist/astro/routes/api/admin/transfer/imports/_id_/receipt.mjs +42 -43
  155. package/dist/astro/routes/api/admin/transfer/imports/_id_/receipt.mjs.map +1 -1
  156. package/dist/astro/routes/api/admin/transfer/imports/index.mjs +44 -45
  157. package/dist/astro/routes/api/admin/transfer/imports/index.mjs.map +1 -1
  158. package/dist/astro/routes/api/admin/users/_id_/disable.mjs +3 -3
  159. package/dist/astro/routes/api/admin/users/_id_/enable.mjs +3 -3
  160. package/dist/astro/routes/api/admin/users/_id_/index.mjs +13 -13
  161. package/dist/astro/routes/api/admin/users/_id_/send-recovery.mjs +5 -5
  162. package/dist/astro/routes/api/admin/users/index.mjs +13 -13
  163. package/dist/astro/routes/api/auth/dev-bypass.mjs +5 -5
  164. package/dist/astro/routes/api/auth/handover.mjs +6 -6
  165. package/dist/astro/routes/api/auth/invite/accept.mjs +3 -3
  166. package/dist/astro/routes/api/auth/invite/complete.mjs +19 -19
  167. package/dist/astro/routes/api/auth/invite/index.mjs +15 -15
  168. package/dist/astro/routes/api/auth/invite/register-options.mjs +16 -16
  169. package/dist/astro/routes/api/auth/logout.mjs +4 -4
  170. package/dist/astro/routes/api/auth/magic-link/send.mjs +18 -18
  171. package/dist/astro/routes/api/auth/magic-link/verify.mjs +15 -15
  172. package/dist/astro/routes/api/auth/me.mjs +14 -14
  173. package/dist/astro/routes/api/auth/mode.mjs +4 -4
  174. package/dist/astro/routes/api/auth/oauth/_provider_/callback.mjs +9 -9
  175. package/dist/astro/routes/api/auth/oauth/_provider_.mjs +2 -2
  176. package/dist/astro/routes/api/auth/passkey/_id_.mjs +13 -13
  177. package/dist/astro/routes/api/auth/passkey/index.mjs +3 -3
  178. package/dist/astro/routes/api/auth/passkey/options.mjs +19 -19
  179. package/dist/astro/routes/api/auth/passkey/register/options.mjs +16 -16
  180. package/dist/astro/routes/api/auth/passkey/register/verify.mjs +17 -17
  181. package/dist/astro/routes/api/auth/passkey/verify.mjs +19 -19
  182. package/dist/astro/routes/api/auth/signup/complete.mjs +19 -19
  183. package/dist/astro/routes/api/auth/signup/request.mjs +17 -17
  184. package/dist/astro/routes/api/auth/signup/verify.mjs +3 -3
  185. package/dist/astro/routes/api/calendar.mjs +14 -14
  186. package/dist/astro/routes/api/comments/_collection_/_contentId_/index.mjs +14 -14
  187. package/dist/astro/routes/api/comments/_collection_/_contentId_/reactions.mjs +20 -20
  188. package/dist/astro/routes/api/content/_collection_/_id_/compare.mjs +4 -4
  189. package/dist/astro/routes/api/content/_collection_/_id_/discard-draft.mjs +18 -18
  190. package/dist/astro/routes/api/content/_collection_/_id_/duplicate.mjs +4 -4
  191. package/dist/astro/routes/api/content/_collection_/_id_/lock.mjs +17 -17
  192. package/dist/astro/routes/api/content/_collection_/_id_/permanent.mjs +5 -5
  193. package/dist/astro/routes/api/content/_collection_/_id_/plugin-extensions/_pluginId_/_kind_/_extensionId_.mjs +10 -10
  194. package/dist/astro/routes/api/content/_collection_/_id_/preview-url.mjs +33 -33
  195. package/dist/astro/routes/api/content/_collection_/_id_/publish.mjs +18 -18
  196. package/dist/astro/routes/api/content/_collection_/_id_/references/_relation_/children.mjs +35 -35
  197. package/dist/astro/routes/api/content/_collection_/_id_/references/_relation_/parents.mjs +35 -35
  198. package/dist/astro/routes/api/content/_collection_/_id_/restore.mjs +5 -5
  199. package/dist/astro/routes/api/content/_collection_/_id_/revisions.mjs +4 -4
  200. package/dist/astro/routes/api/content/_collection_/_id_/schedule.mjs +18 -18
  201. package/dist/astro/routes/api/content/_collection_/_id_/terms/_taxonomy_.mjs +26 -26
  202. package/dist/astro/routes/api/content/_collection_/_id_/translations.mjs +4 -4
  203. package/dist/astro/routes/api/content/_collection_/_id_/unpublish.mjs +18 -18
  204. package/dist/astro/routes/api/content/_collection_/_id_.mjs +18 -18
  205. package/dist/astro/routes/api/content/_collection_/authors.mjs +4 -4
  206. package/dist/astro/routes/api/content/_collection_/index.mjs +14 -14
  207. package/dist/astro/routes/api/content/_collection_/trash.mjs +14 -14
  208. package/dist/astro/routes/api/dashboard.mjs +11 -11
  209. package/dist/astro/routes/api/dev/emails.mjs +4 -4
  210. package/dist/astro/routes/api/dev/scheduled-tasks.mjs +112 -112
  211. package/dist/astro/routes/api/health.mjs +5 -5
  212. package/dist/astro/routes/api/import/probe.d.mts +3 -2
  213. package/dist/astro/routes/api/import/probe.d.mts.map +1 -1
  214. package/dist/astro/routes/api/import/probe.mjs +28 -28
  215. package/dist/astro/routes/api/import/wordpress/analyze.d.mts +4 -3
  216. package/dist/astro/routes/api/import/wordpress/analyze.d.mts.map +1 -1
  217. package/dist/astro/routes/api/import/wordpress/analyze.mjs +6 -28
  218. package/dist/astro/routes/api/import/wordpress/analyze.mjs.map +1 -1
  219. package/dist/astro/routes/api/import/wordpress/execute.d.mts +12 -11
  220. package/dist/astro/routes/api/import/wordpress/execute.d.mts.map +1 -1
  221. package/dist/astro/routes/api/import/wordpress/execute.mjs +26 -27
  222. package/dist/astro/routes/api/import/wordpress/execute.mjs.map +1 -1
  223. package/dist/astro/routes/api/import/wordpress/media.d.mts +12 -11
  224. package/dist/astro/routes/api/import/wordpress/media.d.mts.map +1 -1
  225. package/dist/astro/routes/api/import/wordpress/media.mjs +18 -18
  226. package/dist/astro/routes/api/import/wordpress/prepare.mjs +19 -19
  227. package/dist/astro/routes/api/import/wordpress/prepare.mjs.map +1 -1
  228. package/dist/astro/routes/api/import/wordpress/rewrite-urls.d.mts +13 -12
  229. package/dist/astro/routes/api/import/wordpress/rewrite-urls.d.mts.map +1 -1
  230. package/dist/astro/routes/api/import/wordpress/rewrite-urls.mjs +29 -29
  231. package/dist/astro/routes/api/import/wordpress-plugin/analyze.mjs +28 -28
  232. package/dist/astro/routes/api/import/wordpress-plugin/execute.d.mts +12 -11
  233. package/dist/astro/routes/api/import/wordpress-plugin/execute.d.mts.map +1 -1
  234. package/dist/astro/routes/api/import/wordpress-plugin/execute.mjs +38 -39
  235. package/dist/astro/routes/api/import/wordpress-plugin/execute.mjs.map +1 -1
  236. package/dist/astro/routes/api/manifest.mjs +5 -5
  237. package/dist/astro/routes/api/mcp.mjs +96 -97
  238. package/dist/astro/routes/api/mcp.mjs.map +1 -1
  239. package/dist/astro/routes/api/media/_id_/confirm.mjs +19 -19
  240. package/dist/astro/routes/api/media/_id_/replace.mjs +15 -15
  241. package/dist/astro/routes/api/media/_id_/upload.mjs +8 -8
  242. package/dist/astro/routes/api/media/_id_/usage.mjs +32 -32
  243. package/dist/astro/routes/api/media/_id_.mjs +30 -30
  244. package/dist/astro/routes/api/media/asset/_id_/_filename_.mjs +5 -5
  245. package/dist/astro/routes/api/media/file/_...key_.d.mts.map +1 -1
  246. package/dist/astro/routes/api/media/file/_...key_.mjs +57 -11
  247. package/dist/astro/routes/api/media/file/_...key_.mjs.map +1 -1
  248. package/dist/astro/routes/api/media/folders/_id_.mjs +15 -15
  249. package/dist/astro/routes/api/media/folders/index.mjs +15 -15
  250. package/dist/astro/routes/api/media/providers/_providerId_/_itemId_.mjs +4 -4
  251. package/dist/astro/routes/api/media/providers/_providerId_/index.mjs +4 -4
  252. package/dist/astro/routes/api/media/providers/index.mjs +4 -4
  253. package/dist/astro/routes/api/media/upload-url.mjs +17 -17
  254. package/dist/astro/routes/api/media.mjs +34 -34
  255. package/dist/astro/routes/api/menus/_name_/items/_id_.mjs +20 -19
  256. package/dist/astro/routes/api/menus/_name_/items/_id_.mjs.map +1 -1
  257. package/dist/astro/routes/api/menus/_name_/items.mjs +20 -19
  258. package/dist/astro/routes/api/menus/_name_/items.mjs.map +1 -1
  259. package/dist/astro/routes/api/menus/_name_/reorder.mjs +20 -19
  260. package/dist/astro/routes/api/menus/_name_/reorder.mjs.map +1 -1
  261. package/dist/astro/routes/api/menus/_name_/translations.mjs +20 -19
  262. package/dist/astro/routes/api/menus/_name_/translations.mjs.map +1 -1
  263. package/dist/astro/routes/api/menus/_name_.mjs +20 -19
  264. package/dist/astro/routes/api/menus/_name_.mjs.map +1 -1
  265. package/dist/astro/routes/api/menus/index.mjs +20 -19
  266. package/dist/astro/routes/api/menus/index.mjs.map +1 -1
  267. package/dist/astro/routes/api/oauth/authorize.mjs +6 -6
  268. package/dist/astro/routes/api/oauth/device/authorize.mjs +7 -7
  269. package/dist/astro/routes/api/oauth/device/code.mjs +11 -11
  270. package/dist/astro/routes/api/oauth/device/token.mjs +10 -10
  271. package/dist/astro/routes/api/oauth/register.mjs +7 -7
  272. package/dist/astro/routes/api/oauth/token/refresh.mjs +7 -7
  273. package/dist/astro/routes/api/oauth/token/revoke.mjs +7 -7
  274. package/dist/astro/routes/api/oauth/token.d.mts.map +1 -1
  275. package/dist/astro/routes/api/oauth/token.mjs +8 -8
  276. package/dist/astro/routes/api/oauth/token.mjs.map +1 -1
  277. package/dist/astro/routes/api/openapi.json.mjs +20 -20
  278. package/dist/astro/routes/api/plugins/_pluginId_/_...path_.mjs +10 -10
  279. package/dist/astro/routes/api/redirects/404s/index.mjs +21 -21
  280. package/dist/astro/routes/api/redirects/404s/summary.mjs +21 -21
  281. package/dist/astro/routes/api/redirects/_id_.mjs +22 -22
  282. package/dist/astro/routes/api/redirects/index.mjs +22 -22
  283. package/dist/astro/routes/api/relations/_id_/index.mjs +35 -35
  284. package/dist/astro/routes/api/relations/index.mjs +35 -35
  285. package/dist/astro/routes/api/revisions/_revisionId_/index.mjs +4 -4
  286. package/dist/astro/routes/api/revisions/_revisionId_/restore.mjs +17 -17
  287. package/dist/astro/routes/api/schema/block-types/_slug_/index.mjs +73 -74
  288. package/dist/astro/routes/api/schema/block-types/_slug_/index.mjs.map +1 -1
  289. package/dist/astro/routes/api/schema/block-types/_slug_/versions/_version_/activate.mjs +73 -74
  290. package/dist/astro/routes/api/schema/block-types/_slug_/versions/_version_/activate.mjs.map +1 -1
  291. package/dist/astro/routes/api/schema/block-types/index.mjs +73 -74
  292. package/dist/astro/routes/api/schema/block-types/index.mjs.map +1 -1
  293. package/dist/astro/routes/api/schema/collections/_slug_/fields/_fieldSlug_.mjs +73 -74
  294. package/dist/astro/routes/api/schema/collections/_slug_/fields/_fieldSlug_.mjs.map +1 -1
  295. package/dist/astro/routes/api/schema/collections/_slug_/fields/index.mjs +73 -74
  296. package/dist/astro/routes/api/schema/collections/_slug_/fields/index.mjs.map +1 -1
  297. package/dist/astro/routes/api/schema/collections/_slug_/fields/reorder.mjs +73 -74
  298. package/dist/astro/routes/api/schema/collections/_slug_/fields/reorder.mjs.map +1 -1
  299. package/dist/astro/routes/api/schema/collections/_slug_/index.mjs +73 -74
  300. package/dist/astro/routes/api/schema/collections/_slug_/index.mjs.map +1 -1
  301. package/dist/astro/routes/api/schema/collections/index.mjs +73 -74
  302. package/dist/astro/routes/api/schema/collections/index.mjs.map +1 -1
  303. package/dist/astro/routes/api/schema/collections/reorder.mjs +73 -74
  304. package/dist/astro/routes/api/schema/collections/reorder.mjs.map +1 -1
  305. package/dist/astro/routes/api/schema/index.mjs +17 -17
  306. package/dist/astro/routes/api/schema/orphans/_slug_.mjs +73 -74
  307. package/dist/astro/routes/api/schema/orphans/_slug_.mjs.map +1 -1
  308. package/dist/astro/routes/api/schema/orphans/index.mjs +73 -74
  309. package/dist/astro/routes/api/schema/orphans/index.mjs.map +1 -1
  310. package/dist/astro/routes/api/search/enable.mjs +20 -19
  311. package/dist/astro/routes/api/search/enable.mjs.map +1 -1
  312. package/dist/astro/routes/api/search/index.mjs +19 -18
  313. package/dist/astro/routes/api/search/index.mjs.map +1 -1
  314. package/dist/astro/routes/api/search/rebuild.mjs +20 -19
  315. package/dist/astro/routes/api/search/rebuild.mjs.map +1 -1
  316. package/dist/astro/routes/api/search/stats.mjs +10 -9
  317. package/dist/astro/routes/api/search/stats.mjs.map +1 -1
  318. package/dist/astro/routes/api/search/suggest.mjs +19 -18
  319. package/dist/astro/routes/api/search/suggest.mjs.map +1 -1
  320. package/dist/astro/routes/api/sections/_slug_.mjs +19 -18
  321. package/dist/astro/routes/api/sections/_slug_.mjs.map +1 -1
  322. package/dist/astro/routes/api/sections/index.mjs +19 -18
  323. package/dist/astro/routes/api/sections/index.mjs.map +1 -1
  324. package/dist/astro/routes/api/settings/backups/archives/_name_.mjs +7 -7
  325. package/dist/astro/routes/api/settings/backups/archives/index.mjs +7 -7
  326. package/dist/astro/routes/api/settings/backups/export.mjs +7 -7
  327. package/dist/astro/routes/api/settings/backups/index.mjs +8 -8
  328. package/dist/astro/routes/api/settings/domain-notify.mjs +9 -9
  329. package/dist/astro/routes/api/settings/domain.mjs +21 -21
  330. package/dist/astro/routes/api/settings/email.mjs +5 -5
  331. package/dist/astro/routes/api/settings.mjs +27 -27
  332. package/dist/astro/routes/api/setup/admin-verify.mjs +22 -22
  333. package/dist/astro/routes/api/setup/admin.mjs +17 -17
  334. package/dist/astro/routes/api/setup/dev-bypass.mjs +45 -46
  335. package/dist/astro/routes/api/setup/dev-bypass.mjs.map +1 -1
  336. package/dist/astro/routes/api/setup/dev-reset.mjs +3 -3
  337. package/dist/astro/routes/api/setup/index.mjs +51 -52
  338. package/dist/astro/routes/api/setup/index.mjs.map +1 -1
  339. package/dist/astro/routes/api/setup/status.mjs +5 -5
  340. package/dist/astro/routes/api/site/domain-proof.mjs +15 -15
  341. package/dist/astro/routes/api/snapshot.mjs +10 -10
  342. package/dist/astro/routes/api/taxonomies/_name_/reorder.mjs +25 -25
  343. package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_/translations.mjs +25 -25
  344. package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_.mjs +25 -25
  345. package/dist/astro/routes/api/taxonomies/_name_/terms/index.mjs +25 -25
  346. package/dist/astro/routes/api/taxonomies/_name_/translations.mjs +23 -23
  347. package/dist/astro/routes/api/taxonomies/_name_.mjs +25 -25
  348. package/dist/astro/routes/api/taxonomies/bulk-tag.mjs +36 -36
  349. package/dist/astro/routes/api/taxonomies/index.mjs +25 -25
  350. package/dist/astro/routes/api/themes/preview.mjs +7 -7
  351. package/dist/astro/routes/api/typegen.mjs +5 -5
  352. package/dist/astro/routes/api/visual-editing/action-token.mjs +7 -7
  353. package/dist/astro/routes/api/visual-editing/content/_collection_/_id_/publish.mjs +21 -21
  354. package/dist/astro/routes/api/visual-editing/toolbar-labels.mjs +3 -3
  355. package/dist/astro/routes/api/well-known/auth.mjs +1 -1
  356. package/dist/astro/routes/api/well-known/oauth-authorization-server.mjs +2 -2
  357. package/dist/astro/routes/api/well-known/oauth-protected-resource.mjs +2 -2
  358. package/dist/astro/routes/api/widget-areas/_name_/reorder.d.mts.map +1 -1
  359. package/dist/astro/routes/api/widget-areas/_name_/reorder.mjs +28 -17
  360. package/dist/astro/routes/api/widget-areas/_name_/reorder.mjs.map +1 -1
  361. package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.d.mts.map +1 -1
  362. package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.mjs +24 -20
  363. package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.mjs.map +1 -1
  364. package/dist/astro/routes/api/widget-areas/_name_/widgets.mjs +23 -20
  365. package/dist/astro/routes/api/widget-areas/_name_/widgets.mjs.map +1 -1
  366. package/dist/astro/routes/api/widget-areas/_name_.mjs +13 -10
  367. package/dist/astro/routes/api/widget-areas/_name_.mjs.map +1 -1
  368. package/dist/astro/routes/api/widget-areas/index.mjs +23 -20
  369. package/dist/astro/routes/api/widget-areas/index.mjs.map +1 -1
  370. package/dist/astro/routes/api/widget-components.mjs +4 -4
  371. package/dist/astro/routes/robots.txt.mjs +14 -14
  372. package/dist/astro/routes/sitemap-_collection_.xml.mjs +17 -17
  373. package/dist/astro/routes/sitemap.xml.mjs +15 -15
  374. package/dist/astro/types.d.mts +21 -19
  375. package/dist/astro/types.d.mts.map +1 -1
  376. package/dist/auth/providers/github.d.mts +1 -1
  377. package/dist/auth/providers/google.d.mts +1 -1
  378. package/dist/auth/providers/microsoft.d.mts +1 -1
  379. package/dist/authoritative-records-CQlB3JzE.mjs +5183 -0
  380. package/dist/authoritative-records-CQlB3JzE.mjs.map +1 -0
  381. package/dist/authorize-NJgp8kLI.mjs +74 -0
  382. package/dist/authorize-NJgp8kLI.mjs.map +1 -0
  383. package/dist/backup-8rPSJ28a.mjs +246 -0
  384. package/dist/backup-8rPSJ28a.mjs.map +1 -0
  385. package/dist/block-types-BbOrfnWs.mjs +132 -0
  386. package/dist/block-types-BbOrfnWs.mjs.map +1 -0
  387. package/dist/block-values-Dg0-8PPS.mjs +215 -0
  388. package/dist/block-values-Dg0-8PPS.mjs.map +1 -0
  389. package/dist/byline-DHJS-GGb.mjs +994 -0
  390. package/dist/byline-DHJS-GGb.mjs.map +1 -0
  391. package/dist/byline-fields-CiR8FvvF.mjs +280 -0
  392. package/dist/byline-fields-CiR8FvvF.mjs.map +1 -0
  393. package/dist/byline-fields-D6KYsEa7.mjs +123 -0
  394. package/dist/byline-fields-D6KYsEa7.mjs.map +1 -0
  395. package/dist/bylines-Bsg5cH4S.mjs +234 -0
  396. package/dist/bylines-Bsg5cH4S.mjs.map +1 -0
  397. package/dist/bylines-f_ZEc6Sn.mjs +150 -0
  398. package/dist/bylines-f_ZEc6Sn.mjs.map +1 -0
  399. package/dist/cache-5DHbpEWu.mjs +151 -0
  400. package/dist/cache-5DHbpEWu.mjs.map +1 -0
  401. package/dist/canonical-BudtH-Fx.mjs +174 -0
  402. package/dist/canonical-BudtH-Fx.mjs.map +1 -0
  403. package/dist/capture-triggers-BezAvWcB.mjs +362 -0
  404. package/dist/capture-triggers-BezAvWcB.mjs.map +1 -0
  405. package/dist/challenge-store-B1C0V4b3.mjs +51 -0
  406. package/dist/challenge-store-B1C0V4b3.mjs.map +1 -0
  407. package/dist/checksum-CEqvfxGX.mjs +162 -0
  408. package/dist/checksum-CEqvfxGX.mjs.map +1 -0
  409. package/dist/chrome-tags-BIKBMZYO.mjs +24 -0
  410. package/dist/chrome-tags-BIKBMZYO.mjs.map +1 -0
  411. package/dist/chunks-DiW8VMwz.mjs +25 -0
  412. package/dist/chunks-DiW8VMwz.mjs.map +1 -0
  413. package/dist/cli/index.mjs +52 -53
  414. package/dist/cli/index.mjs.map +1 -1
  415. package/dist/client/index.d.mts +46 -46
  416. package/dist/client/index.mjs +2 -2
  417. package/dist/collection-slugs-cache-DIrLjqH-.mjs +91 -0
  418. package/dist/collection-slugs-cache-DIrLjqH-.mjs.map +1 -0
  419. package/dist/comment-DB74Zpa4.mjs +335 -0
  420. package/dist/comment-DB74Zpa4.mjs.map +1 -0
  421. package/dist/comment-reaction-BScxIWUn.mjs +85 -0
  422. package/dist/comment-reaction-BScxIWUn.mjs.map +1 -0
  423. package/dist/comments-Cor_zKml.mjs +195 -0
  424. package/dist/comments-Cor_zKml.mjs.map +1 -0
  425. package/dist/comments-yiRFx3w5.mjs +99 -0
  426. package/dist/comments-yiRFx3w5.mjs.map +1 -0
  427. package/dist/components-Brp__9xo.mjs +112 -0
  428. package/dist/components-Brp__9xo.mjs.map +1 -0
  429. package/dist/config-D44_8G9J.d.mts +41 -0
  430. package/dist/config-D44_8G9J.d.mts.map +1 -0
  431. package/dist/config-DBU6iUQB.mjs +228 -0
  432. package/dist/config-DBU6iUQB.mjs.map +1 -0
  433. package/dist/config-sDhZvkLR.d.mts +6835 -0
  434. package/dist/config-sDhZvkLR.d.mts.map +1 -0
  435. package/dist/connection-BtEN_lP9.mjs +36 -0
  436. package/dist/connection-BtEN_lP9.mjs.map +1 -0
  437. package/dist/content-BKHUVsE5.mjs +2112 -0
  438. package/dist/content-BKHUVsE5.mjs.map +1 -0
  439. package/dist/content-list-query-ByP4jRpZ.d.mts +26 -0
  440. package/dist/content-list-query-ByP4jRpZ.d.mts.map +1 -0
  441. package/dist/content-policy-BmE0MPZY.mjs +46 -0
  442. package/dist/content-policy-BmE0MPZY.mjs.map +1 -0
  443. package/dist/content-repair-Ukdxoq-R.mjs +442 -0
  444. package/dist/content-repair-Ukdxoq-R.mjs.map +1 -0
  445. package/dist/context-CzjejcsE.mjs +2089 -0
  446. package/dist/context-CzjejcsE.mjs.map +1 -0
  447. package/dist/credits-BKREepht.mjs +110 -0
  448. package/dist/credits-BKREepht.mjs.map +1 -0
  449. package/dist/cron-D7obTIfk.mjs +306 -0
  450. package/dist/cron-D7obTIfk.mjs.map +1 -0
  451. package/dist/dashboard-ynr1qJWM.mjs +168 -0
  452. package/dist/dashboard-ynr1qJWM.mjs.map +1 -0
  453. package/dist/db/index.d.mts +3 -3
  454. package/dist/db/index.mjs +2 -2
  455. package/dist/db/libsql-migrations.d.mts +1 -1
  456. package/dist/db/libsql-migrations.mjs +5 -5
  457. package/dist/db/libsql.d.mts +1 -1
  458. package/dist/db/postgres-migrations.d.mts +1 -1
  459. package/dist/db/postgres-migrations.mjs +5 -5
  460. package/dist/db/postgres.d.mts +1 -1
  461. package/dist/db/sqlite-migrations.d.mts +1 -1
  462. package/dist/db/sqlite-migrations.mjs +5 -5
  463. package/dist/db/sqlite.d.mts +1 -1
  464. package/dist/db/sqlite.mjs +1 -1
  465. package/dist/default-C0W-PhAp.mjs +81 -0
  466. package/dist/default-C0W-PhAp.mjs.map +1 -0
  467. package/dist/deferred-tasks-wlMFJL95.d.mts +10 -0
  468. package/dist/deferred-tasks-wlMFJL95.d.mts.map +1 -0
  469. package/dist/dev-typegen-EBni_pOQ.mjs +29 -0
  470. package/dist/dev-typegen-EBni_pOQ.mjs.map +1 -0
  471. package/dist/device-flow-D1U392GC.mjs +519 -0
  472. package/dist/device-flow-D1U392GC.mjs.map +1 -0
  473. package/dist/dialect-helpers-B1XN2HGB.mjs +314 -0
  474. package/dist/dialect-helpers-B1XN2HGB.mjs.map +1 -0
  475. package/dist/digest-DJ1tHCgy.mjs +194 -0
  476. package/dist/digest-DJ1tHCgy.mjs.map +1 -0
  477. package/dist/direct-executor-Bs2g0ake.mjs +117 -0
  478. package/dist/direct-executor-Bs2g0ake.mjs.map +1 -0
  479. package/dist/dist-BUmWMTbN.mjs +810 -0
  480. package/dist/dist-BUmWMTbN.mjs.map +1 -0
  481. package/dist/email-console-FFVJWb9N.mjs +50 -0
  482. package/dist/email-console-FFVJWb9N.mjs.map +1 -0
  483. package/dist/email-locale-Bs3HFdnq.mjs +25 -0
  484. package/dist/email-locale-Bs3HFdnq.mjs.map +1 -0
  485. package/dist/emdash-runtime-C8T-pZpS.mjs +4425 -0
  486. package/dist/emdash-runtime-C8T-pZpS.mjs.map +1 -0
  487. package/dist/enrich-DFlfnd3u.mjs +194 -0
  488. package/dist/enrich-DFlfnd3u.mjs.map +1 -0
  489. package/dist/entry-lock-BulbgPBX.d.mts +4568 -0
  490. package/dist/entry-lock-BulbgPBX.d.mts.map +1 -0
  491. package/dist/entry-lock-CRVmruM0.mjs +1211 -0
  492. package/dist/entry-lock-CRVmruM0.mjs.map +1 -0
  493. package/dist/entry-lock-D-zJQ4q6.mjs +163 -0
  494. package/dist/entry-lock-D-zJQ4q6.mjs.map +1 -0
  495. package/dist/entry-locks-CJ9uhqg1.mjs +167 -0
  496. package/dist/entry-locks-CJ9uhqg1.mjs.map +1 -0
  497. package/dist/env-types-BE3bCvfP.mjs +38 -0
  498. package/dist/env-types-BE3bCvfP.mjs.map +1 -0
  499. package/dist/error-BCMgPxdn.mjs +90 -0
  500. package/dist/error-BCMgPxdn.mjs.map +1 -0
  501. package/dist/errors-8gJqv-XV.mjs +492 -0
  502. package/dist/errors-8gJqv-XV.mjs.map +1 -0
  503. package/dist/errors-B4f4It-2.mjs +120 -0
  504. package/dist/errors-B4f4It-2.mjs.map +1 -0
  505. package/dist/escape-lsNq38PP.mjs +9 -0
  506. package/dist/escape-lsNq38PP.mjs.map +1 -0
  507. package/dist/fence-Dagicj14.mjs +162 -0
  508. package/dist/fence-Dagicj14.mjs.map +1 -0
  509. package/dist/field-map-BSXdNGt5.mjs +84 -0
  510. package/dist/field-map-BSXdNGt5.mjs.map +1 -0
  511. package/dist/fts-manager-6861qcwk.mjs +489 -0
  512. package/dist/fts-manager-6861qcwk.mjs.map +1 -0
  513. package/dist/gc-CNkXB3mE.mjs +75 -0
  514. package/dist/gc-CNkXB3mE.mjs.map +1 -0
  515. package/dist/hash-BJaeek87.mjs +37 -0
  516. package/dist/hash-BJaeek87.mjs.map +1 -0
  517. package/dist/hreflang-8dUOJAPJ.d.mts +50 -0
  518. package/dist/hreflang-8dUOJAPJ.d.mts.map +1 -0
  519. package/dist/hreflang-BW5A4FLK.mjs +105 -0
  520. package/dist/hreflang-BW5A4FLK.mjs.map +1 -0
  521. package/dist/http-route-dispatch-rXKvTNm9.mjs +342 -0
  522. package/dist/http-route-dispatch-rXKvTNm9.mjs.map +1 -0
  523. package/dist/identity-CPRRSovU.mjs +35 -0
  524. package/dist/identity-CPRRSovU.mjs.map +1 -0
  525. package/dist/import-yVbfPyfd.mjs +2126 -0
  526. package/dist/import-yVbfPyfd.mjs.map +1 -0
  527. package/dist/index-VM7Fzxwe.d.mts +260 -0
  528. package/dist/index-VM7Fzxwe.d.mts.map +1 -0
  529. package/dist/index.d.mts +23 -22
  530. package/dist/index.mjs +104 -105
  531. package/dist/install-finalization-RU6VrHOX.mjs +58 -0
  532. package/dist/install-finalization-RU6VrHOX.mjs.map +1 -0
  533. package/dist/json-recordset-D0WhN2UA.mjs +12 -0
  534. package/dist/json-recordset-D0WhN2UA.mjs.map +1 -0
  535. package/dist/json-schema-v_D_pPNG.mjs +15 -0
  536. package/dist/json-schema-v_D_pPNG.mjs.map +1 -0
  537. package/dist/keys-CifIkT0N.mjs +61 -0
  538. package/dist/keys-CifIkT0N.mjs.map +1 -0
  539. package/dist/kinds-B_Qcl5pz.mjs +974 -0
  540. package/dist/kinds-B_Qcl5pz.mjs.map +1 -0
  541. package/dist/lifecycle-B8d7Rdqx.mjs +25 -0
  542. package/dist/lifecycle-B8d7Rdqx.mjs.map +1 -0
  543. package/dist/load-D4xtzm6h.mjs +28 -0
  544. package/dist/load-D4xtzm6h.mjs.map +1 -0
  545. package/dist/loader-DhnedqY4.mjs +1478 -0
  546. package/dist/loader-DhnedqY4.mjs.map +1 -0
  547. package/dist/loops-B2YS-Zzr.mjs +205 -0
  548. package/dist/loops-B2YS-Zzr.mjs.map +1 -0
  549. package/dist/manifest-builder-g1FLviel.mjs +196 -0
  550. package/dist/manifest-builder-g1FLviel.mjs.map +1 -0
  551. package/dist/manifest-schema-DNb4XmTS.mjs +497 -0
  552. package/dist/manifest-schema-DNb4XmTS.mjs.map +1 -0
  553. package/dist/marketplace-CqbgeIa7.mjs +257 -0
  554. package/dist/marketplace-CqbgeIa7.mjs.map +1 -0
  555. package/dist/media/image-endpoint.mjs +1 -1
  556. package/dist/media/index.d.mts +1 -1
  557. package/dist/media/index.mjs +3 -3
  558. package/dist/media/local-runtime.d.mts +14 -13
  559. package/dist/media/local-runtime.d.mts.map +1 -1
  560. package/dist/media/local-runtime.mjs +14 -14
  561. package/dist/media-BR4_t-Wd.mjs +416 -0
  562. package/dist/media-BR4_t-Wd.mjs.map +1 -0
  563. package/dist/media-CikS-q6E.mjs +294 -0
  564. package/dist/media-CikS-q6E.mjs.map +1 -0
  565. package/dist/media-DepNLhPq.mjs +383 -0
  566. package/dist/media-DepNLhPq.mjs.map +1 -0
  567. package/dist/media-allowlist-BMBLqyWh.mjs +45 -0
  568. package/dist/media-allowlist-BMBLqyWh.mjs.map +1 -0
  569. package/dist/media-folders-CI0Wydfo.mjs +210 -0
  570. package/dist/media-folders-CI0Wydfo.mjs.map +1 -0
  571. package/dist/media-url-BQgKvpQ5.mjs +43 -0
  572. package/dist/media-url-BQgKvpQ5.mjs.map +1 -0
  573. package/dist/media-usage-X1_20MY-.mjs +282 -0
  574. package/dist/media-usage-X1_20MY-.mjs.map +1 -0
  575. package/dist/media-usage-activation-bWusy3M2.mjs +78 -0
  576. package/dist/media-usage-activation-bWusy3M2.mjs.map +1 -0
  577. package/dist/media-usage-work-B2RaoJIa.mjs +151 -0
  578. package/dist/media-usage-work-B2RaoJIa.mjs.map +1 -0
  579. package/dist/media-usage-work-BCK2J-v_.mjs +1036 -0
  580. package/dist/media-usage-work-BCK2J-v_.mjs.map +1 -0
  581. package/dist/menus-B0Qqv_cS.mjs +837 -0
  582. package/dist/menus-B0Qqv_cS.mjs.map +1 -0
  583. package/dist/menus-oypxT1pI.mjs +3802 -0
  584. package/dist/menus-oypxT1pI.mjs.map +1 -0
  585. package/dist/menus-uEAxWAm1.mjs +92 -0
  586. package/dist/menus-uEAxWAm1.mjs.map +1 -0
  587. package/dist/migrations/index.d.mts +1 -1
  588. package/dist/migrations/index.mjs +4 -4
  589. package/dist/mime-D1We9jUx.mjs +81 -0
  590. package/dist/mime-D1We9jUx.mjs.map +1 -0
  591. package/dist/mode-C-D3qICy.mjs +23 -0
  592. package/dist/mode-C-D3qICy.mjs.map +1 -0
  593. package/dist/node-sqlite-compat-CrKzRr0J.mjs +63 -0
  594. package/dist/node-sqlite-compat-CrKzRr0J.mjs.map +1 -0
  595. package/dist/normalize-Cx-bNwhP.mjs +220 -0
  596. package/dist/normalize-Cx-bNwhP.mjs.map +1 -0
  597. package/dist/oauth-authorization-CPLgBrdo.mjs +287 -0
  598. package/dist/oauth-authorization-CPLgBrdo.mjs.map +1 -0
  599. package/dist/oauth-clients-BT0Pg-MO.mjs +266 -0
  600. package/dist/oauth-clients-BT0Pg-MO.mjs.map +1 -0
  601. package/dist/oauth-state-store-BndCfRum.mjs +50 -0
  602. package/dist/oauth-state-store-BndCfRum.mjs.map +1 -0
  603. package/dist/oauth-user-lookup-BDgF6IVG.mjs +26 -0
  604. package/dist/oauth-user-lookup-BDgF6IVG.mjs.map +1 -0
  605. package/dist/object-cache/memory.d.mts +1 -1
  606. package/dist/object-cache-DmKr09La.mjs +603 -0
  607. package/dist/object-cache-DmKr09La.mjs.map +1 -0
  608. package/dist/options-BUUgroHg.d.mts +81 -0
  609. package/dist/options-BUUgroHg.d.mts.map +1 -0
  610. package/dist/ownership-MiyA7qKO.mjs +12 -0
  611. package/dist/ownership-MiyA7qKO.mjs.map +1 -0
  612. package/dist/page/index.d.mts +2 -2
  613. package/dist/page/index.mjs +13 -13
  614. package/dist/parse-B_b6gZxG.mjs +81 -0
  615. package/dist/parse-B_b6gZxG.mjs.map +1 -0
  616. package/dist/parse-Dndx1QmN.d.mts +176 -0
  617. package/dist/parse-Dndx1QmN.d.mts.map +1 -0
  618. package/dist/passkey-config-D2Lua5__.mjs +46 -0
  619. package/dist/passkey-config-D2Lua5__.mjs.map +1 -0
  620. package/dist/paths-biDzFTY2.mjs +77 -0
  621. package/dist/paths-biDzFTY2.mjs.map +1 -0
  622. package/dist/placeholder-CSKu5OkD.d.mts +314 -0
  623. package/dist/placeholder-CSKu5OkD.d.mts.map +1 -0
  624. package/dist/plan-CCoqxNoU.mjs +135 -0
  625. package/dist/plan-CCoqxNoU.mjs.map +1 -0
  626. package/dist/plugin-test-runtime.d.mts +16 -14
  627. package/dist/plugin-test-runtime.d.mts.map +1 -1
  628. package/dist/plugin-test-runtime.mjs +114 -115
  629. package/dist/plugin-tool-name-DDUgN_0p.mjs +27 -0
  630. package/dist/plugin-tool-name-DDUgN_0p.mjs.map +1 -0
  631. package/dist/plugin-types.d.mts +1 -1
  632. package/dist/plugin-utils.d.mts +12 -11
  633. package/dist/plugin-utils.d.mts.map +1 -1
  634. package/dist/plugins/adapt-sandbox-entry.d.mts +12 -11
  635. package/dist/plugins/adapt-sandbox-entry.d.mts.map +1 -1
  636. package/dist/plugins/adapt-sandbox-entry.mjs +4 -4
  637. package/dist/plugins/host.d.mts +5 -5
  638. package/dist/plugins/host.mjs +50 -51
  639. package/dist/plugins-COJ2L49n.mjs +261 -0
  640. package/dist/plugins-COJ2L49n.mjs.map +1 -0
  641. package/dist/policy-BPugqmeV.mjs +53 -0
  642. package/dist/policy-BPugqmeV.mjs.map +1 -0
  643. package/dist/portable-text-BH4zgkSm.mjs +311 -0
  644. package/dist/portable-text-BH4zgkSm.mjs.map +1 -0
  645. package/dist/preview-DLexxwp3.mjs +107 -0
  646. package/dist/preview-DLexxwp3.mjs.map +1 -0
  647. package/dist/protocol-PoAfD_9W.d.mts +65 -0
  648. package/dist/protocol-PoAfD_9W.d.mts.map +1 -0
  649. package/dist/public-plugin-api-routes-CMljrTby.mjs +316 -0
  650. package/dist/public-plugin-api-routes-CMljrTby.mjs.map +1 -0
  651. package/dist/public-submission-ayqoyee4.mjs +251 -0
  652. package/dist/public-submission-ayqoyee4.mjs.map +1 -0
  653. package/dist/public-url-Bt98vysr.mjs +101 -0
  654. package/dist/public-url-Bt98vysr.mjs.map +1 -0
  655. package/dist/query-D62NntCZ.mjs +1146 -0
  656. package/dist/query-D62NntCZ.mjs.map +1 -0
  657. package/dist/query-LmPY2y0C.mjs +41 -0
  658. package/dist/query-LmPY2y0C.mjs.map +1 -0
  659. package/dist/range-CYfeXgGK.mjs +51 -0
  660. package/dist/range-CYfeXgGK.mjs.map +1 -0
  661. package/dist/rate-limit-C04Llsoc.mjs +127 -0
  662. package/dist/rate-limit-C04Llsoc.mjs.map +1 -0
  663. package/dist/receipt-BUsQCOeM.mjs +43 -0
  664. package/dist/receipt-BUsQCOeM.mjs.map +1 -0
  665. package/dist/redirect-CQAV7mCo.mjs +19 -0
  666. package/dist/redirect-CQAV7mCo.mjs.map +1 -0
  667. package/dist/redirect-DjLdw427.mjs +423 -0
  668. package/dist/redirect-DjLdw427.mjs.map +1 -0
  669. package/dist/redirect-paths-DOaVBp6E.mjs +36 -0
  670. package/dist/redirect-paths-DOaVBp6E.mjs.map +1 -0
  671. package/dist/redirects-Cpq1catN.mjs +446 -0
  672. package/dist/redirects-Cpq1catN.mjs.map +1 -0
  673. package/dist/redirects-CyvvZrCJ.mjs +148 -0
  674. package/dist/redirects-CyvvZrCJ.mjs.map +1 -0
  675. package/dist/registry/testing.mjs +3 -3
  676. package/dist/registry-B0-O575m.mjs +8374 -0
  677. package/dist/registry-B0-O575m.mjs.map +1 -0
  678. package/dist/relations-WIOojTL4.mjs +789 -0
  679. package/dist/relations-WIOojTL4.mjs.map +1 -0
  680. package/dist/request-context.d.mts +2 -2
  681. package/dist/request-meta-bwZ_NsvU.mjs +141 -0
  682. package/dist/request-meta-bwZ_NsvU.mjs.map +1 -0
  683. package/dist/resolve-BNnm8EkB.mjs +102 -0
  684. package/dist/resolve-BNnm8EkB.mjs.map +1 -0
  685. package/dist/route-cache-QSOyDEw0.mjs +20 -0
  686. package/dist/route-cache-QSOyDEw0.mjs.map +1 -0
  687. package/dist/route-wire-Ca_HWCZ5.mjs +197 -0
  688. package/dist/route-wire-Ca_HWCZ5.mjs.map +1 -0
  689. package/dist/routes-avqgc-8r.mjs +272 -0
  690. package/dist/routes-avqgc-8r.mjs.map +1 -0
  691. package/dist/runner-Bkkfk4O8.mjs +6669 -0
  692. package/dist/runner-Bkkfk4O8.mjs.map +1 -0
  693. package/dist/runner-Dfgp6-S_.d.mts +73 -0
  694. package/dist/runner-Dfgp6-S_.d.mts.map +1 -0
  695. package/dist/runtime.d.mts +13 -12
  696. package/dist/runtime.d.mts.map +1 -1
  697. package/dist/runtime.mjs +4 -3
  698. package/dist/runtime.mjs.map +1 -1
  699. package/dist/schema/project-env-types.mjs +42 -43
  700. package/dist/schema/project-env-types.mjs.map +1 -1
  701. package/dist/schema-B-3rntlX.mjs +815 -0
  702. package/dist/schema-B-3rntlX.mjs.map +1 -0
  703. package/dist/schema-BqBlUZtb.mjs +13 -0
  704. package/dist/schema-BqBlUZtb.mjs.map +1 -0
  705. package/dist/scopes-DNaY7Ey0.mjs +34 -0
  706. package/dist/scopes-DNaY7Ey0.mjs.map +1 -0
  707. package/dist/search-BPWTnpnD.mjs +450 -0
  708. package/dist/search-BPWTnpnD.mjs.map +1 -0
  709. package/dist/secrets-Dswzrz3k.mjs +369 -0
  710. package/dist/secrets-Dswzrz3k.mjs.map +1 -0
  711. package/dist/sections-rSao6rBG.mjs +346 -0
  712. package/dist/sections-rSao6rBG.mjs.map +1 -0
  713. package/dist/seed/index.d.mts +2 -2
  714. package/dist/seed/index.mjs +40 -41
  715. package/dist/seo/index.d.mts +3 -3
  716. package/dist/seo/index.mjs +27 -27
  717. package/dist/seo-B_H_pqOd.mjs +133 -0
  718. package/dist/seo-B_H_pqOd.mjs.map +1 -0
  719. package/dist/seo-ClB-dw9w.mjs +188 -0
  720. package/dist/seo-ClB-dw9w.mjs.map +1 -0
  721. package/dist/service-DpiUQVpp.mjs +150 -0
  722. package/dist/service-DpiUQVpp.mjs.map +1 -0
  723. package/dist/session-user-DiE4JKPP.mjs +61 -0
  724. package/dist/session-user-DiE4JKPP.mjs.map +1 -0
  725. package/dist/settings--XlUdUaI.mjs +66 -0
  726. package/dist/settings--XlUdUaI.mjs.map +1 -0
  727. package/dist/settings-D932YP2-.mjs +519 -0
  728. package/dist/settings-D932YP2-.mjs.map +1 -0
  729. package/dist/settings-Dd1uivmQ.mjs +73 -0
  730. package/dist/settings-Dd1uivmQ.mjs.map +1 -0
  731. package/dist/setup-complete-qsJYWutC.mjs +65 -0
  732. package/dist/setup-complete-qsJYWutC.mjs.map +1 -0
  733. package/dist/setup-nonce-CBFgUFXw.mjs +25 -0
  734. package/dist/setup-nonce-CBFgUFXw.mjs.map +1 -0
  735. package/dist/site-domain-oRGS_JfA.mjs +131 -0
  736. package/dist/site-domain-oRGS_JfA.mjs.map +1 -0
  737. package/dist/site-settings-DRHfX7bq.mjs +50 -0
  738. package/dist/site-settings-DRHfX7bq.mjs.map +1 -0
  739. package/dist/site-url-MB685I5X.mjs +45 -0
  740. package/dist/site-url-MB685I5X.mjs.map +1 -0
  741. package/dist/sitemap-name-B8QP8wud.mjs +26 -0
  742. package/dist/sitemap-name-B8QP8wud.mjs.map +1 -0
  743. package/dist/slug-aVnUV4SL.mjs +16 -0
  744. package/dist/slug-aVnUV4SL.mjs.map +1 -0
  745. package/dist/snapshot-BjaXDZQ5.mjs +414 -0
  746. package/dist/snapshot-BjaXDZQ5.mjs.map +1 -0
  747. package/dist/ssrf-BcYjyM4M.mjs +406 -0
  748. package/dist/ssrf-BcYjyM4M.mjs.map +1 -0
  749. package/dist/stage-CZQnXM_G.mjs +662 -0
  750. package/dist/stage-CZQnXM_G.mjs.map +1 -0
  751. package/dist/staged-ByBmPFtX.mjs +686 -0
  752. package/dist/staged-ByBmPFtX.mjs.map +1 -0
  753. package/dist/state-CFbGZziM.mjs +178 -0
  754. package/dist/state-CFbGZziM.mjs.map +1 -0
  755. package/dist/status-BFNdxzKc.mjs +30 -0
  756. package/dist/status-BFNdxzKc.mjs.map +1 -0
  757. package/dist/storage/local.d.mts +1 -1
  758. package/dist/storage/local.mjs +2 -2
  759. package/dist/storage/s3.d.mts +1 -1
  760. package/dist/storage/s3.mjs +1 -1
  761. package/dist/storage-query-BFp06Y0s.d.mts +1627 -0
  762. package/dist/storage-query-BFp06Y0s.d.mts.map +1 -0
  763. package/dist/tar-DFjExb9X.mjs +449 -0
  764. package/dist/tar-DFjExb9X.mjs.map +1 -0
  765. package/dist/target-CWZs2-o6.mjs +27 -0
  766. package/dist/target-CWZs2-o6.mjs.map +1 -0
  767. package/dist/taxonomies-5SR76j11.mjs +937 -0
  768. package/dist/taxonomies-5SR76j11.mjs.map +1 -0
  769. package/dist/taxonomies-B__VmCKQ.mjs +703 -0
  770. package/dist/taxonomies-B__VmCKQ.mjs.map +1 -0
  771. package/dist/taxonomy-CMI5fczd.mjs +563 -0
  772. package/dist/taxonomy-CMI5fczd.mjs.map +1 -0
  773. package/dist/tokens-BnhSnGwJ.mjs +171 -0
  774. package/dist/tokens-BnhSnGwJ.mjs.map +1 -0
  775. package/dist/transfer-BbKfufJ4.mjs +166 -0
  776. package/dist/transfer-BbKfufJ4.mjs.map +1 -0
  777. package/dist/transfer-DTGblAj2.mjs +8910 -0
  778. package/dist/transfer-DTGblAj2.mjs.map +1 -0
  779. package/dist/transfer-download-D9LQEDX0.mjs +33 -0
  780. package/dist/transfer-download-D9LQEDX0.mjs.map +1 -0
  781. package/dist/transformations-Bx4lYY0Y.mjs +196 -0
  782. package/dist/transformations-Bx4lYY0Y.mjs.map +1 -0
  783. package/dist/transport-Dzpn5b3i.mjs +137 -0
  784. package/dist/transport-Dzpn5b3i.mjs.map +1 -0
  785. package/dist/trusted-proxy-BU3Nx9g1.mjs +51 -0
  786. package/dist/trusted-proxy-BU3Nx9g1.mjs.map +1 -0
  787. package/dist/turnstile-Cs2wfkJG.mjs +58 -0
  788. package/dist/turnstile-Cs2wfkJG.mjs.map +1 -0
  789. package/dist/types-BAsCk5KU.d.mts +87 -0
  790. package/dist/types-BAsCk5KU.d.mts.map +1 -0
  791. package/dist/types-BuvSwT9Y.d.mts +375 -0
  792. package/dist/types-BuvSwT9Y.d.mts.map +1 -0
  793. package/dist/types-C4KT3Md2.d.mts +293 -0
  794. package/dist/types-C4KT3Md2.d.mts.map +1 -0
  795. package/dist/types-CVXHwIBB.d.mts +125 -0
  796. package/dist/types-CVXHwIBB.d.mts.map +1 -0
  797. package/dist/types-C_asjp1J.mjs.map +1 -1
  798. package/dist/types-CgfFGfO5.mjs +16 -0
  799. package/dist/types-CgfFGfO5.mjs.map +1 -0
  800. package/dist/types-Cj0_yZkn.mjs +18 -0
  801. package/dist/types-Cj0_yZkn.mjs.map +1 -0
  802. package/dist/types-CjftrmZR.d.mts +1741 -0
  803. package/dist/types-CjftrmZR.d.mts.map +1 -0
  804. package/dist/types-DKwRUA-x.d.mts +916 -0
  805. package/dist/types-DKwRUA-x.d.mts.map +1 -0
  806. package/dist/types-DwhEvIVb.mjs.map +1 -1
  807. package/dist/types-GwAyS5SH.d.mts +227 -0
  808. package/dist/types-GwAyS5SH.d.mts.map +1 -0
  809. package/dist/types-qHVygneX.mjs +77 -0
  810. package/dist/types-qHVygneX.mjs.map +1 -0
  811. package/dist/types-sUHaH7lC.mjs +37 -0
  812. package/dist/types-sUHaH7lC.mjs.map +1 -0
  813. package/dist/types-uU2YNYSt.d.mts +209 -0
  814. package/dist/types-uU2YNYSt.d.mts.map +1 -0
  815. package/dist/update-check-ABBJgg6M.mjs +161 -0
  816. package/dist/update-check-ABBJgg6M.mjs.map +1 -0
  817. package/dist/upload-attempts-DPFC4COv.mjs +32 -0
  818. package/dist/upload-attempts-DPFC4COv.mjs.map +1 -0
  819. package/dist/url-pattern-QATUE_rv.mjs +41 -0
  820. package/dist/url-pattern-QATUE_rv.mjs.map +1 -0
  821. package/dist/user-By8SzQxS.mjs +171 -0
  822. package/dist/user-By8SzQxS.mjs.map +1 -0
  823. package/dist/utils-D5uOi6WS.mjs +450 -0
  824. package/dist/utils-D5uOi6WS.mjs.map +1 -0
  825. package/dist/utils-Szp4iBQB.d.mts +376 -0
  826. package/dist/utils-Szp4iBQB.d.mts.map +1 -0
  827. package/dist/validate-DDvxy6qG.d.mts +468 -0
  828. package/dist/validate-DDvxy6qG.d.mts.map +1 -0
  829. package/dist/validate-Dz-TIOFB.mjs +524 -0
  830. package/dist/validate-Dz-TIOFB.mjs.map +1 -0
  831. package/dist/validation-Fc9ZSUS_.mjs +221 -0
  832. package/dist/validation-Fc9ZSUS_.mjs.map +1 -0
  833. package/dist/version-BZj18Q7G.mjs +9 -0
  834. package/dist/version-BZj18Q7G.mjs.map +1 -0
  835. package/dist/version-Bu6Nlbb5.mjs +7 -0
  836. package/dist/version-Bu6Nlbb5.mjs.map +1 -0
  837. package/dist/version-DqB7LIO7.mjs +49 -0
  838. package/dist/version-DqB7LIO7.mjs.map +1 -0
  839. package/dist/video-DytCnw3L.mjs +54 -0
  840. package/dist/video-DytCnw3L.mjs.map +1 -0
  841. package/dist/virtual-modules-DO954n7P.mjs +515 -0
  842. package/dist/virtual-modules-DO954n7P.mjs.map +1 -0
  843. package/dist/widgets-BUx_Mf2q.mjs +134 -0
  844. package/dist/widgets-BUx_Mf2q.mjs.map +1 -0
  845. package/dist/wxr-taxonomies-DbJtWrWM.mjs +454 -0
  846. package/dist/wxr-taxonomies-DbJtWrWM.mjs.map +1 -0
  847. package/dist/zod-generator--nlM0930.mjs +425 -0
  848. package/dist/zod-generator--nlM0930.mjs.map +1 -0
  849. package/package.json +5 -5
  850. package/src/api/handlers/content.ts +49 -18
  851. package/src/api/handlers/device-flow.ts +1 -3
  852. package/src/api/handlers/menus.ts +3 -3
  853. package/src/api/handlers/oauth-authorization.ts +1 -3
  854. package/src/astro/integration/admin-nav.ts +52 -0
  855. package/src/astro/integration/index.ts +7 -0
  856. package/src/astro/integration/runtime.ts +14 -0
  857. package/src/astro/integration/shims/use-sync-external-store-with-selector.js +2 -0
  858. package/src/astro/integration/shims/use-sync-external-store.js +4 -1
  859. package/src/astro/middleware/auth.ts +9 -2
  860. package/src/astro/routes/api/import/wordpress/analyze.ts +5 -29
  861. package/src/astro/routes/api/import/wordpress-plugin/execute.ts +3 -3
  862. package/src/astro/routes/api/media/file/[...key].ts +18 -4
  863. package/src/astro/routes/api/oauth/token.ts +5 -1
  864. package/src/astro/routes/api/widget-areas/[name]/reorder.ts +7 -1
  865. package/src/astro/routes/api/widget-areas/[name]/widgets/[id].ts +3 -1
  866. package/src/astro/routes/api/widget-areas/[name]/widgets.ts +2 -1
  867. package/src/astro/routes/api/widget-areas/[name].ts +2 -1
  868. package/src/astro/routes/api/widget-areas/index.ts +2 -1
  869. package/src/astro/types.ts +4 -3
  870. package/src/auth/api-tokens.ts +3 -0
  871. package/src/cleanup.ts +44 -0
  872. package/src/components/inline-bubble-menu.tsx +109 -95
  873. package/src/components/inline-image.tsx +54 -48
  874. package/src/database/dialect-helpers.ts +10 -3
  875. package/src/database/repositories/byline.ts +22 -14
  876. package/src/database/repositories/content.ts +17 -4
  877. package/src/database/repositories/media.ts +17 -0
  878. package/src/database/repositories/menu.ts +163 -132
  879. package/src/database/repositories/types.ts +3 -3
  880. package/src/database/types.ts +1 -1
  881. package/src/emdash-runtime.ts +23 -7
  882. package/src/import/utils.ts +15 -2
  883. package/src/index.ts +1 -0
  884. package/src/loader.ts +106 -95
  885. package/src/media/content-disposition.ts +56 -0
  886. package/src/media/normalize.ts +2 -0
  887. package/src/media/usage/content-fields.ts +2 -1
  888. package/src/menus/index.ts +137 -25
  889. package/src/object-cache/index.ts +22 -0
  890. package/src/plugin-test-runtime.ts +1 -0
  891. package/src/query.ts +44 -40
  892. package/src/schema/types.ts +7 -6
  893. package/src/search/fts-manager.ts +5 -3
  894. package/src/seed/apply.ts +52 -44
  895. package/src/seed/types.ts +3 -3
  896. package/src/taxonomies/index.ts +22 -51
  897. package/src/transfer/import/advance.ts +12 -1
  898. package/src/transfer/import/scaffold.ts +7 -1
  899. package/src/transfer/import/stages.ts +53 -2
  900. package/src/utils/revalidating-cache.ts +85 -0
  901. package/src/visual-editing/toolbar.ts +7 -2
  902. package/src/widgets/index.ts +27 -13
  903. package/dist/action-token-B1ds4laA.mjs +0 -26
  904. package/dist/action-token-B1ds4laA.mjs.map +0 -1
  905. package/dist/activation-sGF9br3X.mjs +0 -387
  906. package/dist/activation-sGF9br3X.mjs.map +0 -1
  907. package/dist/adapters-BOMSX9PU.d.mts +0 -173
  908. package/dist/adapters-BOMSX9PU.d.mts.map +0 -1
  909. package/dist/after-PcEvMY_6.mjs +0 -96
  910. package/dist/after-PcEvMY_6.mjs.map +0 -1
  911. package/dist/allowed-origins-CovsTkm3.mjs +0 -116
  912. package/dist/allowed-origins-CovsTkm3.mjs.map +0 -1
  913. package/dist/api-C_LxFnOm.mjs +0 -5077
  914. package/dist/api-C_LxFnOm.mjs.map +0 -1
  915. package/dist/api-tokens-C7l0GUAF.mjs +0 -3
  916. package/dist/api-tokens-DQ9Ee-vP.mjs +0 -173
  917. package/dist/api-tokens-DQ9Ee-vP.mjs.map +0 -1
  918. package/dist/apply-CLjfxvyH.mjs +0 -1758
  919. package/dist/apply-CLjfxvyH.mjs.map +0 -1
  920. package/dist/approvals-ocK89i4H.mjs +0 -460
  921. package/dist/approvals-ocK89i4H.mjs.map +0 -1
  922. package/dist/artifact-fetch-CgvvpoWQ.mjs +0 -659
  923. package/dist/artifact-fetch-CgvvpoWQ.mjs.map +0 -1
  924. package/dist/artifacts-DwOYYBQm.mjs +0 -323
  925. package/dist/artifacts-DwOYYBQm.mjs.map +0 -1
  926. package/dist/authoritative-records-LPtrIGOY.mjs +0 -5183
  927. package/dist/authoritative-records-LPtrIGOY.mjs.map +0 -1
  928. package/dist/authorize-CoDsRRp5.mjs +0 -74
  929. package/dist/authorize-CoDsRRp5.mjs.map +0 -1
  930. package/dist/backup-2Wj-hTCN.mjs +0 -246
  931. package/dist/backup-2Wj-hTCN.mjs.map +0 -1
  932. package/dist/block-types-C3gJEe7l.mjs +0 -132
  933. package/dist/block-types-C3gJEe7l.mjs.map +0 -1
  934. package/dist/block-values-CgbMtSGU.mjs +0 -215
  935. package/dist/block-values-CgbMtSGU.mjs.map +0 -1
  936. package/dist/byline-CzGZC2Zs.mjs +0 -922
  937. package/dist/byline-CzGZC2Zs.mjs.map +0 -1
  938. package/dist/byline-fields-B1qHvRps.mjs +0 -280
  939. package/dist/byline-fields-B1qHvRps.mjs.map +0 -1
  940. package/dist/byline-fields-vYd_4Q1e.mjs +0 -123
  941. package/dist/byline-fields-vYd_4Q1e.mjs.map +0 -1
  942. package/dist/bylines-BF555iIz.mjs +0 -150
  943. package/dist/bylines-BF555iIz.mjs.map +0 -1
  944. package/dist/bylines-DJx6IWWi.mjs +0 -234
  945. package/dist/bylines-DJx6IWWi.mjs.map +0 -1
  946. package/dist/cache-BWzswWB-.mjs +0 -151
  947. package/dist/cache-BWzswWB-.mjs.map +0 -1
  948. package/dist/canonical-DjF_z6GI.mjs +0 -174
  949. package/dist/canonical-DjF_z6GI.mjs.map +0 -1
  950. package/dist/capture-triggers-D7g3fOZj.mjs +0 -362
  951. package/dist/capture-triggers-D7g3fOZj.mjs.map +0 -1
  952. package/dist/challenge-store-Cfjdvw86.mjs +0 -51
  953. package/dist/challenge-store-Cfjdvw86.mjs.map +0 -1
  954. package/dist/checksum-BF4acJwn.mjs +0 -162
  955. package/dist/checksum-BF4acJwn.mjs.map +0 -1
  956. package/dist/chrome-tags-BDs29G3g.mjs +0 -24
  957. package/dist/chrome-tags-BDs29G3g.mjs.map +0 -1
  958. package/dist/chunks-CYBOL-zn.mjs +0 -25
  959. package/dist/chunks-CYBOL-zn.mjs.map +0 -1
  960. package/dist/collection-slugs-cache-B2J5aESO.mjs +0 -91
  961. package/dist/collection-slugs-cache-B2J5aESO.mjs.map +0 -1
  962. package/dist/comment-DV7dybcs.mjs +0 -335
  963. package/dist/comment-DV7dybcs.mjs.map +0 -1
  964. package/dist/comment-reaction-CWwqiT6x.mjs +0 -85
  965. package/dist/comment-reaction-CWwqiT6x.mjs.map +0 -1
  966. package/dist/comments-DVjWJm8X.mjs +0 -99
  967. package/dist/comments-DVjWJm8X.mjs.map +0 -1
  968. package/dist/comments-Q-ILHCEI.mjs +0 -195
  969. package/dist/comments-Q-ILHCEI.mjs.map +0 -1
  970. package/dist/components-DnOmvvgg.mjs +0 -112
  971. package/dist/components-DnOmvvgg.mjs.map +0 -1
  972. package/dist/config-9IzA83_U.d.mts +0 -6811
  973. package/dist/config-9IzA83_U.d.mts.map +0 -1
  974. package/dist/config-BdQzFtmR.mjs +0 -228
  975. package/dist/config-BdQzFtmR.mjs.map +0 -1
  976. package/dist/config-Cs2RBkJ6.d.mts +0 -41
  977. package/dist/config-Cs2RBkJ6.d.mts.map +0 -1
  978. package/dist/connection-CiXgZyCY.mjs +0 -36
  979. package/dist/connection-CiXgZyCY.mjs.map +0 -1
  980. package/dist/content-Dt0Os_WQ.mjs +0 -2109
  981. package/dist/content-Dt0Os_WQ.mjs.map +0 -1
  982. package/dist/content-list-query-BK26u9Ly.d.mts +0 -26
  983. package/dist/content-list-query-BK26u9Ly.d.mts.map +0 -1
  984. package/dist/content-policy-BLDbNJOb.mjs +0 -46
  985. package/dist/content-policy-BLDbNJOb.mjs.map +0 -1
  986. package/dist/content-repair-CjwbLy4m.mjs +0 -442
  987. package/dist/content-repair-CjwbLy4m.mjs.map +0 -1
  988. package/dist/context-ErV7UdQY.mjs +0 -2089
  989. package/dist/context-ErV7UdQY.mjs.map +0 -1
  990. package/dist/credits-BRyjafiF.mjs +0 -110
  991. package/dist/credits-BRyjafiF.mjs.map +0 -1
  992. package/dist/cron-Bm5xa7tv.mjs +0 -306
  993. package/dist/cron-Bm5xa7tv.mjs.map +0 -1
  994. package/dist/dashboard-DVxQ5XiI.mjs +0 -168
  995. package/dist/dashboard-DVxQ5XiI.mjs.map +0 -1
  996. package/dist/default-B9Tf2n94.mjs +0 -81
  997. package/dist/default-B9Tf2n94.mjs.map +0 -1
  998. package/dist/deferred-tasks-CpPEqsga.d.mts +0 -9
  999. package/dist/deferred-tasks-CpPEqsga.d.mts.map +0 -1
  1000. package/dist/dev-typegen-ZeWYV8Jp.mjs +0 -29
  1001. package/dist/dev-typegen-ZeWYV8Jp.mjs.map +0 -1
  1002. package/dist/device-flow-BbYNZ9Xi.mjs +0 -521
  1003. package/dist/device-flow-BbYNZ9Xi.mjs.map +0 -1
  1004. package/dist/dialect-helpers-7_IqPdh9.mjs +0 -307
  1005. package/dist/dialect-helpers-7_IqPdh9.mjs.map +0 -1
  1006. package/dist/digest-DlBa7kJl.mjs +0 -194
  1007. package/dist/digest-DlBa7kJl.mjs.map +0 -1
  1008. package/dist/direct-executor-5T8gkhvA.mjs +0 -117
  1009. package/dist/direct-executor-5T8gkhvA.mjs.map +0 -1
  1010. package/dist/dist-DY0aOmAP.mjs +0 -810
  1011. package/dist/dist-DY0aOmAP.mjs.map +0 -1
  1012. package/dist/email-console-v3OM8It-.mjs +0 -50
  1013. package/dist/email-console-v3OM8It-.mjs.map +0 -1
  1014. package/dist/email-locale-CoZo-oZx.mjs +0 -25
  1015. package/dist/email-locale-CoZo-oZx.mjs.map +0 -1
  1016. package/dist/emdash-runtime-DwezbIqQ.mjs +0 -4392
  1017. package/dist/emdash-runtime-DwezbIqQ.mjs.map +0 -1
  1018. package/dist/enrich-C3XIJi0O.mjs +0 -194
  1019. package/dist/enrich-C3XIJi0O.mjs.map +0 -1
  1020. package/dist/entry-lock-CY7XpdSw.d.mts +0 -4568
  1021. package/dist/entry-lock-CY7XpdSw.d.mts.map +0 -1
  1022. package/dist/entry-lock-DDuWaAiP.mjs +0 -1211
  1023. package/dist/entry-lock-DDuWaAiP.mjs.map +0 -1
  1024. package/dist/entry-lock-D_Og9Gy3.mjs +0 -163
  1025. package/dist/entry-lock-D_Og9Gy3.mjs.map +0 -1
  1026. package/dist/entry-locks-Cp8_BcQQ.mjs +0 -167
  1027. package/dist/entry-locks-Cp8_BcQQ.mjs.map +0 -1
  1028. package/dist/env-types-Br8uywYA.mjs +0 -38
  1029. package/dist/env-types-Br8uywYA.mjs.map +0 -1
  1030. package/dist/error-CT2SsX5S.mjs +0 -90
  1031. package/dist/error-CT2SsX5S.mjs.map +0 -1
  1032. package/dist/errors-BMaCpLeS.mjs +0 -479
  1033. package/dist/errors-BMaCpLeS.mjs.map +0 -1
  1034. package/dist/errors-DlJwot7q.mjs +0 -120
  1035. package/dist/errors-DlJwot7q.mjs.map +0 -1
  1036. package/dist/escape-BfbDyuQ-.mjs +0 -9
  1037. package/dist/escape-BfbDyuQ-.mjs.map +0 -1
  1038. package/dist/fence-BOD3SxZG.mjs +0 -162
  1039. package/dist/fence-BOD3SxZG.mjs.map +0 -1
  1040. package/dist/field-defs-cache-C7sR7ZeU.mjs +0 -77
  1041. package/dist/field-defs-cache-C7sR7ZeU.mjs.map +0 -1
  1042. package/dist/field-map-C_rDXfdJ.mjs +0 -84
  1043. package/dist/field-map-C_rDXfdJ.mjs.map +0 -1
  1044. package/dist/fts-manager-BzFo0xx6.mjs +0 -483
  1045. package/dist/fts-manager-BzFo0xx6.mjs.map +0 -1
  1046. package/dist/gc-B_c3DPpi.mjs +0 -75
  1047. package/dist/gc-B_c3DPpi.mjs.map +0 -1
  1048. package/dist/hash-A-o2ZX8O.mjs +0 -37
  1049. package/dist/hash-A-o2ZX8O.mjs.map +0 -1
  1050. package/dist/hreflang-BpUK9Lcu.mjs +0 -105
  1051. package/dist/hreflang-BpUK9Lcu.mjs.map +0 -1
  1052. package/dist/hreflang-D07R-RbI.d.mts +0 -50
  1053. package/dist/hreflang-D07R-RbI.d.mts.map +0 -1
  1054. package/dist/http-route-dispatch-C2Ep2Uf6.mjs +0 -342
  1055. package/dist/http-route-dispatch-C2Ep2Uf6.mjs.map +0 -1
  1056. package/dist/identity-BivQ8wkV.mjs +0 -35
  1057. package/dist/identity-BivQ8wkV.mjs.map +0 -1
  1058. package/dist/import-B4UvHNJz.mjs +0 -2126
  1059. package/dist/import-B4UvHNJz.mjs.map +0 -1
  1060. package/dist/index-C37Ty40w.d.mts +0 -623
  1061. package/dist/index-C37Ty40w.d.mts.map +0 -1
  1062. package/dist/install-finalization-BbYaB4wj.mjs +0 -58
  1063. package/dist/install-finalization-BbYaB4wj.mjs.map +0 -1
  1064. package/dist/json-recordset-BjYIWFkV.mjs +0 -12
  1065. package/dist/json-recordset-BjYIWFkV.mjs.map +0 -1
  1066. package/dist/json-schema-Cde7le0s.mjs +0 -15
  1067. package/dist/json-schema-Cde7le0s.mjs.map +0 -1
  1068. package/dist/keys-CusTXpw-.mjs +0 -61
  1069. package/dist/keys-CusTXpw-.mjs.map +0 -1
  1070. package/dist/kinds-DogmNB6n.mjs +0 -974
  1071. package/dist/kinds-DogmNB6n.mjs.map +0 -1
  1072. package/dist/lifecycle-BLCoCz4T.mjs +0 -25
  1073. package/dist/lifecycle-BLCoCz4T.mjs.map +0 -1
  1074. package/dist/load-Dds3KhXr.mjs +0 -28
  1075. package/dist/load-Dds3KhXr.mjs.map +0 -1
  1076. package/dist/loader-D4w4XE7q.mjs +0 -1420
  1077. package/dist/loader-D4w4XE7q.mjs.map +0 -1
  1078. package/dist/loops-IYgzQdQu.mjs +0 -205
  1079. package/dist/loops-IYgzQdQu.mjs.map +0 -1
  1080. package/dist/manifest-builder-CGF5kujD.mjs +0 -196
  1081. package/dist/manifest-builder-CGF5kujD.mjs.map +0 -1
  1082. package/dist/manifest-schema-B0BxPSjB.mjs +0 -497
  1083. package/dist/manifest-schema-B0BxPSjB.mjs.map +0 -1
  1084. package/dist/marketplace-DNvEGLqU.mjs +0 -257
  1085. package/dist/marketplace-DNvEGLqU.mjs.map +0 -1
  1086. package/dist/media-BL9MRrSG.mjs +0 -294
  1087. package/dist/media-BL9MRrSG.mjs.map +0 -1
  1088. package/dist/media-B_x5B9EA.mjs +0 -373
  1089. package/dist/media-B_x5B9EA.mjs.map +0 -1
  1090. package/dist/media-allowlist-CpmqBbIQ.mjs +0 -45
  1091. package/dist/media-allowlist-CpmqBbIQ.mjs.map +0 -1
  1092. package/dist/media-folders-CNs_A_B-.mjs +0 -210
  1093. package/dist/media-folders-CNs_A_B-.mjs.map +0 -1
  1094. package/dist/media-qTTHVkls.mjs +0 -416
  1095. package/dist/media-qTTHVkls.mjs.map +0 -1
  1096. package/dist/media-url-GJboA1fl.mjs +0 -43
  1097. package/dist/media-url-GJboA1fl.mjs.map +0 -1
  1098. package/dist/media-usage-ClWgrX0d.mjs +0 -282
  1099. package/dist/media-usage-ClWgrX0d.mjs.map +0 -1
  1100. package/dist/media-usage-activation-B8Fjtq0h.mjs +0 -78
  1101. package/dist/media-usage-activation-B8Fjtq0h.mjs.map +0 -1
  1102. package/dist/media-usage-work-L8-Au4j-.mjs +0 -1036
  1103. package/dist/media-usage-work-L8-Au4j-.mjs.map +0 -1
  1104. package/dist/media-usage-work-LXgze5j9.mjs +0 -151
  1105. package/dist/media-usage-work-LXgze5j9.mjs.map +0 -1
  1106. package/dist/menus-BAxcbsbv.mjs +0 -818
  1107. package/dist/menus-BAxcbsbv.mjs.map +0 -1
  1108. package/dist/menus-BI6oBXco.mjs +0 -92
  1109. package/dist/menus-BI6oBXco.mjs.map +0 -1
  1110. package/dist/menus-fvGFd4m6.mjs +0 -3725
  1111. package/dist/menus-fvGFd4m6.mjs.map +0 -1
  1112. package/dist/mime-DwhtRyUt.mjs +0 -81
  1113. package/dist/mime-DwhtRyUt.mjs.map +0 -1
  1114. package/dist/mode-DIDSUwuN.mjs +0 -23
  1115. package/dist/mode-DIDSUwuN.mjs.map +0 -1
  1116. package/dist/node-sqlite-compat-Ddr_mlR9.mjs +0 -63
  1117. package/dist/node-sqlite-compat-Ddr_mlR9.mjs.map +0 -1
  1118. package/dist/normalize-Ip_hFAm8.mjs +0 -216
  1119. package/dist/normalize-Ip_hFAm8.mjs.map +0 -1
  1120. package/dist/oauth-authorization-CcMgeT8R.mjs +0 -274
  1121. package/dist/oauth-authorization-CcMgeT8R.mjs.map +0 -1
  1122. package/dist/oauth-clients-C_osi0PU.mjs +0 -266
  1123. package/dist/oauth-clients-C_osi0PU.mjs.map +0 -1
  1124. package/dist/oauth-state-store-DGLP-6CK.mjs +0 -50
  1125. package/dist/oauth-state-store-DGLP-6CK.mjs.map +0 -1
  1126. package/dist/oauth-user-lookup-z77Ee0Hm.mjs +0 -26
  1127. package/dist/oauth-user-lookup-z77Ee0Hm.mjs.map +0 -1
  1128. package/dist/object-cache-EjasjtoQ.mjs +0 -586
  1129. package/dist/object-cache-EjasjtoQ.mjs.map +0 -1
  1130. package/dist/options-CmUpkyKW.d.mts +0 -81
  1131. package/dist/options-CmUpkyKW.d.mts.map +0 -1
  1132. package/dist/ownership-DCk5NutQ.mjs +0 -12
  1133. package/dist/ownership-DCk5NutQ.mjs.map +0 -1
  1134. package/dist/parse-2W-E2f7w.mjs +0 -81
  1135. package/dist/parse-2W-E2f7w.mjs.map +0 -1
  1136. package/dist/parse-6pN8Xqg5.d.mts +0 -176
  1137. package/dist/parse-6pN8Xqg5.d.mts.map +0 -1
  1138. package/dist/passkey-config-DTTZB6EI.mjs +0 -46
  1139. package/dist/passkey-config-DTTZB6EI.mjs.map +0 -1
  1140. package/dist/paths-CQA62503.mjs +0 -77
  1141. package/dist/paths-CQA62503.mjs.map +0 -1
  1142. package/dist/placeholder-BlfXkucE.d.mts +0 -313
  1143. package/dist/placeholder-BlfXkucE.d.mts.map +0 -1
  1144. package/dist/plan-B95eiwnF.mjs +0 -135
  1145. package/dist/plan-B95eiwnF.mjs.map +0 -1
  1146. package/dist/plugin-tool-name-BDA7m4Xa.mjs +0 -27
  1147. package/dist/plugin-tool-name-BDA7m4Xa.mjs.map +0 -1
  1148. package/dist/plugins-BhxLJ008.mjs +0 -261
  1149. package/dist/plugins-BhxLJ008.mjs.map +0 -1
  1150. package/dist/policy-DOJ2sPqB.mjs +0 -53
  1151. package/dist/policy-DOJ2sPqB.mjs.map +0 -1
  1152. package/dist/portable-text-RCMpCj47.mjs +0 -311
  1153. package/dist/portable-text-RCMpCj47.mjs.map +0 -1
  1154. package/dist/preview-DFwL5APO.mjs +0 -107
  1155. package/dist/preview-DFwL5APO.mjs.map +0 -1
  1156. package/dist/protocol-B-ztxp_y.d.mts +0 -65
  1157. package/dist/protocol-B-ztxp_y.d.mts.map +0 -1
  1158. package/dist/public-plugin-api-routes-ik4fPZMv.mjs +0 -316
  1159. package/dist/public-plugin-api-routes-ik4fPZMv.mjs.map +0 -1
  1160. package/dist/public-submission-C5JZIykp.mjs +0 -251
  1161. package/dist/public-submission-C5JZIykp.mjs.map +0 -1
  1162. package/dist/public-url-CQwzRljH.mjs +0 -101
  1163. package/dist/public-url-CQwzRljH.mjs.map +0 -1
  1164. package/dist/query-DuwyFr5Z.mjs +0 -41
  1165. package/dist/query-DuwyFr5Z.mjs.map +0 -1
  1166. package/dist/query-eR_Nz70M.mjs +0 -1157
  1167. package/dist/query-eR_Nz70M.mjs.map +0 -1
  1168. package/dist/range-BQWPjWgQ.mjs +0 -51
  1169. package/dist/range-BQWPjWgQ.mjs.map +0 -1
  1170. package/dist/rate-limit-mPKeQ3sm.mjs +0 -127
  1171. package/dist/rate-limit-mPKeQ3sm.mjs.map +0 -1
  1172. package/dist/receipt-CmUpyuW5.mjs +0 -43
  1173. package/dist/receipt-CmUpyuW5.mjs.map +0 -1
  1174. package/dist/redirect-BtiMkehU.mjs +0 -19
  1175. package/dist/redirect-BtiMkehU.mjs.map +0 -1
  1176. package/dist/redirect-DcmNMvOs.mjs +0 -423
  1177. package/dist/redirect-DcmNMvOs.mjs.map +0 -1
  1178. package/dist/redirect-paths-K5i3xYfR.mjs +0 -36
  1179. package/dist/redirect-paths-K5i3xYfR.mjs.map +0 -1
  1180. package/dist/redirects-BA_TvtuH.mjs +0 -148
  1181. package/dist/redirects-BA_TvtuH.mjs.map +0 -1
  1182. package/dist/redirects-BIrRvgn4.mjs +0 -446
  1183. package/dist/redirects-BIrRvgn4.mjs.map +0 -1
  1184. package/dist/registry-DymfZkAN.mjs +0 -8374
  1185. package/dist/registry-DymfZkAN.mjs.map +0 -1
  1186. package/dist/relations-DrEs3Sc1.mjs +0 -789
  1187. package/dist/relations-DrEs3Sc1.mjs.map +0 -1
  1188. package/dist/request-meta-o8RIf9pa.mjs +0 -141
  1189. package/dist/request-meta-o8RIf9pa.mjs.map +0 -1
  1190. package/dist/resolve-CVy9xgy_.mjs +0 -102
  1191. package/dist/resolve-CVy9xgy_.mjs.map +0 -1
  1192. package/dist/route-cache-DAG5dPhh.mjs +0 -20
  1193. package/dist/route-cache-DAG5dPhh.mjs.map +0 -1
  1194. package/dist/route-wire-Xbsu8Vih.mjs +0 -197
  1195. package/dist/route-wire-Xbsu8Vih.mjs.map +0 -1
  1196. package/dist/routes-YQkSOsws.mjs +0 -272
  1197. package/dist/routes-YQkSOsws.mjs.map +0 -1
  1198. package/dist/runner-CLorw5vo.mjs +0 -6669
  1199. package/dist/runner-CLorw5vo.mjs.map +0 -1
  1200. package/dist/runner-g1A9P-wD.d.mts +0 -73
  1201. package/dist/runner-g1A9P-wD.d.mts.map +0 -1
  1202. package/dist/schema-Bss8qImF.mjs +0 -13
  1203. package/dist/schema-Bss8qImF.mjs.map +0 -1
  1204. package/dist/schema-C036pqEw.mjs +0 -815
  1205. package/dist/schema-C036pqEw.mjs.map +0 -1
  1206. package/dist/scopes-C_SoYl9x.mjs +0 -34
  1207. package/dist/scopes-C_SoYl9x.mjs.map +0 -1
  1208. package/dist/search-uNqCgePJ.mjs +0 -450
  1209. package/dist/search-uNqCgePJ.mjs.map +0 -1
  1210. package/dist/secrets-Cc_O3Kp-.mjs +0 -369
  1211. package/dist/secrets-Cc_O3Kp-.mjs.map +0 -1
  1212. package/dist/sections-BLusMa96.mjs +0 -346
  1213. package/dist/sections-BLusMa96.mjs.map +0 -1
  1214. package/dist/seo-BodxIpws.mjs +0 -188
  1215. package/dist/seo-BodxIpws.mjs.map +0 -1
  1216. package/dist/seo-DaMYIQY8.mjs +0 -133
  1217. package/dist/seo-DaMYIQY8.mjs.map +0 -1
  1218. package/dist/service-BuM1BRsA.mjs +0 -150
  1219. package/dist/service-BuM1BRsA.mjs.map +0 -1
  1220. package/dist/session-user-2DpQDMKw.mjs +0 -61
  1221. package/dist/session-user-2DpQDMKw.mjs.map +0 -1
  1222. package/dist/settings-B3ZmPF_8.mjs +0 -73
  1223. package/dist/settings-B3ZmPF_8.mjs.map +0 -1
  1224. package/dist/settings-P5hwPX6_.mjs +0 -66
  1225. package/dist/settings-P5hwPX6_.mjs.map +0 -1
  1226. package/dist/settings-yIqoN-Ok.mjs +0 -519
  1227. package/dist/settings-yIqoN-Ok.mjs.map +0 -1
  1228. package/dist/setup-complete-eu6MUQnt.mjs +0 -65
  1229. package/dist/setup-complete-eu6MUQnt.mjs.map +0 -1
  1230. package/dist/setup-nonce-CyPOapqY.mjs +0 -25
  1231. package/dist/setup-nonce-CyPOapqY.mjs.map +0 -1
  1232. package/dist/site-domain-8lEJl_0U.mjs +0 -131
  1233. package/dist/site-domain-8lEJl_0U.mjs.map +0 -1
  1234. package/dist/site-settings-uPkW0e6o.mjs +0 -50
  1235. package/dist/site-settings-uPkW0e6o.mjs.map +0 -1
  1236. package/dist/site-url-25SGVXwL.mjs +0 -45
  1237. package/dist/site-url-25SGVXwL.mjs.map +0 -1
  1238. package/dist/sitemap-name-DTK7CYnY.mjs +0 -26
  1239. package/dist/sitemap-name-DTK7CYnY.mjs.map +0 -1
  1240. package/dist/slug-BEDl2IJY.mjs +0 -16
  1241. package/dist/slug-BEDl2IJY.mjs.map +0 -1
  1242. package/dist/snapshot-CvkIBRLY.mjs +0 -414
  1243. package/dist/snapshot-CvkIBRLY.mjs.map +0 -1
  1244. package/dist/ssrf-mcCKMH6B.mjs +0 -406
  1245. package/dist/ssrf-mcCKMH6B.mjs.map +0 -1
  1246. package/dist/stage-BQfGzGOy.mjs +0 -662
  1247. package/dist/stage-BQfGzGOy.mjs.map +0 -1
  1248. package/dist/staged-B5vQGeSf.mjs +0 -686
  1249. package/dist/staged-B5vQGeSf.mjs.map +0 -1
  1250. package/dist/state-dO6t6OxV.mjs +0 -178
  1251. package/dist/state-dO6t6OxV.mjs.map +0 -1
  1252. package/dist/status-DSURZwKS.mjs +0 -30
  1253. package/dist/status-DSURZwKS.mjs.map +0 -1
  1254. package/dist/storage-query-Cy0SZ8iG.d.mts +0 -1619
  1255. package/dist/storage-query-Cy0SZ8iG.d.mts.map +0 -1
  1256. package/dist/tar-DWzcUZ_Q.mjs +0 -449
  1257. package/dist/tar-DWzcUZ_Q.mjs.map +0 -1
  1258. package/dist/target-C9htUbrT.mjs +0 -27
  1259. package/dist/target-C9htUbrT.mjs.map +0 -1
  1260. package/dist/taxonomies-By2aGvq2.mjs +0 -729
  1261. package/dist/taxonomies-By2aGvq2.mjs.map +0 -1
  1262. package/dist/taxonomies-CVRd_jz0.mjs +0 -937
  1263. package/dist/taxonomies-CVRd_jz0.mjs.map +0 -1
  1264. package/dist/taxonomy-BG_xu2Qf.mjs +0 -563
  1265. package/dist/taxonomy-BG_xu2Qf.mjs.map +0 -1
  1266. package/dist/tokens-U5vzgSrM.mjs +0 -171
  1267. package/dist/tokens-U5vzgSrM.mjs.map +0 -1
  1268. package/dist/transfer-DA0OSfaT.mjs +0 -8873
  1269. package/dist/transfer-DA0OSfaT.mjs.map +0 -1
  1270. package/dist/transfer-Pyf3d7ka.mjs +0 -166
  1271. package/dist/transfer-Pyf3d7ka.mjs.map +0 -1
  1272. package/dist/transfer-download-cX7SuWEy.mjs +0 -33
  1273. package/dist/transfer-download-cX7SuWEy.mjs.map +0 -1
  1274. package/dist/transformations-DczubD4j.mjs +0 -196
  1275. package/dist/transformations-DczubD4j.mjs.map +0 -1
  1276. package/dist/transport-DtIrjEFO.mjs +0 -137
  1277. package/dist/transport-DtIrjEFO.mjs.map +0 -1
  1278. package/dist/trusted-proxy-CDRd5Kmw.mjs +0 -51
  1279. package/dist/trusted-proxy-CDRd5Kmw.mjs.map +0 -1
  1280. package/dist/turnstile-Ct5YuFNY.mjs +0 -58
  1281. package/dist/turnstile-Ct5YuFNY.mjs.map +0 -1
  1282. package/dist/types-Bgujop4S.d.mts +0 -374
  1283. package/dist/types-Bgujop4S.d.mts.map +0 -1
  1284. package/dist/types-BirHUEXt.mjs +0 -18
  1285. package/dist/types-BirHUEXt.mjs.map +0 -1
  1286. package/dist/types-BqJgTL_y.d.mts +0 -293
  1287. package/dist/types-BqJgTL_y.d.mts.map +0 -1
  1288. package/dist/types-C-lrOt9T.d.mts +0 -87
  1289. package/dist/types-C-lrOt9T.d.mts.map +0 -1
  1290. package/dist/types-CCEHAhOv.d.mts +0 -916
  1291. package/dist/types-CCEHAhOv.d.mts.map +0 -1
  1292. package/dist/types-CLVwYRBr.d.mts +0 -227
  1293. package/dist/types-CLVwYRBr.d.mts.map +0 -1
  1294. package/dist/types-DVbTb4Hk.mjs +0 -77
  1295. package/dist/types-DVbTb4Hk.mjs.map +0 -1
  1296. package/dist/types-Ddku19Zw.d.mts +0 -209
  1297. package/dist/types-Ddku19Zw.d.mts.map +0 -1
  1298. package/dist/types-FIiGQ3PE.mjs +0 -16
  1299. package/dist/types-FIiGQ3PE.mjs.map +0 -1
  1300. package/dist/types-OauzCOY0.mjs +0 -37
  1301. package/dist/types-OauzCOY0.mjs.map +0 -1
  1302. package/dist/types-mQGTpP-4.d.mts +0 -1741
  1303. package/dist/types-mQGTpP-4.d.mts.map +0 -1
  1304. package/dist/types-nbjz3Mgm.d.mts +0 -125
  1305. package/dist/types-nbjz3Mgm.d.mts.map +0 -1
  1306. package/dist/update-check-hW32-0pf.mjs +0 -161
  1307. package/dist/update-check-hW32-0pf.mjs.map +0 -1
  1308. package/dist/upload-attempts-Bpik1TLF.mjs +0 -32
  1309. package/dist/upload-attempts-Bpik1TLF.mjs.map +0 -1
  1310. package/dist/url-pattern-CJeCyNij.mjs +0 -41
  1311. package/dist/url-pattern-CJeCyNij.mjs.map +0 -1
  1312. package/dist/user-nQInBZbE.mjs +0 -171
  1313. package/dist/user-nQInBZbE.mjs.map +0 -1
  1314. package/dist/utils-govudc_U.mjs +0 -442
  1315. package/dist/utils-govudc_U.mjs.map +0 -1
  1316. package/dist/validate-BxLvcDYh.mjs +0 -524
  1317. package/dist/validate-BxLvcDYh.mjs.map +0 -1
  1318. package/dist/validate-mnoVfASU.d.mts +0 -468
  1319. package/dist/validate-mnoVfASU.d.mts.map +0 -1
  1320. package/dist/validation-DQDEvh87.mjs +0 -221
  1321. package/dist/validation-DQDEvh87.mjs.map +0 -1
  1322. package/dist/version-BOFfLiVT.mjs +0 -49
  1323. package/dist/version-BOFfLiVT.mjs.map +0 -1
  1324. package/dist/version-Dcvx_C9g.mjs +0 -7
  1325. package/dist/version-Dcvx_C9g.mjs.map +0 -1
  1326. package/dist/version-DzTJ3gD7.mjs +0 -9
  1327. package/dist/version-DzTJ3gD7.mjs.map +0 -1
  1328. package/dist/video-BX7AI5nJ.mjs +0 -54
  1329. package/dist/video-BX7AI5nJ.mjs.map +0 -1
  1330. package/dist/virtual-modules-CU29aip9.mjs +0 -515
  1331. package/dist/virtual-modules-CU29aip9.mjs.map +0 -1
  1332. package/dist/widgets-HIeFmZxt.mjs +0 -121
  1333. package/dist/widgets-HIeFmZxt.mjs.map +0 -1
  1334. package/dist/wxr-taxonomies-DyOGhl8W.mjs +0 -454
  1335. package/dist/wxr-taxonomies-DyOGhl8W.mjs.map +0 -1
  1336. package/dist/zod-generator-VxCPVDpo.mjs +0 -425
  1337. package/dist/zod-generator-VxCPVDpo.mjs.map +0 -1
  1338. /package/dist/{ssrf-BBXcxG-f.mjs → ssrf-DM0E-D_8.mjs} +0 -0
@@ -0,0 +1,1760 @@
1
+ import { f as __exportAll } from "./runner-Bkkfk4O8.mjs";
2
+ import { c as executeAtomicBatchIfSupported, u as isPostgres } from "./dialect-helpers-B1XN2HGB.mjs";
3
+ import { l as resolveConfiguredLocale, o as getLocaleRank, r as getI18nConfig } from "./config-Cs_AwWXI.mjs";
4
+ import { t as OptionsRepository } from "./options-DhrI7eMv.mjs";
5
+ import { t as ContentRepository } from "./content-BKHUVsE5.mjs";
6
+ import { n as localeMatches, r as localeOrder } from "./query-BFHjCzSh.mjs";
7
+ import { f as invalidateMenuObjectCache, g as invalidateWidgetObjectCache, i as coalesceObjectCacheWrites } from "./object-cache-DmKr09La.mjs";
8
+ import { n as chunks, t as SQL_BATCH_SIZE } from "./chunks-DiW8VMwz.mjs";
9
+ import { t as RevisionRepository } from "./revision-Dx7Uth1X.mjs";
10
+ import { t as withTransaction } from "./transaction-CkoQ5wqQ.mjs";
11
+ import { t as MediaRepository } from "./media-DepNLhPq.mjs";
12
+ import { t as TaxonomyRepository } from "./taxonomy-CMI5fczd.mjs";
13
+ import { t as RedirectRepository } from "./redirect-DjLdw427.mjs";
14
+ import { t as BylineRepository } from "./byline-DHJS-GGb.mjs";
15
+ import { t as INTERNAL_MEDIA_PREFIX } from "./normalize-Cx-bNwhP.mjs";
16
+ import { t as imageSize } from "./dist-BUmWMTbN.mjs";
17
+ import { t as FTSManager } from "./fts-manager-6861qcwk.mjs";
18
+ import { b as saveTaxonomyStructure, v as findTaxonomyStructure } from "./loader-DhnedqY4.mjs";
19
+ import { R as BlockTypeRegistry, W as markContentMediaUsageCollectionStaleSafely, n as SchemaRegistry, t as SchemaError } from "./registry-B0-O575m.mjs";
20
+ import { n as computeContentHash } from "./hash-BJaeek87.mjs";
21
+ import { a as resolveBlockTypes, i as normalizeBlocksData } from "./block-values-Dg0-8PPS.mjs";
22
+ import { m as setReferenceSelection } from "./relations-WIOojTL4.mjs";
23
+ import { n as createFieldRelation, t as bindReferenceField } from "./schema-B-3rntlX.mjs";
24
+ import { c as invalidateSiteSettingsCache, d as setSiteSettings } from "./settings-D932YP2-.mjs";
25
+ import { a as ssrfSafeFetch, s as validateExternalUrl } from "./ssrf-BcYjyM4M.mjs";
26
+ import { n as validateSeed, t as findTaxonomyStructureSource } from "./validate-Dz-TIOFB.mjs";
27
+ import { ulid } from "ulidx";
28
+ import mime from "mime/lite";
29
+
30
+ //#region src/media/url.ts
31
+ /**
32
+ * Build the internal file route URL for a storage key, encoding each path
33
+ * segment so `?`, `#` and `%` stay inside the path. A key with an empty, `.` or
34
+ * `..` segment is encoded whole, because the URL parser would collapse those
35
+ * segments and move the request off the route. Mirrors the admin's
36
+ * `localMediaFileUrl`.
37
+ */
38
+ function localMediaFileUrl(key) {
39
+ const segments = key.split("/");
40
+ if (segments.some((segment) => segment === "" || segment === "." || segment === "..")) return `${INTERNAL_MEDIA_PREFIX}${encodeURIComponent(key)}`;
41
+ return `${INTERNAL_MEDIA_PREFIX}${segments.map(encodeURIComponent).join("/")}`;
42
+ }
43
+ /**
44
+ * Resolve the public URL for a locally stored media key. Returns an empty
45
+ * string when no key is given. When a storage adapter is supplied, defers to
46
+ * `storage.getPublicUrl()`; otherwise returns the internal proxy route.
47
+ */
48
+ function resolvePublicMediaUrl(storage, storageKey) {
49
+ if (!storageKey) return "";
50
+ if (storage) return storage.getPublicUrl(storageKey);
51
+ return `/_emdash/api/media/file/${storageKey}`;
52
+ }
53
+ /**
54
+ * Build the `getPublicMediaUrl` closure attached to `Astro.locals.emdash`.
55
+ * Shared by the anonymous fast path and the full-runtime path in middleware.
56
+ *
57
+ * @internal
58
+ */
59
+ function createPublicMediaUrlResolver(storage) {
60
+ return (key) => resolvePublicMediaUrl(storage, key);
61
+ }
62
+
63
+ //#endregion
64
+ //#region src/content/converters/gallery.ts
65
+ /**
66
+ * Shared sanitization for gallery block images and image media, used by both
67
+ * converters so the editor round-trip and the stored shape stay in lockstep.
68
+ */
69
+ /**
70
+ * Read an image's media reference, alt text, and dimensions. Accepts the
71
+ * reference shape (`_ref`, `url`) and the MediaValue that seeded `$media`
72
+ * stores instead (`id`, `src`, `meta.storageKey`, dimensions). The image's own
73
+ * `alt`, `width`, and `height` take precedence over the asset's.
74
+ */
75
+ function resolveImageMedia(image) {
76
+ const record = isRecord(image) ? image : {};
77
+ const asset = isRecord(record.asset) ? record.asset : {};
78
+ const storageKey = isRecord(asset.meta) ? nonEmptyString(asset.meta.storageKey) : void 0;
79
+ const url = nonEmptyString(asset.url) ?? nonEmptyString(asset.src) ?? (storageKey ? localMediaFileUrl(storageKey) : void 0);
80
+ const provider = nonEmptyString(asset.provider);
81
+ const alt = nonEmptyString(record.alt) ?? nonEmptyString(asset.alt);
82
+ const width = typeof record.width === "number" ? record.width : asset.width;
83
+ const height = typeof record.height === "number" ? record.height : asset.height;
84
+ const media = { asset: {
85
+ _type: "reference",
86
+ _ref: nonEmptyString(asset._ref) ?? nonEmptyString(asset.id) ?? "",
87
+ ...url ? { url } : {},
88
+ ...provider ? { provider } : {}
89
+ } };
90
+ if (alt) media.alt = alt;
91
+ if (typeof width === "number") media.width = width;
92
+ if (typeof height === "number") media.height = height;
93
+ return media;
94
+ }
95
+ /**
96
+ * Normalize an untrusted `images` value into well-formed gallery images.
97
+ * Non-object entries and entries without an asset object are dropped.
98
+ * Missing `_key`s are filled via `generateKey` when provided (PM → PT);
99
+ * left empty otherwise (PT → PM keeps whatever the block carried).
100
+ */
101
+ function sanitizeGalleryImages(value, generateKey) {
102
+ if (!Array.isArray(value)) return [];
103
+ const images = [];
104
+ for (const entry of value) {
105
+ if (!isRecord(entry)) continue;
106
+ const record = entry;
107
+ if (!isRecord(record.asset)) continue;
108
+ const { asset, alt, width, height } = resolveImageMedia(record);
109
+ const image = {
110
+ _type: "image",
111
+ _key: typeof record._key === "string" && record._key ? record._key : generateKey ? generateKey() : "",
112
+ asset
113
+ };
114
+ if (alt) image.alt = alt;
115
+ if (typeof record.caption === "string" && record.caption) image.caption = record.caption;
116
+ if (width !== void 0) image.width = width;
117
+ if (height !== void 0) image.height = height;
118
+ if (typeof record.focalX === "number") image.focalX = record.focalX;
119
+ if (typeof record.focalY === "number") image.focalY = record.focalY;
120
+ if (typeof record.blurhash === "string" && record.blurhash) image.blurhash = record.blurhash;
121
+ if (typeof record.dominantColor === "string" && record.dominantColor) image.dominantColor = record.dominantColor;
122
+ images.push(image);
123
+ }
124
+ return images;
125
+ }
126
+ function nonEmptyString(value) {
127
+ return typeof value === "string" && value ? value : void 0;
128
+ }
129
+ function isRecord(value) {
130
+ return typeof value === "object" && value !== null && !Array.isArray(value);
131
+ }
132
+
133
+ //#endregion
134
+ //#region src/seed/apply.ts
135
+ /**
136
+ * Seed engine - applies seed files to database
137
+ *
138
+ * This is the core implementation that bootstraps an EmDash site from a seed file.
139
+ * Apply order is critical for foreign keys and references.
140
+ */
141
+ var apply_exports = /* @__PURE__ */ __exportAll({
142
+ applySeed: () => applySeed,
143
+ applySeedWithinBudget: () => applySeedWithinBudget
144
+ });
145
+ const SEED_MENU_ITEM_INSERT_BATCH_SIZE = 6;
146
+ const SEED_WIDGET_INSERT_BATCH_SIZE = 10;
147
+ async function replaceSeedChildren(db, parentTable, parentIds, buildStatements) {
148
+ if (parentIds.length === 0) return;
149
+ if (await executeAtomicBatchIfSupported(db, buildStatements(db)) !== null) return;
150
+ await withTransaction(db, async (trx) => {
151
+ if (isPostgres(trx)) await trx.selectFrom(parentTable).select("id").where("id", "in", parentIds).orderBy("id").forUpdate().execute();
152
+ for (const statement of buildStatements(trx)) await statement.execute();
153
+ });
154
+ }
155
+ async function applySiteSettings(db, settings, onConflict, result) {
156
+ const entries = Object.entries(settings).filter(([, value]) => value !== void 0);
157
+ if (entries.length === 0) return;
158
+ if (onConflict === "update") {
159
+ await setSiteSettings(settings, db);
160
+ result.settings.applied += entries.length;
161
+ return;
162
+ }
163
+ const options = new OptionsRepository(db);
164
+ let applied = 0;
165
+ try {
166
+ for (const [key, value] of entries) {
167
+ const write = await options.compareAndSet(`site:${key}`, null, value);
168
+ if (!write.applied && onConflict === "error") throw new Error(`Conflict: site setting "site:${key}" already exists`);
169
+ if (write.applied) applied++;
170
+ }
171
+ } finally {
172
+ if (applied > 0) {
173
+ result.settings.applied += applied;
174
+ invalidateSiteSettingsCache();
175
+ }
176
+ }
177
+ }
178
+ /**
179
+ * Set a collection's `titleField`/`dateField`: a separate write run after the
180
+ * fields exist, so `updateCollection` can validate them. No-op when neither is set.
181
+ */
182
+ async function applyDisplayDateFields(registry, collection) {
183
+ if (collection.titleField === void 0 && collection.dateField === void 0) return;
184
+ await registry.updateCollection(collection.slug, {
185
+ titleField: collection.titleField,
186
+ dateField: collection.dateField
187
+ });
188
+ }
189
+ const FILE_EXTENSION_PATTERN = /\.([a-z0-9]+)(?:\?|$)/i;
190
+ const SEED_RELATION_NAME_MAX_ATTEMPTS = 5;
191
+ const SEED_RELATION_INSERT_BATCH_SIZE = 10;
192
+ /** Pattern to remove file extensions */
193
+ const EXTENSION_PATTERN = /\.[^.]+$/;
194
+ /** Pattern to remove query parameters */
195
+ const QUERY_PARAM_PATTERN = /\?.*$/;
196
+ /** Pattern to remove non-alphanumeric characters (except dash and underscore) */
197
+ const SANITIZE_PATTERN = /[^a-zA-Z0-9_-]/g;
198
+ /** Pattern to collapse multiple hyphens */
199
+ const MULTIPLE_HYPHENS_PATTERN = /-+/g;
200
+ /** The `category` and `tag` defs that migrations insert on every new database. */
201
+ const BUILT_IN_TAXONOMY_DEFS = new Map([["taxdef_category", {
202
+ label: "Categories",
203
+ label_singular: "Category",
204
+ hierarchical: 1,
205
+ collections: "[\"posts\"]"
206
+ }], ["taxdef_tag", {
207
+ label: "Tags",
208
+ label_singular: "Tag",
209
+ hierarchical: 0,
210
+ collections: "[\"posts\"]"
211
+ }]]);
212
+ /** Whether `def` is a built-in `category`/`tag` definition still holding its migration defaults. */
213
+ function isUntouchedBuiltInTaxonomyDef(def) {
214
+ const builtIn = BUILT_IN_TAXONOMY_DEFS.get(def.id);
215
+ return builtIn !== void 0 && def.label === builtIn.label && def.label_singular === builtIn.label_singular && def.hierarchical === builtIn.hierarchical && def.collections === builtIn.collections;
216
+ }
217
+ /**
218
+ * Apply a seed file to the database
219
+ *
220
+ * This function is idempotent - safe to run multiple times.
221
+ *
222
+ * @param db - Kysely database instance
223
+ * @param seed - Seed file to apply
224
+ * @param options - Application options
225
+ * @returns Result summary
226
+ */
227
+ async function applySeed(db, seed, options = {}) {
228
+ const { result } = await coalesceObjectCacheWrites(() => applySeedWrites(db, seed, options, null));
229
+ return result;
230
+ }
231
+ /**
232
+ * Apply a seed over several calls, for a platform that caps the queries or
233
+ * fetches of one request.
234
+ *
235
+ * The limits are thresholds, checked before each taxonomy term, byline and
236
+ * content entry is created and before the phases that follow content. Schema,
237
+ * taxonomy definitions and settings are applied in every call, the item that
238
+ * crosses a threshold finishes, and the phases after content (menus,
239
+ * redirects, widgets, sections) run in one call, so set the limits well below
240
+ * the platform's. A call that stops returns `complete: false`; applying the
241
+ * same seed again continues with the first item not yet created. A call
242
+ * creates at least one item before it stops, so repeated calls finish. A
243
+ * `$media` URL used by entries in different calls is still downloaded each time
244
+ * so its content hash can be computed, but the resulting media row is reused
245
+ * when an existing ready row has the same hash. Requires
246
+ * `onConflict: "skip"`.
247
+ */
248
+ async function applySeedWithinBudget(db, seed, options, limits) {
249
+ const budget = new SeedBudget(limits);
250
+ return coalesceObjectCacheWrites(() => applySeedWrites(db.withPlugin(budget), seed, options, budget));
251
+ }
252
+ /**
253
+ * Counts what a budgeted call spends. As a Kysely plugin it sees every query
254
+ * the call runs, including those inside transactions.
255
+ */
256
+ var SeedBudget = class {
257
+ #queries = 0;
258
+ #mediaDownloads = 0;
259
+ constructor(limits) {
260
+ this.limits = limits;
261
+ }
262
+ transformQuery(args) {
263
+ this.#queries++;
264
+ return args.node;
265
+ }
266
+ transformResult(args) {
267
+ return Promise.resolve(args.result);
268
+ }
269
+ countMediaDownload() {
270
+ this.#mediaDownloads++;
271
+ }
272
+ isSpent() {
273
+ const { queries, mediaDownloads } = this.limits;
274
+ return queries !== void 0 && this.#queries >= queries || mediaDownloads !== void 0 && this.#mediaDownloads >= mediaDownloads;
275
+ }
276
+ };
277
+ async function applySeedWrites(db, seed, options, budget) {
278
+ const validation = validateSeed(seed);
279
+ if (!validation.valid) throw new Error(`Invalid seed file:\n${validation.errors.join("\n")}`);
280
+ const { includeContent = false, storage, skipMediaDownload = false, onConflict = "skip" } = options;
281
+ if (budget && onConflict !== "skip") throw new Error("A seed budget requires onConflict: \"skip\"");
282
+ const result = {
283
+ blockTypes: {
284
+ created: 0,
285
+ skipped: 0,
286
+ updated: 0
287
+ },
288
+ collections: {
289
+ created: 0,
290
+ skipped: 0,
291
+ updated: 0
292
+ },
293
+ fields: {
294
+ created: 0,
295
+ skipped: 0,
296
+ updated: 0
297
+ },
298
+ relations: {
299
+ created: 0,
300
+ skipped: 0,
301
+ updated: 0
302
+ },
303
+ taxonomies: {
304
+ created: 0,
305
+ skipped: 0,
306
+ terms: 0
307
+ },
308
+ bylines: {
309
+ created: 0,
310
+ skipped: 0,
311
+ updated: 0
312
+ },
313
+ menus: {
314
+ created: 0,
315
+ items: 0
316
+ },
317
+ redirects: {
318
+ created: 0,
319
+ skipped: 0,
320
+ updated: 0
321
+ },
322
+ widgetAreas: {
323
+ created: 0,
324
+ widgets: 0
325
+ },
326
+ sections: {
327
+ created: 0,
328
+ skipped: 0,
329
+ updated: 0
330
+ },
331
+ settings: { applied: 0 },
332
+ content: {
333
+ created: 0,
334
+ skipped: 0,
335
+ updated: 0
336
+ },
337
+ media: {
338
+ created: 0,
339
+ skipped: 0
340
+ }
341
+ };
342
+ let complete = true;
343
+ const progress = {
344
+ done: 0,
345
+ total: countSeedItems(seed, includeContent)
346
+ };
347
+ const mayCreateItem = () => !budget || result.taxonomies.terms + result.bylines.created + result.content.created === 0 || !budget.isSpent();
348
+ const mediaContext = {
349
+ db,
350
+ storage: storage ?? null,
351
+ skipMediaDownload,
352
+ mediaCache: /* @__PURE__ */ new Map(),
353
+ budget
354
+ };
355
+ const seedIdMap = /* @__PURE__ */ new Map();
356
+ const seedBylineIdMap = /* @__PURE__ */ new Map();
357
+ const staleMarkedContentCollections = /* @__PURE__ */ new Set();
358
+ const failedStaleContentCollections = /* @__PURE__ */ new Set();
359
+ const defaultLocale = getI18nConfig()?.defaultLocale ?? seed.defaultLocale ?? "en";
360
+ const markSeedContentCollectionStale = async (collectionSlug) => {
361
+ if (staleMarkedContentCollections.has(collectionSlug)) return;
362
+ if (await markContentMediaUsageCollectionStaleSafely(db, collectionSlug, "CONTENT_USAGE_STALE")) {
363
+ staleMarkedContentCollections.add(collectionSlug);
364
+ failedStaleContentCollections.delete(collectionSlug);
365
+ } else failedStaleContentCollections.add(collectionSlug);
366
+ };
367
+ const retryFailedSeedContentStaleMarks = async () => {
368
+ for (const collectionSlug of failedStaleContentCollections) if (await markContentMediaUsageCollectionStaleSafely(db, collectionSlug, "CONTENT_USAGE_STALE")) {
369
+ staleMarkedContentCollections.add(collectionSlug);
370
+ failedStaleContentCollections.delete(collectionSlug);
371
+ }
372
+ };
373
+ if (seed.settings) await applySiteSettings(db, seed.settings, onConflict, result);
374
+ if (seed.relations) await applySeedRelations(db, seed.relations, seed.collections ?? [], onConflict, result);
375
+ if (seed.blockTypes) {
376
+ const registry = new BlockTypeRegistry(db);
377
+ for (const blockType of seed.blockTypes) {
378
+ const existing = await registry.getBlockType(blockType.slug);
379
+ await registry.applySeedBlockType(blockType, onConflict);
380
+ if (!existing) result.blockTypes.created++;
381
+ else if (onConflict === "update") result.blockTypes.updated++;
382
+ else result.blockTypes.skipped++;
383
+ }
384
+ }
385
+ if (seed.collections) {
386
+ const registry = new SchemaRegistry(db);
387
+ const seedCollectionSlugs = new Set(seed.collections.map((collection) => collection.slug));
388
+ const knownRelations = await readRelationEnds(db);
389
+ const relationSlugs = new Set(knownRelations.keys());
390
+ const externalTargetExists = /* @__PURE__ */ new Map();
391
+ const pendingRelations = [];
392
+ for (const collection of seed.collections) {
393
+ if (await registry.getCollection(collection.slug)) {
394
+ if (onConflict === "error") throw new Error(`Conflict: collection "${collection.slug}" already exists`);
395
+ if (onConflict === "update") {
396
+ await registry.updateCollection(collection.slug, {
397
+ label: collection.label,
398
+ labelSingular: collection.labelSingular,
399
+ description: collection.description,
400
+ icon: collection.icon,
401
+ admin: collection.admin,
402
+ supports: collection.supports || [],
403
+ urlPattern: collection.urlPattern,
404
+ routable: collection.routable,
405
+ hidden: collection.hidden,
406
+ sortOrder: collection.sortOrder,
407
+ group: collection.group,
408
+ commentsEnabled: collection.commentsEnabled,
409
+ editLocking: collection.editLocking
410
+ });
411
+ result.collections.updated++;
412
+ for (const field of collection.fields) {
413
+ const existingField = await registry.getField(collection.slug, field.slug);
414
+ await upsertSeedField(db, collection.slug, field, existingField, knownRelations);
415
+ if (existingField) result.fields.updated++;
416
+ else result.fields.created++;
417
+ }
418
+ await applyDisplayDateFields(registry, collection);
419
+ continue;
420
+ }
421
+ result.collections.skipped++;
422
+ result.fields.skipped += collection.fields.length;
423
+ continue;
424
+ }
425
+ const fields = [];
426
+ for (const field of collection.fields) {
427
+ let fieldValidation = field.validation;
428
+ const bound = resolveSeedFieldRelation(collection.slug, field, knownRelations);
429
+ const targetCollection = !bound && field.type === "reference" && typeof fieldValidation?.targetCollection === "string" ? fieldValidation.targetCollection : void 0;
430
+ if (bound) fieldValidation = {
431
+ ...fieldValidation,
432
+ ...bound
433
+ };
434
+ if (targetCollection) {
435
+ let targetExists = seedCollectionSlugs.has(targetCollection);
436
+ if (!targetExists) {
437
+ targetExists = externalTargetExists.get(targetCollection) ?? false;
438
+ if (!externalTargetExists.has(targetCollection)) {
439
+ targetExists = Boolean(await registry.getCollection(targetCollection));
440
+ externalTargetExists.set(targetCollection, targetExists);
441
+ }
442
+ }
443
+ if (!targetExists) throw new SchemaError(`Target collection "${targetCollection}" not found`, "COLLECTION_NOT_FOUND");
444
+ const relationId = ulid();
445
+ const relationSlug = allocateSeedRelationName(collection.slug, field.slug, relationSlugs);
446
+ pendingRelations.push({
447
+ id: relationId,
448
+ slug: relationSlug,
449
+ parent_collection: collection.slug,
450
+ child_collection: targetCollection,
451
+ parent_label: collection.label,
452
+ parent_label_singular: collection.labelSingular ?? null,
453
+ child_label: field.label,
454
+ max_children_per_parent: fieldValidation?.multiple ? null : 1
455
+ });
456
+ fieldValidation = {
457
+ ...fieldValidation,
458
+ relation: relationSlug,
459
+ relationSide: "parent"
460
+ };
461
+ }
462
+ fields.push({
463
+ slug: field.slug,
464
+ label: field.label,
465
+ type: field.type,
466
+ required: field.required || false,
467
+ unique: field.unique || false,
468
+ searchable: field.searchable || false,
469
+ indexed: field.indexed || false,
470
+ translatable: field.translatable,
471
+ defaultValue: field.defaultValue,
472
+ validation: fieldValidation,
473
+ widget: field.widget,
474
+ options: field.options
475
+ });
476
+ }
477
+ await registry.createSeedCollection({
478
+ slug: collection.slug,
479
+ label: collection.label,
480
+ labelSingular: collection.labelSingular,
481
+ description: collection.description,
482
+ icon: collection.icon,
483
+ admin: collection.admin,
484
+ supports: collection.supports || [],
485
+ urlPattern: collection.urlPattern,
486
+ routable: collection.routable,
487
+ hidden: collection.hidden,
488
+ sortOrder: collection.sortOrder,
489
+ group: collection.group,
490
+ commentsEnabled: collection.commentsEnabled,
491
+ editLocking: collection.editLocking
492
+ }, fields);
493
+ await applyDisplayDateFields(registry, collection);
494
+ result.collections.created++;
495
+ result.fields.created += collection.fields.length;
496
+ }
497
+ for (const relationBatch of chunks(pendingRelations, SEED_RELATION_INSERT_BATCH_SIZE)) await db.insertInto("_emdash_relations").values(relationBatch).execute();
498
+ }
499
+ if (seed.taxonomies) {
500
+ const termSeedIdMap = /* @__PURE__ */ new Map();
501
+ const taxonomiesBySeedId = /* @__PURE__ */ new Map();
502
+ for (const taxonomy of seed.taxonomies) if (taxonomy.id) taxonomiesBySeedId.set(taxonomy.id, taxonomy);
503
+ const untouchedBuiltInDefIds = new Set((await db.selectFrom("_emdash_taxonomy_defs").select([
504
+ "id",
505
+ "label",
506
+ "label_singular",
507
+ "hierarchical",
508
+ "collections"
509
+ ]).where("id", "in", [...BUILT_IN_TAXONOMY_DEFS.keys()]).execute()).filter(isUntouchedBuiltInTaxonomyDef).map((def) => def.id));
510
+ const declaresOwnStructure = (taxonomy) => findTaxonomyStructureSource(taxonomy, taxonomiesBySeedId) === taxonomy;
511
+ const orderedTaxonomies = [...seed.taxonomies.filter(declaresOwnStructure), ...seed.taxonomies.filter((taxonomy) => !declaresOwnStructure(taxonomy))];
512
+ for (const taxonomy of orderedTaxonomies) {
513
+ const defLocale = resolveConfiguredLocale(taxonomy.locale ?? defaultLocale);
514
+ const defsOfName = await db.selectFrom("_emdash_taxonomy_defs").select(["id", "locale"]).where("name", "=", taxonomy.name).execute();
515
+ const existingDef = defsOfName.filter((def) => resolveConfiguredLocale(def.locale) === defLocale).toSorted((a, b) => getLocaleRank(a.locale, defLocale) - getLocaleRank(b.locale, defLocale) || a.id.localeCompare(b.id))[0];
516
+ const unclaimed = existingDef !== void 0 && untouchedBuiltInDefIds.has(existingDef.id);
517
+ if (existingDef && onConflict === "error" && !unclaimed) throw new Error(`Conflict: taxonomy "${taxonomy.name}" (${defLocale}) already exists`);
518
+ const replacesDef = onConflict === "update" || unclaimed;
519
+ const existingStructure = await findTaxonomyStructure(db, taxonomy.name);
520
+ const replacesStructure = replacesDef || defsOfName.every((def) => untouchedBuiltInDefIds.has(def.id));
521
+ const writesStructure = !existingStructure || replacesStructure && !taxonomy.translationOf;
522
+ const structure = existingStructure && !writesStructure ? existingStructure : {
523
+ hierarchical: taxonomy.hierarchical ?? existingStructure?.hierarchical ?? false,
524
+ collections: taxonomy.collections ?? existingStructure?.collections ?? []
525
+ };
526
+ const defId = existingDef?.id ?? ulid();
527
+ const translationGroup = writesStructure ? await saveTaxonomyStructure(db, taxonomy.name, existingStructure?.id ?? defId, structure) : existingStructure.id;
528
+ if (existingDef) if (replacesDef) await db.updateTable("_emdash_taxonomy_defs").set({
529
+ label: taxonomy.label,
530
+ label_singular: taxonomy.labelSingular ?? null
531
+ }).where("id", "=", existingDef.id).execute();
532
+ else result.taxonomies.skipped++;
533
+ else {
534
+ await db.insertInto("_emdash_taxonomy_defs").values({
535
+ id: defId,
536
+ name: taxonomy.name,
537
+ label: taxonomy.label,
538
+ label_singular: taxonomy.labelSingular ?? null,
539
+ hierarchical: structure.hierarchical ? 1 : 0,
540
+ collections: JSON.stringify(structure.collections),
541
+ locale: defLocale,
542
+ translation_group: translationGroup
543
+ }).execute();
544
+ result.taxonomies.created++;
545
+ }
546
+ if (includeContent && taxonomy.terms && taxonomy.terms.length > 0) {
547
+ const termRepo = new TaxonomyRepository(db);
548
+ const existingTerms = await findExistingSeedTerms(db, taxonomy.name, taxonomy.terms);
549
+ if (structure.hierarchical) {
550
+ const applied = await applyHierarchicalTerms(termRepo, taxonomy.name, defLocale, taxonomy.terms, existingTerms, termSeedIdMap, result, onConflict, mayCreateItem);
551
+ progress.done += applied.processed;
552
+ complete = applied.complete;
553
+ } else for (const term of taxonomy.terms) {
554
+ const termLocale = resolveConfiguredLocale(term.locale ?? defLocale);
555
+ const termKey = seedTermKey(termLocale, term.slug);
556
+ const existingId = existingTerms.get(termKey);
557
+ if (existingId) {
558
+ if (onConflict === "error") throw new Error(`Conflict: taxonomy term "${term.slug}" in "${taxonomy.name}" (${termLocale}) already exists`);
559
+ if (onConflict === "update") {
560
+ await termRepo.update(existingId, {
561
+ label: term.label,
562
+ data: term.description ? { description: term.description } : {}
563
+ });
564
+ result.taxonomies.terms++;
565
+ }
566
+ if (term.id) termSeedIdMap.set(term.id, existingId);
567
+ progress.done++;
568
+ } else {
569
+ if (!mayCreateItem()) {
570
+ complete = false;
571
+ break;
572
+ }
573
+ const translationOf = term.translationOf ? termSeedIdMap.get(term.translationOf) : void 0;
574
+ const created = await termRepo.create({
575
+ name: taxonomy.name,
576
+ slug: term.slug,
577
+ label: term.label,
578
+ data: term.description ? { description: term.description } : void 0,
579
+ locale: termLocale,
580
+ translationOf
581
+ });
582
+ existingTerms.set(termKey, created.id);
583
+ if (term.id) termSeedIdMap.set(term.id, created.id);
584
+ result.taxonomies.terms++;
585
+ progress.done++;
586
+ }
587
+ }
588
+ }
589
+ if (!complete) break;
590
+ }
591
+ const { invalidateTaxonomyDefsCache } = await import("./taxonomies-B__VmCKQ.mjs").then((n) => n.f);
592
+ invalidateTaxonomyDefsCache();
593
+ }
594
+ if (complete && includeContent && seed.bylines) {
595
+ const bylineRepo = new BylineRepository(db);
596
+ const existingBylines = await findExistingSeedBylines(db, seed.bylines.map((byline) => byline.slug));
597
+ for (const byline of seed.bylines) {
598
+ const existingId = existingBylines.get(byline.slug);
599
+ if (existingId) {
600
+ if (onConflict === "error") throw new Error(`Conflict: byline "${byline.slug}" already exists`);
601
+ if (onConflict === "update") {
602
+ const avatar = byline.avatar ? await resolveSeedBylineAvatar(db, byline.avatar) : null;
603
+ try {
604
+ if (!await bylineRepo.update(existingId, {
605
+ displayName: byline.displayName,
606
+ bio: byline.bio ?? null,
607
+ websiteUrl: byline.websiteUrl ?? null,
608
+ isGuest: byline.isGuest,
609
+ ...avatar ? { avatarMediaId: avatar.id } : {}
610
+ })) throw new Error(`Byline "${byline.slug}" disappeared during update`);
611
+ } catch (error) {
612
+ if (avatar?.created) await deleteMediaRow(db, avatar.id);
613
+ throw error;
614
+ }
615
+ seedBylineIdMap.set(byline.id, existingId);
616
+ result.bylines.updated++;
617
+ if (avatar?.created) result.media.created++;
618
+ progress.done++;
619
+ continue;
620
+ }
621
+ seedBylineIdMap.set(byline.id, existingId);
622
+ result.bylines.skipped++;
623
+ progress.done++;
624
+ continue;
625
+ }
626
+ if (!mayCreateItem()) {
627
+ complete = false;
628
+ break;
629
+ }
630
+ const avatar = byline.avatar ? await resolveSeedBylineAvatar(db, byline.avatar) : null;
631
+ let createdId;
632
+ try {
633
+ createdId = (await bylineRepo.create({
634
+ slug: byline.slug,
635
+ displayName: byline.displayName,
636
+ bio: byline.bio ?? null,
637
+ websiteUrl: byline.websiteUrl ?? null,
638
+ isGuest: byline.isGuest,
639
+ avatarMediaId: avatar?.id ?? null
640
+ })).id;
641
+ } catch (error) {
642
+ if (avatar?.created) await deleteMediaRow(db, avatar.id);
643
+ throw error;
644
+ }
645
+ existingBylines.set(byline.slug, createdId);
646
+ seedBylineIdMap.set(byline.id, createdId);
647
+ result.bylines.created++;
648
+ if (avatar?.created) result.media.created++;
649
+ progress.done++;
650
+ }
651
+ }
652
+ if (complete && includeContent && seed.content) {
653
+ const contentRepo = new ContentRepository(db);
654
+ const schemaRegistry = new SchemaRegistry(db);
655
+ const datetimeContexts = /* @__PURE__ */ new Map();
656
+ try {
657
+ for (const [collectionSlug, entries] of Object.entries(seed.content)) {
658
+ const collectionInfo = await schemaRegistry.getCollectionWithFields(collectionSlug);
659
+ const collectionRoutable = collectionInfo?.routable !== false;
660
+ const referenceFields = referenceFieldsOf(collectionInfo);
661
+ const resolvedBlockTypes = collectionInfo?.fields.some((field) => field.type === "blocks") ? await resolveBlockTypes(db) : void 0;
662
+ const existingEntries = await findExistingSeedEntries(contentRepo, collectionSlug, entries, defaultLocale);
663
+ const trashedEntries = await findExistingSeedEntries(contentRepo, collectionSlug, entries.filter((entry) => {
664
+ const { slug, locale } = seedEntryIdentity(entry, defaultLocale);
665
+ return !existingEntries.has(seedEntryKey(entry, slug, locale));
666
+ }), defaultLocale, true);
667
+ for (const entry of entries) {
668
+ const { slug: entrySlug, locale: entryLocale } = seedEntryIdentity(entry, defaultLocale);
669
+ const entryKey = seedEntryKey(entry, entrySlug, entryLocale);
670
+ const existing = existingEntries.get(entryKey);
671
+ if (!existing) {
672
+ if (trashedEntries.get(entryKey)) {
673
+ if (onConflict === "error") throw new Error(`Conflict: content "${entrySlug ?? entry.id}" in "${collectionSlug}" already exists (in trash)`);
674
+ console.warn(`content.${collectionSlug}: "${entrySlug ?? entry.id}" (${entryLocale}) exists in the trash — skipping`);
675
+ result.content.skipped++;
676
+ progress.done++;
677
+ continue;
678
+ }
679
+ }
680
+ if (existing) {
681
+ if (onConflict === "error") throw new Error(`Conflict: content "${entrySlug ?? entry.id}" in "${collectionSlug}" already exists`);
682
+ if (onConflict === "update") {
683
+ let resolvedData = await resolveReferences(entry.data, seedIdMap, mediaContext, result);
684
+ if (collectionInfo) resolvedData = await normalizeBlocksData(db, collectionInfo, resolvedData, existing.data, { restoreBlocks: true }, false, resolvedBlockTypes);
685
+ const { columnData, edges } = splitReferenceFields(collectionSlug, referenceFields, resolvedData);
686
+ const status = entry.status || "published";
687
+ let contentMutated = false;
688
+ try {
689
+ await withTransaction(db, async (trx) => {
690
+ const trxContentRepo = new ContentRepository(trx, datetimeContexts);
691
+ const trxBylineRepo = new BylineRepository(trx);
692
+ const trxRevisionRepo = new RevisionRepository(trx, datetimeContexts);
693
+ await trxContentRepo.update(collectionSlug, existing.id, {
694
+ status,
695
+ data: columnData
696
+ });
697
+ contentMutated = true;
698
+ await applyContentBylines(trxBylineRepo, collectionSlug, existing.id, entry, seedBylineIdMap, true);
699
+ await applyContentTaxonomies(trx, collectionSlug, existing.id, entry, true);
700
+ await applyContentReferences(trx, collectionSlug, existing.id, edges);
701
+ if (status === "published") {
702
+ const draft = await trxRevisionRepo.create({
703
+ collection: collectionSlug,
704
+ entryId: existing.id,
705
+ data: columnData
706
+ });
707
+ try {
708
+ await trxContentRepo.setDraftRevision(collectionSlug, existing.id, draft.id);
709
+ await trxContentRepo.publish(collectionSlug, existing.id, void 0, false, void 0, true, collectionRoutable);
710
+ } catch (error) {
711
+ try {
712
+ await trxRevisionRepo.deleteIfUnreferenced(collectionSlug, existing.id, draft.id);
713
+ } catch (cleanupError) {
714
+ console.error(`[seed] Failed to clean up unstaged revision ${draft.id}:`, cleanupError);
715
+ }
716
+ throw error;
717
+ }
718
+ }
719
+ });
720
+ } catch (error) {
721
+ if (contentMutated) await markSeedContentCollectionStale(collectionSlug);
722
+ throw error;
723
+ }
724
+ seedIdMap.set(entry.id, existing.id);
725
+ result.content.updated++;
726
+ progress.done++;
727
+ await markSeedContentCollectionStale(collectionSlug);
728
+ continue;
729
+ }
730
+ result.content.skipped++;
731
+ seedIdMap.set(entry.id, existing.id);
732
+ progress.done++;
733
+ continue;
734
+ }
735
+ if (!mayCreateItem()) {
736
+ complete = false;
737
+ break;
738
+ }
739
+ let resolvedData = await resolveReferences(entry.data, seedIdMap, mediaContext, result);
740
+ if (collectionInfo) resolvedData = await normalizeBlocksData(db, collectionInfo, resolvedData, {}, { restoreBlocks: true }, false, resolvedBlockTypes);
741
+ const { columnData, edges } = splitReferenceFields(collectionSlug, referenceFields, resolvedData);
742
+ let translationOf;
743
+ if (entry.translationOf) {
744
+ const sourceId = seedIdMap.get(entry.translationOf);
745
+ if (!sourceId) console.warn(`content.${collectionSlug}: translationOf "${entry.translationOf}" not found (not yet created or missing). Skipping translation link.`);
746
+ else translationOf = sourceId;
747
+ }
748
+ const status = entry.status || "published";
749
+ let contentMutated = false;
750
+ let created;
751
+ try {
752
+ created = await withTransaction(db, async (trx) => {
753
+ const trxContentRepo = new ContentRepository(trx, datetimeContexts);
754
+ const trxBylineRepo = new BylineRepository(trx);
755
+ const item = await trxContentRepo.create({
756
+ ...entrySlug ? {} : { id: entry.id },
757
+ type: collectionSlug,
758
+ slug: entrySlug,
759
+ status,
760
+ data: columnData,
761
+ locale: entryLocale,
762
+ translationOf,
763
+ publishedAt: status === "published" ? (/* @__PURE__ */ new Date()).toISOString() : null
764
+ });
765
+ contentMutated = true;
766
+ await applyContentBylines(trxBylineRepo, collectionSlug, item.id, entry, seedBylineIdMap);
767
+ await applyContentTaxonomies(trx, collectionSlug, item.id, entry, false);
768
+ await applyContentReferences(trx, collectionSlug, item.id, edges);
769
+ if (status === "published") await trxContentRepo.publish(collectionSlug, item.id, void 0, false, void 0, true, collectionRoutable);
770
+ return item;
771
+ });
772
+ } catch (error) {
773
+ if (contentMutated) await markSeedContentCollectionStale(collectionSlug);
774
+ throw error;
775
+ }
776
+ seedIdMap.set(entry.id, created.id);
777
+ existingEntries.set(entryKey, created);
778
+ result.content.created++;
779
+ progress.done++;
780
+ await markSeedContentCollectionStale(collectionSlug);
781
+ }
782
+ if (!complete) break;
783
+ }
784
+ } finally {
785
+ await retryFailedSeedContentStaleMarks();
786
+ }
787
+ }
788
+ if (complete && !mayCreateItem()) complete = false;
789
+ if (!complete) {
790
+ await invalidateSeedCaches();
791
+ return {
792
+ result,
793
+ complete,
794
+ progress
795
+ };
796
+ }
797
+ if (seed.menus) {
798
+ const menuSeedIdMap = /* @__PURE__ */ new Map();
799
+ const itemSeedIdMap = /* @__PURE__ */ new Map();
800
+ const menuIds = [];
801
+ const itemRows = [];
802
+ try {
803
+ for (const menu of seed.menus) {
804
+ const locale = resolveConfiguredLocale(menu.locale ?? defaultLocale);
805
+ let lookup = db.selectFrom("_emdash_menus").selectAll().where("name", "=", menu.name).where(localeMatches("locale", locale)).orderBy(localeOrder("locale", locale), "asc").orderBy("id", "asc");
806
+ const existingMenu = await lookup.executeTakeFirst();
807
+ let menuId;
808
+ let translationGroup;
809
+ if (existingMenu) {
810
+ menuId = existingMenu.id;
811
+ translationGroup = existingMenu.translation_group ?? existingMenu.id;
812
+ } else {
813
+ menuId = ulid();
814
+ translationGroup = menuId;
815
+ if (menu.translationOf) {
816
+ const source = menuSeedIdMap.get(menu.translationOf);
817
+ if (source) translationGroup = source.translationGroup;
818
+ else console.warn(`menu "${menu.name}" (${locale}): translationOf "${menu.translationOf}" not found yet; minting a fresh group.`);
819
+ }
820
+ if (await db.insertInto("_emdash_menus").values({
821
+ id: menuId,
822
+ name: menu.name,
823
+ label: menu.label,
824
+ created_at: (/* @__PURE__ */ new Date()).toISOString(),
825
+ updated_at: (/* @__PURE__ */ new Date()).toISOString(),
826
+ locale,
827
+ translation_group: translationGroup
828
+ }).onConflict((conflict) => conflict.columns(["name", "locale"]).doNothing()).returning("id").executeTakeFirst()) result.menus.created++;
829
+ else {
830
+ const concurrentMenu = await lookup.executeTakeFirstOrThrow();
831
+ menuId = concurrentMenu.id;
832
+ translationGroup = concurrentMenu.translation_group ?? concurrentMenu.id;
833
+ }
834
+ }
835
+ if (menu.id) menuSeedIdMap.set(menu.id, {
836
+ id: menuId,
837
+ translationGroup
838
+ });
839
+ menuIds.push(menuId);
840
+ const itemCount = collectMenuItems(itemRows, menuId, existingMenu?.locale ?? locale, menu.items, null, 0, seedIdMap, itemSeedIdMap);
841
+ result.menus.items += itemCount;
842
+ }
843
+ const buildStatements = (target) => [...menuIds.map((id) => target.deleteFrom("_emdash_menu_items").where("menu_id", "=", id)), ...chunks(itemRows, SEED_MENU_ITEM_INSERT_BATCH_SIZE).map((rows) => target.insertInto("_emdash_menu_items").values(rows))];
844
+ await replaceSeedChildren(db, "_emdash_menus", menuIds, buildStatements);
845
+ } finally {
846
+ invalidateMenuObjectCache();
847
+ }
848
+ }
849
+ if (seed.redirects) {
850
+ const redirectRepo = new RedirectRepository(db);
851
+ for (const redirect of seed.redirects) {
852
+ const existing = await redirectRepo.findBySource(redirect.source);
853
+ if (existing) {
854
+ if (onConflict === "error") throw new Error(`Conflict: redirect "${redirect.source}" already exists`);
855
+ if (onConflict === "update") {
856
+ await redirectRepo.update(existing.id, {
857
+ destination: redirect.destination,
858
+ type: redirect.type,
859
+ enabled: redirect.enabled,
860
+ groupName: redirect.groupName
861
+ });
862
+ result.redirects.updated++;
863
+ continue;
864
+ }
865
+ result.redirects.skipped++;
866
+ continue;
867
+ }
868
+ await redirectRepo.create({
869
+ source: redirect.source,
870
+ destination: redirect.destination,
871
+ type: redirect.type,
872
+ enabled: redirect.enabled,
873
+ groupName: redirect.groupName
874
+ });
875
+ result.redirects.created++;
876
+ }
877
+ }
878
+ if (seed.widgetAreas) try {
879
+ const areaIds = [];
880
+ const widgetRows = [];
881
+ for (const area of seed.widgetAreas) {
882
+ const lookup = db.selectFrom("_emdash_widget_areas").selectAll().where("name", "=", area.name);
883
+ const existingArea = await lookup.executeTakeFirst();
884
+ let areaId;
885
+ if (existingArea) areaId = existingArea.id;
886
+ else {
887
+ areaId = ulid();
888
+ if (await db.insertInto("_emdash_widget_areas").values({
889
+ id: areaId,
890
+ name: area.name,
891
+ label: area.label,
892
+ description: area.description ?? null
893
+ }).onConflict((conflict) => conflict.column("name").doNothing()).returning("id").executeTakeFirst()) result.widgetAreas.created++;
894
+ else areaId = (await lookup.executeTakeFirstOrThrow()).id;
895
+ }
896
+ areaIds.push(areaId);
897
+ for (let i = 0; i < area.widgets.length; i++) {
898
+ const widget = area.widgets[i];
899
+ widgetRows.push(createSeedWidgetRow(areaId, widget, i));
900
+ result.widgetAreas.widgets++;
901
+ }
902
+ }
903
+ await replaceSeedChildren(db, "_emdash_widget_areas", areaIds, (target) => [...areaIds.map((id) => target.deleteFrom("_emdash_widgets").where("area_id", "=", id)), ...chunks(widgetRows, SEED_WIDGET_INSERT_BATCH_SIZE).map((rows) => target.insertInto("_emdash_widgets").values(rows))]);
904
+ } finally {
905
+ invalidateWidgetObjectCache();
906
+ }
907
+ if (seed.sections) for (const section of seed.sections) {
908
+ const existing = await db.selectFrom("_emdash_sections").select("id").where("slug", "=", section.slug).executeTakeFirst();
909
+ if (existing) {
910
+ if (onConflict === "error") throw new Error(`Conflict: section "${section.slug}" already exists`);
911
+ if (onConflict === "update") {
912
+ await db.updateTable("_emdash_sections").set({
913
+ title: section.title,
914
+ description: section.description ?? null,
915
+ keywords: section.keywords ? JSON.stringify(section.keywords) : null,
916
+ content: JSON.stringify(section.content),
917
+ source: section.source || "theme",
918
+ updated_at: (/* @__PURE__ */ new Date()).toISOString()
919
+ }).where("id", "=", existing.id).execute();
920
+ result.sections.updated++;
921
+ continue;
922
+ }
923
+ result.sections.skipped++;
924
+ continue;
925
+ }
926
+ const id = ulid();
927
+ const now = (/* @__PURE__ */ new Date()).toISOString();
928
+ await db.insertInto("_emdash_sections").values({
929
+ id,
930
+ slug: section.slug,
931
+ title: section.title,
932
+ description: section.description ?? null,
933
+ keywords: section.keywords ? JSON.stringify(section.keywords) : null,
934
+ content: JSON.stringify(section.content),
935
+ preview_media_id: null,
936
+ source: section.source || "theme",
937
+ theme_id: section.source === "theme" ? section.slug : null,
938
+ created_at: now,
939
+ updated_at: now
940
+ }).execute();
941
+ result.sections.created++;
942
+ }
943
+ if (seed.collections) {
944
+ const ftsManager = new FTSManager(db);
945
+ for (const collection of seed.collections) if (collection.supports?.includes("search")) {
946
+ if ((await ftsManager.getSearchableFields(collection.slug)).length > 0) try {
947
+ await ftsManager.enableSearch(collection.slug);
948
+ } catch (err) {
949
+ console.warn(`Failed to enable search for ${collection.slug}:`, err);
950
+ }
951
+ }
952
+ }
953
+ if (result.redirects.created + result.redirects.updated > 0) {
954
+ const { publishRedirectChanges } = await import("./artifacts-Dvdp2KK-.mjs").then((n) => n.t);
955
+ await publishRedirectChanges(db);
956
+ }
957
+ await invalidateSeedCaches();
958
+ return {
959
+ result,
960
+ complete,
961
+ progress
962
+ };
963
+ }
964
+ function countSeedItems(seed, includeContent) {
965
+ if (!includeContent) return 0;
966
+ const terms = (seed.taxonomies ?? []).reduce((total, taxonomy) => total + (taxonomy.terms?.length ?? 0), 0);
967
+ const entries = Object.values(seed.content ?? {}).reduce((total, collectionEntries) => total + collectionEntries.length, 0);
968
+ return terms + (seed.bylines?.length ?? 0) + entries;
969
+ }
970
+ function seedTermKey(locale, slug) {
971
+ return `${locale}::${slug}`;
972
+ }
973
+ /**
974
+ * Find which of a taxonomy's seed terms already exist, as term ids keyed by
975
+ * `seedTermKey`. Each query covers a batch of slugs.
976
+ */
977
+ async function findExistingSeedTerms(db, taxonomyName, terms) {
978
+ const selected = /* @__PURE__ */ new Map();
979
+ for (const batch of chunks([...new Set(terms.map((term) => term.slug))], SQL_BATCH_SIZE)) {
980
+ const rows = await db.selectFrom("taxonomies").select([
981
+ "id",
982
+ "slug",
983
+ "locale"
984
+ ]).where("name", "=", taxonomyName).where("slug", "in", batch).execute();
985
+ for (const row of rows) {
986
+ const canonicalLocale = resolveConfiguredLocale(row.locale);
987
+ const key = seedTermKey(canonicalLocale, row.slug);
988
+ const previous = selected.get(key);
989
+ if (previous === void 0 || getLocaleRank(row.locale, canonicalLocale) < getLocaleRank(previous.locale, canonicalLocale) || getLocaleRank(row.locale, canonicalLocale) === getLocaleRank(previous.locale, canonicalLocale) && row.id.localeCompare(previous.id) < 0) selected.set(key, {
990
+ id: row.id,
991
+ locale: row.locale
992
+ });
993
+ }
994
+ }
995
+ return new Map(Array.from(selected, ([key, value]) => [key, value.id]));
996
+ }
997
+ /**
998
+ * Match seed bylines by slug, preferring a path over its stored code aliases.
999
+ * Across different configured locales, keep the lowest-locale selection.
1000
+ */
1001
+ async function findExistingSeedBylines(db, slugs) {
1002
+ const existing = /* @__PURE__ */ new Map();
1003
+ for (const batch of chunks([...new Set(slugs)], SQL_BATCH_SIZE)) {
1004
+ const rows = await db.selectFrom("_emdash_bylines").select([
1005
+ "id",
1006
+ "slug",
1007
+ "locale"
1008
+ ]).where("slug", "in", batch).orderBy("locale", "asc").orderBy("id", "asc").execute();
1009
+ for (const row of rows) {
1010
+ const previous = existing.get(row.slug);
1011
+ const locale = resolveConfiguredLocale(row.locale);
1012
+ if (!previous || resolveConfiguredLocale(previous.locale) === locale && getLocaleRank(row.locale, locale) < getLocaleRank(previous.locale, locale)) existing.set(row.slug, row);
1013
+ }
1014
+ }
1015
+ return new Map(Array.from(existing, ([slug, row]) => [slug, row.id]));
1016
+ }
1017
+ /**
1018
+ * Invalidate caches that may have been affected by seed data.
1019
+ * Seed creates bylines, redirects, and collections, all of which
1020
+ * have module-level caches in the hot path.
1021
+ */
1022
+ async function invalidateSeedCaches() {
1023
+ const { invalidateBylineCache } = await import("./bylines-f_ZEc6Sn.mjs").then((n) => n.t);
1024
+ const { invalidateRedirectCache } = await import("./cache-5DHbpEWu.mjs").then((n) => n.t);
1025
+ const { invalidateUrlPatternCache } = await import("./query-D62NntCZ.mjs").then((n) => n.s);
1026
+ invalidateBylineCache();
1027
+ invalidateRedirectCache();
1028
+ invalidateUrlPatternCache();
1029
+ }
1030
+ function seedEntryIdentity(entry, defaultLocale) {
1031
+ return {
1032
+ slug: typeof entry.slug === "string" && entry.slug.trim().length > 0 ? entry.slug : null,
1033
+ locale: resolveConfiguredLocale(entry.locale ?? defaultLocale)
1034
+ };
1035
+ }
1036
+ async function readRelationEnds(db) {
1037
+ const rows = await db.selectFrom("_emdash_relations").select([
1038
+ "slug",
1039
+ "parent_collection",
1040
+ "child_collection"
1041
+ ]).execute();
1042
+ return new Map(rows.map((row) => [row.slug, {
1043
+ parentCollection: row.parent_collection,
1044
+ childCollection: row.child_collection
1045
+ }]));
1046
+ }
1047
+ /**
1048
+ * Resolve the relation a seed reference field names, and which end of it this
1049
+ * collection sits on.
1050
+ *
1051
+ * `relationSide` is only needed for a self-referential relation, where both ends
1052
+ * are this collection; otherwise the side follows from which end matches.
1053
+ * `targetCollection` is the collection at the other end, derived rather than
1054
+ * trusted, so a seed cannot declare a target the relation disagrees with.
1055
+ */
1056
+ function resolveSeedFieldRelation(collectionSlug, field, knownRelations) {
1057
+ if (field.type !== "reference") return null;
1058
+ const named = field.validation?.relation;
1059
+ if (typeof named !== "string" || named.length === 0) return null;
1060
+ const relation = knownRelations.get(named);
1061
+ if (!relation) throw new SchemaError(`Relation "${named}" not found`, "RELATION_NOT_FOUND");
1062
+ const declared = field.validation?.relationSide;
1063
+ const side = declared === "parent" || declared === "child" ? declared : relation.parentCollection === collectionSlug ? "parent" : "child";
1064
+ if ((side === "parent" ? relation.parentCollection : relation.childCollection) !== collectionSlug) throw new SchemaError(`Relation "${named}" has no ${side} end on collection "${collectionSlug}"`, "VALIDATION_ERROR");
1065
+ return {
1066
+ relation: named,
1067
+ relationSide: side,
1068
+ targetCollection: side === "parent" ? relation.childCollection : relation.parentCollection
1069
+ };
1070
+ }
1071
+ /**
1072
+ * Create or update the relations a seed declares, before the fields that name
1073
+ * them.
1074
+ *
1075
+ * A relation's two collections are fixed once it exists: changing one would
1076
+ * leave its links pointing into a collection that is no longer an end of it, so
1077
+ * a seed that names different ones fails rather than rewriting the row. Labels
1078
+ * and limits are updated under `onConflict: "update"`.
1079
+ */
1080
+ async function applySeedRelations(db, relations, seedCollections, onConflict, result) {
1081
+ const existing = await readRelationEnds(db);
1082
+ const known = new Set(seedCollections.map((collection) => collection.slug));
1083
+ for (const row of await db.selectFrom("_emdash_collections").select("slug").execute()) known.add(row.slug);
1084
+ const now = (/* @__PURE__ */ new Date()).toISOString();
1085
+ for (const relation of relations) {
1086
+ for (const end of [relation.parentCollection, relation.childCollection]) if (!known.has(end)) throw new SchemaError(`Relation "${relation.slug}" names collection "${end}", which does not exist`, "COLLECTION_NOT_FOUND");
1087
+ const current = existing.get(relation.slug);
1088
+ if (current) {
1089
+ if (current.parentCollection !== relation.parentCollection || current.childCollection !== relation.childCollection) throw new SchemaError(`Relation "${relation.slug}" joins ${current.parentCollection} to ${current.childCollection}; a relation's collections cannot change`, "RELATION_COLLECTIONS_IMMUTABLE");
1090
+ if (onConflict === "error") throw new Error(`Conflict: relation "${relation.slug}" already exists`);
1091
+ if (onConflict !== "update") {
1092
+ result.relations.skipped++;
1093
+ continue;
1094
+ }
1095
+ await db.updateTable("_emdash_relations").set({
1096
+ parent_label: relation.parentLabel,
1097
+ parent_label_singular: relation.parentLabelSingular ?? null,
1098
+ child_label: relation.childLabel,
1099
+ child_label_singular: relation.childLabelSingular ?? null,
1100
+ max_children_per_parent: relation.maxChildrenPerParent ?? null,
1101
+ max_parents_per_child: relation.maxParentsPerChild ?? null,
1102
+ updated_at: now
1103
+ }).where("slug", "=", relation.slug).execute();
1104
+ result.relations.updated++;
1105
+ continue;
1106
+ }
1107
+ await db.insertInto("_emdash_relations").values({
1108
+ id: ulid(),
1109
+ slug: relation.slug,
1110
+ parent_collection: relation.parentCollection,
1111
+ child_collection: relation.childCollection,
1112
+ parent_label: relation.parentLabel,
1113
+ parent_label_singular: relation.parentLabelSingular ?? null,
1114
+ child_label: relation.childLabel,
1115
+ child_label_singular: relation.childLabelSingular ?? null,
1116
+ max_children_per_parent: relation.maxChildrenPerParent ?? null,
1117
+ max_parents_per_child: relation.maxParentsPerChild ?? null,
1118
+ created_at: now,
1119
+ updated_at: now
1120
+ }).execute();
1121
+ existing.set(relation.slug, {
1122
+ parentCollection: relation.parentCollection,
1123
+ childCollection: relation.childCollection
1124
+ });
1125
+ result.relations.created++;
1126
+ }
1127
+ }
1128
+ function allocateSeedRelationName(collectionSlug, fieldSlug, usedNames) {
1129
+ const baseName = `${collectionSlug}_${fieldSlug}`.slice(0, 63);
1130
+ for (let attempt = 0; attempt < SEED_RELATION_NAME_MAX_ATTEMPTS; attempt++) {
1131
+ const suffix = attempt === 0 ? "" : `_${attempt + 1}`;
1132
+ const name = attempt === 0 ? baseName : `${baseName.slice(0, 63 - suffix.length)}${suffix}`;
1133
+ if (!usedNames.has(name)) {
1134
+ usedNames.add(name);
1135
+ return name;
1136
+ }
1137
+ }
1138
+ throw new SchemaError("Could not allocate a unique relation name", "RELATION_NAME_CONFLICT");
1139
+ }
1140
+ /**
1141
+ * Slugful entries use the existing locale-aware key. Slugless seed entries
1142
+ * persist their seed ID, which keeps re-application idempotent.
1143
+ */
1144
+ function seedEntryKey(entry, slug, locale) {
1145
+ return slug === null ? `id:${entry.id}` : `slug:${locale}:${slug}`;
1146
+ }
1147
+ /**
1148
+ * Find which of a collection's seed entries already exist, keyed by
1149
+ * `seedEntryKey`. Each query covers a batch of entries.
1150
+ */
1151
+ async function findExistingSeedEntries(repo, collectionSlug, entries, defaultLocale, includeTrashed = false) {
1152
+ const identities = entries.map((entry) => ({
1153
+ entry,
1154
+ ...seedEntryIdentity(entry, defaultLocale)
1155
+ }));
1156
+ const slugsByLocale = /* @__PURE__ */ new Map();
1157
+ for (const { slug, locale } of identities) {
1158
+ if (slug === null) continue;
1159
+ const slugs = slugsByLocale.get(locale);
1160
+ if (slugs) slugs.push(slug);
1161
+ else slugsByLocale.set(locale, [slug]);
1162
+ }
1163
+ const bySlug = /* @__PURE__ */ new Map();
1164
+ for (const [locale, slugs] of slugsByLocale) bySlug.set(locale, await repo.findManyBySlugsInLocale(collectionSlug, slugs, locale, { includeTrashed }));
1165
+ const byId = await repo.findManyByIds(collectionSlug, identities.filter(({ slug }) => slug === null).map(({ entry }) => entry.id), { includeTrashed });
1166
+ const existing = /* @__PURE__ */ new Map();
1167
+ for (const { entry, slug, locale } of identities) {
1168
+ const item = slug === null ? byId.get(entry.id) : bySlug.get(locale)?.get(slug);
1169
+ if (item) existing.set(seedEntryKey(entry, slug, locale), item);
1170
+ }
1171
+ return existing;
1172
+ }
1173
+ /**
1174
+ * Apply hierarchical taxonomy terms (parents before children). Stops before
1175
+ * creating a term once `mayCreate` returns false, and returns how many terms
1176
+ * were found or created.
1177
+ */
1178
+ async function applyHierarchicalTerms(termRepo, taxonomyName, defLocale, terms, existingTerms, termSeedIdMap, result, onConflict, mayCreate) {
1179
+ let processed = 0;
1180
+ const slugToId = /* @__PURE__ */ new Map();
1181
+ const resolveTermLocale = (term) => resolveConfiguredLocale(term.locale ?? defLocale);
1182
+ let remaining = [...terms];
1183
+ let maxPasses = 10;
1184
+ while (remaining.length > 0 && maxPasses > 0) {
1185
+ const processedThisPass = [];
1186
+ for (const term of remaining) {
1187
+ const termLocale = resolveTermLocale(term);
1188
+ const parentReady = !term.parent || slugToId.has(`${termLocale}::${term.parent}`);
1189
+ const translationReady = !term.translationOf || termSeedIdMap.has(term.translationOf);
1190
+ if (!parentReady || !translationReady) continue;
1191
+ const parentId = term.parent ? slugToId.get(`${termLocale}::${term.parent}`) : void 0;
1192
+ const translationOf = term.translationOf ? termSeedIdMap.get(term.translationOf) : void 0;
1193
+ const termKey = seedTermKey(termLocale, term.slug);
1194
+ const existingId = existingTerms.get(termKey);
1195
+ if (existingId) {
1196
+ if (onConflict === "error") throw new Error(`Conflict: taxonomy term "${term.slug}" in "${taxonomyName}" (${termLocale}) already exists`);
1197
+ if (onConflict === "update") {
1198
+ await termRepo.update(existingId, {
1199
+ label: term.label,
1200
+ parentId,
1201
+ data: term.description ? { description: term.description } : {}
1202
+ });
1203
+ result.taxonomies.terms++;
1204
+ }
1205
+ slugToId.set(termKey, existingId);
1206
+ if (term.id) termSeedIdMap.set(term.id, existingId);
1207
+ } else {
1208
+ if (!mayCreate()) return {
1209
+ processed,
1210
+ complete: false
1211
+ };
1212
+ const created = await termRepo.create({
1213
+ name: taxonomyName,
1214
+ slug: term.slug,
1215
+ label: term.label,
1216
+ parentId,
1217
+ data: term.description ? { description: term.description } : void 0,
1218
+ locale: termLocale,
1219
+ translationOf
1220
+ });
1221
+ existingTerms.set(termKey, created.id);
1222
+ slugToId.set(termKey, created.id);
1223
+ if (term.id) termSeedIdMap.set(term.id, created.id);
1224
+ result.taxonomies.terms++;
1225
+ }
1226
+ processed++;
1227
+ processedThisPass.push(term.slug + "::" + termLocale);
1228
+ }
1229
+ remaining = remaining.filter((term) => !processedThisPass.includes(term.slug + "::" + resolveTermLocale(term)));
1230
+ maxPasses--;
1231
+ }
1232
+ if (remaining.length > 0) console.warn(`Could not process ${remaining.length} terms due to missing parents/translations`);
1233
+ return {
1234
+ processed,
1235
+ complete: true
1236
+ };
1237
+ }
1238
+ /**
1239
+ * Apply byline credits to a content entry.
1240
+ * In update mode, clears existing credits even if the seed has none.
1241
+ */
1242
+ async function applyContentBylines(bylineRepo, collectionSlug, contentId, entry, seedBylineIdMap, isUpdate = false) {
1243
+ if (!entry.bylines || entry.bylines.length === 0) {
1244
+ if (isUpdate) await bylineRepo.setContentBylines(collectionSlug, contentId, []);
1245
+ return;
1246
+ }
1247
+ const credits = entry.bylines.map((credit) => {
1248
+ const bylineId = seedBylineIdMap.get(credit.byline);
1249
+ if (!bylineId) return null;
1250
+ return {
1251
+ bylineId,
1252
+ roleLabel: credit.roleLabel ?? null
1253
+ };
1254
+ }).filter((credit) => Boolean(credit));
1255
+ if (credits.length !== entry.bylines.length) console.warn(`content.${collectionSlug}.${entry.slug ?? entry.id}: one or more byline refs could not be resolved`);
1256
+ if (credits.length > 0 || isUpdate) await bylineRepo.setContentBylines(collectionSlug, contentId, credits);
1257
+ }
1258
+ /**
1259
+ * Apply taxonomy term assignments to a content entry.
1260
+ * In update mode, clears existing assignments before re-attaching.
1261
+ */
1262
+ /**
1263
+ * Create or update a field from a seed.
1264
+ *
1265
+ * A reference field bound to a relation is storage-less: it persists no column
1266
+ * and its edges live in `_emdash_content_references`. Seeds create fields
1267
+ * through the registry (not the schema handler that owns the relation
1268
+ * lifecycle), so this mirrors the handler — it creates the relation on first
1269
+ * insert (field + relation in one transaction) and preserves the
1270
+ * server-assigned `validation.relation`/`targetCollection` on re-apply, since a
1271
+ * seed's field validation omits them and would otherwise orphan the relation. A
1272
+ * reference field with no `targetCollection` cannot form a relation, so it is
1273
+ * created column-backed, holding a plain entry id.
1274
+ */
1275
+ async function upsertSeedField(db, collectionSlug, field, existing, knownRelations) {
1276
+ const bound = resolveSeedFieldRelation(collectionSlug, field, knownRelations);
1277
+ if (existing) {
1278
+ const update = {
1279
+ label: field.label,
1280
+ type: field.type,
1281
+ required: field.required || false,
1282
+ unique: field.unique || false,
1283
+ searchable: field.searchable || false,
1284
+ indexed: field.indexed || false,
1285
+ translatable: field.translatable,
1286
+ defaultValue: field.defaultValue,
1287
+ widget: field.widget,
1288
+ options: field.options
1289
+ };
1290
+ if (!bound && field.type === "reference" && !existing.validation?.relation && typeof field.validation?.targetCollection === "string") {
1291
+ await bindReferenceField(db, collectionSlug, existing, {
1292
+ ...update,
1293
+ validation: field.validation
1294
+ }, field.validation.targetCollection);
1295
+ return;
1296
+ }
1297
+ const validation = bound ? {
1298
+ ...field.validation,
1299
+ ...bound
1300
+ } : field.type === "reference" && existing.validation?.relation ? {
1301
+ ...field.validation,
1302
+ relation: existing.validation.relation,
1303
+ relationSide: existing.validation.relationSide,
1304
+ targetCollection: existing.validation.targetCollection
1305
+ } : field.validation;
1306
+ await new SchemaRegistry(db).updateField(collectionSlug, field.slug, {
1307
+ ...update,
1308
+ validation
1309
+ });
1310
+ return;
1311
+ }
1312
+ const input = {
1313
+ slug: field.slug,
1314
+ label: field.label,
1315
+ type: field.type,
1316
+ required: field.required || false,
1317
+ unique: field.unique || false,
1318
+ searchable: field.searchable || false,
1319
+ indexed: field.indexed || false,
1320
+ translatable: field.translatable,
1321
+ defaultValue: field.defaultValue,
1322
+ validation: field.validation,
1323
+ widget: field.widget,
1324
+ options: field.options
1325
+ };
1326
+ if (bound) {
1327
+ await new SchemaRegistry(db).createField(collectionSlug, {
1328
+ ...input,
1329
+ validation: {
1330
+ ...field.validation,
1331
+ ...bound
1332
+ }
1333
+ });
1334
+ return;
1335
+ }
1336
+ const targetCollection = field.type === "reference" && typeof field.validation?.targetCollection === "string" ? field.validation.targetCollection : void 0;
1337
+ if (targetCollection) {
1338
+ await withTransaction(db, async (trx) => {
1339
+ const relation = await createFieldRelation(trx, collectionSlug, field.slug, field.label, targetCollection, field.validation?.multiple ? null : 1);
1340
+ await new SchemaRegistry(trx).createField(collectionSlug, {
1341
+ ...input,
1342
+ validation: {
1343
+ ...field.validation,
1344
+ relation: relation.slug,
1345
+ relationSide: "parent"
1346
+ }
1347
+ });
1348
+ });
1349
+ return;
1350
+ }
1351
+ await new SchemaRegistry(db).createField(collectionSlug, input);
1352
+ }
1353
+ /**
1354
+ * Split resolved content `data` into the plain column data and the reference
1355
+ * edge writes. A reference field bound to a relation is storage-less, so its key
1356
+ * left in `data` would hit the column writer (and `syncDataColumns` on publish)
1357
+ * and throw "no such column". Its `$ref:`-resolved value — a child entry id or
1358
+ * an array of them — is captured as an edge write instead, keyed by the field's
1359
+ * relation. A reference field with no relation still owns its column, so its
1360
+ * resolved id is written there like any other string.
1361
+ */
1362
+ /** One collection's reference fields by slug, read once per collection: the
1363
+ * schema phase has finished by the time content is applied. */
1364
+ function referenceFieldsOf(collection) {
1365
+ return new Map((collection?.fields ?? []).filter((f) => f.type === "reference").map((f) => [f.slug, f]));
1366
+ }
1367
+ function splitReferenceFields(collectionSlug, referenceFields, data) {
1368
+ if (referenceFields.size === 0) return {
1369
+ columnData: data,
1370
+ edges: []
1371
+ };
1372
+ const columnData = {};
1373
+ const edges = [];
1374
+ for (const [key, value] of Object.entries(data)) {
1375
+ if (!referenceFields.get(key)?.validation?.relation) {
1376
+ columnData[key] = value;
1377
+ continue;
1378
+ }
1379
+ const childIds = [];
1380
+ for (const candidate of Array.isArray(value) ? value : [value]) {
1381
+ if (typeof candidate !== "string" || candidate.length === 0) continue;
1382
+ if (candidate.startsWith("$ref:")) {
1383
+ console.warn(`content.${collectionSlug}: reference "${candidate}" in field "${key}" did not resolve (not yet created or missing). Skipping.`);
1384
+ continue;
1385
+ }
1386
+ childIds.push(candidate);
1387
+ }
1388
+ edges.push({
1389
+ fieldSlug: key,
1390
+ childIds
1391
+ });
1392
+ }
1393
+ return {
1394
+ columnData,
1395
+ edges
1396
+ };
1397
+ }
1398
+ /**
1399
+ * Write reference edges for a content entry, replacing any existing set per
1400
+ * relation (so re-applying a seed is idempotent). Throws to abort the enclosing
1401
+ * transaction if a child entry cannot be resolved — a half-written entry is
1402
+ * worse than a failed apply.
1403
+ */
1404
+ async function applyContentReferences(trx, collectionSlug, contentId, edges) {
1405
+ for (const { fieldSlug, childIds } of edges) {
1406
+ const result = await setReferenceSelection(trx, collectionSlug, contentId, fieldSlug, childIds);
1407
+ if (!result.success) throw new Error(`content.${collectionSlug}: failed to write references for "${contentId}": ${result.error.message}`);
1408
+ }
1409
+ }
1410
+ async function applyContentTaxonomies(db, collectionSlug, contentId, entry, isUpdate) {
1411
+ const termRepo = new TaxonomyRepository(db);
1412
+ if (isUpdate) await termRepo.clearEntryTerms(collectionSlug, contentId);
1413
+ if (!entry.taxonomies) {
1414
+ if (isUpdate) {
1415
+ const { invalidateTermCache } = await import("./taxonomies-B__VmCKQ.mjs").then((n) => n.f);
1416
+ invalidateTermCache();
1417
+ }
1418
+ return;
1419
+ }
1420
+ for (const [taxonomyName, termSlugs] of Object.entries(entry.taxonomies)) for (const termSlug of termSlugs) {
1421
+ const term = await termRepo.findBySlug(taxonomyName, termSlug);
1422
+ if (term) await termRepo.attachToEntry(collectionSlug, contentId, term.id);
1423
+ }
1424
+ const { invalidateTermCache } = await import("./taxonomies-B__VmCKQ.mjs").then((n) => n.f);
1425
+ invalidateTermCache();
1426
+ }
1427
+ /**
1428
+ * Collect menu item rows recursively.
1429
+ *
1430
+ * When a `SeedMenuItem` carries `id`/`translationOf`, the import resolves the
1431
+ * source item's `translation_group` so cross-locale "same nav entry" links
1432
+ * survive export → apply. Items without `translationOf` get a fresh group
1433
+ * (= their own id).
1434
+ */
1435
+ function collectMenuItems(rows, menuId, locale, items, parentId, startOrder, seedIdMap, itemSeedIdMap) {
1436
+ let count = 0;
1437
+ let order = startOrder;
1438
+ for (const item of items) {
1439
+ const itemId = ulid();
1440
+ const itemLocale = item.locale ?? locale;
1441
+ let referenceId = null;
1442
+ let referenceCollection = null;
1443
+ if (item.type !== "custom" && item.type !== "taxonomy") {
1444
+ const collection = item.collection || (item.type === "page" || item.type === "post" ? `${item.type}s` : null);
1445
+ if (item.ref) {
1446
+ const resolved = seedIdMap.get(item.ref);
1447
+ if (resolved && collection) {
1448
+ referenceId = resolved;
1449
+ referenceCollection = collection;
1450
+ }
1451
+ } else referenceCollection = collection;
1452
+ }
1453
+ let translationGroup = itemId;
1454
+ if (item.translationOf) {
1455
+ const source = itemSeedIdMap.get(item.translationOf);
1456
+ if (source) translationGroup = source.translationGroup;
1457
+ else console.warn(`menu item "${item.label ?? item.url ?? item.ref ?? "(unlabeled)"}" (${itemLocale}): translationOf "${item.translationOf}" not found yet; minting a fresh group.`);
1458
+ }
1459
+ rows.push({
1460
+ id: itemId,
1461
+ menu_id: menuId,
1462
+ parent_id: parentId,
1463
+ sort_order: order,
1464
+ type: item.type,
1465
+ reference_collection: referenceCollection,
1466
+ reference_id: referenceId,
1467
+ custom_url: item.url ?? null,
1468
+ label: item.label || "",
1469
+ title_attr: item.titleAttr ?? null,
1470
+ target: item.target ?? null,
1471
+ css_classes: item.cssClasses ?? null,
1472
+ created_at: (/* @__PURE__ */ new Date()).toISOString(),
1473
+ locale: itemLocale,
1474
+ translation_group: translationGroup
1475
+ });
1476
+ if (item.id) itemSeedIdMap.set(item.id, {
1477
+ id: itemId,
1478
+ translationGroup
1479
+ });
1480
+ count++;
1481
+ order++;
1482
+ if (item.children && item.children.length > 0) {
1483
+ const childCount = collectMenuItems(rows, menuId, itemLocale, item.children, itemId, 0, seedIdMap, itemSeedIdMap);
1484
+ count += childCount;
1485
+ }
1486
+ }
1487
+ return count;
1488
+ }
1489
+ /**
1490
+ * Build a widget row
1491
+ */
1492
+ function createSeedWidgetRow(areaId, widget, sortOrder) {
1493
+ return {
1494
+ id: ulid(),
1495
+ area_id: areaId,
1496
+ sort_order: sortOrder,
1497
+ type: widget.type,
1498
+ title: widget.title ?? null,
1499
+ content: widget.content ? JSON.stringify(widget.content) : null,
1500
+ menu_name: widget.menuName ?? null,
1501
+ component_id: widget.componentId ?? null,
1502
+ component_props: widget.props ? JSON.stringify(widget.props) : null
1503
+ };
1504
+ }
1505
+ /**
1506
+ * Type guard for $media reference
1507
+ */
1508
+ function isSeedMediaReference(value) {
1509
+ if (typeof value !== "object" || value === null || !("$media" in value)) return false;
1510
+ const media = value.$media;
1511
+ return typeof media === "object" && media !== null && "url" in media && typeof media.url === "string";
1512
+ }
1513
+ /**
1514
+ * Resolve $ref: and $media references in content data
1515
+ */
1516
+ async function resolveReferences(data, seedIdMap, mediaContext, result) {
1517
+ const resolved = {};
1518
+ for (const [key, value] of Object.entries(data)) resolved[key] = await resolveValue(value, seedIdMap, mediaContext, result);
1519
+ return resolved;
1520
+ }
1521
+ /**
1522
+ * Resolve a single value recursively
1523
+ */
1524
+ async function resolveValue(value, seedIdMap, mediaContext, result) {
1525
+ if (typeof value === "string" && value.startsWith("$ref:")) {
1526
+ const seedId = value.slice(5);
1527
+ return seedIdMap.get(seedId) ?? value;
1528
+ }
1529
+ if (isSeedMediaReference(value)) return resolveMedia(value, mediaContext, result);
1530
+ if (Array.isArray(value)) return Promise.all(value.map((item) => resolveValue(item, seedIdMap, mediaContext, result)));
1531
+ if (typeof value === "object" && value !== null) {
1532
+ const resolved = {};
1533
+ for (const [k, v] of Object.entries(value)) resolved[k] = await resolveValue(v, seedIdMap, mediaContext, result);
1534
+ if (resolved._type === "gallery" && Array.isArray(resolved.images)) resolved.images = sanitizeGalleryImages(resolved.images, ulid);
1535
+ else if (resolved._type === "image" && "asset" in value && isSeedMediaReference(value.asset)) {
1536
+ const [image] = sanitizeGalleryImages([resolved], ulid);
1537
+ if (image) Object.assign(resolved, image);
1538
+ }
1539
+ return resolved;
1540
+ }
1541
+ return value;
1542
+ }
1543
+ /**
1544
+ * Resolve a seeded byline avatar to a `media` row id. The file is assumed to
1545
+ * already exist in storage (the caller supplies its `storageKey`), so nothing
1546
+ * is downloaded or uploaded.
1547
+ *
1548
+ * Idempotent: if a media row with the same `storageKey` already exists it is
1549
+ * reused rather than duplicated, so re-applying a seed in `update` mode does
1550
+ * not leak rows. `created` reports whether a new row was inserted, so the
1551
+ * caller can both account for it and delete it if the subsequent byline write
1552
+ * fails (the only cross-dialect way to avoid an orphan — `withTransaction`
1553
+ * is a no-op on D1).
1554
+ */
1555
+ async function resolveSeedBylineAvatar(db, avatar) {
1556
+ const existing = await db.selectFrom("media").select("id").where("storage_key", "=", avatar.storageKey).orderBy("id", "asc").executeTakeFirst();
1557
+ if (existing) return {
1558
+ id: existing.id,
1559
+ created: false
1560
+ };
1561
+ const basename = avatar.storageKey.split("/").pop();
1562
+ const filename = avatar.filename ?? (basename && basename.length > 0 ? basename : avatar.storageKey);
1563
+ return {
1564
+ id: (await new MediaRepository(db).create({
1565
+ filename,
1566
+ mimeType: avatar.mimeType ?? "image/jpeg",
1567
+ storageKey: avatar.storageKey,
1568
+ alt: avatar.alt,
1569
+ width: avatar.width,
1570
+ height: avatar.height,
1571
+ status: "ready"
1572
+ })).id,
1573
+ created: true
1574
+ };
1575
+ }
1576
+ /**
1577
+ * Delete a media row by id. Best-effort cleanup for a failed byline write: a
1578
+ * failure here must not mask the original error that triggered the cleanup, so
1579
+ * it is logged and swallowed rather than thrown.
1580
+ */
1581
+ async function deleteMediaRow(db, id) {
1582
+ try {
1583
+ await db.deleteFrom("media").where("id", "=", id).execute();
1584
+ } catch (error) {
1585
+ console.warn(`[seed] failed to clean up orphaned avatar media ${id}:`, error);
1586
+ }
1587
+ }
1588
+ /**
1589
+ * Resolve a $media reference by downloading and uploading the media
1590
+ */
1591
+ async function resolveMedia(ref, ctx, result) {
1592
+ const { url, alt, filename, caption, libraryCaption } = ref.$media;
1593
+ const cached = ctx.mediaCache.get(url);
1594
+ if (cached) {
1595
+ result.media.skipped++;
1596
+ return {
1597
+ ...cached,
1598
+ alt: alt ?? cached.alt,
1599
+ caption: caption ?? cached.caption
1600
+ };
1601
+ }
1602
+ if (ctx.skipMediaDownload) {
1603
+ const defaultCaption = libraryCaption ?? void 0;
1604
+ const mediaValue = {
1605
+ provider: "external",
1606
+ id: ulid(),
1607
+ src: url,
1608
+ alt: alt ?? void 0,
1609
+ caption: caption ?? defaultCaption,
1610
+ filename: filename ?? void 0
1611
+ };
1612
+ ctx.mediaCache.set(url, {
1613
+ ...mediaValue,
1614
+ caption: defaultCaption
1615
+ });
1616
+ result.media.skipped++;
1617
+ return mediaValue;
1618
+ }
1619
+ if (!ctx.storage) {
1620
+ console.warn(`Skipping $media reference (no storage configured): ${url}`);
1621
+ result.media.skipped++;
1622
+ return null;
1623
+ }
1624
+ try {
1625
+ validateExternalUrl(url);
1626
+ console.log(` 📥 Downloading: ${url}`);
1627
+ ctx.budget?.countMediaDownload();
1628
+ const response = await ssrfSafeFetch(url, { headers: { "User-Agent": "EmDash-CMS/1.0" } });
1629
+ if (!response.ok) {
1630
+ console.warn(` ⚠️ Failed to download ${url}: ${response.status}`);
1631
+ result.media.skipped++;
1632
+ return null;
1633
+ }
1634
+ const contentType = response.headers.get("content-type") || "application/octet-stream";
1635
+ const ext = getExtensionFromContentType(contentType) || getExtensionFromUrl(url) || ".bin";
1636
+ const arrayBuffer = await response.arrayBuffer();
1637
+ const body = new Uint8Array(arrayBuffer);
1638
+ const contentHash = await computeContentHash(body);
1639
+ const mediaRepo = new MediaRepository(ctx.db);
1640
+ const existing = await mediaRepo.findByContentHash(contentHash);
1641
+ if (existing) {
1642
+ const mediaValue = {
1643
+ provider: "local",
1644
+ id: existing.id,
1645
+ alt: alt ?? existing.alt ?? void 0,
1646
+ caption: caption ?? existing.caption ?? void 0,
1647
+ width: existing.width ?? void 0,
1648
+ height: existing.height ?? void 0,
1649
+ mimeType: existing.mimeType,
1650
+ filename: existing.filename,
1651
+ meta: { storageKey: existing.storageKey }
1652
+ };
1653
+ ctx.mediaCache.set(url, {
1654
+ ...mediaValue,
1655
+ caption: existing.caption ?? void 0
1656
+ });
1657
+ result.media.skipped++;
1658
+ console.log(` ✅ Reused: ${existing.filename}`);
1659
+ return mediaValue;
1660
+ }
1661
+ const storageId = ulid();
1662
+ const finalFilename = filename || generateFilename(url, ext);
1663
+ const storageKey = `${storageId}${ext}`;
1664
+ let width;
1665
+ let height;
1666
+ if (contentType.startsWith("image/")) {
1667
+ const dimensions = getImageDimensions(body);
1668
+ width = dimensions?.width;
1669
+ height = dimensions?.height;
1670
+ }
1671
+ await ctx.storage.upload({
1672
+ key: storageKey,
1673
+ body,
1674
+ contentType
1675
+ });
1676
+ const media = await mediaRepo.create({
1677
+ filename: finalFilename,
1678
+ mimeType: contentType,
1679
+ size: body.length,
1680
+ width,
1681
+ height,
1682
+ alt,
1683
+ caption: (libraryCaption === void 0 ? caption : libraryCaption) ?? void 0,
1684
+ storageKey,
1685
+ contentHash,
1686
+ status: "ready"
1687
+ });
1688
+ const mediaValue = {
1689
+ provider: "local",
1690
+ id: media.id,
1691
+ alt: alt ?? void 0,
1692
+ caption: caption ?? media.caption ?? void 0,
1693
+ width,
1694
+ height,
1695
+ mimeType: contentType,
1696
+ filename: finalFilename,
1697
+ meta: { storageKey }
1698
+ };
1699
+ ctx.mediaCache.set(url, {
1700
+ ...mediaValue,
1701
+ caption: media.caption ?? void 0
1702
+ });
1703
+ result.media.created++;
1704
+ console.log(` ✅ Uploaded: ${finalFilename}`);
1705
+ return mediaValue;
1706
+ } catch (error) {
1707
+ console.warn(` ⚠️ Error processing $media ${url}:`, error instanceof Error ? error.message : error);
1708
+ result.media.skipped++;
1709
+ return null;
1710
+ }
1711
+ }
1712
+ /**
1713
+ * Get file extension from content type
1714
+ */
1715
+ function getExtensionFromContentType(contentType) {
1716
+ const baseMime = contentType.split(";")[0].trim();
1717
+ const ext = mime.getExtension(baseMime);
1718
+ return ext ? `.${ext}` : null;
1719
+ }
1720
+ /**
1721
+ * Get file extension from URL
1722
+ */
1723
+ function getExtensionFromUrl(url) {
1724
+ try {
1725
+ const match = new URL(url).pathname.match(FILE_EXTENSION_PATTERN);
1726
+ return match ? `.${match[1]}` : null;
1727
+ } catch {
1728
+ return null;
1729
+ }
1730
+ }
1731
+ /**
1732
+ * Generate a filename from URL
1733
+ */
1734
+ function generateFilename(url, ext) {
1735
+ try {
1736
+ return `${(new URL(url).pathname.split("/").pop() || "media").replace(EXTENSION_PATTERN, "").replace(QUERY_PARAM_PATTERN, "").replace(SANITIZE_PATTERN, "-").replace(MULTIPLE_HYPHENS_PATTERN, "-") || "media"}${ext}`;
1737
+ } catch {
1738
+ return `media${ext}`;
1739
+ }
1740
+ }
1741
+ /**
1742
+ * Get image dimensions from buffer using image-size.
1743
+ * Supports PNG, JPEG, GIF, WebP, AVIF, SVG, TIFF, and more.
1744
+ */
1745
+ function getImageDimensions(buffer) {
1746
+ try {
1747
+ const result = imageSize(buffer);
1748
+ if (result.width != null && result.height != null) return {
1749
+ width: result.width,
1750
+ height: result.height
1751
+ };
1752
+ return null;
1753
+ } catch {
1754
+ return null;
1755
+ }
1756
+ }
1757
+
1758
+ //#endregion
1759
+ export { sanitizeGalleryImages as a, resolveImageMedia as i, applySeedWithinBudget as n, createPublicMediaUrlResolver as o, apply_exports as r, applySeed as t };
1760
+ //# sourceMappingURL=apply-DVnupNeS.mjs.map