@sonicjs-cms/core 3.0.0-beta.10 → 3.0.0-beta.12

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 (49) hide show
  1. package/dist/{chunk-V464XBYS.js → chunk-ALNODOY4.js} +3 -3
  2. package/dist/{chunk-V464XBYS.js.map → chunk-ALNODOY4.js.map} +1 -1
  3. package/dist/{chunk-MUNO67TT.cjs → chunk-BYLQOBO6.cjs} +13 -13
  4. package/dist/{chunk-MUNO67TT.cjs.map → chunk-BYLQOBO6.cjs.map} +1 -1
  5. package/dist/{chunk-IDCZBF35.js → chunk-DMXDQ5YI.js} +4 -4
  6. package/dist/{chunk-IDCZBF35.js.map → chunk-DMXDQ5YI.js.map} +1 -1
  7. package/dist/{chunk-ALDRXTUO.js → chunk-INKP2WNU.js} +2 -2
  8. package/dist/{chunk-ALDRXTUO.js.map → chunk-INKP2WNU.js.map} +1 -1
  9. package/dist/{chunk-IHTXB7AT.cjs → chunk-KI5KMJH2.cjs} +2 -2
  10. package/dist/{chunk-IHTXB7AT.cjs.map → chunk-KI5KMJH2.cjs.map} +1 -1
  11. package/dist/{chunk-R4ILO3W6.cjs → chunk-LLWLHFTD.cjs} +2 -2
  12. package/dist/{chunk-R4ILO3W6.cjs.map → chunk-LLWLHFTD.cjs.map} +1 -1
  13. package/dist/{chunk-PMGOBS6X.cjs → chunk-NYLWNR6T.cjs} +4 -4
  14. package/dist/{chunk-PMGOBS6X.cjs.map → chunk-NYLWNR6T.cjs.map} +1 -1
  15. package/dist/{chunk-ATUPB6MN.js → chunk-Q3P7Y5VO.js} +4 -4
  16. package/dist/{chunk-ATUPB6MN.js.map → chunk-Q3P7Y5VO.js.map} +1 -1
  17. package/dist/{chunk-6OC6MF3C.js → chunk-R2O6TTQS.js} +9 -20
  18. package/dist/{chunk-TO6EY4P7.cjs.map → chunk-R2O6TTQS.js.map} +1 -1
  19. package/dist/{chunk-PYVFXCSD.js → chunk-SUHGXAII.js} +2 -2
  20. package/dist/{chunk-PYVFXCSD.js.map → chunk-SUHGXAII.js.map} +1 -1
  21. package/dist/{chunk-3KYKEXV7.cjs → chunk-SY7CBACS.cjs} +10 -10
  22. package/dist/{chunk-3KYKEXV7.cjs.map → chunk-SY7CBACS.cjs.map} +1 -1
  23. package/dist/{chunk-TO6EY4P7.cjs → chunk-TV7LRFXH.cjs} +200 -211
  24. package/dist/{chunk-6OC6MF3C.js.map → chunk-TV7LRFXH.cjs.map} +1 -1
  25. package/dist/{chunk-F67UK75A.cjs → chunk-XGH2FVVR.cjs} +3 -3
  26. package/dist/{chunk-F67UK75A.cjs.map → chunk-XGH2FVVR.cjs.map} +1 -1
  27. package/dist/{chunk-IGADDMXH.js → chunk-XHBEFQJ3.js} +3 -3
  28. package/dist/{chunk-IGADDMXH.js.map → chunk-XHBEFQJ3.js.map} +1 -1
  29. package/dist/index.cjs +286 -254
  30. package/dist/index.cjs.map +1 -1
  31. package/dist/index.js +47 -15
  32. package/dist/index.js.map +1 -1
  33. package/dist/middleware.cjs +32 -32
  34. package/dist/middleware.js +3 -3
  35. package/dist/migrations-AFSCRO56.cjs +13 -0
  36. package/dist/{migrations-2XHQEGOQ.cjs.map → migrations-AFSCRO56.cjs.map} +1 -1
  37. package/dist/migrations-MLBACCPF.js +4 -0
  38. package/dist/{migrations-PE3CDVSM.js.map → migrations-MLBACCPF.js.map} +1 -1
  39. package/dist/plugins.cjs +40 -40
  40. package/dist/plugins.js +3 -3
  41. package/dist/routes.cjs +26 -26
  42. package/dist/routes.js +6 -6
  43. package/dist/services.cjs +18 -18
  44. package/dist/services.js +2 -2
  45. package/dist/utils.cjs +3 -3
  46. package/dist/utils.js +1 -1
  47. package/package.json +1 -1
  48. package/dist/migrations-2XHQEGOQ.cjs +0 -13
  49. package/dist/migrations-PE3CDVSM.js +0 -4
package/dist/index.cjs CHANGED
@@ -1,31 +1,32 @@
1
1
  'use strict';
2
2
 
3
3
  var chunkNUKJ54GA_cjs = require('./chunk-NUKJ54GA.cjs');
4
- var chunkTO6EY4P7_cjs = require('./chunk-TO6EY4P7.cjs');
4
+ var chunkTV7LRFXH_cjs = require('./chunk-TV7LRFXH.cjs');
5
5
  require('./chunk-HIKBY7MS.cjs');
6
6
  require('./chunk-N32OWET6.cjs');
7
7
  var chunk4BTBSXMR_cjs = require('./chunk-4BTBSXMR.cjs');
8
8
  var chunkYA3TJ65D_cjs = require('./chunk-YA3TJ65D.cjs');
9
9
  var chunkYP7GW2G5_cjs = require('./chunk-YP7GW2G5.cjs');
10
- var chunkMUNO67TT_cjs = require('./chunk-MUNO67TT.cjs');
10
+ var chunkBYLQOBO6_cjs = require('./chunk-BYLQOBO6.cjs');
11
11
  var chunk2CB4KY7I_cjs = require('./chunk-2CB4KY7I.cjs');
12
12
  var chunkJEQ7FLOD_cjs = require('./chunk-JEQ7FLOD.cjs');
13
- var chunkR4ILO3W6_cjs = require('./chunk-R4ILO3W6.cjs');
14
- var chunkIHTXB7AT_cjs = require('./chunk-IHTXB7AT.cjs');
13
+ var chunkLLWLHFTD_cjs = require('./chunk-LLWLHFTD.cjs');
14
+ var chunkKI5KMJH2_cjs = require('./chunk-KI5KMJH2.cjs');
15
15
  var chunkCRGUD4KC_cjs = require('./chunk-CRGUD4KC.cjs');
16
16
  var chunkPXNTCCPE_cjs = require('./chunk-PXNTCCPE.cjs');
17
17
  var chunkK623Q6WD_cjs = require('./chunk-K623Q6WD.cjs');
18
- var chunk3KYKEXV7_cjs = require('./chunk-3KYKEXV7.cjs');
19
- var chunkPMGOBS6X_cjs = require('./chunk-PMGOBS6X.cjs');
18
+ var chunkSY7CBACS_cjs = require('./chunk-SY7CBACS.cjs');
19
+ var chunkNYLWNR6T_cjs = require('./chunk-NYLWNR6T.cjs');
20
20
  var chunkJ6JTWD2A_cjs = require('./chunk-J6JTWD2A.cjs');
21
21
  var chunkIXUHXTHW_cjs = require('./chunk-IXUHXTHW.cjs');
22
22
  var chunkRCQ2HIQD_cjs = require('./chunk-RCQ2HIQD.cjs');
23
23
  require('./chunk-P3XDZL6Q.cjs');
24
- var chunkF67UK75A_cjs = require('./chunk-F67UK75A.cjs');
24
+ var chunkXGH2FVVR_cjs = require('./chunk-XGH2FVVR.cjs');
25
25
  var chunkMNWKYY5E_cjs = require('./chunk-MNWKYY5E.cjs');
26
26
  var chunkQTFKZBLC_cjs = require('./chunk-QTFKZBLC.cjs');
27
27
  require('./chunk-IGJUBJBW.cjs');
28
28
  var hono = require('hono');
29
+ var cors = require('hono/cors');
29
30
  var zod = require('zod');
30
31
  var cookie = require('hono/cookie');
31
32
  var html = require('hono/html');
@@ -573,7 +574,7 @@ function formatCellValue(value) {
573
574
  // src/plugins/core-plugins/database-tools-plugin/admin-routes.ts
574
575
  function createDatabaseToolsAdminRoutes() {
575
576
  const router3 = new hono.Hono();
576
- router3.use("*", chunkMUNO67TT_cjs.requireAuth());
577
+ router3.use("*", chunkBYLQOBO6_cjs.requireAuth());
577
578
  router3.get("/api/stats", async (c) => {
578
579
  try {
579
580
  const user = c.get("user");
@@ -976,7 +977,7 @@ var SiteConfigService = class {
976
977
 
977
978
  // src/plugins/core-plugins/email-plugin/routes/admin.ts
978
979
  var adminRoutes = new hono.Hono();
979
- adminRoutes.use("*", chunkMUNO67TT_cjs.requireAuth());
980
+ adminRoutes.use("*", chunkBYLQOBO6_cjs.requireAuth());
980
981
  adminRoutes.post("/settings", async (c) => {
981
982
  if (c.get("user")?.role !== "admin") {
982
983
  return c.json({ error: "admin role required" }, 403);
@@ -1014,7 +1015,7 @@ adminRoutes.post("/test", async (c) => {
1014
1015
  const { subject, html: html4, text } = renderTestEmail({ siteName });
1015
1016
  try {
1016
1017
  const settingsLoaded = await settings.load();
1017
- const result = await chunkTO6EY4P7_cjs.getEmailService().send({
1018
+ const result = await chunkTV7LRFXH_cjs.getEmailService().send({
1018
1019
  to,
1019
1020
  subject,
1020
1021
  html: html4,
@@ -1096,7 +1097,7 @@ function makeOnRegistrationCompleted(env) {
1096
1097
  siteName,
1097
1098
  loginUrl: siteConfig.buildLoginUrl(siteUrl)
1098
1099
  });
1099
- const result = await chunkTO6EY4P7_cjs.getEmailService().send({
1100
+ const result = await chunkTV7LRFXH_cjs.getEmailService().send({
1100
1101
  to: user.email,
1101
1102
  subject,
1102
1103
  html: html4,
@@ -1170,7 +1171,7 @@ function makeOnPasswordResetRequested(env) {
1170
1171
  expiresAt: Date.now() + DEFAULT_EXPIRY_MS,
1171
1172
  siteName
1172
1173
  });
1173
- const result = await chunkTO6EY4P7_cjs.getEmailService().send({
1174
+ const result = await chunkTV7LRFXH_cjs.getEmailService().send({
1174
1175
  to: user.email,
1175
1176
  subject,
1176
1177
  html: html4,
@@ -1238,7 +1239,7 @@ function makeOnPasswordResetCompleted(env) {
1238
1239
  supportEmail,
1239
1240
  when: Date.now()
1240
1241
  });
1241
- const result = await chunkTO6EY4P7_cjs.getEmailService().send({
1242
+ const result = await chunkTV7LRFXH_cjs.getEmailService().send({
1242
1243
  to: user.email,
1243
1244
  subject,
1244
1245
  html: html4,
@@ -1970,7 +1971,7 @@ var CloudflareEmailProvider = class {
1970
1971
  }
1971
1972
  }
1972
1973
  };
1973
- var emailPluginV3 = chunkPMGOBS6X_cjs.definePlugin({
1974
+ var emailPluginV3 = chunkNYLWNR6T_cjs.definePlugin({
1974
1975
  id: "email",
1975
1976
  version: "1.0.0",
1976
1977
  name: "Email",
@@ -1984,7 +1985,7 @@ var emailPluginV3 = chunkPMGOBS6X_cjs.definePlugin({
1984
1985
  const db = env.DB;
1985
1986
  if (db) {
1986
1987
  try {
1987
- const typeRegistry = new chunkMUNO67TT_cjs.DocumentTypeRegistry(db);
1988
+ const typeRegistry = new chunkBYLQOBO6_cjs.DocumentTypeRegistry(db);
1988
1989
  await typeRegistry.register({
1989
1990
  id: "email_log",
1990
1991
  name: "email_log",
@@ -1999,7 +2000,7 @@ var emailPluginV3 = chunkPMGOBS6X_cjs.definePlugin({
1999
2000
  } catch {
2000
2001
  }
2001
2002
  }
2002
- if (!chunkTO6EY4P7_cjs.hasEmailService()) {
2003
+ if (!chunkTV7LRFXH_cjs.hasEmailService()) {
2003
2004
  const settings = db ? await new EmailSettingsService(db).load() : {};
2004
2005
  const envResendKey = typeof env.RESEND_API_KEY === "string" && env.RESEND_API_KEY ? env.RESEND_API_KEY : void 0;
2005
2006
  const cfEmailBinding = env.EMAIL;
@@ -2017,7 +2018,7 @@ var emailPluginV3 = chunkPMGOBS6X_cjs.definePlugin({
2017
2018
  } else {
2018
2019
  provider = resolveEmailProvider({ env });
2019
2020
  }
2020
- chunkTO6EY4P7_cjs.setEmailService(new EmailService({ ...serviceOpts, provider }));
2021
+ chunkTV7LRFXH_cjs.setEmailService(new EmailService({ ...serviceOpts, provider }));
2021
2022
  }
2022
2023
  ctx.hooks.on("auth:registration:completed", makeOnRegistrationCompleted(env));
2023
2024
  ctx.hooks.on("auth:password-reset:requested", makeOnPasswordResetRequested(env));
@@ -2028,7 +2029,7 @@ var emailPluginV3 = chunkPMGOBS6X_cjs.definePlugin({
2028
2029
  var BATCH_SIZE = 100;
2029
2030
  ({
2030
2031
  schema: zod.z.record(zod.z.string(), zod.z.unknown())});
2031
- var emailReconciliationPlugin = chunkPMGOBS6X_cjs.definePlugin({
2032
+ var emailReconciliationPlugin = chunkNYLWNR6T_cjs.definePlugin({
2032
2033
  id: "email-reconciliation",
2033
2034
  version: "1.0.0",
2034
2035
  description: "Hourly cron that backfills email delivery state from provider status APIs. Only active for providers that implement EmailProvider.reconcile().",
@@ -2049,11 +2050,11 @@ var emailReconciliationPlugin = chunkPMGOBS6X_cjs.definePlugin({
2049
2050
  console.warn("[email-reconciliation] No DB binding in cron env \u2014 skipping.");
2050
2051
  return;
2051
2052
  }
2052
- if (!chunkTO6EY4P7_cjs.hasEmailService()) {
2053
+ if (!chunkTV7LRFXH_cjs.hasEmailService()) {
2053
2054
  console.warn("[email-reconciliation] EmailService not initialized \u2014 skipping.");
2054
2055
  return;
2055
2056
  }
2056
- const emailService = chunkTO6EY4P7_cjs.getEmailService();
2057
+ const emailService = chunkTV7LRFXH_cjs.getEmailService();
2057
2058
  let rows = [];
2058
2059
  try {
2059
2060
  const result = await db.prepare(
@@ -2539,8 +2540,8 @@ function buildOtpApi() {
2539
2540
  loginUrl: settings.loginUrl || "",
2540
2541
  loginButtonText: settings.loginButtonText || ""
2541
2542
  });
2542
- if (chunkTO6EY4P7_cjs.hasEmailService()) {
2543
- const sent = await chunkTO6EY4P7_cjs.getEmailService().send({
2543
+ if (chunkTV7LRFXH_cjs.hasEmailService()) {
2544
+ const sent = await chunkTV7LRFXH_cjs.getEmailService().send({
2544
2545
  to: normalizedEmail,
2545
2546
  subject: `Your login code for ${siteName}`,
2546
2547
  flow: "otp",
@@ -2642,21 +2643,21 @@ function buildOtpApi() {
2642
2643
  error: "Account is deactivated"
2643
2644
  }, 403);
2644
2645
  }
2645
- const tokenTtl = await chunkMUNO67TT_cjs.getJwtExpirySecondsFromDb(db, c.env);
2646
- const token = await chunkMUNO67TT_cjs.AuthManager.generateToken(user.id, user.email, user.role, c.env.JWT_SECRET, tokenTtl);
2646
+ const tokenTtl = await chunkBYLQOBO6_cjs.getJwtExpirySecondsFromDb(db, c.env);
2647
+ const token = await chunkBYLQOBO6_cjs.AuthManager.generateToken(user.id, user.email, user.role, c.env.JWT_SECRET, tokenTtl);
2647
2648
  cookie.setCookie(c, "auth_token", token, {
2648
2649
  httpOnly: true,
2649
2650
  secure: true,
2650
2651
  sameSite: "Strict",
2651
2652
  maxAge: tokenTtl
2652
2653
  });
2653
- chunkTO6EY4P7_cjs.dispatchHookEvent(
2654
+ chunkTV7LRFXH_cjs.dispatchHookEvent(
2654
2655
  c,
2655
2656
  "auth:otp:verified",
2656
2657
  { user: { id: user.id, email: user.email, role: user.role } },
2657
2658
  "fire-and-forget"
2658
2659
  );
2659
- const customData = await chunkTO6EY4P7_cjs.getCustomData(db, user.id);
2660
+ const customData = await chunkTV7LRFXH_cjs.getCustomData(db, user.id);
2660
2661
  const { is_active: _isActive, ...publicUser } = user;
2661
2662
  return c.json({
2662
2663
  success: true,
@@ -2701,7 +2702,7 @@ function buildOtpApi() {
2701
2702
  });
2702
2703
  return otpAPI;
2703
2704
  }
2704
- var otpLoginPlugin = chunkPMGOBS6X_cjs.definePlugin({
2705
+ var otpLoginPlugin = chunkNYLWNR6T_cjs.definePlugin({
2705
2706
  id: "otp-login",
2706
2707
  version: "1.0.0",
2707
2708
  name: "OTP Login",
@@ -3098,15 +3099,15 @@ function buildOauthApi() {
3098
3099
  if (!user || !user.is_active) {
3099
3100
  return c.redirect("/auth/login?error=Account is deactivated");
3100
3101
  }
3101
- const tokenTtl2 = await chunkMUNO67TT_cjs.getJwtExpirySecondsFromDb(c.env.DB, c.env);
3102
- const jwt2 = await chunkMUNO67TT_cjs.AuthManager.generateToken(
3102
+ const tokenTtl2 = await chunkBYLQOBO6_cjs.getJwtExpirySecondsFromDb(c.env.DB, c.env);
3103
+ const jwt2 = await chunkBYLQOBO6_cjs.AuthManager.generateToken(
3103
3104
  user.id,
3104
3105
  user.email,
3105
3106
  user.role,
3106
3107
  c.env.JWT_SECRET,
3107
3108
  tokenTtl2
3108
3109
  );
3109
- chunkMUNO67TT_cjs.AuthManager.setAuthCookie(c, jwt2, { sameSite: "Lax", maxAge: tokenTtl2 });
3110
+ chunkBYLQOBO6_cjs.AuthManager.setAuthCookie(c, jwt2, { sameSite: "Lax", maxAge: tokenTtl2 });
3110
3111
  return c.redirect("/admin");
3111
3112
  }
3112
3113
  const existingUser = await oauthService.findUserByEmail(profile.email);
@@ -3123,15 +3124,15 @@ function buildOauthApi() {
3123
3124
  tokenExpiresAt: tokenExpiresAt ?? void 0,
3124
3125
  profileData: JSON.stringify(profile)
3125
3126
  });
3126
- const tokenTtl2 = await chunkMUNO67TT_cjs.getJwtExpirySecondsFromDb(c.env.DB, c.env);
3127
- const jwt2 = await chunkMUNO67TT_cjs.AuthManager.generateToken(
3127
+ const tokenTtl2 = await chunkBYLQOBO6_cjs.getJwtExpirySecondsFromDb(c.env.DB, c.env);
3128
+ const jwt2 = await chunkBYLQOBO6_cjs.AuthManager.generateToken(
3128
3129
  existingUser.id,
3129
3130
  existingUser.email,
3130
3131
  existingUser.role,
3131
3132
  c.env.JWT_SECRET,
3132
3133
  tokenTtl2
3133
3134
  );
3134
- chunkMUNO67TT_cjs.AuthManager.setAuthCookie(c, jwt2, { sameSite: "Lax", maxAge: tokenTtl2 });
3135
+ chunkBYLQOBO6_cjs.AuthManager.setAuthCookie(c, jwt2, { sameSite: "Lax", maxAge: tokenTtl2 });
3135
3136
  return c.redirect("/admin");
3136
3137
  }
3137
3138
  const newUserId = await oauthService.createUserFromOAuth(profile);
@@ -3144,15 +3145,15 @@ function buildOauthApi() {
3144
3145
  tokenExpiresAt: tokenExpiresAt ?? void 0,
3145
3146
  profileData: JSON.stringify(profile)
3146
3147
  });
3147
- const tokenTtl = await chunkMUNO67TT_cjs.getJwtExpirySecondsFromDb(c.env.DB, c.env);
3148
- const jwt = await chunkMUNO67TT_cjs.AuthManager.generateToken(
3148
+ const tokenTtl = await chunkBYLQOBO6_cjs.getJwtExpirySecondsFromDb(c.env.DB, c.env);
3149
+ const jwt = await chunkBYLQOBO6_cjs.AuthManager.generateToken(
3149
3150
  newUserId,
3150
3151
  profile.email.toLowerCase(),
3151
3152
  "viewer",
3152
3153
  c.env.JWT_SECRET,
3153
3154
  tokenTtl
3154
3155
  );
3155
- chunkMUNO67TT_cjs.AuthManager.setAuthCookie(c, jwt, { sameSite: "Lax", maxAge: tokenTtl });
3156
+ chunkBYLQOBO6_cjs.AuthManager.setAuthCookie(c, jwt, { sameSite: "Lax", maxAge: tokenTtl });
3156
3157
  return c.redirect("/admin");
3157
3158
  } catch (error) {
3158
3159
  console.error("OAuth callback error:", error);
@@ -3247,7 +3248,7 @@ function buildOauthApi() {
3247
3248
  });
3248
3249
  return oauthAPI;
3249
3250
  }
3250
- var oauthProvidersPlugin = chunkPMGOBS6X_cjs.definePlugin({
3251
+ var oauthProvidersPlugin = chunkNYLWNR6T_cjs.definePlugin({
3251
3252
  id: "oauth-providers",
3252
3253
  version: "1.0.0",
3253
3254
  name: "OAuth Providers",
@@ -3824,7 +3825,7 @@ var AISearchService = class {
3824
3825
  */
3825
3826
  async detectNewCollections() {
3826
3827
  try {
3827
- const allCollections = chunkR4ILO3W6_cjs.getCollectionRegistry().listActive().filter((r) => !r.internal).map((r) => ({
3828
+ const allCollections = chunkLLWLHFTD_cjs.getCollectionRegistry().listActive().filter((r) => !r.internal).map((r) => ({
3828
3829
  id: r.id,
3829
3830
  name: r.name,
3830
3831
  display_name: r.displayName,
@@ -3876,7 +3877,7 @@ var AISearchService = class {
3876
3877
  */
3877
3878
  async getAllCollections() {
3878
3879
  try {
3879
- const allCollections = chunkR4ILO3W6_cjs.getCollectionRegistry().listActive().filter((r) => !r.internal).sort((a, b) => a.displayName.localeCompare(b.displayName)).map((r) => ({
3880
+ const allCollections = chunkLLWLHFTD_cjs.getCollectionRegistry().listActive().filter((r) => !r.internal).sort((a, b) => a.displayName.localeCompare(b.displayName)).map((r) => ({
3880
3881
  id: r.id,
3881
3882
  name: r.name,
3882
3883
  display_name: r.displayName,
@@ -4212,7 +4213,7 @@ var IndexManager = class {
4212
4213
  */
4213
4214
  async indexCollection(collectionId) {
4214
4215
  try {
4215
- const registry = chunkR4ILO3W6_cjs.getCollectionRegistry();
4216
+ const registry = chunkLLWLHFTD_cjs.getCollectionRegistry();
4216
4217
  const record = registry.getById(collectionId) ?? registry.getByName(collectionId);
4217
4218
  if (!record) {
4218
4219
  throw new Error(`Collection ${collectionId} not found`);
@@ -4839,7 +4840,7 @@ function renderSettingsPage(data) {
4839
4840
 
4840
4841
  // src/plugins/core-plugins/ai-search-plugin/routes/admin.ts
4841
4842
  var adminRoutes2 = new hono.Hono();
4842
- adminRoutes2.use("*", chunkMUNO67TT_cjs.requireAuth());
4843
+ adminRoutes2.use("*", chunkBYLQOBO6_cjs.requireAuth());
4843
4844
  adminRoutes2.get("/", async (c) => {
4844
4845
  try {
4845
4846
  const user = c.get("user");
@@ -5080,7 +5081,7 @@ var manifest_default = {
5080
5081
  author: "SonicJS"};
5081
5082
 
5082
5083
  // src/plugins/core-plugins/ai-search-plugin/index.ts
5083
- var aiSearchPlugin = chunkPMGOBS6X_cjs.definePlugin({
5084
+ var aiSearchPlugin = chunkNYLWNR6T_cjs.definePlugin({
5084
5085
  id: manifest_default.id,
5085
5086
  version: manifest_default.version,
5086
5087
  name: manifest_default.name,
@@ -5951,7 +5952,7 @@ function renderSecuritySettingsPage(data) {
5951
5952
 
5952
5953
  // src/plugins/core-plugins/security-audit-plugin/routes/admin.ts
5953
5954
  var adminRoutes3 = new hono.Hono();
5954
- adminRoutes3.use("*", chunkMUNO67TT_cjs.requireAuth());
5955
+ adminRoutes3.use("*", chunkBYLQOBO6_cjs.requireAuth());
5955
5956
  adminRoutes3.use("*", async (c, next) => {
5956
5957
  const user = c.get("user");
5957
5958
  if (user?.role !== "admin") {
@@ -5961,7 +5962,7 @@ adminRoutes3.use("*", async (c, next) => {
5961
5962
  });
5962
5963
  async function getSettings(db) {
5963
5964
  try {
5964
- const pluginService = new chunkR4ILO3W6_cjs.PluginService(db);
5965
+ const pluginService = new chunkLLWLHFTD_cjs.PluginService(db);
5965
5966
  const plugin2 = await pluginService.getPlugin("security-audit");
5966
5967
  if (plugin2?.settings) {
5967
5968
  const settings = typeof plugin2.settings === "string" ? JSON.parse(plugin2.settings) : plugin2.settings;
@@ -6066,7 +6067,7 @@ adminRoutes3.post("/settings", async (c) => {
6066
6067
  autoPurge: body["retention.autoPurge"] === "true"
6067
6068
  }
6068
6069
  };
6069
- const pluginService = new chunkR4ILO3W6_cjs.PluginService(db);
6070
+ const pluginService = new chunkLLWLHFTD_cjs.PluginService(db);
6070
6071
  await pluginService.updatePluginSettings("security-audit", settings);
6071
6072
  if (c.req.header("HX-Request")) {
6072
6073
  return c.json({ success: true });
@@ -6227,7 +6228,7 @@ var BruteForceDetector = class {
6227
6228
 
6228
6229
  // src/plugins/core-plugins/security-audit-plugin/routes/api.ts
6229
6230
  var apiRoutes2 = new hono.Hono();
6230
- apiRoutes2.use("*", chunkMUNO67TT_cjs.requireAuth());
6231
+ apiRoutes2.use("*", chunkBYLQOBO6_cjs.requireAuth());
6231
6232
  apiRoutes2.use("*", async (c, next) => {
6232
6233
  const user = c.get("user");
6233
6234
  if (user?.role !== "admin") {
@@ -6237,7 +6238,7 @@ apiRoutes2.use("*", async (c, next) => {
6237
6238
  });
6238
6239
  async function getSettings2(db) {
6239
6240
  try {
6240
- const pluginService = new chunkR4ILO3W6_cjs.PluginService(db);
6241
+ const pluginService = new chunkLLWLHFTD_cjs.PluginService(db);
6241
6242
  const plugin2 = await pluginService.getPlugin("security-audit");
6242
6243
  if (plugin2?.settings) {
6243
6244
  const settings = typeof plugin2.settings === "string" ? JSON.parse(plugin2.settings) : plugin2.settings;
@@ -6385,7 +6386,7 @@ function generateFingerprint(ip, userAgent) {
6385
6386
  }
6386
6387
  async function getPluginSettings(db) {
6387
6388
  try {
6388
- const pluginService = new chunkR4ILO3W6_cjs.PluginService(db);
6389
+ const pluginService = new chunkLLWLHFTD_cjs.PluginService(db);
6389
6390
  const plugin2 = await pluginService.getPlugin("security-audit");
6390
6391
  if (plugin2?.settings) {
6391
6392
  const settings = typeof plugin2.settings === "string" ? JSON.parse(plugin2.settings) : plugin2.settings;
@@ -6616,7 +6617,7 @@ async function logAuthEvent(c, db, settings, ip, userAgent, countryCode, fingerp
6616
6617
 
6617
6618
  // src/plugins/core-plugins/security-audit-plugin/index.ts
6618
6619
  var SECURITY_ICON = `<svg class="h-5 w-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z"/></svg>`;
6619
- var securityAuditPlugin = chunkPMGOBS6X_cjs.definePlugin({
6620
+ var securityAuditPlugin = chunkNYLWNR6T_cjs.definePlugin({
6620
6621
  id: "security-audit",
6621
6622
  version: "1.0.0",
6622
6623
  name: "Security Audit",
@@ -7372,7 +7373,7 @@ var DEFAULT_SETTINGS3 = {
7372
7373
 
7373
7374
  // src/plugins/core-plugins/stripe-plugin/routes/admin.ts
7374
7375
  var adminRoutes4 = new hono.Hono();
7375
- adminRoutes4.use("*", chunkMUNO67TT_cjs.requireAuth());
7376
+ adminRoutes4.use("*", chunkBYLQOBO6_cjs.requireAuth());
7376
7377
  adminRoutes4.use("*", async (c, next) => {
7377
7378
  const user = c.get("user");
7378
7379
  if (user?.role !== "admin") {
@@ -7382,7 +7383,7 @@ adminRoutes4.use("*", async (c, next) => {
7382
7383
  });
7383
7384
  async function getSettings3(db) {
7384
7385
  try {
7385
- const pluginService = new chunkR4ILO3W6_cjs.PluginService(db);
7386
+ const pluginService = new chunkLLWLHFTD_cjs.PluginService(db);
7386
7387
  const plugin2 = await pluginService.getPlugin("stripe");
7387
7388
  if (plugin2?.settings) {
7388
7389
  const settings = typeof plugin2.settings === "string" ? JSON.parse(plugin2.settings) : plugin2.settings;
@@ -7704,7 +7705,7 @@ function timingSafeEqual(a, b) {
7704
7705
  var apiRoutes3 = new hono.Hono();
7705
7706
  async function getSettings4(db) {
7706
7707
  try {
7707
- const pluginService = new chunkR4ILO3W6_cjs.PluginService(db);
7708
+ const pluginService = new chunkLLWLHFTD_cjs.PluginService(db);
7708
7709
  const plugin2 = await pluginService.getPlugin("stripe");
7709
7710
  if (plugin2?.settings) {
7710
7711
  const settings = typeof plugin2.settings === "string" ? JSON.parse(plugin2.settings) : plugin2.settings;
@@ -7855,7 +7856,7 @@ apiRoutes3.post("/webhook", async (c) => {
7855
7856
  }
7856
7857
  return c.json({ received: true });
7857
7858
  });
7858
- apiRoutes3.post("/create-checkout-session", chunkMUNO67TT_cjs.requireAuth(), async (c) => {
7859
+ apiRoutes3.post("/create-checkout-session", chunkBYLQOBO6_cjs.requireAuth(), async (c) => {
7859
7860
  const db = c.env.DB;
7860
7861
  const user = c.get("user");
7861
7862
  if (!user) return c.json({ error: "Unauthorized" }, 401);
@@ -7895,7 +7896,7 @@ apiRoutes3.post("/create-checkout-session", chunkMUNO67TT_cjs.requireAuth(), asy
7895
7896
  });
7896
7897
  return c.json({ sessionId: session.id, url: session.url });
7897
7898
  });
7898
- apiRoutes3.get("/subscription", chunkMUNO67TT_cjs.requireAuth(), async (c) => {
7899
+ apiRoutes3.get("/subscription", chunkBYLQOBO6_cjs.requireAuth(), async (c) => {
7899
7900
  const user = c.get("user");
7900
7901
  if (!user) return c.json({ error: "Unauthorized" }, 401);
7901
7902
  const db = c.env.DB;
@@ -7907,7 +7908,7 @@ apiRoutes3.get("/subscription", chunkMUNO67TT_cjs.requireAuth(), async (c) => {
7907
7908
  }
7908
7909
  return c.json({ subscription });
7909
7910
  });
7910
- apiRoutes3.get("/subscriptions", chunkMUNO67TT_cjs.requireAuth(), async (c) => {
7911
+ apiRoutes3.get("/subscriptions", chunkBYLQOBO6_cjs.requireAuth(), async (c) => {
7911
7912
  const user = c.get("user");
7912
7913
  if (user?.role !== "admin") return c.json({ error: "Access denied" }, 403);
7913
7914
  const db = c.env.DB;
@@ -7923,7 +7924,7 @@ apiRoutes3.get("/subscriptions", chunkMUNO67TT_cjs.requireAuth(), async (c) => {
7923
7924
  const result = await subscriptionService.list(filters);
7924
7925
  return c.json(result);
7925
7926
  });
7926
- apiRoutes3.get("/stats", chunkMUNO67TT_cjs.requireAuth(), async (c) => {
7927
+ apiRoutes3.get("/stats", chunkBYLQOBO6_cjs.requireAuth(), async (c) => {
7927
7928
  const user = c.get("user");
7928
7929
  if (user?.role !== "admin") return c.json({ error: "Access denied" }, 403);
7929
7930
  const db = c.env.DB;
@@ -7932,7 +7933,7 @@ apiRoutes3.get("/stats", chunkMUNO67TT_cjs.requireAuth(), async (c) => {
7932
7933
  const stats = await subscriptionService.getStats();
7933
7934
  return c.json(stats);
7934
7935
  });
7935
- apiRoutes3.post("/sync-subscriptions", chunkMUNO67TT_cjs.requireAuth(), async (c) => {
7936
+ apiRoutes3.post("/sync-subscriptions", chunkBYLQOBO6_cjs.requireAuth(), async (c) => {
7936
7937
  const user = c.get("user");
7937
7938
  if (user?.role !== "admin") return c.json({ error: "Access denied" }, 403);
7938
7939
  const db = c.env.DB;
@@ -7980,7 +7981,7 @@ apiRoutes3.post("/sync-subscriptions", chunkMUNO67TT_cjs.requireAuth(), async (c
7980
7981
  }, 500);
7981
7982
  }
7982
7983
  });
7983
- apiRoutes3.get("/events", chunkMUNO67TT_cjs.requireAuth(), async (c) => {
7984
+ apiRoutes3.get("/events", chunkBYLQOBO6_cjs.requireAuth(), async (c) => {
7984
7985
  const user = c.get("user");
7985
7986
  if (user?.role !== "admin") return c.json({ error: "Access denied" }, 403);
7986
7987
  const db = c.env.DB;
@@ -8003,7 +8004,7 @@ apiRoutes3.get("/events", chunkMUNO67TT_cjs.requireAuth(), async (c) => {
8003
8004
 
8004
8005
  // src/plugins/core-plugins/stripe-plugin/index.ts
8005
8006
  var STRIPE_ICON = `<svg class="h-5 w-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 10h18M7 15h1m4 0h1m-7 4h12a3 3 0 003-3V8a3 3 0 00-3-3H6a3 3 0 00-3 3v8a3 3 0 003 3z"/></svg>`;
8006
- var stripePlugin = chunkPMGOBS6X_cjs.definePlugin({
8007
+ var stripePlugin = chunkNYLWNR6T_cjs.definePlugin({
8007
8008
  id: "stripe",
8008
8009
  version: "1.0.0",
8009
8010
  name: "Stripe",
@@ -8276,7 +8277,7 @@ function renderFormsListPage(data) {
8276
8277
 
8277
8278
  <!-- Forms Table -->
8278
8279
  <div class="bg-white dark:bg-zinc-900 rounded-lg border border-zinc-950/5 dark:border-white/10 overflow-hidden">
8279
- ${chunkTO6EY4P7_cjs.renderTable(tableData)}
8280
+ ${chunkTV7LRFXH_cjs.renderTable(tableData)}
8280
8281
  </div>
8281
8282
  </div>
8282
8283
  `;
@@ -9704,8 +9705,9 @@ function renderFormCreatePage(data) {
9704
9705
  }
9705
9706
 
9706
9707
  // src/routes/admin-forms.ts
9708
+ var isTableMissing = (err) => String(err?.message ?? err?.cause?.message ?? "").includes("no such table: forms");
9707
9709
  var adminFormsRoutes = new hono.Hono();
9708
- adminFormsRoutes.use("*", chunkMUNO67TT_cjs.requireAuth());
9710
+ adminFormsRoutes.use("*", chunkBYLQOBO6_cjs.requireAuth());
9709
9711
  adminFormsRoutes.get("/", async (c) => {
9710
9712
  try {
9711
9713
  const user = c.get("user");
@@ -9745,6 +9747,14 @@ adminFormsRoutes.get("/", async (c) => {
9745
9747
  };
9746
9748
  return c.html(renderFormsListPage(pageData));
9747
9749
  } catch (error) {
9750
+ if (isTableMissing(error)) {
9751
+ const user = c.get("user");
9752
+ return c.html(renderFormsListPage({
9753
+ forms: [],
9754
+ user: user ? { name: user.email, email: user.email, role: user.role } : void 0,
9755
+ version: c.get("appVersion")
9756
+ }));
9757
+ }
9748
9758
  console.error("Error listing forms:", error);
9749
9759
  return c.html("<p>Error loading forms</p>", 500);
9750
9760
  }
@@ -9855,6 +9865,7 @@ adminFormsRoutes.post("/", async (c) => {
9855
9865
  ).run();
9856
9866
  return c.redirect(`/admin/forms/${formId}/builder`);
9857
9867
  } catch (error) {
9868
+ if (isTableMissing(error)) return c.json({ error: "Forms storage not configured \u2014 run database migrations" }, 503);
9858
9869
  console.error("Error creating form:", error);
9859
9870
  return c.json({ error: "Failed to create form" }, 500);
9860
9871
  }
@@ -9869,7 +9880,7 @@ adminFormsRoutes.get("/:id/builder", async (c) => {
9869
9880
  if (!form) {
9870
9881
  return c.html("<p>Form not found</p>", 404);
9871
9882
  }
9872
- const turnstileService = new chunk3KYKEXV7_cjs.TurnstileService(db);
9883
+ const turnstileService = new chunkSY7CBACS_cjs.TurnstileService(db);
9873
9884
  const turnstileSettings = await turnstileService.getSettings();
9874
9885
  const pageData = {
9875
9886
  id: form.id,
@@ -9892,6 +9903,7 @@ adminFormsRoutes.get("/:id/builder", async (c) => {
9892
9903
  };
9893
9904
  return c.html(renderFormBuilderPage(pageData));
9894
9905
  } catch (error) {
9906
+ if (isTableMissing(error)) return c.html("<p>Forms storage not configured \u2014 run database migrations</p>", 503);
9895
9907
  console.error("Error showing form builder:", error);
9896
9908
  return c.html("<p>Error loading form builder</p>", 500);
9897
9909
  }
@@ -9921,6 +9933,7 @@ adminFormsRoutes.put("/:id", async (c) => {
9921
9933
  ).run();
9922
9934
  return c.json({ success: true, message: "Form saved successfully" });
9923
9935
  } catch (error) {
9936
+ if (isTableMissing(error)) return c.json({ error: "Forms storage not configured \u2014 run database migrations" }, 503);
9924
9937
  console.error("Error updating form:", error);
9925
9938
  return c.json({ error: "Failed to save form" }, 500);
9926
9939
  }
@@ -9942,6 +9955,7 @@ adminFormsRoutes.delete("/:id", async (c) => {
9942
9955
  await db.prepare("DELETE FROM forms WHERE id = ?").bind(formId).run();
9943
9956
  return c.json({ success: true, message: "Form deleted successfully" });
9944
9957
  } catch (error) {
9958
+ if (isTableMissing(error)) return c.json({ error: "Forms storage not configured \u2014 run database migrations" }, 503);
9945
9959
  console.error("Error deleting form:", error);
9946
9960
  return c.json({ error: "Failed to delete form" }, 500);
9947
9961
  }
@@ -10002,6 +10016,7 @@ adminFormsRoutes.get("/:id/submissions", async (c) => {
10002
10016
  `;
10003
10017
  return c.html(html4);
10004
10018
  } catch (error) {
10019
+ if (isTableMissing(error)) return c.html("<p>Forms storage not configured \u2014 run database migrations</p>", 503);
10005
10020
  console.error("Error loading submissions:", error);
10006
10021
  return c.html("<p>Error loading submissions</p>", 500);
10007
10022
  }
@@ -10022,6 +10037,7 @@ function sanitizeDeep(value) {
10022
10037
  }
10023
10038
  return value;
10024
10039
  }
10040
+ var isTableMissing2 = (err) => String(err?.message ?? err?.cause?.message ?? "").includes("no such table: form");
10025
10041
  var publicFormsRoutes = new hono.Hono();
10026
10042
  publicFormsRoutes.get("/:identifier/turnstile-config", async (c) => {
10027
10043
  try {
@@ -10033,7 +10049,7 @@ publicFormsRoutes.get("/:identifier/turnstile-config", async (c) => {
10033
10049
  if (!form) {
10034
10050
  return c.json({ error: "Form not found" }, 404);
10035
10051
  }
10036
- const turnstileService = new chunk3KYKEXV7_cjs.TurnstileService(db);
10052
+ const turnstileService = new chunkSY7CBACS_cjs.TurnstileService(db);
10037
10053
  const globalSettings = await turnstileService.getSettings();
10038
10054
  const formSettings = form.turnstile_settings ? JSON.parse(form.turnstile_settings) : { inherit: true };
10039
10055
  const enabled = form.turnstile_enabled === 1 || formSettings.inherit && globalSettings?.enabled;
@@ -10049,6 +10065,7 @@ publicFormsRoutes.get("/:identifier/turnstile-config", async (c) => {
10049
10065
  appearance: formSettings.appearance || globalSettings.appearance || "always"
10050
10066
  });
10051
10067
  } catch (error) {
10068
+ if (isTableMissing2(error)) return c.json({ enabled: false });
10052
10069
  console.error("Error fetching Turnstile config:", error);
10053
10070
  return c.json({ error: "Failed to fetch config" }, 500);
10054
10071
  }
@@ -10076,6 +10093,7 @@ publicFormsRoutes.get("/:identifier/schema", async (c) => {
10076
10093
  submitUrl: `/api/forms/${form.id}/submit`
10077
10094
  });
10078
10095
  } catch (error) {
10096
+ if (isTableMissing2(error)) return c.json({ error: "Form not found" }, 404);
10079
10097
  console.error("Error fetching form schema:", error);
10080
10098
  return c.json({ error: "Failed to fetch form schema" }, 500);
10081
10099
  }
@@ -10442,6 +10460,7 @@ publicFormsRoutes.get("/:name", async (c) => {
10442
10460
  `;
10443
10461
  return c.html(html4);
10444
10462
  } catch (error) {
10463
+ if (isTableMissing2(error)) return c.html("<h1>Form not found</h1><p>This form does not exist or is not publicly available.</p>", 404);
10445
10464
  console.error("Error rendering form:", error);
10446
10465
  return c.html("<p>Error loading form</p>", 500);
10447
10466
  }
@@ -10460,7 +10479,7 @@ publicFormsRoutes.post("/:identifier/submit", async (c) => {
10460
10479
  const turnstileEnabled = form.turnstile_enabled === 1;
10461
10480
  const turnstileSettings = form.turnstile_settings ? JSON.parse(form.turnstile_settings) : { inherit: true };
10462
10481
  if (turnstileEnabled || turnstileSettings.inherit) {
10463
- const turnstileService = new chunk3KYKEXV7_cjs.TurnstileService(db);
10482
+ const turnstileService = new chunkSY7CBACS_cjs.TurnstileService(db);
10464
10483
  const globalEnabled = await turnstileService.isEnabled();
10465
10484
  if (globalEnabled || turnstileEnabled) {
10466
10485
  const turnstileToken = body.data?.turnstile || body.turnstile;
@@ -10515,13 +10534,14 @@ publicFormsRoutes.post("/:identifier/submit", async (c) => {
10515
10534
  message: "Form submitted successfully"
10516
10535
  });
10517
10536
  } catch (error) {
10537
+ if (isTableMissing2(error)) return c.json({ error: "Form not found" }, 404);
10518
10538
  console.error("Error submitting form:", error);
10519
10539
  return c.json({ error: "Failed to submit form" }, 500);
10520
10540
  }
10521
10541
  });
10522
10542
 
10523
10543
  // src/plugins/core-plugins/forms-plugin/index.ts
10524
- var formsPlugin = chunkPMGOBS6X_cjs.definePlugin({
10544
+ var formsPlugin = chunkNYLWNR6T_cjs.definePlugin({
10525
10545
  id: "forms",
10526
10546
  version: "1.0.0",
10527
10547
  name: "Forms",
@@ -10541,7 +10561,7 @@ var formsPlugin = chunkPMGOBS6X_cjs.definePlugin({
10541
10561
  });
10542
10562
  chunkK623Q6WD_cjs.init_admin_layout_catalyst_template();
10543
10563
  var adminRbacRoutes = new hono.Hono();
10544
- adminRbacRoutes.use("*", chunkMUNO67TT_cjs.requireRbac("rbac", "manage"));
10564
+ adminRbacRoutes.use("*", chunkBYLQOBO6_cjs.requireRbac("rbac", "manage"));
10545
10565
  var esc = (s) => String(s).replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
10546
10566
  var TABS2 = `
10547
10567
  <div class="border-b border-zinc-950/10 dark:border-white/10 mb-6">
@@ -10849,7 +10869,7 @@ adminRbacRoutes.get("/", async (c) => {
10849
10869
  title: "Roles & Permissions",
10850
10870
  pageTitle: "Roles & Permissions",
10851
10871
  currentPath: "/admin/users",
10852
- version: chunkF67UK75A_cjs.getCoreVersion(),
10872
+ version: chunkXGH2FVVR_cjs.getCoreVersion(),
10853
10873
  user: u ? { name: u.email || "Admin", email: u.email || "", role: u.role || "admin" } : void 0,
10854
10874
  content: content2
10855
10875
  })
@@ -10986,7 +11006,7 @@ adminRbacRoutes.get("/check", async (c) => {
10986
11006
  });
10987
11007
 
10988
11008
  // src/middleware/plugin-menu.ts
10989
- var REGISTRY_MENU_PLUGINS = Object.values(chunkR4ILO3W6_cjs.PLUGIN_REGISTRY).filter((p) => p.adminMenu !== null).map((p) => ({
11009
+ var REGISTRY_MENU_PLUGINS = Object.values(chunkLLWLHFTD_cjs.PLUGIN_REGISTRY).filter((p) => p.adminMenu !== null).map((p) => ({
10990
11010
  id: p.id,
10991
11011
  label: p.adminMenu.label,
10992
11012
  path: p.adminMenu.path,
@@ -11066,12 +11086,13 @@ function pluginMenuMiddleware() {
11066
11086
  }
11067
11087
  c.set("pluginMenuItems", activeMenuItems.map((m) => ({ label: m.label, path: m.path, icon: resolveIcon(m.icon) || "" })));
11068
11088
  await next();
11069
- if (activeMenuItems.length > 0 && c.res.headers.get("content-type")?.includes("text/html")) {
11089
+ const finalItems = c.get("pluginMenuItems") ?? [];
11090
+ if (finalItems.length > 0 && c.res.headers.get("content-type")?.includes("text/html")) {
11070
11091
  const status = c.res.status;
11071
11092
  const headers = new Headers(c.res.headers);
11072
11093
  const html4 = await c.res.text();
11073
11094
  if (html4.includes(MARKER)) {
11074
- const renderedItems = activeMenuItems.map((item) => renderMenuItem(item, path)).join("");
11095
+ const renderedItems = finalItems.map((item) => renderMenuItem(item, path)).join("");
11075
11096
  const newHtml = html4.split(MARKER).join(renderedItems);
11076
11097
  c.res = new Response(newHtml, { status, headers });
11077
11098
  } else {
@@ -11082,7 +11103,7 @@ function pluginMenuMiddleware() {
11082
11103
  }
11083
11104
  chunkK623Q6WD_cjs.init_admin_layout_catalyst_template();
11084
11105
  var adminRoutes5 = new hono.Hono();
11085
- adminRoutes5.use("*", chunkMUNO67TT_cjs.requireAuth());
11106
+ adminRoutes5.use("*", chunkBYLQOBO6_cjs.requireAuth());
11086
11107
  adminRoutes5.use("*", async (c, next) => {
11087
11108
  const user = c.get("user");
11088
11109
  if (user?.role !== "admin") {
@@ -11437,7 +11458,7 @@ apiRoutes4.get("/stats", async (c) => {
11437
11458
  });
11438
11459
 
11439
11460
  // src/plugins/core-plugins/analytics/index.ts
11440
- var analyticsPlugin = chunkPMGOBS6X_cjs.definePlugin({
11461
+ var analyticsPlugin = chunkNYLWNR6T_cjs.definePlugin({
11441
11462
  id: "core-analytics",
11442
11463
  version: "1.0.0",
11443
11464
  name: "Analytics",
@@ -11584,7 +11605,7 @@ function esc2(s) {
11584
11605
  return (s || "").replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
11585
11606
  }
11586
11607
  async function getVariablesMap(db) {
11587
- let variables = chunkTO6EY4P7_cjs.getVariablesCached();
11608
+ let variables = chunkTV7LRFXH_cjs.getVariablesCached();
11588
11609
  if (variables) return variables;
11589
11610
  try {
11590
11611
  const { results } = await db.prepare(
@@ -11594,7 +11615,7 @@ async function getVariablesMap(db) {
11594
11615
  for (const row of results || []) {
11595
11616
  variables.set(row.key, row.value);
11596
11617
  }
11597
- chunkTO6EY4P7_cjs.setVariablesCache(variables);
11618
+ chunkTV7LRFXH_cjs.setVariablesCache(variables);
11598
11619
  return variables;
11599
11620
  } catch {
11600
11621
  return /* @__PURE__ */ new Map();
@@ -11663,7 +11684,7 @@ apiRoutes5.post("/", async (c) => {
11663
11684
  await db.prepare(
11664
11685
  "INSERT INTO global_variables (key, value, description, category, is_active) VALUES (?, ?, ?, ?, ?)"
11665
11686
  ).bind(key, value || "", description || "", category || "general", isActive !== false ? 1 : 0).run();
11666
- chunkTO6EY4P7_cjs.invalidateVariablesCache();
11687
+ chunkTV7LRFXH_cjs.invalidateVariablesCache();
11667
11688
  const created = await db.prepare("SELECT * FROM global_variables WHERE key = ?").bind(key).first();
11668
11689
  return c.json({ success: true, data: formatVariable(created) }, 201);
11669
11690
  } catch {
@@ -11708,7 +11729,7 @@ apiRoutes5.put("/:id", async (c) => {
11708
11729
  updates.push("updated_at = strftime('%s', 'now')");
11709
11730
  params.push(id);
11710
11731
  await db.prepare(`UPDATE global_variables SET ${updates.join(", ")} WHERE id = ?`).bind(...params).run();
11711
- chunkTO6EY4P7_cjs.invalidateVariablesCache();
11732
+ chunkTV7LRFXH_cjs.invalidateVariablesCache();
11712
11733
  const updated = await db.prepare("SELECT * FROM global_variables WHERE id = ?").bind(id).first();
11713
11734
  return c.json({ success: true, data: formatVariable(updated) });
11714
11735
  } catch {
@@ -11722,7 +11743,7 @@ apiRoutes5.delete("/:id", async (c) => {
11722
11743
  const existing = await db.prepare("SELECT id FROM global_variables WHERE id = ?").bind(id).first();
11723
11744
  if (!existing) return c.json({ error: "Variable not found" }, 404);
11724
11745
  await db.prepare("DELETE FROM global_variables WHERE id = ?").bind(id).run();
11725
- chunkTO6EY4P7_cjs.invalidateVariablesCache();
11746
+ chunkTV7LRFXH_cjs.invalidateVariablesCache();
11726
11747
  return c.json({ success: true });
11727
11748
  } catch {
11728
11749
  return c.json({ success: false, error: "Failed to delete variable" }, 500);
@@ -11782,7 +11803,7 @@ adminRoutes6.put("/:id", async (c) => {
11782
11803
  const value = body.value;
11783
11804
  if (value !== void 0) {
11784
11805
  await db.prepare("UPDATE global_variables SET value = ?, updated_at = strftime('%s', 'now') WHERE id = ?").bind(value, id).run();
11785
- chunkTO6EY4P7_cjs.invalidateVariablesCache();
11806
+ chunkTV7LRFXH_cjs.invalidateVariablesCache();
11786
11807
  }
11787
11808
  return c.html('<span class="text-green-400 text-xs">Saved</span>');
11788
11809
  });
@@ -11790,7 +11811,7 @@ adminRoutes6.post("/:id/toggle", async (c) => {
11790
11811
  const db = c.env.DB;
11791
11812
  const id = c.req.param("id");
11792
11813
  await db.prepare("UPDATE global_variables SET is_active = CASE WHEN is_active = 1 THEN 0 ELSE 1 END, updated_at = strftime('%s', 'now') WHERE id = ?").bind(id).run();
11793
- chunkTO6EY4P7_cjs.invalidateVariablesCache();
11814
+ chunkTV7LRFXH_cjs.invalidateVariablesCache();
11794
11815
  c.header("HX-Redirect", "/admin/global-variables");
11795
11816
  return c.body(null, 204);
11796
11817
  });
@@ -11811,7 +11832,7 @@ adminRoutes6.post("/", async (c) => {
11811
11832
  await db.prepare(
11812
11833
  "INSERT INTO global_variables (key, value, description, category) VALUES (?, ?, ?, ?)"
11813
11834
  ).bind(key, value, description, category).run();
11814
- chunkTO6EY4P7_cjs.invalidateVariablesCache();
11835
+ chunkTV7LRFXH_cjs.invalidateVariablesCache();
11815
11836
  c.header("HX-Redirect", "/admin/global-variables");
11816
11837
  return c.body(null, 204);
11817
11838
  });
@@ -11830,7 +11851,7 @@ adminRoutes6.post("/settings/editor-integration", async (c) => {
11830
11851
  adminRoutes6.delete("/:id", async (c) => {
11831
11852
  const db = c.env.DB;
11832
11853
  await db.prepare("DELETE FROM global_variables WHERE id = ?").bind(c.req.param("id")).run();
11833
- chunkTO6EY4P7_cjs.invalidateVariablesCache();
11854
+ chunkTV7LRFXH_cjs.invalidateVariablesCache();
11834
11855
  return c.html("");
11835
11856
  });
11836
11857
  function renderAdminPage(variables, editorStatus = { editorActive: false, activeEditorName: "", enableEditorIntegration: true }) {
@@ -12148,7 +12169,7 @@ function renderAdminPage(variables, editorStatus = { editorActive: false, active
12148
12169
  </div>
12149
12170
  ` });
12150
12171
  }
12151
- var globalVariablesPlugin = chunkPMGOBS6X_cjs.definePlugin({
12172
+ var globalVariablesPlugin = chunkNYLWNR6T_cjs.definePlugin({
12152
12173
  id: "global-variables",
12153
12174
  version: "1.1.0",
12154
12175
  name: "Global Variables",
@@ -12171,7 +12192,7 @@ var globalVariablesPlugin = chunkPMGOBS6X_cjs.definePlugin({
12171
12192
  if (!db || !data) return data;
12172
12193
  const variables = await getVariablesMap(db);
12173
12194
  if (variables.size === 0) return data;
12174
- return chunkTO6EY4P7_cjs.resolveVariablesInObject(data, variables);
12195
+ return chunkTV7LRFXH_cjs.resolveVariablesInObject(data, variables);
12175
12196
  } catch {
12176
12197
  return data;
12177
12198
  }
@@ -12189,7 +12210,7 @@ var globalVariablesPlugin = chunkPMGOBS6X_cjs.definePlugin({
12189
12210
  },
12190
12211
  activate: async () => console.info("[GlobalVariables] Plugin activated"),
12191
12212
  deactivate: async () => {
12192
- chunkTO6EY4P7_cjs.invalidateVariablesCache();
12213
+ chunkTV7LRFXH_cjs.invalidateVariablesCache();
12193
12214
  console.info("[GlobalVariables] Plugin deactivated, cache cleared");
12194
12215
  },
12195
12216
  uninstall: async (ctx) => {
@@ -12755,7 +12776,7 @@ function renderAdminPage2(shortcodes, editorStatus = { editorActive: false, acti
12755
12776
  </div>
12756
12777
  ` });
12757
12778
  }
12758
- var shortcodesPlugin = chunkPMGOBS6X_cjs.definePlugin({
12779
+ var shortcodesPlugin = chunkNYLWNR6T_cjs.definePlugin({
12759
12780
  id: "shortcodes",
12760
12781
  version: "1.0.0",
12761
12782
  name: "Shortcodes",
@@ -12839,7 +12860,7 @@ helloWorldRoutes.get("/", async (c) => {
12839
12860
  </html>
12840
12861
  `);
12841
12862
  });
12842
- var helloWorldPlugin = chunkPMGOBS6X_cjs.definePlugin({
12863
+ var helloWorldPlugin = chunkNYLWNR6T_cjs.definePlugin({
12843
12864
  id: "hello-world",
12844
12865
  version: "1.0.0",
12845
12866
  name: "Hello World",
@@ -13067,7 +13088,7 @@ function renderTenantForm(data) {
13067
13088
  // src/plugins/core-plugins/multi-tenant-plugin/templates/tenant-members.template.ts
13068
13089
  chunkK623Q6WD_cjs.init_admin_layout_catalyst_template();
13069
13090
  function roleOptions(selected) {
13070
- return chunkTO6EY4P7_cjs.VALID_MEMBER_ROLES.map(
13091
+ return chunkTV7LRFXH_cjs.VALID_MEMBER_ROLES.map(
13071
13092
  (r) => `<option value="${r}" ${r === selected ? "selected" : ""}>${r}</option>`
13072
13093
  ).join("");
13073
13094
  }
@@ -13129,7 +13150,7 @@ function renderInvitations(slug, invitations) {
13129
13150
  <div>
13130
13151
  <label for="invite-role" class="mb-1 block text-xs font-medium text-zinc-500 dark:text-zinc-400">Role</label>
13131
13152
  <select id="invite-role" name="role" class="rounded-lg border border-zinc-950/10 bg-white px-2 py-2 text-sm text-zinc-950 dark:border-white/10 dark:bg-zinc-800 dark:text-white">
13132
- ${chunkTO6EY4P7_cjs.VALID_MEMBER_ROLES.map((r) => `<option value="${r}" ${r === "viewer" ? "selected" : ""}>${r}</option>`).join("")}
13153
+ ${chunkTV7LRFXH_cjs.VALID_MEMBER_ROLES.map((r) => `<option value="${r}" ${r === "viewer" ? "selected" : ""}>${r}</option>`).join("")}
13133
13154
  </select>
13134
13155
  </div>
13135
13156
  <button type="submit" data-send-invite class="rounded-lg bg-zinc-950 px-3.5 py-2 text-sm font-semibold text-white hover:bg-zinc-800 dark:bg-white dark:text-zinc-950 dark:hover:bg-zinc-200">Invite</button>
@@ -13225,7 +13246,7 @@ function renderTenantMembers(data) {
13225
13246
  // src/plugins/core-plugins/multi-tenant-plugin/templates/user-memberships.template.ts
13226
13247
  chunkK623Q6WD_cjs.init_admin_layout_catalyst_template();
13227
13248
  function roleOptions2(selected) {
13228
- return chunkTO6EY4P7_cjs.VALID_MEMBER_ROLES.map(
13249
+ return chunkTV7LRFXH_cjs.VALID_MEMBER_ROLES.map(
13229
13250
  (r) => `<option value="${r}" ${r === selected ? "selected" : ""}>${r}</option>`
13230
13251
  ).join("");
13231
13252
  }
@@ -13387,7 +13408,7 @@ function zodToFieldErrors(error) {
13387
13408
  }
13388
13409
  async function isMultiTenantActive(db) {
13389
13410
  try {
13390
- const plugin2 = await new chunkR4ILO3W6_cjs.PluginService(db).getPlugin(chunkR4ILO3W6_cjs.MULTI_TENANT_PLUGIN_ID);
13411
+ const plugin2 = await new chunkLLWLHFTD_cjs.PluginService(db).getPlugin(chunkLLWLHFTD_cjs.MULTI_TENANT_PLUGIN_ID);
13391
13412
  return plugin2?.status === "active";
13392
13413
  } catch {
13393
13414
  return false;
@@ -13395,7 +13416,7 @@ async function isMultiTenantActive(db) {
13395
13416
  }
13396
13417
  function createTenantAdminRoutes() {
13397
13418
  const routes2 = new hono.Hono();
13398
- routes2.use("*", chunkMUNO67TT_cjs.requireAuth());
13419
+ routes2.use("*", chunkBYLQOBO6_cjs.requireAuth());
13399
13420
  routes2.use("*", async (c, next) => {
13400
13421
  const user = c.get("user");
13401
13422
  if (user?.role !== "admin") {
@@ -13409,7 +13430,7 @@ function createTenantAdminRoutes() {
13409
13430
  const form = await c.req.formData();
13410
13431
  const slug = String(form.get("tenant") ?? "").trim().toLowerCase();
13411
13432
  const redirect = String(form.get("redirect") ?? "");
13412
- const svc = new chunkTO6EY4P7_cjs.TenantService(db);
13433
+ const svc = new chunkTV7LRFXH_cjs.TenantService(db);
13413
13434
  const tenant = await svc.getTenantBySlug(slug);
13414
13435
  if (!tenant || tenant.status !== "active") {
13415
13436
  return c.json({ error: "Unknown or inactive tenant" }, 400);
@@ -13419,7 +13440,7 @@ function createTenantAdminRoutes() {
13419
13440
  if (!user.isSuperAdmin && !await svc.isMember(user.userId, slug)) {
13420
13441
  return c.json({ error: "You are not a member of this tenant" }, 403);
13421
13442
  }
13422
- cookie.setCookie(c, chunkR4ILO3W6_cjs.TENANT_COOKIE, slug, {
13443
+ cookie.setCookie(c, chunkLLWLHFTD_cjs.TENANT_COOKIE, slug, {
13423
13444
  path: "/",
13424
13445
  httpOnly: true,
13425
13446
  sameSite: "Lax",
@@ -13436,7 +13457,7 @@ function createTenantAdminRoutes() {
13436
13457
  if (!user) return c.redirect("/auth/login");
13437
13458
  const token = c.req.query("token") ?? "";
13438
13459
  try {
13439
- const { slug } = await new chunkTO6EY4P7_cjs.TenantService(db).acceptInvitation(token, user.userId, user.email);
13460
+ const { slug } = await new chunkTV7LRFXH_cjs.TenantService(db).acceptInvitation(token, user.userId, user.email);
13440
13461
  return c.redirect(`/admin/tenants/${slug}/members?message=Invitation accepted`);
13441
13462
  } catch (error) {
13442
13463
  const message = error instanceof Error ? error.message : "Failed to accept invitation";
@@ -13464,7 +13485,7 @@ function createTenantAdminRoutes() {
13464
13485
  const userId = c.req.param("userId");
13465
13486
  const target = await db.prepare("SELECT id, email FROM auth_user WHERE id = ?").bind(userId).first();
13466
13487
  if (!target?.id) return c.redirect("/admin/users?message=User not found&type=error");
13467
- const svc = new chunkTO6EY4P7_cjs.TenantService(db);
13488
+ const svc = new chunkTV7LRFXH_cjs.TenantService(db);
13468
13489
  const [memberships, allTenants] = await Promise.all([svc.listUserMemberships(userId), svc.listTenants()]);
13469
13490
  const memberSlugs = new Set(memberships.map((m) => m.slug));
13470
13491
  const availableTenants = allTenants.filter((t) => t.status === "active" && !memberSlugs.has(t.slug)).map((t) => ({ slug: t.slug, name: t.name }));
@@ -13489,10 +13510,10 @@ function createTenantAdminRoutes() {
13489
13510
  const slug = String(form.get("slug") ?? "").trim().toLowerCase();
13490
13511
  const role = String(form.get("role") ?? "viewer");
13491
13512
  const redirectTo = String(form.get("_redirect") ?? "") || `/admin/tenants/users/${userId}`;
13492
- if (!chunkTO6EY4P7_cjs.isValidMemberRole(role)) throw new Error(`Invalid role '${role}'`);
13513
+ if (!chunkTV7LRFXH_cjs.isValidMemberRole(role)) throw new Error(`Invalid role '${role}'`);
13493
13514
  const target = await db.prepare("SELECT email FROM auth_user WHERE id = ?").bind(userId).first();
13494
13515
  if (!target) throw new Error("User not found");
13495
- const svc = new chunkTO6EY4P7_cjs.TenantService(db);
13516
+ const svc = new chunkTV7LRFXH_cjs.TenantService(db);
13496
13517
  if (!await svc.getTenantBySlug(slug)) throw new Error("Tenant not found");
13497
13518
  if (await svc.isMember(userId, slug)) throw new Error(`Already a member of '${slug}'`);
13498
13519
  await svc.addMember(slug, userId, role, target.email ?? null);
@@ -13511,7 +13532,7 @@ function createTenantAdminRoutes() {
13511
13532
  const form = await c.req.formData();
13512
13533
  const role = String(form.get("role") ?? "");
13513
13534
  const redirectTo = String(form.get("_redirect") ?? "") || `/admin/tenants/users/${userId}`;
13514
- await new chunkTO6EY4P7_cjs.TenantService(db).setMemberRole(slug, userId, role);
13535
+ await new chunkTV7LRFXH_cjs.TenantService(db).setMemberRole(slug, userId, role);
13515
13536
  return c.redirect(`${redirectTo}?message=Role updated`);
13516
13537
  } catch (error) {
13517
13538
  const message = error instanceof Error ? error.message : "Failed to update role";
@@ -13526,7 +13547,7 @@ function createTenantAdminRoutes() {
13526
13547
  try {
13527
13548
  const form = await c.req.formData();
13528
13549
  const redirectTo = String(form.get("_redirect") ?? "") || `/admin/tenants/users/${userId}`;
13529
- await new chunkTO6EY4P7_cjs.TenantService(db).removeMember(slug, userId);
13550
+ await new chunkTV7LRFXH_cjs.TenantService(db).removeMember(slug, userId);
13530
13551
  return c.redirect(`${redirectTo}?message=Removed from ${encodeURIComponent(slug)}`);
13531
13552
  } catch (error) {
13532
13553
  const message = error instanceof Error ? error.message : "Failed to remove membership";
@@ -13541,7 +13562,7 @@ function createTenantAdminRoutes() {
13541
13562
  return c.html(renderTenantsInactive({ user: userShape(cur), version }));
13542
13563
  }
13543
13564
  const roleName = c.req.param("roleName");
13544
- const assignments = await new chunkTO6EY4P7_cjs.TenantService(db).listAssignmentsByRole(roleName);
13565
+ const assignments = await new chunkTV7LRFXH_cjs.TenantService(db).listAssignmentsByRole(roleName);
13545
13566
  return c.html(renderRoleUsage({ roleName, assignments, user: userShape(cur), version }));
13546
13567
  });
13547
13568
  routes2.get("/", async (c) => {
@@ -13551,7 +13572,7 @@ function createTenantAdminRoutes() {
13551
13572
  if (!await isMultiTenantActive(db)) {
13552
13573
  return c.html(renderTenantsInactive({ user: userShape(user), version }));
13553
13574
  }
13554
- const svc = new chunkTO6EY4P7_cjs.TenantService(db);
13575
+ const svc = new chunkTV7LRFXH_cjs.TenantService(db);
13555
13576
  await svc.ensureDefaultTenant();
13556
13577
  const tenants = await svc.listTenants();
13557
13578
  const [docRes, memberRes] = await db.batch([
@@ -13590,7 +13611,7 @@ function createTenantAdminRoutes() {
13590
13611
  formEntries = Object.fromEntries(form.entries());
13591
13612
  const validated = tenantFormSchema.parse(formEntries);
13592
13613
  if (!validated.slug) throw new zod.z.ZodError([{ code: "custom", message: "Slug is required", path: ["slug"] }]);
13593
- const svc = new chunkTO6EY4P7_cjs.TenantService(db);
13614
+ const svc = new chunkTV7LRFXH_cjs.TenantService(db);
13594
13615
  await svc.createTenant({
13595
13616
  name: validated.name,
13596
13617
  slug: validated.slug,
@@ -13615,7 +13636,7 @@ function createTenantAdminRoutes() {
13615
13636
  if (!await isMultiTenantActive(db)) {
13616
13637
  return c.html(renderTenantsInactive({ user: userShape(user), version }));
13617
13638
  }
13618
- const tenant = await new chunkTO6EY4P7_cjs.TenantService(db).getTenantBySlug(c.req.param("slug"));
13639
+ const tenant = await new chunkTV7LRFXH_cjs.TenantService(db).getTenantBySlug(c.req.param("slug"));
13619
13640
  if (!tenant) return c.redirect("/admin/tenants?message=Tenant not found&type=error");
13620
13641
  return c.html(renderTenantForm({ tenant, isEdit: true, user: userShape(user), version }));
13621
13642
  });
@@ -13625,7 +13646,7 @@ function createTenantAdminRoutes() {
13625
13646
  const version = c.get("appVersion");
13626
13647
  const slug = c.req.param("slug");
13627
13648
  if (!await isMultiTenantActive(db)) return c.json({ error: "Multi-tenant plugin is not active" }, 403);
13628
- const svc = new chunkTO6EY4P7_cjs.TenantService(db);
13649
+ const svc = new chunkTV7LRFXH_cjs.TenantService(db);
13629
13650
  try {
13630
13651
  const form = await c.req.formData();
13631
13652
  const validated = tenantFormSchema.parse(Object.fromEntries(form.entries()));
@@ -13650,7 +13671,7 @@ function createTenantAdminRoutes() {
13650
13671
  const slug = c.req.param("slug");
13651
13672
  if (!await isMultiTenantActive(db)) return c.json({ error: "Multi-tenant plugin is not active" }, 403);
13652
13673
  try {
13653
- await new chunkTO6EY4P7_cjs.TenantService(db).deleteTenant(slug);
13674
+ await new chunkTV7LRFXH_cjs.TenantService(db).deleteTenant(slug);
13654
13675
  return c.redirect("/admin/tenants?message=Tenant deleted successfully");
13655
13676
  } catch (error) {
13656
13677
  const message = error instanceof Error ? error.message : "Failed to delete tenant";
@@ -13665,7 +13686,7 @@ function createTenantAdminRoutes() {
13665
13686
  return c.html(renderTenantsInactive({ user: userShape(user), version }));
13666
13687
  }
13667
13688
  const slug = c.req.param("slug");
13668
- const svc = new chunkTO6EY4P7_cjs.TenantService(db);
13689
+ const svc = new chunkTV7LRFXH_cjs.TenantService(db);
13669
13690
  const tenant = await svc.getTenantBySlug(slug);
13670
13691
  if (!tenant) return c.redirect("/admin/tenants?message=Tenant not found&type=error");
13671
13692
  const [members, invitations] = await Promise.all([svc.listMembers(slug), svc.listInvitations(slug)]);
@@ -13691,7 +13712,7 @@ function createTenantAdminRoutes() {
13691
13712
  const form = await c.req.formData();
13692
13713
  const email = String(form.get("email") ?? "");
13693
13714
  const role = String(form.get("role") ?? "viewer");
13694
- await new chunkTO6EY4P7_cjs.TenantService(db).addMemberByEmail(slug, email, role);
13715
+ await new chunkTV7LRFXH_cjs.TenantService(db).addMemberByEmail(slug, email, role);
13695
13716
  return c.redirect(`/admin/tenants/${slug}/members?message=Member added`);
13696
13717
  } catch (error) {
13697
13718
  const message = error instanceof Error ? error.message : "Failed to add member";
@@ -13706,7 +13727,7 @@ function createTenantAdminRoutes() {
13706
13727
  try {
13707
13728
  const form = await c.req.formData();
13708
13729
  const role = String(form.get("role") ?? "");
13709
- await new chunkTO6EY4P7_cjs.TenantService(db).setMemberRole(slug, userId, role);
13730
+ await new chunkTV7LRFXH_cjs.TenantService(db).setMemberRole(slug, userId, role);
13710
13731
  return c.redirect(`/admin/tenants/${slug}/members?message=Role updated`);
13711
13732
  } catch (error) {
13712
13733
  const message = error instanceof Error ? error.message : "Failed to update role";
@@ -13719,7 +13740,7 @@ function createTenantAdminRoutes() {
13719
13740
  const userId = c.req.param("userId");
13720
13741
  if (!await isMultiTenantActive(db)) return c.json({ error: "Multi-tenant plugin is not active" }, 403);
13721
13742
  try {
13722
- await new chunkTO6EY4P7_cjs.TenantService(db).removeMember(slug, userId);
13743
+ await new chunkTV7LRFXH_cjs.TenantService(db).removeMember(slug, userId);
13723
13744
  return c.redirect(`/admin/tenants/${slug}/members?message=Member removed`);
13724
13745
  } catch (error) {
13725
13746
  const message = error instanceof Error ? error.message : "Failed to remove member";
@@ -13735,12 +13756,12 @@ function createTenantAdminRoutes() {
13735
13756
  const form = await c.req.formData();
13736
13757
  const email = String(form.get("email") ?? "");
13737
13758
  const role = String(form.get("role") ?? "viewer");
13738
- const token = await new chunkTO6EY4P7_cjs.TenantService(db).createInvitation(slug, email, role, user?.userId ?? null);
13759
+ const token = await new chunkTV7LRFXH_cjs.TenantService(db).createInvitation(slug, email, role, user?.userId ?? null);
13739
13760
  const origin = c.req.header("origin") || new URL(c.req.url).origin;
13740
13761
  const acceptUrl = `${origin}/join/invite?token=${encodeURIComponent(token)}`;
13741
13762
  let note;
13742
13763
  let noteType = "";
13743
- const svc2 = chunkTO6EY4P7_cjs.hasEmailService() ? chunkTO6EY4P7_cjs.getEmailService() : null;
13764
+ const svc2 = chunkTV7LRFXH_cjs.hasEmailService() ? chunkTV7LRFXH_cjs.getEmailService() : null;
13744
13765
  const hasRealProvider = !!svc2 && svc2.getProviderName() !== "console";
13745
13766
  if (hasRealProvider) {
13746
13767
  const result = await svc2.send({
@@ -13781,7 +13802,7 @@ function createTenantAdminRoutes() {
13781
13802
  WHERE i.id = ? AND t.slug = ? AND i.status = 'pending'`
13782
13803
  ).bind(id, slug).first();
13783
13804
  if (!inv) throw new Error("Invitation not found or already used");
13784
- const svc2 = chunkTO6EY4P7_cjs.hasEmailService() ? chunkTO6EY4P7_cjs.getEmailService() : null;
13805
+ const svc2 = chunkTV7LRFXH_cjs.hasEmailService() ? chunkTV7LRFXH_cjs.getEmailService() : null;
13785
13806
  const hasRealProvider = !!svc2 && svc2.getProviderName() !== "console";
13786
13807
  if (!hasRealProvider) throw new Error("No email plugin active");
13787
13808
  const origin = c.req.header("origin") || new URL(c.req.url).origin;
@@ -13806,7 +13827,7 @@ function createTenantAdminRoutes() {
13806
13827
  const id = c.req.param("id");
13807
13828
  if (!await isMultiTenantActive(db)) return c.json({ error: "Multi-tenant plugin is not active" }, 403);
13808
13829
  try {
13809
- await new chunkTO6EY4P7_cjs.TenantService(db).revokeInvitation(slug, id);
13830
+ await new chunkTV7LRFXH_cjs.TenantService(db).revokeInvitation(slug, id);
13810
13831
  return c.redirect(`/admin/tenants/${slug}/members?message=Invitation revoked`);
13811
13832
  } catch (error) {
13812
13833
  const message = error instanceof Error ? error.message : "Failed to revoke invitation";
@@ -14036,7 +14057,7 @@ function createJoinRoutes() {
14036
14057
  if (existing) return rerender("An account with this email already exists. Please sign in instead.");
14037
14058
  try {
14038
14059
  const userId = crypto.randomUUID();
14039
- const passwordHash = await chunkMUNO67TT_cjs.AuthManager.hashPassword(password);
14060
+ const passwordHash = await chunkBYLQOBO6_cjs.AuthManager.hashPassword(password);
14040
14061
  const now = Date.now();
14041
14062
  const nowSec = Math.floor(now / 1e3);
14042
14063
  await db.batch([
@@ -14049,7 +14070,7 @@ function createJoinRoutes() {
14049
14070
  VALUES (?, ?, ?, 'credential', ?, ?, ?)`
14050
14071
  ).bind(`cred-${userId}`, userId, userId, passwordHash, nowSec, nowSec)
14051
14072
  ]);
14052
- await new chunkTO6EY4P7_cjs.TenantService(db).acceptInvitation(token, userId, inv.email);
14073
+ await new chunkTV7LRFXH_cjs.TenantService(db).acceptInvitation(token, userId, inv.email);
14053
14074
  const auth = chunkNUKJ54GA_cjs.createAuth(c.env);
14054
14075
  const origin = new URL(c.req.url).origin;
14055
14076
  const baReq = new Request(`${origin}/auth/sign-in/email`, {
@@ -14117,7 +14138,7 @@ function createJoinRoutes() {
14117
14138
  const baBody = await baRes.json();
14118
14139
  const userId = baBody?.user?.id;
14119
14140
  if (!userId) return rerender("Sign-in succeeded but could not read user ID.");
14120
- await new chunkTO6EY4P7_cjs.TenantService(db).acceptInvitation(token, userId, inv.email);
14141
+ await new chunkTV7LRFXH_cjs.TenantService(db).acceptInvitation(token, userId, inv.email);
14121
14142
  const headers = new Headers({ Location: "/admin?message=Welcome! You have joined " + encodeURIComponent(inv.tenantName) });
14122
14143
  copyBaCookies(baRes, headers);
14123
14144
  return new Response(null, { status: 302, headers });
@@ -14131,7 +14152,7 @@ function createJoinRoutes() {
14131
14152
 
14132
14153
  // src/plugins/core-plugins/multi-tenant-plugin/index.ts
14133
14154
  var TENANT_ICON = `<svg class="h-5 w-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3.75 21h16.5M4.5 3h15M5.25 3v18m13.5-18v18M9 6.75h1.5m-1.5 3h1.5m-1.5 3h1.5m3-6H15m-1.5 3H15m-1.5 3H15M9 21v-3.375c0-.621.504-1.125 1.125-1.125h3.75c.621 0 1.125.504 1.125 1.125V21"/></svg>`;
14134
- var multiTenantPlugin = chunkPMGOBS6X_cjs.definePlugin({
14155
+ var multiTenantPlugin = chunkNYLWNR6T_cjs.definePlugin({
14135
14156
  id: manifest_default2.id,
14136
14157
  version: "1.0.0",
14137
14158
  name: manifest_default2.name,
@@ -14146,30 +14167,30 @@ var multiTenantPlugin = chunkPMGOBS6X_cjs.definePlugin({
14146
14167
  { label: "Tenants", path: "/admin/tenants", icon: TENANT_ICON, order: 80 }
14147
14168
  ],
14148
14169
  activate: async () => {
14149
- chunkR4ILO3W6_cjs.invalidateTenantCache();
14170
+ chunkLLWLHFTD_cjs.invalidateTenantCache();
14150
14171
  console.info("\u2705 Multi-Tenant plugin activated");
14151
14172
  },
14152
14173
  deactivate: async () => {
14153
- chunkR4ILO3W6_cjs.invalidateTenantCache();
14174
+ chunkLLWLHFTD_cjs.invalidateTenantCache();
14154
14175
  console.info("\u274C Multi-Tenant plugin deactivated");
14155
14176
  }
14156
14177
  });
14157
14178
  var routes = new hono.Hono();
14158
- routes.use("*", chunkMUNO67TT_cjs.requireAuth());
14159
- routes.use("*", chunkMUNO67TT_cjs.requireRole(["admin", "editor"]));
14179
+ routes.use("*", chunkBYLQOBO6_cjs.requireAuth());
14180
+ routes.use("*", chunkBYLQOBO6_cjs.requireRole(["admin", "editor"]));
14160
14181
  routes.get("/:rootId", async (c) => {
14161
14182
  const { rootId } = c.req.param();
14162
14183
  const db = c.env.DB;
14163
- const scope = await chunkTO6EY4P7_cjs.resolveDocScope(c, db, { rootId });
14184
+ const scope = await chunkTV7LRFXH_cjs.resolveDocScope(c, db, { rootId });
14164
14185
  if (!scope) {
14165
14186
  return c.html('<p class="text-zinc-500 dark:text-zinc-400 p-4">Document not found.</p>', 404);
14166
14187
  }
14167
14188
  if (!scope.docType?.settings?.versioning) {
14168
14189
  return c.html('<p class="text-zinc-500 dark:text-zinc-400 p-4">Versioning not enabled for this type.</p>', 404);
14169
14190
  }
14170
- const denied = await chunkTO6EY4P7_cjs.denyIfNotAllowed(c, db, rootId, "read", scope.docType?.settings, scope.tenantId);
14191
+ const denied = await chunkTV7LRFXH_cjs.denyIfNotAllowed(c, db, rootId, "read", scope.docType?.settings, scope.tenantId);
14171
14192
  if (denied) return denied;
14172
- const repo = new chunkTO6EY4P7_cjs.DocumentRepository(db, scope.tenantId);
14193
+ const repo = new chunkTV7LRFXH_cjs.DocumentRepository(db, scope.tenantId);
14173
14194
  const versions = await repo.getVersionHistory(rootId);
14174
14195
  const safeRootIdAttr = chunkMNWKYY5E_cjs.escapeHtml(rootId);
14175
14196
  const rows = versions.map((v) => {
@@ -14262,14 +14283,14 @@ routes.post("/:rootId/restore/:versionNumber", async (c) => {
14262
14283
  const { rootId, versionNumber } = c.req.param();
14263
14284
  const db = c.env.DB;
14264
14285
  const user = c.get("user");
14265
- const scope = await chunkTO6EY4P7_cjs.resolveDocScope(c, db, { rootId });
14286
+ const scope = await chunkTV7LRFXH_cjs.resolveDocScope(c, db, { rootId });
14266
14287
  if (!scope) {
14267
14288
  return c.json({ error: "Document not found" }, 404);
14268
14289
  }
14269
14290
  if (!scope.docType?.settings?.versioning) {
14270
14291
  return c.json({ error: "Versioning not enabled for this type" }, 404);
14271
14292
  }
14272
- const denied = await chunkTO6EY4P7_cjs.denyIfNotAllowed(c, db, rootId, "update", scope.docType?.settings, scope.tenantId);
14293
+ const denied = await chunkTV7LRFXH_cjs.denyIfNotAllowed(c, db, rootId, "update", scope.docType?.settings, scope.tenantId);
14273
14294
  if (denied) return denied;
14274
14295
  const row = await db.prepare("SELECT * FROM documents WHERE root_id = ? AND tenant_id = ? AND version_number = ? LIMIT 1").bind(rootId, scope.tenantId, Number(versionNumber)).first();
14275
14296
  if (!row) {
@@ -14292,7 +14313,7 @@ routes.post("/:rootId/restore/:versionNumber", async (c) => {
14292
14313
  var routes_default = routes;
14293
14314
 
14294
14315
  // src/plugins/core-plugins/versioning-plugin/index.ts
14295
- var versioningPlugin = chunkPMGOBS6X_cjs.definePlugin({
14316
+ var versioningPlugin = chunkNYLWNR6T_cjs.definePlugin({
14296
14317
  id: "versioning",
14297
14318
  version: "1.0.0",
14298
14319
  name: "Versioning",
@@ -14369,8 +14390,8 @@ function createMagicLinkAuthPlugin() {
14369
14390
  const baseUrl = new URL(c.req.url).origin;
14370
14391
  const magicLink = `${baseUrl}/auth/magic-link/verify?token=${token}`;
14371
14392
  try {
14372
- if (chunkTO6EY4P7_cjs.hasEmailService()) {
14373
- await chunkTO6EY4P7_cjs.getEmailService().send({
14393
+ if (chunkTV7LRFXH_cjs.hasEmailService()) {
14394
+ await chunkTV7LRFXH_cjs.getEmailService().send({
14374
14395
  to: normalizedEmail,
14375
14396
  subject: "Your Magic Link to Sign In",
14376
14397
  flow: "magic-link",
@@ -14447,19 +14468,19 @@ function createMagicLinkAuthPlugin() {
14447
14468
  SET used = 1, used_at = ?
14448
14469
  WHERE id = ?
14449
14470
  `).bind(Date.now(), magicLink.id).run();
14450
- const tokenTtl = await chunkMUNO67TT_cjs.getJwtExpirySecondsFromDb(c.env.DB, c.env);
14451
- const jwtToken = await chunkMUNO67TT_cjs.AuthManager.generateToken(
14471
+ const tokenTtl = await chunkBYLQOBO6_cjs.getJwtExpirySecondsFromDb(c.env.DB, c.env);
14472
+ const jwtToken = await chunkBYLQOBO6_cjs.AuthManager.generateToken(
14452
14473
  user.id,
14453
14474
  user.email,
14454
14475
  user.role,
14455
14476
  c.env.JWT_SECRET,
14456
14477
  tokenTtl
14457
14478
  );
14458
- chunkMUNO67TT_cjs.AuthManager.setAuthCookie(c, jwtToken, { maxAge: tokenTtl });
14479
+ chunkBYLQOBO6_cjs.AuthManager.setAuthCookie(c, jwtToken, { maxAge: tokenTtl });
14459
14480
  await db.prepare(`
14460
14481
  UPDATE auth_user SET last_login_at = ? WHERE id = ?
14461
14482
  `).bind(Date.now(), user.id).run();
14462
- chunkTO6EY4P7_cjs.dispatchHookEvent(
14483
+ chunkTV7LRFXH_cjs.dispatchHookEvent(
14463
14484
  c,
14464
14485
  "auth:magic-link:consumed",
14465
14486
  { user: { id: user.id, email: user.email, role: user.role } },
@@ -14944,7 +14965,7 @@ async function warmCollections(db) {
14944
14965
  const collectionCache = chunkYA3TJ65D_cjs.getCacheService(config);
14945
14966
  let count = 0;
14946
14967
  try {
14947
- const results = chunkR4ILO3W6_cjs.getCollectionRegistry().listActive().map(chunkR4ILO3W6_cjs.collectionRecordToRow);
14968
+ const results = chunkLLWLHFTD_cjs.getCollectionRegistry().listActive().map(chunkLLWLHFTD_cjs.collectionRecordToRow);
14948
14969
  for (const collection of results) {
14949
14970
  const key = collectionCache.generateKey("item", collection.id);
14950
14971
  await collectionCache.set(key, collection);
@@ -15215,7 +15236,7 @@ function renderCacheDashboard(data) {
15215
15236
  </script>
15216
15237
 
15217
15238
  <!-- Confirmation Dialogs -->
15218
- ${chunkTO6EY4P7_cjs.renderConfirmationDialog({
15239
+ ${chunkTV7LRFXH_cjs.renderConfirmationDialog({
15219
15240
  id: "clear-all-cache-confirm",
15220
15241
  title: "Clear All Cache",
15221
15242
  message: "Are you sure you want to clear all cache entries? This cannot be undone.",
@@ -15226,7 +15247,7 @@ function renderCacheDashboard(data) {
15226
15247
  onConfirm: "performClearAllCaches()"
15227
15248
  })}
15228
15249
 
15229
- ${chunkTO6EY4P7_cjs.renderConfirmationDialog({
15250
+ ${chunkTV7LRFXH_cjs.renderConfirmationDialog({
15230
15251
  id: "clear-namespace-cache-confirm",
15231
15252
  title: "Clear Namespace Cache",
15232
15253
  message: "Clear cache for this namespace?",
@@ -15237,7 +15258,7 @@ function renderCacheDashboard(data) {
15237
15258
  onConfirm: "performClearNamespaceCache()"
15238
15259
  })}
15239
15260
 
15240
- ${chunkTO6EY4P7_cjs.getConfirmationDialogScript()}
15261
+ ${chunkTV7LRFXH_cjs.getConfirmationDialogScript()}
15241
15262
  `;
15242
15263
  const layoutData = {
15243
15264
  title: "Cache System",
@@ -15503,7 +15524,7 @@ app.get("/", async (c) => {
15503
15524
  const totalRequests = totalHits + totalMisses;
15504
15525
  const overallHitRate = totalRequests > 0 ? totalHits / totalRequests * 100 : 0;
15505
15526
  const DEFAULT_TTL = chunkYA3TJ65D_cjs.CACHE_CONFIGS.api?.ttl ?? 300;
15506
- const collections = chunkR4ILO3W6_cjs.getCollectionRegistry().listActive().filter((r) => !r.internal).map((r) => {
15527
+ const collections = chunkLLWLHFTD_cjs.getCollectionRegistry().listActive().filter((r) => !r.internal).map((r) => {
15507
15528
  const cacheOverride = r.cache;
15508
15529
  const cacheEnabled = cacheOverride?.enabled !== false;
15509
15530
  const hasCustomTtl = typeof cacheOverride?.ttl === "number";
@@ -16040,16 +16061,16 @@ var faviconSvg = `<?xml version="1.0" encoding="UTF-8" standalone="no"?>
16040
16061
  // src/app.ts
16041
16062
  function createSonicJSApp(config = {}) {
16042
16063
  const app2 = new hono.Hono();
16043
- const appVersion = config.version || chunkF67UK75A_cjs.getCoreVersion();
16064
+ const appVersion = config.version || chunkXGH2FVVR_cjs.getCoreVersion();
16044
16065
  const appName = config.name || "SonicJS AI";
16045
- const hookSystem = new chunk3KYKEXV7_cjs.HookSystemImpl();
16066
+ const hookSystem = new chunkSY7CBACS_cjs.HookSystemImpl();
16046
16067
  chunkJ6JTWD2A_cjs.setHookSystem(hookSystem);
16047
16068
  const magicLinkPlugin = createMagicLinkAuthPlugin();
16048
16069
  const corePluginsBeforeCatchAll = [
16049
16070
  securityAuditPlugin,
16050
16071
  aiSearchPlugin,
16051
16072
  oauthProvidersPlugin,
16052
- chunkTO6EY4P7_cjs.userProfilesPlugin,
16073
+ chunkTV7LRFXH_cjs.userProfilesPlugin,
16053
16074
  otpLoginPlugin,
16054
16075
  analyticsPlugin,
16055
16076
  stripePlugin,
@@ -16059,23 +16080,23 @@ function createSonicJSApp(config = {}) {
16059
16080
  shortcodesPlugin,
16060
16081
  helloWorldPlugin,
16061
16082
  multiTenantPlugin,
16062
- chunkTO6EY4P7_cjs.lexicalEditorPlugin,
16083
+ chunkTV7LRFXH_cjs.lexicalEditorPlugin,
16063
16084
  versioningPlugin
16064
16085
  ];
16065
16086
  const corePluginsAfterCatchAll = [emailPluginV3, magicLinkPlugin, emailReconciliationPlugin];
16066
- const wirePlugins = chunk3KYKEXV7_cjs.createPluginWirer(
16087
+ const wirePlugins = chunkSY7CBACS_cjs.createPluginWirer(
16067
16088
  () => [...corePluginsBeforeCatchAll, ...corePluginsAfterCatchAll, ...config.plugins?.register ?? []],
16068
16089
  // The capability-gated `ctx.cap.email` resolves to the app EmailService, which
16069
16090
  // is initialized (below) just before wiring on the first request.
16070
16091
  () => ({
16071
16092
  hooks: hookSystem,
16072
16093
  env: firstRequestEnv,
16073
- providers: { email: () => chunkTO6EY4P7_cjs.getEmailService() }
16094
+ providers: { email: () => chunkTV7LRFXH_cjs.getEmailService() }
16074
16095
  })
16075
16096
  );
16076
16097
  let firstRequestEnv;
16077
16098
  const initEmailService = async (env = {}) => {
16078
- if (chunkTO6EY4P7_cjs.hasEmailService()) return;
16099
+ if (chunkTV7LRFXH_cjs.hasEmailService()) return;
16079
16100
  let provider;
16080
16101
  let defaultFrom = config.email?.from;
16081
16102
  let defaultReplyTo;
@@ -16110,14 +16131,14 @@ function createSonicJSApp(config = {}) {
16110
16131
  }
16111
16132
  }
16112
16133
  defaultFrom = defaultFrom || env.DEFAULT_FROM_EMAIL || "noreply@sonicjs.local";
16113
- chunkTO6EY4P7_cjs.setEmailService(new EmailService({ provider, defaultFrom, defaultReplyTo, db: env.DB }));
16134
+ chunkTV7LRFXH_cjs.setEmailService(new EmailService({ provider, defaultFrom, defaultReplyTo, db: env.DB }));
16114
16135
  };
16115
16136
  app2.use("*", async (c, next) => {
16116
16137
  c.set("appVersion", appVersion);
16117
16138
  await next();
16118
16139
  });
16119
- app2.use("*", chunkMUNO67TT_cjs.metricsMiddleware());
16120
- app2.use("*", chunkMUNO67TT_cjs.bootstrapMiddleware(config));
16140
+ app2.use("*", chunkBYLQOBO6_cjs.metricsMiddleware());
16141
+ app2.use("*", chunkBYLQOBO6_cjs.bootstrapMiddleware(config));
16121
16142
  const boot = async (env) => {
16122
16143
  if (config.plugins?.disableAll) return;
16123
16144
  firstRequestEnv = env;
@@ -16144,8 +16165,19 @@ function createSonicJSApp(config = {}) {
16144
16165
  app2.use("*", async (_c, next) => {
16145
16166
  await next();
16146
16167
  });
16147
- app2.use("*", chunkMUNO67TT_cjs.securityHeadersMiddleware());
16148
- app2.use("*", chunkMUNO67TT_cjs.csrfProtection());
16168
+ app2.use("*", cors.cors({
16169
+ origin: (origin, c) => {
16170
+ const allowed = c.env?.CORS_ORIGINS;
16171
+ if (!allowed) return null;
16172
+ const list = allowed.split(",").map((s) => s.trim());
16173
+ return list.includes(origin) ? origin : null;
16174
+ },
16175
+ allowMethods: ["GET", "POST", "PUT", "DELETE", "OPTIONS"],
16176
+ allowHeaders: ["Content-Type", "Authorization", "X-API-Key"],
16177
+ credentials: true
16178
+ }));
16179
+ app2.use("*", chunkBYLQOBO6_cjs.securityHeadersMiddleware());
16180
+ app2.use("*", chunkBYLQOBO6_cjs.csrfProtection());
16149
16181
  app2.use("*", async (c, next) => {
16150
16182
  try {
16151
16183
  const reqUrl = new URL(c.req.url);
@@ -16182,9 +16214,9 @@ function createSonicJSApp(config = {}) {
16182
16214
  app2.use("*", middleware);
16183
16215
  }
16184
16216
  }
16185
- app2.use("*", chunkR4ILO3W6_cjs.tenantMiddleware());
16186
- app2.use("/admin/*", chunkMUNO67TT_cjs.requireAuth());
16187
- app2.use("/admin/*", chunkMUNO67TT_cjs.requireRbac("portal", "access"));
16217
+ app2.use("*", chunkLLWLHFTD_cjs.tenantMiddleware());
16218
+ app2.use("/admin/*", chunkBYLQOBO6_cjs.requireAuth());
16219
+ app2.use("/admin/*", chunkBYLQOBO6_cjs.requireRbac("portal", "access"));
16188
16220
  app2.use("/admin/*", pluginMenuMiddleware());
16189
16221
  const NAV_LANDING = [
16190
16222
  { path: "/admin/content", perm: "content:read" },
@@ -16230,43 +16262,43 @@ function createSonicJSApp(config = {}) {
16230
16262
  });
16231
16263
  app2.route("/api/security-audit", apiRoutes2);
16232
16264
  app2.route("/admin/plugins/security-audit", adminRoutes3);
16233
- app2.route("/api/media", chunkTO6EY4P7_cjs.api_media_default);
16234
- app2.route("/api/system", chunkTO6EY4P7_cjs.api_system_default);
16235
- app2.route("/api/documents", chunkTO6EY4P7_cjs.apiDocumentsRoutes);
16236
- app2.route("/api", chunkTO6EY4P7_cjs.api_default);
16237
- app2.route("/admin/documents", chunkTO6EY4P7_cjs.adminDocumentsRoutes);
16238
- chunk3KYKEXV7_cjs.registerPluginRoutes(app2, [formsPlugin], { source: "core" });
16239
- app2.route("/admin/api", chunkTO6EY4P7_cjs.admin_api_default);
16240
- app2.route("/admin/collections", chunkTO6EY4P7_cjs.adminCollectionsRoutes);
16241
- app2.route("/admin/settings", chunkTO6EY4P7_cjs.adminSettingsRoutes);
16242
- app2.route("/admin/api-reference", chunkTO6EY4P7_cjs.router2);
16265
+ app2.route("/api/media", chunkTV7LRFXH_cjs.api_media_default);
16266
+ app2.route("/api/system", chunkTV7LRFXH_cjs.api_system_default);
16267
+ app2.route("/api/documents", chunkTV7LRFXH_cjs.apiDocumentsRoutes);
16268
+ app2.route("/api", chunkTV7LRFXH_cjs.api_default);
16269
+ app2.route("/admin/documents", chunkTV7LRFXH_cjs.adminDocumentsRoutes);
16270
+ chunkSY7CBACS_cjs.registerPluginRoutes(app2, [formsPlugin], { source: "core" });
16271
+ app2.route("/admin/api", chunkTV7LRFXH_cjs.admin_api_default);
16272
+ app2.route("/admin/collections", chunkTV7LRFXH_cjs.adminCollectionsRoutes);
16273
+ app2.route("/admin/settings", chunkTV7LRFXH_cjs.adminSettingsRoutes);
16274
+ app2.route("/admin/api-reference", chunkTV7LRFXH_cjs.router2);
16243
16275
  app2.route("/admin/database-tools", createDatabaseToolsAdminRoutes());
16244
- app2.route("/admin/content", chunkTO6EY4P7_cjs.admin_content_default);
16245
- app2.route("/admin/media", chunkTO6EY4P7_cjs.adminMediaRoutes);
16276
+ app2.route("/admin/content", chunkTV7LRFXH_cjs.admin_content_default);
16277
+ app2.route("/admin/media", chunkTV7LRFXH_cjs.adminMediaRoutes);
16246
16278
  app2.use("/auth/*", securityAuditMiddleware());
16247
16279
  if (!config.plugins?.disableAll) {
16248
- chunk3KYKEXV7_cjs.registerPluginRoutes(app2, corePluginsBeforeCatchAll, { source: "core" });
16280
+ chunkSY7CBACS_cjs.registerPluginRoutes(app2, corePluginsBeforeCatchAll, { source: "core" });
16249
16281
  app2.route("/admin/cache", cache_default.getRoutes());
16250
16282
  if (config.plugins?.register && config.plugins.register.length > 0) {
16251
- chunk3KYKEXV7_cjs.registerPluginRoutes(app2, config.plugins.register, { source: "user" });
16283
+ chunkSY7CBACS_cjs.registerPluginRoutes(app2, config.plugins.register, { source: "user" });
16252
16284
  }
16253
16285
  }
16254
16286
  app2.route("/api/events", apiRoutes4);
16255
- app2.route("/admin/dashboard", chunkTO6EY4P7_cjs.router);
16256
- app2.route("/admin/plugins", chunkTO6EY4P7_cjs.adminPluginRoutes);
16257
- app2.route("/admin/logs", chunkTO6EY4P7_cjs.adminLogsRoutes);
16287
+ app2.route("/admin/dashboard", chunkTV7LRFXH_cjs.router);
16288
+ app2.route("/admin/plugins", chunkTV7LRFXH_cjs.adminPluginRoutes);
16289
+ app2.route("/admin/logs", chunkTV7LRFXH_cjs.adminLogsRoutes);
16258
16290
  app2.route("/admin/rbac", adminRbacRoutes);
16259
- app2.route("/admin", chunkTO6EY4P7_cjs.userRoutes);
16260
- app2.route("/auth", chunkTO6EY4P7_cjs.auth_default);
16291
+ app2.route("/admin", chunkTV7LRFXH_cjs.userRoutes);
16292
+ app2.route("/auth", chunkTV7LRFXH_cjs.auth_default);
16261
16293
  app2.on(["GET", "POST"], "/auth/*", (c) => {
16262
16294
  const reqUrl = new URL(c.req.url);
16263
16295
  const requestBaseURL = `${reqUrl.protocol}//${reqUrl.host}`;
16264
16296
  const auth = chunkNUKJ54GA_cjs.createAuth(c.env, config.auth?.extendBetterAuth, requestBaseURL);
16265
16297
  return auth.handler(c.req.raw);
16266
16298
  });
16267
- app2.route("/", chunkTO6EY4P7_cjs.test_cleanup_default);
16299
+ app2.route("/", chunkTV7LRFXH_cjs.test_cleanup_default);
16268
16300
  if (!config.plugins?.disableAll) {
16269
- chunk3KYKEXV7_cjs.registerPluginRoutes(app2, corePluginsAfterCatchAll, { source: "core" });
16301
+ chunkSY7CBACS_cjs.registerPluginRoutes(app2, corePluginsAfterCatchAll, { source: "core" });
16270
16302
  }
16271
16303
  if (!config.plugins?.disableAll) {
16272
16304
  const allMountedPlugins = [
@@ -16275,8 +16307,8 @@ function createSonicJSApp(config = {}) {
16275
16307
  ...corePluginsAfterCatchAll,
16276
16308
  ...config.plugins?.register ?? []
16277
16309
  ];
16278
- chunk3KYKEXV7_cjs.setPluginMenu(allMountedPlugins.flatMap((p) => p.menu ?? []));
16279
- chunkPMGOBS6X_cjs.setPluginDefinitions(allMountedPlugins);
16310
+ chunkSY7CBACS_cjs.setPluginMenu(allMountedPlugins.flatMap((p) => p.menu ?? []));
16311
+ chunkNYLWNR6T_cjs.setPluginDefinitions(allMountedPlugins);
16280
16312
  }
16281
16313
  app2.get("/favicon.svg", (c) => {
16282
16314
  return new Response(faviconSvg, {
@@ -19768,7 +19800,7 @@ function createRedirectApiRoutes() {
19768
19800
  });
19769
19801
  return api;
19770
19802
  }
19771
- var redirectPlugin = chunkPMGOBS6X_cjs.definePlugin({
19803
+ var redirectPlugin = chunkNYLWNR6T_cjs.definePlugin({
19772
19804
  id: manifest_default3.id,
19773
19805
  version: manifest_default3.version,
19774
19806
  name: manifest_default3.name,
@@ -19786,7 +19818,7 @@ var redirectPlugin = chunkPMGOBS6X_cjs.definePlugin({
19786
19818
  async onBoot(ctx) {
19787
19819
  const db = ctx.env?.DB;
19788
19820
  if (!db) return;
19789
- const registry = new chunkMUNO67TT_cjs.DocumentTypeRegistry(db);
19821
+ const registry = new chunkBYLQOBO6_cjs.DocumentTypeRegistry(db);
19790
19822
  await registry.register({
19791
19823
  id: "redirect",
19792
19824
  name: "redirect",
@@ -19902,87 +19934,87 @@ function createDb(d1$1) {
19902
19934
  }
19903
19935
 
19904
19936
  // src/index.ts
19905
- var VERSION = chunkF67UK75A_cjs.package_default.version;
19937
+ var VERSION = chunkXGH2FVVR_cjs.package_default.version;
19906
19938
 
19907
19939
  Object.defineProperty(exports, "ROUTES_INFO", {
19908
19940
  enumerable: true,
19909
- get: function () { return chunkTO6EY4P7_cjs.ROUTES_INFO; }
19941
+ get: function () { return chunkTV7LRFXH_cjs.ROUTES_INFO; }
19910
19942
  });
19911
19943
  Object.defineProperty(exports, "adminApiRoutes", {
19912
19944
  enumerable: true,
19913
- get: function () { return chunkTO6EY4P7_cjs.admin_api_default; }
19945
+ get: function () { return chunkTV7LRFXH_cjs.admin_api_default; }
19914
19946
  });
19915
19947
  Object.defineProperty(exports, "adminCheckboxRoutes", {
19916
19948
  enumerable: true,
19917
- get: function () { return chunkTO6EY4P7_cjs.adminCheckboxRoutes; }
19949
+ get: function () { return chunkTV7LRFXH_cjs.adminCheckboxRoutes; }
19918
19950
  });
19919
19951
  Object.defineProperty(exports, "adminCollectionsRoutes", {
19920
19952
  enumerable: true,
19921
- get: function () { return chunkTO6EY4P7_cjs.adminCollectionsRoutes; }
19953
+ get: function () { return chunkTV7LRFXH_cjs.adminCollectionsRoutes; }
19922
19954
  });
19923
19955
  Object.defineProperty(exports, "adminContentRoutes", {
19924
19956
  enumerable: true,
19925
- get: function () { return chunkTO6EY4P7_cjs.admin_content_default; }
19957
+ get: function () { return chunkTV7LRFXH_cjs.admin_content_default; }
19926
19958
  });
19927
19959
  Object.defineProperty(exports, "adminDashboardRoutes", {
19928
19960
  enumerable: true,
19929
- get: function () { return chunkTO6EY4P7_cjs.router; }
19961
+ get: function () { return chunkTV7LRFXH_cjs.router; }
19930
19962
  });
19931
19963
  Object.defineProperty(exports, "adminLogsRoutes", {
19932
19964
  enumerable: true,
19933
- get: function () { return chunkTO6EY4P7_cjs.adminLogsRoutes; }
19965
+ get: function () { return chunkTV7LRFXH_cjs.adminLogsRoutes; }
19934
19966
  });
19935
19967
  Object.defineProperty(exports, "adminMediaRoutes", {
19936
19968
  enumerable: true,
19937
- get: function () { return chunkTO6EY4P7_cjs.adminMediaRoutes; }
19969
+ get: function () { return chunkTV7LRFXH_cjs.adminMediaRoutes; }
19938
19970
  });
19939
19971
  Object.defineProperty(exports, "adminPluginRoutes", {
19940
19972
  enumerable: true,
19941
- get: function () { return chunkTO6EY4P7_cjs.adminPluginRoutes; }
19973
+ get: function () { return chunkTV7LRFXH_cjs.adminPluginRoutes; }
19942
19974
  });
19943
19975
  Object.defineProperty(exports, "adminSettingsRoutes", {
19944
19976
  enumerable: true,
19945
- get: function () { return chunkTO6EY4P7_cjs.adminSettingsRoutes; }
19977
+ get: function () { return chunkTV7LRFXH_cjs.adminSettingsRoutes; }
19946
19978
  });
19947
19979
  Object.defineProperty(exports, "adminUsersRoutes", {
19948
19980
  enumerable: true,
19949
- get: function () { return chunkTO6EY4P7_cjs.userRoutes; }
19981
+ get: function () { return chunkTV7LRFXH_cjs.userRoutes; }
19950
19982
  });
19951
19983
  Object.defineProperty(exports, "apiContentCrudRoutes", {
19952
19984
  enumerable: true,
19953
- get: function () { return chunkTO6EY4P7_cjs.api_content_crud_default; }
19985
+ get: function () { return chunkTV7LRFXH_cjs.api_content_crud_default; }
19954
19986
  });
19955
19987
  Object.defineProperty(exports, "apiMediaRoutes", {
19956
19988
  enumerable: true,
19957
- get: function () { return chunkTO6EY4P7_cjs.api_media_default; }
19989
+ get: function () { return chunkTV7LRFXH_cjs.api_media_default; }
19958
19990
  });
19959
19991
  Object.defineProperty(exports, "apiRoutes", {
19960
19992
  enumerable: true,
19961
- get: function () { return chunkTO6EY4P7_cjs.api_default; }
19993
+ get: function () { return chunkTV7LRFXH_cjs.api_default; }
19962
19994
  });
19963
19995
  Object.defineProperty(exports, "apiSystemRoutes", {
19964
19996
  enumerable: true,
19965
- get: function () { return chunkTO6EY4P7_cjs.api_system_default; }
19997
+ get: function () { return chunkTV7LRFXH_cjs.api_system_default; }
19966
19998
  });
19967
19999
  Object.defineProperty(exports, "authRoutes", {
19968
20000
  enumerable: true,
19969
- get: function () { return chunkTO6EY4P7_cjs.auth_default; }
20001
+ get: function () { return chunkTV7LRFXH_cjs.auth_default; }
19970
20002
  });
19971
20003
  Object.defineProperty(exports, "createUserProfilesPlugin", {
19972
20004
  enumerable: true,
19973
- get: function () { return chunkTO6EY4P7_cjs.createUserProfilesPlugin; }
20005
+ get: function () { return chunkTV7LRFXH_cjs.createUserProfilesPlugin; }
19974
20006
  });
19975
20007
  Object.defineProperty(exports, "defineUserProfile", {
19976
20008
  enumerable: true,
19977
- get: function () { return chunkTO6EY4P7_cjs.defineUserProfile; }
20009
+ get: function () { return chunkTV7LRFXH_cjs.defineUserProfile; }
19978
20010
  });
19979
20011
  Object.defineProperty(exports, "getUserProfileConfig", {
19980
20012
  enumerable: true,
19981
- get: function () { return chunkTO6EY4P7_cjs.getUserProfileConfig; }
20013
+ get: function () { return chunkTV7LRFXH_cjs.getUserProfileConfig; }
19982
20014
  });
19983
20015
  Object.defineProperty(exports, "userProfilesPlugin", {
19984
20016
  enumerable: true,
19985
- get: function () { return chunkTO6EY4P7_cjs.userProfilesPlugin; }
20017
+ get: function () { return chunkTV7LRFXH_cjs.userProfilesPlugin; }
19986
20018
  });
19987
20019
  Object.defineProperty(exports, "Logger", {
19988
20020
  enumerable: true,
@@ -20138,87 +20170,87 @@ Object.defineProperty(exports, "workflowHistory", {
20138
20170
  });
20139
20171
  Object.defineProperty(exports, "AuthManager", {
20140
20172
  enumerable: true,
20141
- get: function () { return chunkMUNO67TT_cjs.AuthManager; }
20173
+ get: function () { return chunkBYLQOBO6_cjs.AuthManager; }
20142
20174
  });
20143
20175
  Object.defineProperty(exports, "PermissionManager", {
20144
20176
  enumerable: true,
20145
- get: function () { return chunkMUNO67TT_cjs.PermissionManager; }
20177
+ get: function () { return chunkBYLQOBO6_cjs.PermissionManager; }
20146
20178
  });
20147
20179
  Object.defineProperty(exports, "bootstrapDocumentTypes", {
20148
20180
  enumerable: true,
20149
- get: function () { return chunkMUNO67TT_cjs.bootstrapDocumentTypes; }
20181
+ get: function () { return chunkBYLQOBO6_cjs.bootstrapDocumentTypes; }
20150
20182
  });
20151
20183
  Object.defineProperty(exports, "bootstrapMiddleware", {
20152
20184
  enumerable: true,
20153
- get: function () { return chunkMUNO67TT_cjs.bootstrapMiddleware; }
20185
+ get: function () { return chunkBYLQOBO6_cjs.bootstrapMiddleware; }
20154
20186
  });
20155
20187
  Object.defineProperty(exports, "cacheHeaders", {
20156
20188
  enumerable: true,
20157
- get: function () { return chunkMUNO67TT_cjs.cacheHeaders; }
20189
+ get: function () { return chunkBYLQOBO6_cjs.cacheHeaders; }
20158
20190
  });
20159
20191
  Object.defineProperty(exports, "compressionMiddleware", {
20160
20192
  enumerable: true,
20161
- get: function () { return chunkMUNO67TT_cjs.compressionMiddleware; }
20193
+ get: function () { return chunkBYLQOBO6_cjs.compressionMiddleware; }
20162
20194
  });
20163
20195
  Object.defineProperty(exports, "detailedLoggingMiddleware", {
20164
20196
  enumerable: true,
20165
- get: function () { return chunkMUNO67TT_cjs.detailedLoggingMiddleware; }
20197
+ get: function () { return chunkBYLQOBO6_cjs.detailedLoggingMiddleware; }
20166
20198
  });
20167
20199
  Object.defineProperty(exports, "getActivePlugins", {
20168
20200
  enumerable: true,
20169
- get: function () { return chunkMUNO67TT_cjs.getActivePlugins; }
20201
+ get: function () { return chunkBYLQOBO6_cjs.getActivePlugins; }
20170
20202
  });
20171
20203
  Object.defineProperty(exports, "isPluginActive", {
20172
20204
  enumerable: true,
20173
- get: function () { return chunkMUNO67TT_cjs.isPluginActive; }
20205
+ get: function () { return chunkBYLQOBO6_cjs.isPluginActive; }
20174
20206
  });
20175
20207
  Object.defineProperty(exports, "logActivity", {
20176
20208
  enumerable: true,
20177
- get: function () { return chunkMUNO67TT_cjs.logActivity; }
20209
+ get: function () { return chunkBYLQOBO6_cjs.logActivity; }
20178
20210
  });
20179
20211
  Object.defineProperty(exports, "loggingMiddleware", {
20180
20212
  enumerable: true,
20181
- get: function () { return chunkMUNO67TT_cjs.loggingMiddleware; }
20213
+ get: function () { return chunkBYLQOBO6_cjs.loggingMiddleware; }
20182
20214
  });
20183
20215
  Object.defineProperty(exports, "optionalAuth", {
20184
20216
  enumerable: true,
20185
- get: function () { return chunkMUNO67TT_cjs.optionalAuth; }
20217
+ get: function () { return chunkBYLQOBO6_cjs.optionalAuth; }
20186
20218
  });
20187
20219
  Object.defineProperty(exports, "performanceLoggingMiddleware", {
20188
20220
  enumerable: true,
20189
- get: function () { return chunkMUNO67TT_cjs.performanceLoggingMiddleware; }
20221
+ get: function () { return chunkBYLQOBO6_cjs.performanceLoggingMiddleware; }
20190
20222
  });
20191
20223
  Object.defineProperty(exports, "requireActivePlugin", {
20192
20224
  enumerable: true,
20193
- get: function () { return chunkMUNO67TT_cjs.requireActivePlugin; }
20225
+ get: function () { return chunkBYLQOBO6_cjs.requireActivePlugin; }
20194
20226
  });
20195
20227
  Object.defineProperty(exports, "requireActivePlugins", {
20196
20228
  enumerable: true,
20197
- get: function () { return chunkMUNO67TT_cjs.requireActivePlugins; }
20229
+ get: function () { return chunkBYLQOBO6_cjs.requireActivePlugins; }
20198
20230
  });
20199
20231
  Object.defineProperty(exports, "requireAnyPermission", {
20200
20232
  enumerable: true,
20201
- get: function () { return chunkMUNO67TT_cjs.requireAnyPermission; }
20233
+ get: function () { return chunkBYLQOBO6_cjs.requireAnyPermission; }
20202
20234
  });
20203
20235
  Object.defineProperty(exports, "requireAuth", {
20204
20236
  enumerable: true,
20205
- get: function () { return chunkMUNO67TT_cjs.requireAuth; }
20237
+ get: function () { return chunkBYLQOBO6_cjs.requireAuth; }
20206
20238
  });
20207
20239
  Object.defineProperty(exports, "requirePermission", {
20208
20240
  enumerable: true,
20209
- get: function () { return chunkMUNO67TT_cjs.requirePermission; }
20241
+ get: function () { return chunkBYLQOBO6_cjs.requirePermission; }
20210
20242
  });
20211
20243
  Object.defineProperty(exports, "requireRole", {
20212
20244
  enumerable: true,
20213
- get: function () { return chunkMUNO67TT_cjs.requireRole; }
20245
+ get: function () { return chunkBYLQOBO6_cjs.requireRole; }
20214
20246
  });
20215
20247
  Object.defineProperty(exports, "securityHeaders", {
20216
20248
  enumerable: true,
20217
- get: function () { return chunkMUNO67TT_cjs.securityHeadersMiddleware; }
20249
+ get: function () { return chunkBYLQOBO6_cjs.securityHeadersMiddleware; }
20218
20250
  });
20219
20251
  Object.defineProperty(exports, "securityLoggingMiddleware", {
20220
20252
  enumerable: true,
20221
- get: function () { return chunkMUNO67TT_cjs.securityLoggingMiddleware; }
20253
+ get: function () { return chunkBYLQOBO6_cjs.securityLoggingMiddleware; }
20222
20254
  });
20223
20255
  Object.defineProperty(exports, "RbacService", {
20224
20256
  enumerable: true,
@@ -20226,35 +20258,35 @@ Object.defineProperty(exports, "RbacService", {
20226
20258
  });
20227
20259
  Object.defineProperty(exports, "PluginBootstrapService", {
20228
20260
  enumerable: true,
20229
- get: function () { return chunkR4ILO3W6_cjs.PluginBootstrapService; }
20261
+ get: function () { return chunkLLWLHFTD_cjs.PluginBootstrapService; }
20230
20262
  });
20231
20263
  Object.defineProperty(exports, "PluginServiceClass", {
20232
20264
  enumerable: true,
20233
- get: function () { return chunkR4ILO3W6_cjs.PluginService; }
20265
+ get: function () { return chunkLLWLHFTD_cjs.PluginService; }
20234
20266
  });
20235
20267
  Object.defineProperty(exports, "getAvailableCollectionNames", {
20236
20268
  enumerable: true,
20237
- get: function () { return chunkR4ILO3W6_cjs.getAvailableCollectionNames; }
20269
+ get: function () { return chunkLLWLHFTD_cjs.getAvailableCollectionNames; }
20238
20270
  });
20239
20271
  Object.defineProperty(exports, "loadCollectionConfig", {
20240
20272
  enumerable: true,
20241
- get: function () { return chunkR4ILO3W6_cjs.loadCollectionConfig; }
20273
+ get: function () { return chunkLLWLHFTD_cjs.loadCollectionConfig; }
20242
20274
  });
20243
20275
  Object.defineProperty(exports, "loadCollectionConfigs", {
20244
20276
  enumerable: true,
20245
- get: function () { return chunkR4ILO3W6_cjs.loadCollectionConfigs; }
20277
+ get: function () { return chunkLLWLHFTD_cjs.loadCollectionConfigs; }
20246
20278
  });
20247
20279
  Object.defineProperty(exports, "registerCollections", {
20248
20280
  enumerable: true,
20249
- get: function () { return chunkR4ILO3W6_cjs.registerCollections; }
20281
+ get: function () { return chunkLLWLHFTD_cjs.registerCollections; }
20250
20282
  });
20251
20283
  Object.defineProperty(exports, "validateCollectionConfig", {
20252
20284
  enumerable: true,
20253
- get: function () { return chunkR4ILO3W6_cjs.validateCollectionConfig; }
20285
+ get: function () { return chunkLLWLHFTD_cjs.validateCollectionConfig; }
20254
20286
  });
20255
20287
  Object.defineProperty(exports, "MigrationService", {
20256
20288
  enumerable: true,
20257
- get: function () { return chunkIHTXB7AT_cjs.MigrationService; }
20289
+ get: function () { return chunkKI5KMJH2_cjs.MigrationService; }
20258
20290
  });
20259
20291
  Object.defineProperty(exports, "renderFilterBar", {
20260
20292
  enumerable: true,
@@ -20294,99 +20326,99 @@ Object.defineProperty(exports, "renderAdminLayoutCatalyst", {
20294
20326
  });
20295
20327
  Object.defineProperty(exports, "HookSystemImpl", {
20296
20328
  enumerable: true,
20297
- get: function () { return chunk3KYKEXV7_cjs.HookSystemImpl; }
20329
+ get: function () { return chunkSY7CBACS_cjs.HookSystemImpl; }
20298
20330
  });
20299
20331
  Object.defineProperty(exports, "HookUtils", {
20300
20332
  enumerable: true,
20301
- get: function () { return chunk3KYKEXV7_cjs.HookUtils; }
20333
+ get: function () { return chunkSY7CBACS_cjs.HookUtils; }
20302
20334
  });
20303
20335
  Object.defineProperty(exports, "PluginDependencyCycleError", {
20304
20336
  enumerable: true,
20305
- get: function () { return chunk3KYKEXV7_cjs.PluginDependencyCycleError; }
20337
+ get: function () { return chunkSY7CBACS_cjs.PluginDependencyCycleError; }
20306
20338
  });
20307
20339
  Object.defineProperty(exports, "PluginManagerClass", {
20308
20340
  enumerable: true,
20309
- get: function () { return chunk3KYKEXV7_cjs.PluginManager; }
20341
+ get: function () { return chunkSY7CBACS_cjs.PluginManager; }
20310
20342
  });
20311
20343
  Object.defineProperty(exports, "PluginRegistryImpl", {
20312
20344
  enumerable: true,
20313
- get: function () { return chunk3KYKEXV7_cjs.PluginRegistryImpl; }
20345
+ get: function () { return chunkSY7CBACS_cjs.PluginRegistryImpl; }
20314
20346
  });
20315
20347
  Object.defineProperty(exports, "PluginValidatorClass", {
20316
20348
  enumerable: true,
20317
- get: function () { return chunk3KYKEXV7_cjs.PluginValidator; }
20349
+ get: function () { return chunkSY7CBACS_cjs.PluginValidator; }
20318
20350
  });
20319
20351
  Object.defineProperty(exports, "RegisterPluginsError", {
20320
20352
  enumerable: true,
20321
- get: function () { return chunk3KYKEXV7_cjs.RegisterPluginsError; }
20353
+ get: function () { return chunkSY7CBACS_cjs.RegisterPluginsError; }
20322
20354
  });
20323
20355
  Object.defineProperty(exports, "ScopedHookSystemClass", {
20324
20356
  enumerable: true,
20325
- get: function () { return chunk3KYKEXV7_cjs.ScopedHookSystem; }
20357
+ get: function () { return chunkSY7CBACS_cjs.ScopedHookSystem; }
20326
20358
  });
20327
20359
  Object.defineProperty(exports, "collectCronSchedules", {
20328
20360
  enumerable: true,
20329
- get: function () { return chunk3KYKEXV7_cjs.collectCronSchedules; }
20361
+ get: function () { return chunkSY7CBACS_cjs.collectCronSchedules; }
20330
20362
  });
20331
20363
  Object.defineProperty(exports, "collectCrons", {
20332
20364
  enumerable: true,
20333
- get: function () { return chunk3KYKEXV7_cjs.collectCrons; }
20365
+ get: function () { return chunkSY7CBACS_cjs.collectCrons; }
20334
20366
  });
20335
20367
  Object.defineProperty(exports, "createScheduledHandler", {
20336
20368
  enumerable: true,
20337
- get: function () { return chunk3KYKEXV7_cjs.createScheduledHandler; }
20369
+ get: function () { return chunkSY7CBACS_cjs.createScheduledHandler; }
20338
20370
  });
20339
20371
  Object.defineProperty(exports, "dispatchCronTick", {
20340
20372
  enumerable: true,
20341
- get: function () { return chunk3KYKEXV7_cjs.dispatchCronTick; }
20373
+ get: function () { return chunkSY7CBACS_cjs.dispatchCronTick; }
20342
20374
  });
20343
20375
  Object.defineProperty(exports, "getPluginMenu", {
20344
20376
  enumerable: true,
20345
- get: function () { return chunk3KYKEXV7_cjs.getPluginMenu; }
20377
+ get: function () { return chunkSY7CBACS_cjs.getPluginMenu; }
20346
20378
  });
20347
20379
  Object.defineProperty(exports, "registerPlugins", {
20348
20380
  enumerable: true,
20349
- get: function () { return chunk3KYKEXV7_cjs.registerPlugins; }
20381
+ get: function () { return chunkSY7CBACS_cjs.registerPlugins; }
20350
20382
  });
20351
20383
  Object.defineProperty(exports, "resetPluginMenu", {
20352
20384
  enumerable: true,
20353
- get: function () { return chunk3KYKEXV7_cjs.resetPluginMenu; }
20385
+ get: function () { return chunkSY7CBACS_cjs.resetPluginMenu; }
20354
20386
  });
20355
20387
  Object.defineProperty(exports, "resolvePluginMenuItems", {
20356
20388
  enumerable: true,
20357
- get: function () { return chunk3KYKEXV7_cjs.resolvePluginMenuItems; }
20389
+ get: function () { return chunkSY7CBACS_cjs.resolvePluginMenuItems; }
20358
20390
  });
20359
20391
  Object.defineProperty(exports, "setPluginMenu", {
20360
20392
  enumerable: true,
20361
- get: function () { return chunk3KYKEXV7_cjs.setPluginMenu; }
20393
+ get: function () { return chunkSY7CBACS_cjs.setPluginMenu; }
20362
20394
  });
20363
20395
  Object.defineProperty(exports, "topoSort", {
20364
20396
  enumerable: true,
20365
- get: function () { return chunk3KYKEXV7_cjs.topoSort; }
20397
+ get: function () { return chunkSY7CBACS_cjs.topoSort; }
20366
20398
  });
20367
20399
  Object.defineProperty(exports, "applySchemaDefaults", {
20368
20400
  enumerable: true,
20369
- get: function () { return chunkPMGOBS6X_cjs.applySchemaDefaults; }
20401
+ get: function () { return chunkNYLWNR6T_cjs.applySchemaDefaults; }
20370
20402
  });
20371
20403
  Object.defineProperty(exports, "definePlugin", {
20372
20404
  enumerable: true,
20373
- get: function () { return chunkPMGOBS6X_cjs.definePlugin; }
20405
+ get: function () { return chunkNYLWNR6T_cjs.definePlugin; }
20374
20406
  });
20375
20407
  Object.defineProperty(exports, "isDefinedPlugin", {
20376
20408
  enumerable: true,
20377
- get: function () { return chunkPMGOBS6X_cjs.isDefinedPlugin; }
20409
+ get: function () { return chunkNYLWNR6T_cjs.isDefinedPlugin; }
20378
20410
  });
20379
20411
  Object.defineProperty(exports, "parseConfigSchema", {
20380
20412
  enumerable: true,
20381
- get: function () { return chunkPMGOBS6X_cjs.parseConfigSchema; }
20413
+ get: function () { return chunkNYLWNR6T_cjs.parseConfigSchema; }
20382
20414
  });
20383
20415
  Object.defineProperty(exports, "parseFormDataToSettings", {
20384
20416
  enumerable: true,
20385
- get: function () { return chunkPMGOBS6X_cjs.parseFormDataToSettings; }
20417
+ get: function () { return chunkNYLWNR6T_cjs.parseFormDataToSettings; }
20386
20418
  });
20387
20419
  Object.defineProperty(exports, "renderSchemaFields", {
20388
20420
  enumerable: true,
20389
- get: function () { return chunkPMGOBS6X_cjs.renderSchemaFields; }
20421
+ get: function () { return chunkNYLWNR6T_cjs.renderSchemaFields; }
20390
20422
  });
20391
20423
  Object.defineProperty(exports, "getHookSystem", {
20392
20424
  enumerable: true,
@@ -20434,11 +20466,11 @@ Object.defineProperty(exports, "metricsTracker", {
20434
20466
  });
20435
20467
  Object.defineProperty(exports, "SONICJS_VERSION", {
20436
20468
  enumerable: true,
20437
- get: function () { return chunkF67UK75A_cjs.SONICJS_VERSION; }
20469
+ get: function () { return chunkXGH2FVVR_cjs.SONICJS_VERSION; }
20438
20470
  });
20439
20471
  Object.defineProperty(exports, "getCoreVersion", {
20440
20472
  enumerable: true,
20441
- get: function () { return chunkF67UK75A_cjs.getCoreVersion; }
20473
+ get: function () { return chunkXGH2FVVR_cjs.getCoreVersion; }
20442
20474
  });
20443
20475
  Object.defineProperty(exports, "escapeHtml", {
20444
20476
  enumerable: true,