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

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-IDCZBF35.js → chunk-3PU4WVU6.js} +4 -4
  2. package/dist/{chunk-IDCZBF35.js.map → chunk-3PU4WVU6.js.map} +1 -1
  3. package/dist/{chunk-ALDRXTUO.js → chunk-6H66MSSL.js} +2 -2
  4. package/dist/{chunk-ALDRXTUO.js.map → chunk-6H66MSSL.js.map} +1 -1
  5. package/dist/{chunk-IGADDMXH.js → chunk-HPAJKZAQ.js} +3 -3
  6. package/dist/{chunk-IGADDMXH.js.map → chunk-HPAJKZAQ.js.map} +1 -1
  7. package/dist/{chunk-TO6EY4P7.cjs → chunk-K342JMA3.cjs} +200 -200
  8. package/dist/{chunk-TO6EY4P7.cjs.map → chunk-K342JMA3.cjs.map} +1 -1
  9. package/dist/{chunk-F67UK75A.cjs → chunk-KV3CM5RK.cjs} +3 -3
  10. package/dist/{chunk-F67UK75A.cjs.map → chunk-KV3CM5RK.cjs.map} +1 -1
  11. package/dist/{chunk-3KYKEXV7.cjs → chunk-MKKGA3C4.cjs} +10 -10
  12. package/dist/{chunk-3KYKEXV7.cjs.map → chunk-MKKGA3C4.cjs.map} +1 -1
  13. package/dist/{chunk-IHTXB7AT.cjs → chunk-ORF4CT74.cjs} +2 -2
  14. package/dist/{chunk-IHTXB7AT.cjs.map → chunk-ORF4CT74.cjs.map} +1 -1
  15. package/dist/{chunk-ATUPB6MN.js → chunk-PDYRDYXI.js} +4 -4
  16. package/dist/{chunk-ATUPB6MN.js.map → chunk-PDYRDYXI.js.map} +1 -1
  17. package/dist/{chunk-R4ILO3W6.cjs → chunk-QJNKSFDJ.cjs} +2 -2
  18. package/dist/{chunk-R4ILO3W6.cjs.map → chunk-QJNKSFDJ.cjs.map} +1 -1
  19. package/dist/{chunk-PYVFXCSD.js → chunk-QLFTG3QJ.js} +2 -2
  20. package/dist/{chunk-PYVFXCSD.js.map → chunk-QLFTG3QJ.js.map} +1 -1
  21. package/dist/{chunk-6OC6MF3C.js → chunk-SXLVXD2X.js} +9 -9
  22. package/dist/{chunk-6OC6MF3C.js.map → chunk-SXLVXD2X.js.map} +1 -1
  23. package/dist/{chunk-PMGOBS6X.cjs → chunk-UHRHZXVR.cjs} +4 -4
  24. package/dist/{chunk-PMGOBS6X.cjs.map → chunk-UHRHZXVR.cjs.map} +1 -1
  25. package/dist/{chunk-MUNO67TT.cjs → chunk-YJEBDJDV.cjs} +13 -13
  26. package/dist/{chunk-MUNO67TT.cjs.map → chunk-YJEBDJDV.cjs.map} +1 -1
  27. package/dist/{chunk-V464XBYS.js → chunk-ZUEIQFE5.js} +3 -3
  28. package/dist/{chunk-V464XBYS.js.map → chunk-ZUEIQFE5.js.map} +1 -1
  29. package/dist/index.cjs +255 -254
  30. package/dist/index.cjs.map +1 -1
  31. package/dist/index.js +16 -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-XQLBY7E5.js +4 -0
  36. package/dist/{migrations-PE3CDVSM.js.map → migrations-XQLBY7E5.js.map} +1 -1
  37. package/dist/migrations-ZXJEUTFA.cjs +13 -0
  38. package/dist/{migrations-2XHQEGOQ.cjs.map → migrations-ZXJEUTFA.cjs.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,27 +1,27 @@
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 chunkK342JMA3_cjs = require('./chunk-K342JMA3.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 chunkYJEBDJDV_cjs = require('./chunk-YJEBDJDV.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 chunkQJNKSFDJ_cjs = require('./chunk-QJNKSFDJ.cjs');
14
+ var chunkORF4CT74_cjs = require('./chunk-ORF4CT74.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 chunkMKKGA3C4_cjs = require('./chunk-MKKGA3C4.cjs');
19
+ var chunkUHRHZXVR_cjs = require('./chunk-UHRHZXVR.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 chunkKV3CM5RK_cjs = require('./chunk-KV3CM5RK.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');
@@ -573,7 +573,7 @@ function formatCellValue(value) {
573
573
  // src/plugins/core-plugins/database-tools-plugin/admin-routes.ts
574
574
  function createDatabaseToolsAdminRoutes() {
575
575
  const router3 = new hono.Hono();
576
- router3.use("*", chunkMUNO67TT_cjs.requireAuth());
576
+ router3.use("*", chunkYJEBDJDV_cjs.requireAuth());
577
577
  router3.get("/api/stats", async (c) => {
578
578
  try {
579
579
  const user = c.get("user");
@@ -976,7 +976,7 @@ var SiteConfigService = class {
976
976
 
977
977
  // src/plugins/core-plugins/email-plugin/routes/admin.ts
978
978
  var adminRoutes = new hono.Hono();
979
- adminRoutes.use("*", chunkMUNO67TT_cjs.requireAuth());
979
+ adminRoutes.use("*", chunkYJEBDJDV_cjs.requireAuth());
980
980
  adminRoutes.post("/settings", async (c) => {
981
981
  if (c.get("user")?.role !== "admin") {
982
982
  return c.json({ error: "admin role required" }, 403);
@@ -1014,7 +1014,7 @@ adminRoutes.post("/test", async (c) => {
1014
1014
  const { subject, html: html4, text } = renderTestEmail({ siteName });
1015
1015
  try {
1016
1016
  const settingsLoaded = await settings.load();
1017
- const result = await chunkTO6EY4P7_cjs.getEmailService().send({
1017
+ const result = await chunkK342JMA3_cjs.getEmailService().send({
1018
1018
  to,
1019
1019
  subject,
1020
1020
  html: html4,
@@ -1096,7 +1096,7 @@ function makeOnRegistrationCompleted(env) {
1096
1096
  siteName,
1097
1097
  loginUrl: siteConfig.buildLoginUrl(siteUrl)
1098
1098
  });
1099
- const result = await chunkTO6EY4P7_cjs.getEmailService().send({
1099
+ const result = await chunkK342JMA3_cjs.getEmailService().send({
1100
1100
  to: user.email,
1101
1101
  subject,
1102
1102
  html: html4,
@@ -1170,7 +1170,7 @@ function makeOnPasswordResetRequested(env) {
1170
1170
  expiresAt: Date.now() + DEFAULT_EXPIRY_MS,
1171
1171
  siteName
1172
1172
  });
1173
- const result = await chunkTO6EY4P7_cjs.getEmailService().send({
1173
+ const result = await chunkK342JMA3_cjs.getEmailService().send({
1174
1174
  to: user.email,
1175
1175
  subject,
1176
1176
  html: html4,
@@ -1238,7 +1238,7 @@ function makeOnPasswordResetCompleted(env) {
1238
1238
  supportEmail,
1239
1239
  when: Date.now()
1240
1240
  });
1241
- const result = await chunkTO6EY4P7_cjs.getEmailService().send({
1241
+ const result = await chunkK342JMA3_cjs.getEmailService().send({
1242
1242
  to: user.email,
1243
1243
  subject,
1244
1244
  html: html4,
@@ -1970,7 +1970,7 @@ var CloudflareEmailProvider = class {
1970
1970
  }
1971
1971
  }
1972
1972
  };
1973
- var emailPluginV3 = chunkPMGOBS6X_cjs.definePlugin({
1973
+ var emailPluginV3 = chunkUHRHZXVR_cjs.definePlugin({
1974
1974
  id: "email",
1975
1975
  version: "1.0.0",
1976
1976
  name: "Email",
@@ -1984,7 +1984,7 @@ var emailPluginV3 = chunkPMGOBS6X_cjs.definePlugin({
1984
1984
  const db = env.DB;
1985
1985
  if (db) {
1986
1986
  try {
1987
- const typeRegistry = new chunkMUNO67TT_cjs.DocumentTypeRegistry(db);
1987
+ const typeRegistry = new chunkYJEBDJDV_cjs.DocumentTypeRegistry(db);
1988
1988
  await typeRegistry.register({
1989
1989
  id: "email_log",
1990
1990
  name: "email_log",
@@ -1999,7 +1999,7 @@ var emailPluginV3 = chunkPMGOBS6X_cjs.definePlugin({
1999
1999
  } catch {
2000
2000
  }
2001
2001
  }
2002
- if (!chunkTO6EY4P7_cjs.hasEmailService()) {
2002
+ if (!chunkK342JMA3_cjs.hasEmailService()) {
2003
2003
  const settings = db ? await new EmailSettingsService(db).load() : {};
2004
2004
  const envResendKey = typeof env.RESEND_API_KEY === "string" && env.RESEND_API_KEY ? env.RESEND_API_KEY : void 0;
2005
2005
  const cfEmailBinding = env.EMAIL;
@@ -2017,7 +2017,7 @@ var emailPluginV3 = chunkPMGOBS6X_cjs.definePlugin({
2017
2017
  } else {
2018
2018
  provider = resolveEmailProvider({ env });
2019
2019
  }
2020
- chunkTO6EY4P7_cjs.setEmailService(new EmailService({ ...serviceOpts, provider }));
2020
+ chunkK342JMA3_cjs.setEmailService(new EmailService({ ...serviceOpts, provider }));
2021
2021
  }
2022
2022
  ctx.hooks.on("auth:registration:completed", makeOnRegistrationCompleted(env));
2023
2023
  ctx.hooks.on("auth:password-reset:requested", makeOnPasswordResetRequested(env));
@@ -2028,7 +2028,7 @@ var emailPluginV3 = chunkPMGOBS6X_cjs.definePlugin({
2028
2028
  var BATCH_SIZE = 100;
2029
2029
  ({
2030
2030
  schema: zod.z.record(zod.z.string(), zod.z.unknown())});
2031
- var emailReconciliationPlugin = chunkPMGOBS6X_cjs.definePlugin({
2031
+ var emailReconciliationPlugin = chunkUHRHZXVR_cjs.definePlugin({
2032
2032
  id: "email-reconciliation",
2033
2033
  version: "1.0.0",
2034
2034
  description: "Hourly cron that backfills email delivery state from provider status APIs. Only active for providers that implement EmailProvider.reconcile().",
@@ -2049,11 +2049,11 @@ var emailReconciliationPlugin = chunkPMGOBS6X_cjs.definePlugin({
2049
2049
  console.warn("[email-reconciliation] No DB binding in cron env \u2014 skipping.");
2050
2050
  return;
2051
2051
  }
2052
- if (!chunkTO6EY4P7_cjs.hasEmailService()) {
2052
+ if (!chunkK342JMA3_cjs.hasEmailService()) {
2053
2053
  console.warn("[email-reconciliation] EmailService not initialized \u2014 skipping.");
2054
2054
  return;
2055
2055
  }
2056
- const emailService = chunkTO6EY4P7_cjs.getEmailService();
2056
+ const emailService = chunkK342JMA3_cjs.getEmailService();
2057
2057
  let rows = [];
2058
2058
  try {
2059
2059
  const result = await db.prepare(
@@ -2539,8 +2539,8 @@ function buildOtpApi() {
2539
2539
  loginUrl: settings.loginUrl || "",
2540
2540
  loginButtonText: settings.loginButtonText || ""
2541
2541
  });
2542
- if (chunkTO6EY4P7_cjs.hasEmailService()) {
2543
- const sent = await chunkTO6EY4P7_cjs.getEmailService().send({
2542
+ if (chunkK342JMA3_cjs.hasEmailService()) {
2543
+ const sent = await chunkK342JMA3_cjs.getEmailService().send({
2544
2544
  to: normalizedEmail,
2545
2545
  subject: `Your login code for ${siteName}`,
2546
2546
  flow: "otp",
@@ -2642,21 +2642,21 @@ function buildOtpApi() {
2642
2642
  error: "Account is deactivated"
2643
2643
  }, 403);
2644
2644
  }
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);
2645
+ const tokenTtl = await chunkYJEBDJDV_cjs.getJwtExpirySecondsFromDb(db, c.env);
2646
+ const token = await chunkYJEBDJDV_cjs.AuthManager.generateToken(user.id, user.email, user.role, c.env.JWT_SECRET, tokenTtl);
2647
2647
  cookie.setCookie(c, "auth_token", token, {
2648
2648
  httpOnly: true,
2649
2649
  secure: true,
2650
2650
  sameSite: "Strict",
2651
2651
  maxAge: tokenTtl
2652
2652
  });
2653
- chunkTO6EY4P7_cjs.dispatchHookEvent(
2653
+ chunkK342JMA3_cjs.dispatchHookEvent(
2654
2654
  c,
2655
2655
  "auth:otp:verified",
2656
2656
  { user: { id: user.id, email: user.email, role: user.role } },
2657
2657
  "fire-and-forget"
2658
2658
  );
2659
- const customData = await chunkTO6EY4P7_cjs.getCustomData(db, user.id);
2659
+ const customData = await chunkK342JMA3_cjs.getCustomData(db, user.id);
2660
2660
  const { is_active: _isActive, ...publicUser } = user;
2661
2661
  return c.json({
2662
2662
  success: true,
@@ -2701,7 +2701,7 @@ function buildOtpApi() {
2701
2701
  });
2702
2702
  return otpAPI;
2703
2703
  }
2704
- var otpLoginPlugin = chunkPMGOBS6X_cjs.definePlugin({
2704
+ var otpLoginPlugin = chunkUHRHZXVR_cjs.definePlugin({
2705
2705
  id: "otp-login",
2706
2706
  version: "1.0.0",
2707
2707
  name: "OTP Login",
@@ -3098,15 +3098,15 @@ function buildOauthApi() {
3098
3098
  if (!user || !user.is_active) {
3099
3099
  return c.redirect("/auth/login?error=Account is deactivated");
3100
3100
  }
3101
- const tokenTtl2 = await chunkMUNO67TT_cjs.getJwtExpirySecondsFromDb(c.env.DB, c.env);
3102
- const jwt2 = await chunkMUNO67TT_cjs.AuthManager.generateToken(
3101
+ const tokenTtl2 = await chunkYJEBDJDV_cjs.getJwtExpirySecondsFromDb(c.env.DB, c.env);
3102
+ const jwt2 = await chunkYJEBDJDV_cjs.AuthManager.generateToken(
3103
3103
  user.id,
3104
3104
  user.email,
3105
3105
  user.role,
3106
3106
  c.env.JWT_SECRET,
3107
3107
  tokenTtl2
3108
3108
  );
3109
- chunkMUNO67TT_cjs.AuthManager.setAuthCookie(c, jwt2, { sameSite: "Lax", maxAge: tokenTtl2 });
3109
+ chunkYJEBDJDV_cjs.AuthManager.setAuthCookie(c, jwt2, { sameSite: "Lax", maxAge: tokenTtl2 });
3110
3110
  return c.redirect("/admin");
3111
3111
  }
3112
3112
  const existingUser = await oauthService.findUserByEmail(profile.email);
@@ -3123,15 +3123,15 @@ function buildOauthApi() {
3123
3123
  tokenExpiresAt: tokenExpiresAt ?? void 0,
3124
3124
  profileData: JSON.stringify(profile)
3125
3125
  });
3126
- const tokenTtl2 = await chunkMUNO67TT_cjs.getJwtExpirySecondsFromDb(c.env.DB, c.env);
3127
- const jwt2 = await chunkMUNO67TT_cjs.AuthManager.generateToken(
3126
+ const tokenTtl2 = await chunkYJEBDJDV_cjs.getJwtExpirySecondsFromDb(c.env.DB, c.env);
3127
+ const jwt2 = await chunkYJEBDJDV_cjs.AuthManager.generateToken(
3128
3128
  existingUser.id,
3129
3129
  existingUser.email,
3130
3130
  existingUser.role,
3131
3131
  c.env.JWT_SECRET,
3132
3132
  tokenTtl2
3133
3133
  );
3134
- chunkMUNO67TT_cjs.AuthManager.setAuthCookie(c, jwt2, { sameSite: "Lax", maxAge: tokenTtl2 });
3134
+ chunkYJEBDJDV_cjs.AuthManager.setAuthCookie(c, jwt2, { sameSite: "Lax", maxAge: tokenTtl2 });
3135
3135
  return c.redirect("/admin");
3136
3136
  }
3137
3137
  const newUserId = await oauthService.createUserFromOAuth(profile);
@@ -3144,15 +3144,15 @@ function buildOauthApi() {
3144
3144
  tokenExpiresAt: tokenExpiresAt ?? void 0,
3145
3145
  profileData: JSON.stringify(profile)
3146
3146
  });
3147
- const tokenTtl = await chunkMUNO67TT_cjs.getJwtExpirySecondsFromDb(c.env.DB, c.env);
3148
- const jwt = await chunkMUNO67TT_cjs.AuthManager.generateToken(
3147
+ const tokenTtl = await chunkYJEBDJDV_cjs.getJwtExpirySecondsFromDb(c.env.DB, c.env);
3148
+ const jwt = await chunkYJEBDJDV_cjs.AuthManager.generateToken(
3149
3149
  newUserId,
3150
3150
  profile.email.toLowerCase(),
3151
3151
  "viewer",
3152
3152
  c.env.JWT_SECRET,
3153
3153
  tokenTtl
3154
3154
  );
3155
- chunkMUNO67TT_cjs.AuthManager.setAuthCookie(c, jwt, { sameSite: "Lax", maxAge: tokenTtl });
3155
+ chunkYJEBDJDV_cjs.AuthManager.setAuthCookie(c, jwt, { sameSite: "Lax", maxAge: tokenTtl });
3156
3156
  return c.redirect("/admin");
3157
3157
  } catch (error) {
3158
3158
  console.error("OAuth callback error:", error);
@@ -3247,7 +3247,7 @@ function buildOauthApi() {
3247
3247
  });
3248
3248
  return oauthAPI;
3249
3249
  }
3250
- var oauthProvidersPlugin = chunkPMGOBS6X_cjs.definePlugin({
3250
+ var oauthProvidersPlugin = chunkUHRHZXVR_cjs.definePlugin({
3251
3251
  id: "oauth-providers",
3252
3252
  version: "1.0.0",
3253
3253
  name: "OAuth Providers",
@@ -3824,7 +3824,7 @@ var AISearchService = class {
3824
3824
  */
3825
3825
  async detectNewCollections() {
3826
3826
  try {
3827
- const allCollections = chunkR4ILO3W6_cjs.getCollectionRegistry().listActive().filter((r) => !r.internal).map((r) => ({
3827
+ const allCollections = chunkQJNKSFDJ_cjs.getCollectionRegistry().listActive().filter((r) => !r.internal).map((r) => ({
3828
3828
  id: r.id,
3829
3829
  name: r.name,
3830
3830
  display_name: r.displayName,
@@ -3876,7 +3876,7 @@ var AISearchService = class {
3876
3876
  */
3877
3877
  async getAllCollections() {
3878
3878
  try {
3879
- const allCollections = chunkR4ILO3W6_cjs.getCollectionRegistry().listActive().filter((r) => !r.internal).sort((a, b) => a.displayName.localeCompare(b.displayName)).map((r) => ({
3879
+ const allCollections = chunkQJNKSFDJ_cjs.getCollectionRegistry().listActive().filter((r) => !r.internal).sort((a, b) => a.displayName.localeCompare(b.displayName)).map((r) => ({
3880
3880
  id: r.id,
3881
3881
  name: r.name,
3882
3882
  display_name: r.displayName,
@@ -4212,7 +4212,7 @@ var IndexManager = class {
4212
4212
  */
4213
4213
  async indexCollection(collectionId) {
4214
4214
  try {
4215
- const registry = chunkR4ILO3W6_cjs.getCollectionRegistry();
4215
+ const registry = chunkQJNKSFDJ_cjs.getCollectionRegistry();
4216
4216
  const record = registry.getById(collectionId) ?? registry.getByName(collectionId);
4217
4217
  if (!record) {
4218
4218
  throw new Error(`Collection ${collectionId} not found`);
@@ -4839,7 +4839,7 @@ function renderSettingsPage(data) {
4839
4839
 
4840
4840
  // src/plugins/core-plugins/ai-search-plugin/routes/admin.ts
4841
4841
  var adminRoutes2 = new hono.Hono();
4842
- adminRoutes2.use("*", chunkMUNO67TT_cjs.requireAuth());
4842
+ adminRoutes2.use("*", chunkYJEBDJDV_cjs.requireAuth());
4843
4843
  adminRoutes2.get("/", async (c) => {
4844
4844
  try {
4845
4845
  const user = c.get("user");
@@ -5080,7 +5080,7 @@ var manifest_default = {
5080
5080
  author: "SonicJS"};
5081
5081
 
5082
5082
  // src/plugins/core-plugins/ai-search-plugin/index.ts
5083
- var aiSearchPlugin = chunkPMGOBS6X_cjs.definePlugin({
5083
+ var aiSearchPlugin = chunkUHRHZXVR_cjs.definePlugin({
5084
5084
  id: manifest_default.id,
5085
5085
  version: manifest_default.version,
5086
5086
  name: manifest_default.name,
@@ -5951,7 +5951,7 @@ function renderSecuritySettingsPage(data) {
5951
5951
 
5952
5952
  // src/plugins/core-plugins/security-audit-plugin/routes/admin.ts
5953
5953
  var adminRoutes3 = new hono.Hono();
5954
- adminRoutes3.use("*", chunkMUNO67TT_cjs.requireAuth());
5954
+ adminRoutes3.use("*", chunkYJEBDJDV_cjs.requireAuth());
5955
5955
  adminRoutes3.use("*", async (c, next) => {
5956
5956
  const user = c.get("user");
5957
5957
  if (user?.role !== "admin") {
@@ -5961,7 +5961,7 @@ adminRoutes3.use("*", async (c, next) => {
5961
5961
  });
5962
5962
  async function getSettings(db) {
5963
5963
  try {
5964
- const pluginService = new chunkR4ILO3W6_cjs.PluginService(db);
5964
+ const pluginService = new chunkQJNKSFDJ_cjs.PluginService(db);
5965
5965
  const plugin2 = await pluginService.getPlugin("security-audit");
5966
5966
  if (plugin2?.settings) {
5967
5967
  const settings = typeof plugin2.settings === "string" ? JSON.parse(plugin2.settings) : plugin2.settings;
@@ -6066,7 +6066,7 @@ adminRoutes3.post("/settings", async (c) => {
6066
6066
  autoPurge: body["retention.autoPurge"] === "true"
6067
6067
  }
6068
6068
  };
6069
- const pluginService = new chunkR4ILO3W6_cjs.PluginService(db);
6069
+ const pluginService = new chunkQJNKSFDJ_cjs.PluginService(db);
6070
6070
  await pluginService.updatePluginSettings("security-audit", settings);
6071
6071
  if (c.req.header("HX-Request")) {
6072
6072
  return c.json({ success: true });
@@ -6227,7 +6227,7 @@ var BruteForceDetector = class {
6227
6227
 
6228
6228
  // src/plugins/core-plugins/security-audit-plugin/routes/api.ts
6229
6229
  var apiRoutes2 = new hono.Hono();
6230
- apiRoutes2.use("*", chunkMUNO67TT_cjs.requireAuth());
6230
+ apiRoutes2.use("*", chunkYJEBDJDV_cjs.requireAuth());
6231
6231
  apiRoutes2.use("*", async (c, next) => {
6232
6232
  const user = c.get("user");
6233
6233
  if (user?.role !== "admin") {
@@ -6237,7 +6237,7 @@ apiRoutes2.use("*", async (c, next) => {
6237
6237
  });
6238
6238
  async function getSettings2(db) {
6239
6239
  try {
6240
- const pluginService = new chunkR4ILO3W6_cjs.PluginService(db);
6240
+ const pluginService = new chunkQJNKSFDJ_cjs.PluginService(db);
6241
6241
  const plugin2 = await pluginService.getPlugin("security-audit");
6242
6242
  if (plugin2?.settings) {
6243
6243
  const settings = typeof plugin2.settings === "string" ? JSON.parse(plugin2.settings) : plugin2.settings;
@@ -6385,7 +6385,7 @@ function generateFingerprint(ip, userAgent) {
6385
6385
  }
6386
6386
  async function getPluginSettings(db) {
6387
6387
  try {
6388
- const pluginService = new chunkR4ILO3W6_cjs.PluginService(db);
6388
+ const pluginService = new chunkQJNKSFDJ_cjs.PluginService(db);
6389
6389
  const plugin2 = await pluginService.getPlugin("security-audit");
6390
6390
  if (plugin2?.settings) {
6391
6391
  const settings = typeof plugin2.settings === "string" ? JSON.parse(plugin2.settings) : plugin2.settings;
@@ -6616,7 +6616,7 @@ async function logAuthEvent(c, db, settings, ip, userAgent, countryCode, fingerp
6616
6616
 
6617
6617
  // src/plugins/core-plugins/security-audit-plugin/index.ts
6618
6618
  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({
6619
+ var securityAuditPlugin = chunkUHRHZXVR_cjs.definePlugin({
6620
6620
  id: "security-audit",
6621
6621
  version: "1.0.0",
6622
6622
  name: "Security Audit",
@@ -7372,7 +7372,7 @@ var DEFAULT_SETTINGS3 = {
7372
7372
 
7373
7373
  // src/plugins/core-plugins/stripe-plugin/routes/admin.ts
7374
7374
  var adminRoutes4 = new hono.Hono();
7375
- adminRoutes4.use("*", chunkMUNO67TT_cjs.requireAuth());
7375
+ adminRoutes4.use("*", chunkYJEBDJDV_cjs.requireAuth());
7376
7376
  adminRoutes4.use("*", async (c, next) => {
7377
7377
  const user = c.get("user");
7378
7378
  if (user?.role !== "admin") {
@@ -7382,7 +7382,7 @@ adminRoutes4.use("*", async (c, next) => {
7382
7382
  });
7383
7383
  async function getSettings3(db) {
7384
7384
  try {
7385
- const pluginService = new chunkR4ILO3W6_cjs.PluginService(db);
7385
+ const pluginService = new chunkQJNKSFDJ_cjs.PluginService(db);
7386
7386
  const plugin2 = await pluginService.getPlugin("stripe");
7387
7387
  if (plugin2?.settings) {
7388
7388
  const settings = typeof plugin2.settings === "string" ? JSON.parse(plugin2.settings) : plugin2.settings;
@@ -7704,7 +7704,7 @@ function timingSafeEqual(a, b) {
7704
7704
  var apiRoutes3 = new hono.Hono();
7705
7705
  async function getSettings4(db) {
7706
7706
  try {
7707
- const pluginService = new chunkR4ILO3W6_cjs.PluginService(db);
7707
+ const pluginService = new chunkQJNKSFDJ_cjs.PluginService(db);
7708
7708
  const plugin2 = await pluginService.getPlugin("stripe");
7709
7709
  if (plugin2?.settings) {
7710
7710
  const settings = typeof plugin2.settings === "string" ? JSON.parse(plugin2.settings) : plugin2.settings;
@@ -7855,7 +7855,7 @@ apiRoutes3.post("/webhook", async (c) => {
7855
7855
  }
7856
7856
  return c.json({ received: true });
7857
7857
  });
7858
- apiRoutes3.post("/create-checkout-session", chunkMUNO67TT_cjs.requireAuth(), async (c) => {
7858
+ apiRoutes3.post("/create-checkout-session", chunkYJEBDJDV_cjs.requireAuth(), async (c) => {
7859
7859
  const db = c.env.DB;
7860
7860
  const user = c.get("user");
7861
7861
  if (!user) return c.json({ error: "Unauthorized" }, 401);
@@ -7895,7 +7895,7 @@ apiRoutes3.post("/create-checkout-session", chunkMUNO67TT_cjs.requireAuth(), asy
7895
7895
  });
7896
7896
  return c.json({ sessionId: session.id, url: session.url });
7897
7897
  });
7898
- apiRoutes3.get("/subscription", chunkMUNO67TT_cjs.requireAuth(), async (c) => {
7898
+ apiRoutes3.get("/subscription", chunkYJEBDJDV_cjs.requireAuth(), async (c) => {
7899
7899
  const user = c.get("user");
7900
7900
  if (!user) return c.json({ error: "Unauthorized" }, 401);
7901
7901
  const db = c.env.DB;
@@ -7907,7 +7907,7 @@ apiRoutes3.get("/subscription", chunkMUNO67TT_cjs.requireAuth(), async (c) => {
7907
7907
  }
7908
7908
  return c.json({ subscription });
7909
7909
  });
7910
- apiRoutes3.get("/subscriptions", chunkMUNO67TT_cjs.requireAuth(), async (c) => {
7910
+ apiRoutes3.get("/subscriptions", chunkYJEBDJDV_cjs.requireAuth(), async (c) => {
7911
7911
  const user = c.get("user");
7912
7912
  if (user?.role !== "admin") return c.json({ error: "Access denied" }, 403);
7913
7913
  const db = c.env.DB;
@@ -7923,7 +7923,7 @@ apiRoutes3.get("/subscriptions", chunkMUNO67TT_cjs.requireAuth(), async (c) => {
7923
7923
  const result = await subscriptionService.list(filters);
7924
7924
  return c.json(result);
7925
7925
  });
7926
- apiRoutes3.get("/stats", chunkMUNO67TT_cjs.requireAuth(), async (c) => {
7926
+ apiRoutes3.get("/stats", chunkYJEBDJDV_cjs.requireAuth(), async (c) => {
7927
7927
  const user = c.get("user");
7928
7928
  if (user?.role !== "admin") return c.json({ error: "Access denied" }, 403);
7929
7929
  const db = c.env.DB;
@@ -7932,7 +7932,7 @@ apiRoutes3.get("/stats", chunkMUNO67TT_cjs.requireAuth(), async (c) => {
7932
7932
  const stats = await subscriptionService.getStats();
7933
7933
  return c.json(stats);
7934
7934
  });
7935
- apiRoutes3.post("/sync-subscriptions", chunkMUNO67TT_cjs.requireAuth(), async (c) => {
7935
+ apiRoutes3.post("/sync-subscriptions", chunkYJEBDJDV_cjs.requireAuth(), async (c) => {
7936
7936
  const user = c.get("user");
7937
7937
  if (user?.role !== "admin") return c.json({ error: "Access denied" }, 403);
7938
7938
  const db = c.env.DB;
@@ -7980,7 +7980,7 @@ apiRoutes3.post("/sync-subscriptions", chunkMUNO67TT_cjs.requireAuth(), async (c
7980
7980
  }, 500);
7981
7981
  }
7982
7982
  });
7983
- apiRoutes3.get("/events", chunkMUNO67TT_cjs.requireAuth(), async (c) => {
7983
+ apiRoutes3.get("/events", chunkYJEBDJDV_cjs.requireAuth(), async (c) => {
7984
7984
  const user = c.get("user");
7985
7985
  if (user?.role !== "admin") return c.json({ error: "Access denied" }, 403);
7986
7986
  const db = c.env.DB;
@@ -8003,7 +8003,7 @@ apiRoutes3.get("/events", chunkMUNO67TT_cjs.requireAuth(), async (c) => {
8003
8003
 
8004
8004
  // src/plugins/core-plugins/stripe-plugin/index.ts
8005
8005
  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({
8006
+ var stripePlugin = chunkUHRHZXVR_cjs.definePlugin({
8007
8007
  id: "stripe",
8008
8008
  version: "1.0.0",
8009
8009
  name: "Stripe",
@@ -8276,7 +8276,7 @@ function renderFormsListPage(data) {
8276
8276
 
8277
8277
  <!-- Forms Table -->
8278
8278
  <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)}
8279
+ ${chunkK342JMA3_cjs.renderTable(tableData)}
8280
8280
  </div>
8281
8281
  </div>
8282
8282
  `;
@@ -9705,7 +9705,7 @@ function renderFormCreatePage(data) {
9705
9705
 
9706
9706
  // src/routes/admin-forms.ts
9707
9707
  var adminFormsRoutes = new hono.Hono();
9708
- adminFormsRoutes.use("*", chunkMUNO67TT_cjs.requireAuth());
9708
+ adminFormsRoutes.use("*", chunkYJEBDJDV_cjs.requireAuth());
9709
9709
  adminFormsRoutes.get("/", async (c) => {
9710
9710
  try {
9711
9711
  const user = c.get("user");
@@ -9869,7 +9869,7 @@ adminFormsRoutes.get("/:id/builder", async (c) => {
9869
9869
  if (!form) {
9870
9870
  return c.html("<p>Form not found</p>", 404);
9871
9871
  }
9872
- const turnstileService = new chunk3KYKEXV7_cjs.TurnstileService(db);
9872
+ const turnstileService = new chunkMKKGA3C4_cjs.TurnstileService(db);
9873
9873
  const turnstileSettings = await turnstileService.getSettings();
9874
9874
  const pageData = {
9875
9875
  id: form.id,
@@ -10033,7 +10033,7 @@ publicFormsRoutes.get("/:identifier/turnstile-config", async (c) => {
10033
10033
  if (!form) {
10034
10034
  return c.json({ error: "Form not found" }, 404);
10035
10035
  }
10036
- const turnstileService = new chunk3KYKEXV7_cjs.TurnstileService(db);
10036
+ const turnstileService = new chunkMKKGA3C4_cjs.TurnstileService(db);
10037
10037
  const globalSettings = await turnstileService.getSettings();
10038
10038
  const formSettings = form.turnstile_settings ? JSON.parse(form.turnstile_settings) : { inherit: true };
10039
10039
  const enabled = form.turnstile_enabled === 1 || formSettings.inherit && globalSettings?.enabled;
@@ -10460,7 +10460,7 @@ publicFormsRoutes.post("/:identifier/submit", async (c) => {
10460
10460
  const turnstileEnabled = form.turnstile_enabled === 1;
10461
10461
  const turnstileSettings = form.turnstile_settings ? JSON.parse(form.turnstile_settings) : { inherit: true };
10462
10462
  if (turnstileEnabled || turnstileSettings.inherit) {
10463
- const turnstileService = new chunk3KYKEXV7_cjs.TurnstileService(db);
10463
+ const turnstileService = new chunkMKKGA3C4_cjs.TurnstileService(db);
10464
10464
  const globalEnabled = await turnstileService.isEnabled();
10465
10465
  if (globalEnabled || turnstileEnabled) {
10466
10466
  const turnstileToken = body.data?.turnstile || body.turnstile;
@@ -10521,7 +10521,7 @@ publicFormsRoutes.post("/:identifier/submit", async (c) => {
10521
10521
  });
10522
10522
 
10523
10523
  // src/plugins/core-plugins/forms-plugin/index.ts
10524
- var formsPlugin = chunkPMGOBS6X_cjs.definePlugin({
10524
+ var formsPlugin = chunkUHRHZXVR_cjs.definePlugin({
10525
10525
  id: "forms",
10526
10526
  version: "1.0.0",
10527
10527
  name: "Forms",
@@ -10541,7 +10541,7 @@ var formsPlugin = chunkPMGOBS6X_cjs.definePlugin({
10541
10541
  });
10542
10542
  chunkK623Q6WD_cjs.init_admin_layout_catalyst_template();
10543
10543
  var adminRbacRoutes = new hono.Hono();
10544
- adminRbacRoutes.use("*", chunkMUNO67TT_cjs.requireRbac("rbac", "manage"));
10544
+ adminRbacRoutes.use("*", chunkYJEBDJDV_cjs.requireRbac("rbac", "manage"));
10545
10545
  var esc = (s) => String(s).replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
10546
10546
  var TABS2 = `
10547
10547
  <div class="border-b border-zinc-950/10 dark:border-white/10 mb-6">
@@ -10849,7 +10849,7 @@ adminRbacRoutes.get("/", async (c) => {
10849
10849
  title: "Roles & Permissions",
10850
10850
  pageTitle: "Roles & Permissions",
10851
10851
  currentPath: "/admin/users",
10852
- version: chunkF67UK75A_cjs.getCoreVersion(),
10852
+ version: chunkKV3CM5RK_cjs.getCoreVersion(),
10853
10853
  user: u ? { name: u.email || "Admin", email: u.email || "", role: u.role || "admin" } : void 0,
10854
10854
  content: content2
10855
10855
  })
@@ -10986,7 +10986,7 @@ adminRbacRoutes.get("/check", async (c) => {
10986
10986
  });
10987
10987
 
10988
10988
  // src/middleware/plugin-menu.ts
10989
- var REGISTRY_MENU_PLUGINS = Object.values(chunkR4ILO3W6_cjs.PLUGIN_REGISTRY).filter((p) => p.adminMenu !== null).map((p) => ({
10989
+ var REGISTRY_MENU_PLUGINS = Object.values(chunkQJNKSFDJ_cjs.PLUGIN_REGISTRY).filter((p) => p.adminMenu !== null).map((p) => ({
10990
10990
  id: p.id,
10991
10991
  label: p.adminMenu.label,
10992
10992
  path: p.adminMenu.path,
@@ -11066,12 +11066,13 @@ function pluginMenuMiddleware() {
11066
11066
  }
11067
11067
  c.set("pluginMenuItems", activeMenuItems.map((m) => ({ label: m.label, path: m.path, icon: resolveIcon(m.icon) || "" })));
11068
11068
  await next();
11069
- if (activeMenuItems.length > 0 && c.res.headers.get("content-type")?.includes("text/html")) {
11069
+ const finalItems = c.get("pluginMenuItems") ?? [];
11070
+ if (finalItems.length > 0 && c.res.headers.get("content-type")?.includes("text/html")) {
11070
11071
  const status = c.res.status;
11071
11072
  const headers = new Headers(c.res.headers);
11072
11073
  const html4 = await c.res.text();
11073
11074
  if (html4.includes(MARKER)) {
11074
- const renderedItems = activeMenuItems.map((item) => renderMenuItem(item, path)).join("");
11075
+ const renderedItems = finalItems.map((item) => renderMenuItem(item, path)).join("");
11075
11076
  const newHtml = html4.split(MARKER).join(renderedItems);
11076
11077
  c.res = new Response(newHtml, { status, headers });
11077
11078
  } else {
@@ -11082,7 +11083,7 @@ function pluginMenuMiddleware() {
11082
11083
  }
11083
11084
  chunkK623Q6WD_cjs.init_admin_layout_catalyst_template();
11084
11085
  var adminRoutes5 = new hono.Hono();
11085
- adminRoutes5.use("*", chunkMUNO67TT_cjs.requireAuth());
11086
+ adminRoutes5.use("*", chunkYJEBDJDV_cjs.requireAuth());
11086
11087
  adminRoutes5.use("*", async (c, next) => {
11087
11088
  const user = c.get("user");
11088
11089
  if (user?.role !== "admin") {
@@ -11437,7 +11438,7 @@ apiRoutes4.get("/stats", async (c) => {
11437
11438
  });
11438
11439
 
11439
11440
  // src/plugins/core-plugins/analytics/index.ts
11440
- var analyticsPlugin = chunkPMGOBS6X_cjs.definePlugin({
11441
+ var analyticsPlugin = chunkUHRHZXVR_cjs.definePlugin({
11441
11442
  id: "core-analytics",
11442
11443
  version: "1.0.0",
11443
11444
  name: "Analytics",
@@ -11584,7 +11585,7 @@ function esc2(s) {
11584
11585
  return (s || "").replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
11585
11586
  }
11586
11587
  async function getVariablesMap(db) {
11587
- let variables = chunkTO6EY4P7_cjs.getVariablesCached();
11588
+ let variables = chunkK342JMA3_cjs.getVariablesCached();
11588
11589
  if (variables) return variables;
11589
11590
  try {
11590
11591
  const { results } = await db.prepare(
@@ -11594,7 +11595,7 @@ async function getVariablesMap(db) {
11594
11595
  for (const row of results || []) {
11595
11596
  variables.set(row.key, row.value);
11596
11597
  }
11597
- chunkTO6EY4P7_cjs.setVariablesCache(variables);
11598
+ chunkK342JMA3_cjs.setVariablesCache(variables);
11598
11599
  return variables;
11599
11600
  } catch {
11600
11601
  return /* @__PURE__ */ new Map();
@@ -11663,7 +11664,7 @@ apiRoutes5.post("/", async (c) => {
11663
11664
  await db.prepare(
11664
11665
  "INSERT INTO global_variables (key, value, description, category, is_active) VALUES (?, ?, ?, ?, ?)"
11665
11666
  ).bind(key, value || "", description || "", category || "general", isActive !== false ? 1 : 0).run();
11666
- chunkTO6EY4P7_cjs.invalidateVariablesCache();
11667
+ chunkK342JMA3_cjs.invalidateVariablesCache();
11667
11668
  const created = await db.prepare("SELECT * FROM global_variables WHERE key = ?").bind(key).first();
11668
11669
  return c.json({ success: true, data: formatVariable(created) }, 201);
11669
11670
  } catch {
@@ -11708,7 +11709,7 @@ apiRoutes5.put("/:id", async (c) => {
11708
11709
  updates.push("updated_at = strftime('%s', 'now')");
11709
11710
  params.push(id);
11710
11711
  await db.prepare(`UPDATE global_variables SET ${updates.join(", ")} WHERE id = ?`).bind(...params).run();
11711
- chunkTO6EY4P7_cjs.invalidateVariablesCache();
11712
+ chunkK342JMA3_cjs.invalidateVariablesCache();
11712
11713
  const updated = await db.prepare("SELECT * FROM global_variables WHERE id = ?").bind(id).first();
11713
11714
  return c.json({ success: true, data: formatVariable(updated) });
11714
11715
  } catch {
@@ -11722,7 +11723,7 @@ apiRoutes5.delete("/:id", async (c) => {
11722
11723
  const existing = await db.prepare("SELECT id FROM global_variables WHERE id = ?").bind(id).first();
11723
11724
  if (!existing) return c.json({ error: "Variable not found" }, 404);
11724
11725
  await db.prepare("DELETE FROM global_variables WHERE id = ?").bind(id).run();
11725
- chunkTO6EY4P7_cjs.invalidateVariablesCache();
11726
+ chunkK342JMA3_cjs.invalidateVariablesCache();
11726
11727
  return c.json({ success: true });
11727
11728
  } catch {
11728
11729
  return c.json({ success: false, error: "Failed to delete variable" }, 500);
@@ -11782,7 +11783,7 @@ adminRoutes6.put("/:id", async (c) => {
11782
11783
  const value = body.value;
11783
11784
  if (value !== void 0) {
11784
11785
  await db.prepare("UPDATE global_variables SET value = ?, updated_at = strftime('%s', 'now') WHERE id = ?").bind(value, id).run();
11785
- chunkTO6EY4P7_cjs.invalidateVariablesCache();
11786
+ chunkK342JMA3_cjs.invalidateVariablesCache();
11786
11787
  }
11787
11788
  return c.html('<span class="text-green-400 text-xs">Saved</span>');
11788
11789
  });
@@ -11790,7 +11791,7 @@ adminRoutes6.post("/:id/toggle", async (c) => {
11790
11791
  const db = c.env.DB;
11791
11792
  const id = c.req.param("id");
11792
11793
  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();
11794
+ chunkK342JMA3_cjs.invalidateVariablesCache();
11794
11795
  c.header("HX-Redirect", "/admin/global-variables");
11795
11796
  return c.body(null, 204);
11796
11797
  });
@@ -11811,7 +11812,7 @@ adminRoutes6.post("/", async (c) => {
11811
11812
  await db.prepare(
11812
11813
  "INSERT INTO global_variables (key, value, description, category) VALUES (?, ?, ?, ?)"
11813
11814
  ).bind(key, value, description, category).run();
11814
- chunkTO6EY4P7_cjs.invalidateVariablesCache();
11815
+ chunkK342JMA3_cjs.invalidateVariablesCache();
11815
11816
  c.header("HX-Redirect", "/admin/global-variables");
11816
11817
  return c.body(null, 204);
11817
11818
  });
@@ -11830,7 +11831,7 @@ adminRoutes6.post("/settings/editor-integration", async (c) => {
11830
11831
  adminRoutes6.delete("/:id", async (c) => {
11831
11832
  const db = c.env.DB;
11832
11833
  await db.prepare("DELETE FROM global_variables WHERE id = ?").bind(c.req.param("id")).run();
11833
- chunkTO6EY4P7_cjs.invalidateVariablesCache();
11834
+ chunkK342JMA3_cjs.invalidateVariablesCache();
11834
11835
  return c.html("");
11835
11836
  });
11836
11837
  function renderAdminPage(variables, editorStatus = { editorActive: false, activeEditorName: "", enableEditorIntegration: true }) {
@@ -12148,7 +12149,7 @@ function renderAdminPage(variables, editorStatus = { editorActive: false, active
12148
12149
  </div>
12149
12150
  ` });
12150
12151
  }
12151
- var globalVariablesPlugin = chunkPMGOBS6X_cjs.definePlugin({
12152
+ var globalVariablesPlugin = chunkUHRHZXVR_cjs.definePlugin({
12152
12153
  id: "global-variables",
12153
12154
  version: "1.1.0",
12154
12155
  name: "Global Variables",
@@ -12171,7 +12172,7 @@ var globalVariablesPlugin = chunkPMGOBS6X_cjs.definePlugin({
12171
12172
  if (!db || !data) return data;
12172
12173
  const variables = await getVariablesMap(db);
12173
12174
  if (variables.size === 0) return data;
12174
- return chunkTO6EY4P7_cjs.resolveVariablesInObject(data, variables);
12175
+ return chunkK342JMA3_cjs.resolveVariablesInObject(data, variables);
12175
12176
  } catch {
12176
12177
  return data;
12177
12178
  }
@@ -12189,7 +12190,7 @@ var globalVariablesPlugin = chunkPMGOBS6X_cjs.definePlugin({
12189
12190
  },
12190
12191
  activate: async () => console.info("[GlobalVariables] Plugin activated"),
12191
12192
  deactivate: async () => {
12192
- chunkTO6EY4P7_cjs.invalidateVariablesCache();
12193
+ chunkK342JMA3_cjs.invalidateVariablesCache();
12193
12194
  console.info("[GlobalVariables] Plugin deactivated, cache cleared");
12194
12195
  },
12195
12196
  uninstall: async (ctx) => {
@@ -12755,7 +12756,7 @@ function renderAdminPage2(shortcodes, editorStatus = { editorActive: false, acti
12755
12756
  </div>
12756
12757
  ` });
12757
12758
  }
12758
- var shortcodesPlugin = chunkPMGOBS6X_cjs.definePlugin({
12759
+ var shortcodesPlugin = chunkUHRHZXVR_cjs.definePlugin({
12759
12760
  id: "shortcodes",
12760
12761
  version: "1.0.0",
12761
12762
  name: "Shortcodes",
@@ -12839,7 +12840,7 @@ helloWorldRoutes.get("/", async (c) => {
12839
12840
  </html>
12840
12841
  `);
12841
12842
  });
12842
- var helloWorldPlugin = chunkPMGOBS6X_cjs.definePlugin({
12843
+ var helloWorldPlugin = chunkUHRHZXVR_cjs.definePlugin({
12843
12844
  id: "hello-world",
12844
12845
  version: "1.0.0",
12845
12846
  name: "Hello World",
@@ -13067,7 +13068,7 @@ function renderTenantForm(data) {
13067
13068
  // src/plugins/core-plugins/multi-tenant-plugin/templates/tenant-members.template.ts
13068
13069
  chunkK623Q6WD_cjs.init_admin_layout_catalyst_template();
13069
13070
  function roleOptions(selected) {
13070
- return chunkTO6EY4P7_cjs.VALID_MEMBER_ROLES.map(
13071
+ return chunkK342JMA3_cjs.VALID_MEMBER_ROLES.map(
13071
13072
  (r) => `<option value="${r}" ${r === selected ? "selected" : ""}>${r}</option>`
13072
13073
  ).join("");
13073
13074
  }
@@ -13129,7 +13130,7 @@ function renderInvitations(slug, invitations) {
13129
13130
  <div>
13130
13131
  <label for="invite-role" class="mb-1 block text-xs font-medium text-zinc-500 dark:text-zinc-400">Role</label>
13131
13132
  <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("")}
13133
+ ${chunkK342JMA3_cjs.VALID_MEMBER_ROLES.map((r) => `<option value="${r}" ${r === "viewer" ? "selected" : ""}>${r}</option>`).join("")}
13133
13134
  </select>
13134
13135
  </div>
13135
13136
  <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 +13226,7 @@ function renderTenantMembers(data) {
13225
13226
  // src/plugins/core-plugins/multi-tenant-plugin/templates/user-memberships.template.ts
13226
13227
  chunkK623Q6WD_cjs.init_admin_layout_catalyst_template();
13227
13228
  function roleOptions2(selected) {
13228
- return chunkTO6EY4P7_cjs.VALID_MEMBER_ROLES.map(
13229
+ return chunkK342JMA3_cjs.VALID_MEMBER_ROLES.map(
13229
13230
  (r) => `<option value="${r}" ${r === selected ? "selected" : ""}>${r}</option>`
13230
13231
  ).join("");
13231
13232
  }
@@ -13387,7 +13388,7 @@ function zodToFieldErrors(error) {
13387
13388
  }
13388
13389
  async function isMultiTenantActive(db) {
13389
13390
  try {
13390
- const plugin2 = await new chunkR4ILO3W6_cjs.PluginService(db).getPlugin(chunkR4ILO3W6_cjs.MULTI_TENANT_PLUGIN_ID);
13391
+ const plugin2 = await new chunkQJNKSFDJ_cjs.PluginService(db).getPlugin(chunkQJNKSFDJ_cjs.MULTI_TENANT_PLUGIN_ID);
13391
13392
  return plugin2?.status === "active";
13392
13393
  } catch {
13393
13394
  return false;
@@ -13395,7 +13396,7 @@ async function isMultiTenantActive(db) {
13395
13396
  }
13396
13397
  function createTenantAdminRoutes() {
13397
13398
  const routes2 = new hono.Hono();
13398
- routes2.use("*", chunkMUNO67TT_cjs.requireAuth());
13399
+ routes2.use("*", chunkYJEBDJDV_cjs.requireAuth());
13399
13400
  routes2.use("*", async (c, next) => {
13400
13401
  const user = c.get("user");
13401
13402
  if (user?.role !== "admin") {
@@ -13409,7 +13410,7 @@ function createTenantAdminRoutes() {
13409
13410
  const form = await c.req.formData();
13410
13411
  const slug = String(form.get("tenant") ?? "").trim().toLowerCase();
13411
13412
  const redirect = String(form.get("redirect") ?? "");
13412
- const svc = new chunkTO6EY4P7_cjs.TenantService(db);
13413
+ const svc = new chunkK342JMA3_cjs.TenantService(db);
13413
13414
  const tenant = await svc.getTenantBySlug(slug);
13414
13415
  if (!tenant || tenant.status !== "active") {
13415
13416
  return c.json({ error: "Unknown or inactive tenant" }, 400);
@@ -13419,7 +13420,7 @@ function createTenantAdminRoutes() {
13419
13420
  if (!user.isSuperAdmin && !await svc.isMember(user.userId, slug)) {
13420
13421
  return c.json({ error: "You are not a member of this tenant" }, 403);
13421
13422
  }
13422
- cookie.setCookie(c, chunkR4ILO3W6_cjs.TENANT_COOKIE, slug, {
13423
+ cookie.setCookie(c, chunkQJNKSFDJ_cjs.TENANT_COOKIE, slug, {
13423
13424
  path: "/",
13424
13425
  httpOnly: true,
13425
13426
  sameSite: "Lax",
@@ -13436,7 +13437,7 @@ function createTenantAdminRoutes() {
13436
13437
  if (!user) return c.redirect("/auth/login");
13437
13438
  const token = c.req.query("token") ?? "";
13438
13439
  try {
13439
- const { slug } = await new chunkTO6EY4P7_cjs.TenantService(db).acceptInvitation(token, user.userId, user.email);
13440
+ const { slug } = await new chunkK342JMA3_cjs.TenantService(db).acceptInvitation(token, user.userId, user.email);
13440
13441
  return c.redirect(`/admin/tenants/${slug}/members?message=Invitation accepted`);
13441
13442
  } catch (error) {
13442
13443
  const message = error instanceof Error ? error.message : "Failed to accept invitation";
@@ -13464,7 +13465,7 @@ function createTenantAdminRoutes() {
13464
13465
  const userId = c.req.param("userId");
13465
13466
  const target = await db.prepare("SELECT id, email FROM auth_user WHERE id = ?").bind(userId).first();
13466
13467
  if (!target?.id) return c.redirect("/admin/users?message=User not found&type=error");
13467
- const svc = new chunkTO6EY4P7_cjs.TenantService(db);
13468
+ const svc = new chunkK342JMA3_cjs.TenantService(db);
13468
13469
  const [memberships, allTenants] = await Promise.all([svc.listUserMemberships(userId), svc.listTenants()]);
13469
13470
  const memberSlugs = new Set(memberships.map((m) => m.slug));
13470
13471
  const availableTenants = allTenants.filter((t) => t.status === "active" && !memberSlugs.has(t.slug)).map((t) => ({ slug: t.slug, name: t.name }));
@@ -13489,10 +13490,10 @@ function createTenantAdminRoutes() {
13489
13490
  const slug = String(form.get("slug") ?? "").trim().toLowerCase();
13490
13491
  const role = String(form.get("role") ?? "viewer");
13491
13492
  const redirectTo = String(form.get("_redirect") ?? "") || `/admin/tenants/users/${userId}`;
13492
- if (!chunkTO6EY4P7_cjs.isValidMemberRole(role)) throw new Error(`Invalid role '${role}'`);
13493
+ if (!chunkK342JMA3_cjs.isValidMemberRole(role)) throw new Error(`Invalid role '${role}'`);
13493
13494
  const target = await db.prepare("SELECT email FROM auth_user WHERE id = ?").bind(userId).first();
13494
13495
  if (!target) throw new Error("User not found");
13495
- const svc = new chunkTO6EY4P7_cjs.TenantService(db);
13496
+ const svc = new chunkK342JMA3_cjs.TenantService(db);
13496
13497
  if (!await svc.getTenantBySlug(slug)) throw new Error("Tenant not found");
13497
13498
  if (await svc.isMember(userId, slug)) throw new Error(`Already a member of '${slug}'`);
13498
13499
  await svc.addMember(slug, userId, role, target.email ?? null);
@@ -13511,7 +13512,7 @@ function createTenantAdminRoutes() {
13511
13512
  const form = await c.req.formData();
13512
13513
  const role = String(form.get("role") ?? "");
13513
13514
  const redirectTo = String(form.get("_redirect") ?? "") || `/admin/tenants/users/${userId}`;
13514
- await new chunkTO6EY4P7_cjs.TenantService(db).setMemberRole(slug, userId, role);
13515
+ await new chunkK342JMA3_cjs.TenantService(db).setMemberRole(slug, userId, role);
13515
13516
  return c.redirect(`${redirectTo}?message=Role updated`);
13516
13517
  } catch (error) {
13517
13518
  const message = error instanceof Error ? error.message : "Failed to update role";
@@ -13526,7 +13527,7 @@ function createTenantAdminRoutes() {
13526
13527
  try {
13527
13528
  const form = await c.req.formData();
13528
13529
  const redirectTo = String(form.get("_redirect") ?? "") || `/admin/tenants/users/${userId}`;
13529
- await new chunkTO6EY4P7_cjs.TenantService(db).removeMember(slug, userId);
13530
+ await new chunkK342JMA3_cjs.TenantService(db).removeMember(slug, userId);
13530
13531
  return c.redirect(`${redirectTo}?message=Removed from ${encodeURIComponent(slug)}`);
13531
13532
  } catch (error) {
13532
13533
  const message = error instanceof Error ? error.message : "Failed to remove membership";
@@ -13541,7 +13542,7 @@ function createTenantAdminRoutes() {
13541
13542
  return c.html(renderTenantsInactive({ user: userShape(cur), version }));
13542
13543
  }
13543
13544
  const roleName = c.req.param("roleName");
13544
- const assignments = await new chunkTO6EY4P7_cjs.TenantService(db).listAssignmentsByRole(roleName);
13545
+ const assignments = await new chunkK342JMA3_cjs.TenantService(db).listAssignmentsByRole(roleName);
13545
13546
  return c.html(renderRoleUsage({ roleName, assignments, user: userShape(cur), version }));
13546
13547
  });
13547
13548
  routes2.get("/", async (c) => {
@@ -13551,7 +13552,7 @@ function createTenantAdminRoutes() {
13551
13552
  if (!await isMultiTenantActive(db)) {
13552
13553
  return c.html(renderTenantsInactive({ user: userShape(user), version }));
13553
13554
  }
13554
- const svc = new chunkTO6EY4P7_cjs.TenantService(db);
13555
+ const svc = new chunkK342JMA3_cjs.TenantService(db);
13555
13556
  await svc.ensureDefaultTenant();
13556
13557
  const tenants = await svc.listTenants();
13557
13558
  const [docRes, memberRes] = await db.batch([
@@ -13590,7 +13591,7 @@ function createTenantAdminRoutes() {
13590
13591
  formEntries = Object.fromEntries(form.entries());
13591
13592
  const validated = tenantFormSchema.parse(formEntries);
13592
13593
  if (!validated.slug) throw new zod.z.ZodError([{ code: "custom", message: "Slug is required", path: ["slug"] }]);
13593
- const svc = new chunkTO6EY4P7_cjs.TenantService(db);
13594
+ const svc = new chunkK342JMA3_cjs.TenantService(db);
13594
13595
  await svc.createTenant({
13595
13596
  name: validated.name,
13596
13597
  slug: validated.slug,
@@ -13615,7 +13616,7 @@ function createTenantAdminRoutes() {
13615
13616
  if (!await isMultiTenantActive(db)) {
13616
13617
  return c.html(renderTenantsInactive({ user: userShape(user), version }));
13617
13618
  }
13618
- const tenant = await new chunkTO6EY4P7_cjs.TenantService(db).getTenantBySlug(c.req.param("slug"));
13619
+ const tenant = await new chunkK342JMA3_cjs.TenantService(db).getTenantBySlug(c.req.param("slug"));
13619
13620
  if (!tenant) return c.redirect("/admin/tenants?message=Tenant not found&type=error");
13620
13621
  return c.html(renderTenantForm({ tenant, isEdit: true, user: userShape(user), version }));
13621
13622
  });
@@ -13625,7 +13626,7 @@ function createTenantAdminRoutes() {
13625
13626
  const version = c.get("appVersion");
13626
13627
  const slug = c.req.param("slug");
13627
13628
  if (!await isMultiTenantActive(db)) return c.json({ error: "Multi-tenant plugin is not active" }, 403);
13628
- const svc = new chunkTO6EY4P7_cjs.TenantService(db);
13629
+ const svc = new chunkK342JMA3_cjs.TenantService(db);
13629
13630
  try {
13630
13631
  const form = await c.req.formData();
13631
13632
  const validated = tenantFormSchema.parse(Object.fromEntries(form.entries()));
@@ -13650,7 +13651,7 @@ function createTenantAdminRoutes() {
13650
13651
  const slug = c.req.param("slug");
13651
13652
  if (!await isMultiTenantActive(db)) return c.json({ error: "Multi-tenant plugin is not active" }, 403);
13652
13653
  try {
13653
- await new chunkTO6EY4P7_cjs.TenantService(db).deleteTenant(slug);
13654
+ await new chunkK342JMA3_cjs.TenantService(db).deleteTenant(slug);
13654
13655
  return c.redirect("/admin/tenants?message=Tenant deleted successfully");
13655
13656
  } catch (error) {
13656
13657
  const message = error instanceof Error ? error.message : "Failed to delete tenant";
@@ -13665,7 +13666,7 @@ function createTenantAdminRoutes() {
13665
13666
  return c.html(renderTenantsInactive({ user: userShape(user), version }));
13666
13667
  }
13667
13668
  const slug = c.req.param("slug");
13668
- const svc = new chunkTO6EY4P7_cjs.TenantService(db);
13669
+ const svc = new chunkK342JMA3_cjs.TenantService(db);
13669
13670
  const tenant = await svc.getTenantBySlug(slug);
13670
13671
  if (!tenant) return c.redirect("/admin/tenants?message=Tenant not found&type=error");
13671
13672
  const [members, invitations] = await Promise.all([svc.listMembers(slug), svc.listInvitations(slug)]);
@@ -13691,7 +13692,7 @@ function createTenantAdminRoutes() {
13691
13692
  const form = await c.req.formData();
13692
13693
  const email = String(form.get("email") ?? "");
13693
13694
  const role = String(form.get("role") ?? "viewer");
13694
- await new chunkTO6EY4P7_cjs.TenantService(db).addMemberByEmail(slug, email, role);
13695
+ await new chunkK342JMA3_cjs.TenantService(db).addMemberByEmail(slug, email, role);
13695
13696
  return c.redirect(`/admin/tenants/${slug}/members?message=Member added`);
13696
13697
  } catch (error) {
13697
13698
  const message = error instanceof Error ? error.message : "Failed to add member";
@@ -13706,7 +13707,7 @@ function createTenantAdminRoutes() {
13706
13707
  try {
13707
13708
  const form = await c.req.formData();
13708
13709
  const role = String(form.get("role") ?? "");
13709
- await new chunkTO6EY4P7_cjs.TenantService(db).setMemberRole(slug, userId, role);
13710
+ await new chunkK342JMA3_cjs.TenantService(db).setMemberRole(slug, userId, role);
13710
13711
  return c.redirect(`/admin/tenants/${slug}/members?message=Role updated`);
13711
13712
  } catch (error) {
13712
13713
  const message = error instanceof Error ? error.message : "Failed to update role";
@@ -13719,7 +13720,7 @@ function createTenantAdminRoutes() {
13719
13720
  const userId = c.req.param("userId");
13720
13721
  if (!await isMultiTenantActive(db)) return c.json({ error: "Multi-tenant plugin is not active" }, 403);
13721
13722
  try {
13722
- await new chunkTO6EY4P7_cjs.TenantService(db).removeMember(slug, userId);
13723
+ await new chunkK342JMA3_cjs.TenantService(db).removeMember(slug, userId);
13723
13724
  return c.redirect(`/admin/tenants/${slug}/members?message=Member removed`);
13724
13725
  } catch (error) {
13725
13726
  const message = error instanceof Error ? error.message : "Failed to remove member";
@@ -13735,12 +13736,12 @@ function createTenantAdminRoutes() {
13735
13736
  const form = await c.req.formData();
13736
13737
  const email = String(form.get("email") ?? "");
13737
13738
  const role = String(form.get("role") ?? "viewer");
13738
- const token = await new chunkTO6EY4P7_cjs.TenantService(db).createInvitation(slug, email, role, user?.userId ?? null);
13739
+ const token = await new chunkK342JMA3_cjs.TenantService(db).createInvitation(slug, email, role, user?.userId ?? null);
13739
13740
  const origin = c.req.header("origin") || new URL(c.req.url).origin;
13740
13741
  const acceptUrl = `${origin}/join/invite?token=${encodeURIComponent(token)}`;
13741
13742
  let note;
13742
13743
  let noteType = "";
13743
- const svc2 = chunkTO6EY4P7_cjs.hasEmailService() ? chunkTO6EY4P7_cjs.getEmailService() : null;
13744
+ const svc2 = chunkK342JMA3_cjs.hasEmailService() ? chunkK342JMA3_cjs.getEmailService() : null;
13744
13745
  const hasRealProvider = !!svc2 && svc2.getProviderName() !== "console";
13745
13746
  if (hasRealProvider) {
13746
13747
  const result = await svc2.send({
@@ -13781,7 +13782,7 @@ function createTenantAdminRoutes() {
13781
13782
  WHERE i.id = ? AND t.slug = ? AND i.status = 'pending'`
13782
13783
  ).bind(id, slug).first();
13783
13784
  if (!inv) throw new Error("Invitation not found or already used");
13784
- const svc2 = chunkTO6EY4P7_cjs.hasEmailService() ? chunkTO6EY4P7_cjs.getEmailService() : null;
13785
+ const svc2 = chunkK342JMA3_cjs.hasEmailService() ? chunkK342JMA3_cjs.getEmailService() : null;
13785
13786
  const hasRealProvider = !!svc2 && svc2.getProviderName() !== "console";
13786
13787
  if (!hasRealProvider) throw new Error("No email plugin active");
13787
13788
  const origin = c.req.header("origin") || new URL(c.req.url).origin;
@@ -13806,7 +13807,7 @@ function createTenantAdminRoutes() {
13806
13807
  const id = c.req.param("id");
13807
13808
  if (!await isMultiTenantActive(db)) return c.json({ error: "Multi-tenant plugin is not active" }, 403);
13808
13809
  try {
13809
- await new chunkTO6EY4P7_cjs.TenantService(db).revokeInvitation(slug, id);
13810
+ await new chunkK342JMA3_cjs.TenantService(db).revokeInvitation(slug, id);
13810
13811
  return c.redirect(`/admin/tenants/${slug}/members?message=Invitation revoked`);
13811
13812
  } catch (error) {
13812
13813
  const message = error instanceof Error ? error.message : "Failed to revoke invitation";
@@ -14036,7 +14037,7 @@ function createJoinRoutes() {
14036
14037
  if (existing) return rerender("An account with this email already exists. Please sign in instead.");
14037
14038
  try {
14038
14039
  const userId = crypto.randomUUID();
14039
- const passwordHash = await chunkMUNO67TT_cjs.AuthManager.hashPassword(password);
14040
+ const passwordHash = await chunkYJEBDJDV_cjs.AuthManager.hashPassword(password);
14040
14041
  const now = Date.now();
14041
14042
  const nowSec = Math.floor(now / 1e3);
14042
14043
  await db.batch([
@@ -14049,7 +14050,7 @@ function createJoinRoutes() {
14049
14050
  VALUES (?, ?, ?, 'credential', ?, ?, ?)`
14050
14051
  ).bind(`cred-${userId}`, userId, userId, passwordHash, nowSec, nowSec)
14051
14052
  ]);
14052
- await new chunkTO6EY4P7_cjs.TenantService(db).acceptInvitation(token, userId, inv.email);
14053
+ await new chunkK342JMA3_cjs.TenantService(db).acceptInvitation(token, userId, inv.email);
14053
14054
  const auth = chunkNUKJ54GA_cjs.createAuth(c.env);
14054
14055
  const origin = new URL(c.req.url).origin;
14055
14056
  const baReq = new Request(`${origin}/auth/sign-in/email`, {
@@ -14117,7 +14118,7 @@ function createJoinRoutes() {
14117
14118
  const baBody = await baRes.json();
14118
14119
  const userId = baBody?.user?.id;
14119
14120
  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);
14121
+ await new chunkK342JMA3_cjs.TenantService(db).acceptInvitation(token, userId, inv.email);
14121
14122
  const headers = new Headers({ Location: "/admin?message=Welcome! You have joined " + encodeURIComponent(inv.tenantName) });
14122
14123
  copyBaCookies(baRes, headers);
14123
14124
  return new Response(null, { status: 302, headers });
@@ -14131,7 +14132,7 @@ function createJoinRoutes() {
14131
14132
 
14132
14133
  // src/plugins/core-plugins/multi-tenant-plugin/index.ts
14133
14134
  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({
14135
+ var multiTenantPlugin = chunkUHRHZXVR_cjs.definePlugin({
14135
14136
  id: manifest_default2.id,
14136
14137
  version: "1.0.0",
14137
14138
  name: manifest_default2.name,
@@ -14146,30 +14147,30 @@ var multiTenantPlugin = chunkPMGOBS6X_cjs.definePlugin({
14146
14147
  { label: "Tenants", path: "/admin/tenants", icon: TENANT_ICON, order: 80 }
14147
14148
  ],
14148
14149
  activate: async () => {
14149
- chunkR4ILO3W6_cjs.invalidateTenantCache();
14150
+ chunkQJNKSFDJ_cjs.invalidateTenantCache();
14150
14151
  console.info("\u2705 Multi-Tenant plugin activated");
14151
14152
  },
14152
14153
  deactivate: async () => {
14153
- chunkR4ILO3W6_cjs.invalidateTenantCache();
14154
+ chunkQJNKSFDJ_cjs.invalidateTenantCache();
14154
14155
  console.info("\u274C Multi-Tenant plugin deactivated");
14155
14156
  }
14156
14157
  });
14157
14158
  var routes = new hono.Hono();
14158
- routes.use("*", chunkMUNO67TT_cjs.requireAuth());
14159
- routes.use("*", chunkMUNO67TT_cjs.requireRole(["admin", "editor"]));
14159
+ routes.use("*", chunkYJEBDJDV_cjs.requireAuth());
14160
+ routes.use("*", chunkYJEBDJDV_cjs.requireRole(["admin", "editor"]));
14160
14161
  routes.get("/:rootId", async (c) => {
14161
14162
  const { rootId } = c.req.param();
14162
14163
  const db = c.env.DB;
14163
- const scope = await chunkTO6EY4P7_cjs.resolveDocScope(c, db, { rootId });
14164
+ const scope = await chunkK342JMA3_cjs.resolveDocScope(c, db, { rootId });
14164
14165
  if (!scope) {
14165
14166
  return c.html('<p class="text-zinc-500 dark:text-zinc-400 p-4">Document not found.</p>', 404);
14166
14167
  }
14167
14168
  if (!scope.docType?.settings?.versioning) {
14168
14169
  return c.html('<p class="text-zinc-500 dark:text-zinc-400 p-4">Versioning not enabled for this type.</p>', 404);
14169
14170
  }
14170
- const denied = await chunkTO6EY4P7_cjs.denyIfNotAllowed(c, db, rootId, "read", scope.docType?.settings, scope.tenantId);
14171
+ const denied = await chunkK342JMA3_cjs.denyIfNotAllowed(c, db, rootId, "read", scope.docType?.settings, scope.tenantId);
14171
14172
  if (denied) return denied;
14172
- const repo = new chunkTO6EY4P7_cjs.DocumentRepository(db, scope.tenantId);
14173
+ const repo = new chunkK342JMA3_cjs.DocumentRepository(db, scope.tenantId);
14173
14174
  const versions = await repo.getVersionHistory(rootId);
14174
14175
  const safeRootIdAttr = chunkMNWKYY5E_cjs.escapeHtml(rootId);
14175
14176
  const rows = versions.map((v) => {
@@ -14262,14 +14263,14 @@ routes.post("/:rootId/restore/:versionNumber", async (c) => {
14262
14263
  const { rootId, versionNumber } = c.req.param();
14263
14264
  const db = c.env.DB;
14264
14265
  const user = c.get("user");
14265
- const scope = await chunkTO6EY4P7_cjs.resolveDocScope(c, db, { rootId });
14266
+ const scope = await chunkK342JMA3_cjs.resolveDocScope(c, db, { rootId });
14266
14267
  if (!scope) {
14267
14268
  return c.json({ error: "Document not found" }, 404);
14268
14269
  }
14269
14270
  if (!scope.docType?.settings?.versioning) {
14270
14271
  return c.json({ error: "Versioning not enabled for this type" }, 404);
14271
14272
  }
14272
- const denied = await chunkTO6EY4P7_cjs.denyIfNotAllowed(c, db, rootId, "update", scope.docType?.settings, scope.tenantId);
14273
+ const denied = await chunkK342JMA3_cjs.denyIfNotAllowed(c, db, rootId, "update", scope.docType?.settings, scope.tenantId);
14273
14274
  if (denied) return denied;
14274
14275
  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
14276
  if (!row) {
@@ -14292,7 +14293,7 @@ routes.post("/:rootId/restore/:versionNumber", async (c) => {
14292
14293
  var routes_default = routes;
14293
14294
 
14294
14295
  // src/plugins/core-plugins/versioning-plugin/index.ts
14295
- var versioningPlugin = chunkPMGOBS6X_cjs.definePlugin({
14296
+ var versioningPlugin = chunkUHRHZXVR_cjs.definePlugin({
14296
14297
  id: "versioning",
14297
14298
  version: "1.0.0",
14298
14299
  name: "Versioning",
@@ -14369,8 +14370,8 @@ function createMagicLinkAuthPlugin() {
14369
14370
  const baseUrl = new URL(c.req.url).origin;
14370
14371
  const magicLink = `${baseUrl}/auth/magic-link/verify?token=${token}`;
14371
14372
  try {
14372
- if (chunkTO6EY4P7_cjs.hasEmailService()) {
14373
- await chunkTO6EY4P7_cjs.getEmailService().send({
14373
+ if (chunkK342JMA3_cjs.hasEmailService()) {
14374
+ await chunkK342JMA3_cjs.getEmailService().send({
14374
14375
  to: normalizedEmail,
14375
14376
  subject: "Your Magic Link to Sign In",
14376
14377
  flow: "magic-link",
@@ -14447,19 +14448,19 @@ function createMagicLinkAuthPlugin() {
14447
14448
  SET used = 1, used_at = ?
14448
14449
  WHERE id = ?
14449
14450
  `).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(
14451
+ const tokenTtl = await chunkYJEBDJDV_cjs.getJwtExpirySecondsFromDb(c.env.DB, c.env);
14452
+ const jwtToken = await chunkYJEBDJDV_cjs.AuthManager.generateToken(
14452
14453
  user.id,
14453
14454
  user.email,
14454
14455
  user.role,
14455
14456
  c.env.JWT_SECRET,
14456
14457
  tokenTtl
14457
14458
  );
14458
- chunkMUNO67TT_cjs.AuthManager.setAuthCookie(c, jwtToken, { maxAge: tokenTtl });
14459
+ chunkYJEBDJDV_cjs.AuthManager.setAuthCookie(c, jwtToken, { maxAge: tokenTtl });
14459
14460
  await db.prepare(`
14460
14461
  UPDATE auth_user SET last_login_at = ? WHERE id = ?
14461
14462
  `).bind(Date.now(), user.id).run();
14462
- chunkTO6EY4P7_cjs.dispatchHookEvent(
14463
+ chunkK342JMA3_cjs.dispatchHookEvent(
14463
14464
  c,
14464
14465
  "auth:magic-link:consumed",
14465
14466
  { user: { id: user.id, email: user.email, role: user.role } },
@@ -14944,7 +14945,7 @@ async function warmCollections(db) {
14944
14945
  const collectionCache = chunkYA3TJ65D_cjs.getCacheService(config);
14945
14946
  let count = 0;
14946
14947
  try {
14947
- const results = chunkR4ILO3W6_cjs.getCollectionRegistry().listActive().map(chunkR4ILO3W6_cjs.collectionRecordToRow);
14948
+ const results = chunkQJNKSFDJ_cjs.getCollectionRegistry().listActive().map(chunkQJNKSFDJ_cjs.collectionRecordToRow);
14948
14949
  for (const collection of results) {
14949
14950
  const key = collectionCache.generateKey("item", collection.id);
14950
14951
  await collectionCache.set(key, collection);
@@ -15215,7 +15216,7 @@ function renderCacheDashboard(data) {
15215
15216
  </script>
15216
15217
 
15217
15218
  <!-- Confirmation Dialogs -->
15218
- ${chunkTO6EY4P7_cjs.renderConfirmationDialog({
15219
+ ${chunkK342JMA3_cjs.renderConfirmationDialog({
15219
15220
  id: "clear-all-cache-confirm",
15220
15221
  title: "Clear All Cache",
15221
15222
  message: "Are you sure you want to clear all cache entries? This cannot be undone.",
@@ -15226,7 +15227,7 @@ function renderCacheDashboard(data) {
15226
15227
  onConfirm: "performClearAllCaches()"
15227
15228
  })}
15228
15229
 
15229
- ${chunkTO6EY4P7_cjs.renderConfirmationDialog({
15230
+ ${chunkK342JMA3_cjs.renderConfirmationDialog({
15230
15231
  id: "clear-namespace-cache-confirm",
15231
15232
  title: "Clear Namespace Cache",
15232
15233
  message: "Clear cache for this namespace?",
@@ -15237,7 +15238,7 @@ function renderCacheDashboard(data) {
15237
15238
  onConfirm: "performClearNamespaceCache()"
15238
15239
  })}
15239
15240
 
15240
- ${chunkTO6EY4P7_cjs.getConfirmationDialogScript()}
15241
+ ${chunkK342JMA3_cjs.getConfirmationDialogScript()}
15241
15242
  `;
15242
15243
  const layoutData = {
15243
15244
  title: "Cache System",
@@ -15503,7 +15504,7 @@ app.get("/", async (c) => {
15503
15504
  const totalRequests = totalHits + totalMisses;
15504
15505
  const overallHitRate = totalRequests > 0 ? totalHits / totalRequests * 100 : 0;
15505
15506
  const DEFAULT_TTL = chunkYA3TJ65D_cjs.CACHE_CONFIGS.api?.ttl ?? 300;
15506
- const collections = chunkR4ILO3W6_cjs.getCollectionRegistry().listActive().filter((r) => !r.internal).map((r) => {
15507
+ const collections = chunkQJNKSFDJ_cjs.getCollectionRegistry().listActive().filter((r) => !r.internal).map((r) => {
15507
15508
  const cacheOverride = r.cache;
15508
15509
  const cacheEnabled = cacheOverride?.enabled !== false;
15509
15510
  const hasCustomTtl = typeof cacheOverride?.ttl === "number";
@@ -16040,16 +16041,16 @@ var faviconSvg = `<?xml version="1.0" encoding="UTF-8" standalone="no"?>
16040
16041
  // src/app.ts
16041
16042
  function createSonicJSApp(config = {}) {
16042
16043
  const app2 = new hono.Hono();
16043
- const appVersion = config.version || chunkF67UK75A_cjs.getCoreVersion();
16044
+ const appVersion = config.version || chunkKV3CM5RK_cjs.getCoreVersion();
16044
16045
  const appName = config.name || "SonicJS AI";
16045
- const hookSystem = new chunk3KYKEXV7_cjs.HookSystemImpl();
16046
+ const hookSystem = new chunkMKKGA3C4_cjs.HookSystemImpl();
16046
16047
  chunkJ6JTWD2A_cjs.setHookSystem(hookSystem);
16047
16048
  const magicLinkPlugin = createMagicLinkAuthPlugin();
16048
16049
  const corePluginsBeforeCatchAll = [
16049
16050
  securityAuditPlugin,
16050
16051
  aiSearchPlugin,
16051
16052
  oauthProvidersPlugin,
16052
- chunkTO6EY4P7_cjs.userProfilesPlugin,
16053
+ chunkK342JMA3_cjs.userProfilesPlugin,
16053
16054
  otpLoginPlugin,
16054
16055
  analyticsPlugin,
16055
16056
  stripePlugin,
@@ -16059,23 +16060,23 @@ function createSonicJSApp(config = {}) {
16059
16060
  shortcodesPlugin,
16060
16061
  helloWorldPlugin,
16061
16062
  multiTenantPlugin,
16062
- chunkTO6EY4P7_cjs.lexicalEditorPlugin,
16063
+ chunkK342JMA3_cjs.lexicalEditorPlugin,
16063
16064
  versioningPlugin
16064
16065
  ];
16065
16066
  const corePluginsAfterCatchAll = [emailPluginV3, magicLinkPlugin, emailReconciliationPlugin];
16066
- const wirePlugins = chunk3KYKEXV7_cjs.createPluginWirer(
16067
+ const wirePlugins = chunkMKKGA3C4_cjs.createPluginWirer(
16067
16068
  () => [...corePluginsBeforeCatchAll, ...corePluginsAfterCatchAll, ...config.plugins?.register ?? []],
16068
16069
  // The capability-gated `ctx.cap.email` resolves to the app EmailService, which
16069
16070
  // is initialized (below) just before wiring on the first request.
16070
16071
  () => ({
16071
16072
  hooks: hookSystem,
16072
16073
  env: firstRequestEnv,
16073
- providers: { email: () => chunkTO6EY4P7_cjs.getEmailService() }
16074
+ providers: { email: () => chunkK342JMA3_cjs.getEmailService() }
16074
16075
  })
16075
16076
  );
16076
16077
  let firstRequestEnv;
16077
16078
  const initEmailService = async (env = {}) => {
16078
- if (chunkTO6EY4P7_cjs.hasEmailService()) return;
16079
+ if (chunkK342JMA3_cjs.hasEmailService()) return;
16079
16080
  let provider;
16080
16081
  let defaultFrom = config.email?.from;
16081
16082
  let defaultReplyTo;
@@ -16110,14 +16111,14 @@ function createSonicJSApp(config = {}) {
16110
16111
  }
16111
16112
  }
16112
16113
  defaultFrom = defaultFrom || env.DEFAULT_FROM_EMAIL || "noreply@sonicjs.local";
16113
- chunkTO6EY4P7_cjs.setEmailService(new EmailService({ provider, defaultFrom, defaultReplyTo, db: env.DB }));
16114
+ chunkK342JMA3_cjs.setEmailService(new EmailService({ provider, defaultFrom, defaultReplyTo, db: env.DB }));
16114
16115
  };
16115
16116
  app2.use("*", async (c, next) => {
16116
16117
  c.set("appVersion", appVersion);
16117
16118
  await next();
16118
16119
  });
16119
- app2.use("*", chunkMUNO67TT_cjs.metricsMiddleware());
16120
- app2.use("*", chunkMUNO67TT_cjs.bootstrapMiddleware(config));
16120
+ app2.use("*", chunkYJEBDJDV_cjs.metricsMiddleware());
16121
+ app2.use("*", chunkYJEBDJDV_cjs.bootstrapMiddleware(config));
16121
16122
  const boot = async (env) => {
16122
16123
  if (config.plugins?.disableAll) return;
16123
16124
  firstRequestEnv = env;
@@ -16144,8 +16145,8 @@ function createSonicJSApp(config = {}) {
16144
16145
  app2.use("*", async (_c, next) => {
16145
16146
  await next();
16146
16147
  });
16147
- app2.use("*", chunkMUNO67TT_cjs.securityHeadersMiddleware());
16148
- app2.use("*", chunkMUNO67TT_cjs.csrfProtection());
16148
+ app2.use("*", chunkYJEBDJDV_cjs.securityHeadersMiddleware());
16149
+ app2.use("*", chunkYJEBDJDV_cjs.csrfProtection());
16149
16150
  app2.use("*", async (c, next) => {
16150
16151
  try {
16151
16152
  const reqUrl = new URL(c.req.url);
@@ -16182,9 +16183,9 @@ function createSonicJSApp(config = {}) {
16182
16183
  app2.use("*", middleware);
16183
16184
  }
16184
16185
  }
16185
- app2.use("*", chunkR4ILO3W6_cjs.tenantMiddleware());
16186
- app2.use("/admin/*", chunkMUNO67TT_cjs.requireAuth());
16187
- app2.use("/admin/*", chunkMUNO67TT_cjs.requireRbac("portal", "access"));
16186
+ app2.use("*", chunkQJNKSFDJ_cjs.tenantMiddleware());
16187
+ app2.use("/admin/*", chunkYJEBDJDV_cjs.requireAuth());
16188
+ app2.use("/admin/*", chunkYJEBDJDV_cjs.requireRbac("portal", "access"));
16188
16189
  app2.use("/admin/*", pluginMenuMiddleware());
16189
16190
  const NAV_LANDING = [
16190
16191
  { path: "/admin/content", perm: "content:read" },
@@ -16230,43 +16231,43 @@ function createSonicJSApp(config = {}) {
16230
16231
  });
16231
16232
  app2.route("/api/security-audit", apiRoutes2);
16232
16233
  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);
16234
+ app2.route("/api/media", chunkK342JMA3_cjs.api_media_default);
16235
+ app2.route("/api/system", chunkK342JMA3_cjs.api_system_default);
16236
+ app2.route("/api/documents", chunkK342JMA3_cjs.apiDocumentsRoutes);
16237
+ app2.route("/api", chunkK342JMA3_cjs.api_default);
16238
+ app2.route("/admin/documents", chunkK342JMA3_cjs.adminDocumentsRoutes);
16239
+ chunkMKKGA3C4_cjs.registerPluginRoutes(app2, [formsPlugin], { source: "core" });
16240
+ app2.route("/admin/api", chunkK342JMA3_cjs.admin_api_default);
16241
+ app2.route("/admin/collections", chunkK342JMA3_cjs.adminCollectionsRoutes);
16242
+ app2.route("/admin/settings", chunkK342JMA3_cjs.adminSettingsRoutes);
16243
+ app2.route("/admin/api-reference", chunkK342JMA3_cjs.router2);
16243
16244
  app2.route("/admin/database-tools", createDatabaseToolsAdminRoutes());
16244
- app2.route("/admin/content", chunkTO6EY4P7_cjs.admin_content_default);
16245
- app2.route("/admin/media", chunkTO6EY4P7_cjs.adminMediaRoutes);
16245
+ app2.route("/admin/content", chunkK342JMA3_cjs.admin_content_default);
16246
+ app2.route("/admin/media", chunkK342JMA3_cjs.adminMediaRoutes);
16246
16247
  app2.use("/auth/*", securityAuditMiddleware());
16247
16248
  if (!config.plugins?.disableAll) {
16248
- chunk3KYKEXV7_cjs.registerPluginRoutes(app2, corePluginsBeforeCatchAll, { source: "core" });
16249
+ chunkMKKGA3C4_cjs.registerPluginRoutes(app2, corePluginsBeforeCatchAll, { source: "core" });
16249
16250
  app2.route("/admin/cache", cache_default.getRoutes());
16250
16251
  if (config.plugins?.register && config.plugins.register.length > 0) {
16251
- chunk3KYKEXV7_cjs.registerPluginRoutes(app2, config.plugins.register, { source: "user" });
16252
+ chunkMKKGA3C4_cjs.registerPluginRoutes(app2, config.plugins.register, { source: "user" });
16252
16253
  }
16253
16254
  }
16254
16255
  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);
16256
+ app2.route("/admin/dashboard", chunkK342JMA3_cjs.router);
16257
+ app2.route("/admin/plugins", chunkK342JMA3_cjs.adminPluginRoutes);
16258
+ app2.route("/admin/logs", chunkK342JMA3_cjs.adminLogsRoutes);
16258
16259
  app2.route("/admin/rbac", adminRbacRoutes);
16259
- app2.route("/admin", chunkTO6EY4P7_cjs.userRoutes);
16260
- app2.route("/auth", chunkTO6EY4P7_cjs.auth_default);
16260
+ app2.route("/admin", chunkK342JMA3_cjs.userRoutes);
16261
+ app2.route("/auth", chunkK342JMA3_cjs.auth_default);
16261
16262
  app2.on(["GET", "POST"], "/auth/*", (c) => {
16262
16263
  const reqUrl = new URL(c.req.url);
16263
16264
  const requestBaseURL = `${reqUrl.protocol}//${reqUrl.host}`;
16264
16265
  const auth = chunkNUKJ54GA_cjs.createAuth(c.env, config.auth?.extendBetterAuth, requestBaseURL);
16265
16266
  return auth.handler(c.req.raw);
16266
16267
  });
16267
- app2.route("/", chunkTO6EY4P7_cjs.test_cleanup_default);
16268
+ app2.route("/", chunkK342JMA3_cjs.test_cleanup_default);
16268
16269
  if (!config.plugins?.disableAll) {
16269
- chunk3KYKEXV7_cjs.registerPluginRoutes(app2, corePluginsAfterCatchAll, { source: "core" });
16270
+ chunkMKKGA3C4_cjs.registerPluginRoutes(app2, corePluginsAfterCatchAll, { source: "core" });
16270
16271
  }
16271
16272
  if (!config.plugins?.disableAll) {
16272
16273
  const allMountedPlugins = [
@@ -16275,8 +16276,8 @@ function createSonicJSApp(config = {}) {
16275
16276
  ...corePluginsAfterCatchAll,
16276
16277
  ...config.plugins?.register ?? []
16277
16278
  ];
16278
- chunk3KYKEXV7_cjs.setPluginMenu(allMountedPlugins.flatMap((p) => p.menu ?? []));
16279
- chunkPMGOBS6X_cjs.setPluginDefinitions(allMountedPlugins);
16279
+ chunkMKKGA3C4_cjs.setPluginMenu(allMountedPlugins.flatMap((p) => p.menu ?? []));
16280
+ chunkUHRHZXVR_cjs.setPluginDefinitions(allMountedPlugins);
16280
16281
  }
16281
16282
  app2.get("/favicon.svg", (c) => {
16282
16283
  return new Response(faviconSvg, {
@@ -19768,7 +19769,7 @@ function createRedirectApiRoutes() {
19768
19769
  });
19769
19770
  return api;
19770
19771
  }
19771
- var redirectPlugin = chunkPMGOBS6X_cjs.definePlugin({
19772
+ var redirectPlugin = chunkUHRHZXVR_cjs.definePlugin({
19772
19773
  id: manifest_default3.id,
19773
19774
  version: manifest_default3.version,
19774
19775
  name: manifest_default3.name,
@@ -19786,7 +19787,7 @@ var redirectPlugin = chunkPMGOBS6X_cjs.definePlugin({
19786
19787
  async onBoot(ctx) {
19787
19788
  const db = ctx.env?.DB;
19788
19789
  if (!db) return;
19789
- const registry = new chunkMUNO67TT_cjs.DocumentTypeRegistry(db);
19790
+ const registry = new chunkYJEBDJDV_cjs.DocumentTypeRegistry(db);
19790
19791
  await registry.register({
19791
19792
  id: "redirect",
19792
19793
  name: "redirect",
@@ -19902,87 +19903,87 @@ function createDb(d1$1) {
19902
19903
  }
19903
19904
 
19904
19905
  // src/index.ts
19905
- var VERSION = chunkF67UK75A_cjs.package_default.version;
19906
+ var VERSION = chunkKV3CM5RK_cjs.package_default.version;
19906
19907
 
19907
19908
  Object.defineProperty(exports, "ROUTES_INFO", {
19908
19909
  enumerable: true,
19909
- get: function () { return chunkTO6EY4P7_cjs.ROUTES_INFO; }
19910
+ get: function () { return chunkK342JMA3_cjs.ROUTES_INFO; }
19910
19911
  });
19911
19912
  Object.defineProperty(exports, "adminApiRoutes", {
19912
19913
  enumerable: true,
19913
- get: function () { return chunkTO6EY4P7_cjs.admin_api_default; }
19914
+ get: function () { return chunkK342JMA3_cjs.admin_api_default; }
19914
19915
  });
19915
19916
  Object.defineProperty(exports, "adminCheckboxRoutes", {
19916
19917
  enumerable: true,
19917
- get: function () { return chunkTO6EY4P7_cjs.adminCheckboxRoutes; }
19918
+ get: function () { return chunkK342JMA3_cjs.adminCheckboxRoutes; }
19918
19919
  });
19919
19920
  Object.defineProperty(exports, "adminCollectionsRoutes", {
19920
19921
  enumerable: true,
19921
- get: function () { return chunkTO6EY4P7_cjs.adminCollectionsRoutes; }
19922
+ get: function () { return chunkK342JMA3_cjs.adminCollectionsRoutes; }
19922
19923
  });
19923
19924
  Object.defineProperty(exports, "adminContentRoutes", {
19924
19925
  enumerable: true,
19925
- get: function () { return chunkTO6EY4P7_cjs.admin_content_default; }
19926
+ get: function () { return chunkK342JMA3_cjs.admin_content_default; }
19926
19927
  });
19927
19928
  Object.defineProperty(exports, "adminDashboardRoutes", {
19928
19929
  enumerable: true,
19929
- get: function () { return chunkTO6EY4P7_cjs.router; }
19930
+ get: function () { return chunkK342JMA3_cjs.router; }
19930
19931
  });
19931
19932
  Object.defineProperty(exports, "adminLogsRoutes", {
19932
19933
  enumerable: true,
19933
- get: function () { return chunkTO6EY4P7_cjs.adminLogsRoutes; }
19934
+ get: function () { return chunkK342JMA3_cjs.adminLogsRoutes; }
19934
19935
  });
19935
19936
  Object.defineProperty(exports, "adminMediaRoutes", {
19936
19937
  enumerable: true,
19937
- get: function () { return chunkTO6EY4P7_cjs.adminMediaRoutes; }
19938
+ get: function () { return chunkK342JMA3_cjs.adminMediaRoutes; }
19938
19939
  });
19939
19940
  Object.defineProperty(exports, "adminPluginRoutes", {
19940
19941
  enumerable: true,
19941
- get: function () { return chunkTO6EY4P7_cjs.adminPluginRoutes; }
19942
+ get: function () { return chunkK342JMA3_cjs.adminPluginRoutes; }
19942
19943
  });
19943
19944
  Object.defineProperty(exports, "adminSettingsRoutes", {
19944
19945
  enumerable: true,
19945
- get: function () { return chunkTO6EY4P7_cjs.adminSettingsRoutes; }
19946
+ get: function () { return chunkK342JMA3_cjs.adminSettingsRoutes; }
19946
19947
  });
19947
19948
  Object.defineProperty(exports, "adminUsersRoutes", {
19948
19949
  enumerable: true,
19949
- get: function () { return chunkTO6EY4P7_cjs.userRoutes; }
19950
+ get: function () { return chunkK342JMA3_cjs.userRoutes; }
19950
19951
  });
19951
19952
  Object.defineProperty(exports, "apiContentCrudRoutes", {
19952
19953
  enumerable: true,
19953
- get: function () { return chunkTO6EY4P7_cjs.api_content_crud_default; }
19954
+ get: function () { return chunkK342JMA3_cjs.api_content_crud_default; }
19954
19955
  });
19955
19956
  Object.defineProperty(exports, "apiMediaRoutes", {
19956
19957
  enumerable: true,
19957
- get: function () { return chunkTO6EY4P7_cjs.api_media_default; }
19958
+ get: function () { return chunkK342JMA3_cjs.api_media_default; }
19958
19959
  });
19959
19960
  Object.defineProperty(exports, "apiRoutes", {
19960
19961
  enumerable: true,
19961
- get: function () { return chunkTO6EY4P7_cjs.api_default; }
19962
+ get: function () { return chunkK342JMA3_cjs.api_default; }
19962
19963
  });
19963
19964
  Object.defineProperty(exports, "apiSystemRoutes", {
19964
19965
  enumerable: true,
19965
- get: function () { return chunkTO6EY4P7_cjs.api_system_default; }
19966
+ get: function () { return chunkK342JMA3_cjs.api_system_default; }
19966
19967
  });
19967
19968
  Object.defineProperty(exports, "authRoutes", {
19968
19969
  enumerable: true,
19969
- get: function () { return chunkTO6EY4P7_cjs.auth_default; }
19970
+ get: function () { return chunkK342JMA3_cjs.auth_default; }
19970
19971
  });
19971
19972
  Object.defineProperty(exports, "createUserProfilesPlugin", {
19972
19973
  enumerable: true,
19973
- get: function () { return chunkTO6EY4P7_cjs.createUserProfilesPlugin; }
19974
+ get: function () { return chunkK342JMA3_cjs.createUserProfilesPlugin; }
19974
19975
  });
19975
19976
  Object.defineProperty(exports, "defineUserProfile", {
19976
19977
  enumerable: true,
19977
- get: function () { return chunkTO6EY4P7_cjs.defineUserProfile; }
19978
+ get: function () { return chunkK342JMA3_cjs.defineUserProfile; }
19978
19979
  });
19979
19980
  Object.defineProperty(exports, "getUserProfileConfig", {
19980
19981
  enumerable: true,
19981
- get: function () { return chunkTO6EY4P7_cjs.getUserProfileConfig; }
19982
+ get: function () { return chunkK342JMA3_cjs.getUserProfileConfig; }
19982
19983
  });
19983
19984
  Object.defineProperty(exports, "userProfilesPlugin", {
19984
19985
  enumerable: true,
19985
- get: function () { return chunkTO6EY4P7_cjs.userProfilesPlugin; }
19986
+ get: function () { return chunkK342JMA3_cjs.userProfilesPlugin; }
19986
19987
  });
19987
19988
  Object.defineProperty(exports, "Logger", {
19988
19989
  enumerable: true,
@@ -20138,87 +20139,87 @@ Object.defineProperty(exports, "workflowHistory", {
20138
20139
  });
20139
20140
  Object.defineProperty(exports, "AuthManager", {
20140
20141
  enumerable: true,
20141
- get: function () { return chunkMUNO67TT_cjs.AuthManager; }
20142
+ get: function () { return chunkYJEBDJDV_cjs.AuthManager; }
20142
20143
  });
20143
20144
  Object.defineProperty(exports, "PermissionManager", {
20144
20145
  enumerable: true,
20145
- get: function () { return chunkMUNO67TT_cjs.PermissionManager; }
20146
+ get: function () { return chunkYJEBDJDV_cjs.PermissionManager; }
20146
20147
  });
20147
20148
  Object.defineProperty(exports, "bootstrapDocumentTypes", {
20148
20149
  enumerable: true,
20149
- get: function () { return chunkMUNO67TT_cjs.bootstrapDocumentTypes; }
20150
+ get: function () { return chunkYJEBDJDV_cjs.bootstrapDocumentTypes; }
20150
20151
  });
20151
20152
  Object.defineProperty(exports, "bootstrapMiddleware", {
20152
20153
  enumerable: true,
20153
- get: function () { return chunkMUNO67TT_cjs.bootstrapMiddleware; }
20154
+ get: function () { return chunkYJEBDJDV_cjs.bootstrapMiddleware; }
20154
20155
  });
20155
20156
  Object.defineProperty(exports, "cacheHeaders", {
20156
20157
  enumerable: true,
20157
- get: function () { return chunkMUNO67TT_cjs.cacheHeaders; }
20158
+ get: function () { return chunkYJEBDJDV_cjs.cacheHeaders; }
20158
20159
  });
20159
20160
  Object.defineProperty(exports, "compressionMiddleware", {
20160
20161
  enumerable: true,
20161
- get: function () { return chunkMUNO67TT_cjs.compressionMiddleware; }
20162
+ get: function () { return chunkYJEBDJDV_cjs.compressionMiddleware; }
20162
20163
  });
20163
20164
  Object.defineProperty(exports, "detailedLoggingMiddleware", {
20164
20165
  enumerable: true,
20165
- get: function () { return chunkMUNO67TT_cjs.detailedLoggingMiddleware; }
20166
+ get: function () { return chunkYJEBDJDV_cjs.detailedLoggingMiddleware; }
20166
20167
  });
20167
20168
  Object.defineProperty(exports, "getActivePlugins", {
20168
20169
  enumerable: true,
20169
- get: function () { return chunkMUNO67TT_cjs.getActivePlugins; }
20170
+ get: function () { return chunkYJEBDJDV_cjs.getActivePlugins; }
20170
20171
  });
20171
20172
  Object.defineProperty(exports, "isPluginActive", {
20172
20173
  enumerable: true,
20173
- get: function () { return chunkMUNO67TT_cjs.isPluginActive; }
20174
+ get: function () { return chunkYJEBDJDV_cjs.isPluginActive; }
20174
20175
  });
20175
20176
  Object.defineProperty(exports, "logActivity", {
20176
20177
  enumerable: true,
20177
- get: function () { return chunkMUNO67TT_cjs.logActivity; }
20178
+ get: function () { return chunkYJEBDJDV_cjs.logActivity; }
20178
20179
  });
20179
20180
  Object.defineProperty(exports, "loggingMiddleware", {
20180
20181
  enumerable: true,
20181
- get: function () { return chunkMUNO67TT_cjs.loggingMiddleware; }
20182
+ get: function () { return chunkYJEBDJDV_cjs.loggingMiddleware; }
20182
20183
  });
20183
20184
  Object.defineProperty(exports, "optionalAuth", {
20184
20185
  enumerable: true,
20185
- get: function () { return chunkMUNO67TT_cjs.optionalAuth; }
20186
+ get: function () { return chunkYJEBDJDV_cjs.optionalAuth; }
20186
20187
  });
20187
20188
  Object.defineProperty(exports, "performanceLoggingMiddleware", {
20188
20189
  enumerable: true,
20189
- get: function () { return chunkMUNO67TT_cjs.performanceLoggingMiddleware; }
20190
+ get: function () { return chunkYJEBDJDV_cjs.performanceLoggingMiddleware; }
20190
20191
  });
20191
20192
  Object.defineProperty(exports, "requireActivePlugin", {
20192
20193
  enumerable: true,
20193
- get: function () { return chunkMUNO67TT_cjs.requireActivePlugin; }
20194
+ get: function () { return chunkYJEBDJDV_cjs.requireActivePlugin; }
20194
20195
  });
20195
20196
  Object.defineProperty(exports, "requireActivePlugins", {
20196
20197
  enumerable: true,
20197
- get: function () { return chunkMUNO67TT_cjs.requireActivePlugins; }
20198
+ get: function () { return chunkYJEBDJDV_cjs.requireActivePlugins; }
20198
20199
  });
20199
20200
  Object.defineProperty(exports, "requireAnyPermission", {
20200
20201
  enumerable: true,
20201
- get: function () { return chunkMUNO67TT_cjs.requireAnyPermission; }
20202
+ get: function () { return chunkYJEBDJDV_cjs.requireAnyPermission; }
20202
20203
  });
20203
20204
  Object.defineProperty(exports, "requireAuth", {
20204
20205
  enumerable: true,
20205
- get: function () { return chunkMUNO67TT_cjs.requireAuth; }
20206
+ get: function () { return chunkYJEBDJDV_cjs.requireAuth; }
20206
20207
  });
20207
20208
  Object.defineProperty(exports, "requirePermission", {
20208
20209
  enumerable: true,
20209
- get: function () { return chunkMUNO67TT_cjs.requirePermission; }
20210
+ get: function () { return chunkYJEBDJDV_cjs.requirePermission; }
20210
20211
  });
20211
20212
  Object.defineProperty(exports, "requireRole", {
20212
20213
  enumerable: true,
20213
- get: function () { return chunkMUNO67TT_cjs.requireRole; }
20214
+ get: function () { return chunkYJEBDJDV_cjs.requireRole; }
20214
20215
  });
20215
20216
  Object.defineProperty(exports, "securityHeaders", {
20216
20217
  enumerable: true,
20217
- get: function () { return chunkMUNO67TT_cjs.securityHeadersMiddleware; }
20218
+ get: function () { return chunkYJEBDJDV_cjs.securityHeadersMiddleware; }
20218
20219
  });
20219
20220
  Object.defineProperty(exports, "securityLoggingMiddleware", {
20220
20221
  enumerable: true,
20221
- get: function () { return chunkMUNO67TT_cjs.securityLoggingMiddleware; }
20222
+ get: function () { return chunkYJEBDJDV_cjs.securityLoggingMiddleware; }
20222
20223
  });
20223
20224
  Object.defineProperty(exports, "RbacService", {
20224
20225
  enumerable: true,
@@ -20226,35 +20227,35 @@ Object.defineProperty(exports, "RbacService", {
20226
20227
  });
20227
20228
  Object.defineProperty(exports, "PluginBootstrapService", {
20228
20229
  enumerable: true,
20229
- get: function () { return chunkR4ILO3W6_cjs.PluginBootstrapService; }
20230
+ get: function () { return chunkQJNKSFDJ_cjs.PluginBootstrapService; }
20230
20231
  });
20231
20232
  Object.defineProperty(exports, "PluginServiceClass", {
20232
20233
  enumerable: true,
20233
- get: function () { return chunkR4ILO3W6_cjs.PluginService; }
20234
+ get: function () { return chunkQJNKSFDJ_cjs.PluginService; }
20234
20235
  });
20235
20236
  Object.defineProperty(exports, "getAvailableCollectionNames", {
20236
20237
  enumerable: true,
20237
- get: function () { return chunkR4ILO3W6_cjs.getAvailableCollectionNames; }
20238
+ get: function () { return chunkQJNKSFDJ_cjs.getAvailableCollectionNames; }
20238
20239
  });
20239
20240
  Object.defineProperty(exports, "loadCollectionConfig", {
20240
20241
  enumerable: true,
20241
- get: function () { return chunkR4ILO3W6_cjs.loadCollectionConfig; }
20242
+ get: function () { return chunkQJNKSFDJ_cjs.loadCollectionConfig; }
20242
20243
  });
20243
20244
  Object.defineProperty(exports, "loadCollectionConfigs", {
20244
20245
  enumerable: true,
20245
- get: function () { return chunkR4ILO3W6_cjs.loadCollectionConfigs; }
20246
+ get: function () { return chunkQJNKSFDJ_cjs.loadCollectionConfigs; }
20246
20247
  });
20247
20248
  Object.defineProperty(exports, "registerCollections", {
20248
20249
  enumerable: true,
20249
- get: function () { return chunkR4ILO3W6_cjs.registerCollections; }
20250
+ get: function () { return chunkQJNKSFDJ_cjs.registerCollections; }
20250
20251
  });
20251
20252
  Object.defineProperty(exports, "validateCollectionConfig", {
20252
20253
  enumerable: true,
20253
- get: function () { return chunkR4ILO3W6_cjs.validateCollectionConfig; }
20254
+ get: function () { return chunkQJNKSFDJ_cjs.validateCollectionConfig; }
20254
20255
  });
20255
20256
  Object.defineProperty(exports, "MigrationService", {
20256
20257
  enumerable: true,
20257
- get: function () { return chunkIHTXB7AT_cjs.MigrationService; }
20258
+ get: function () { return chunkORF4CT74_cjs.MigrationService; }
20258
20259
  });
20259
20260
  Object.defineProperty(exports, "renderFilterBar", {
20260
20261
  enumerable: true,
@@ -20294,99 +20295,99 @@ Object.defineProperty(exports, "renderAdminLayoutCatalyst", {
20294
20295
  });
20295
20296
  Object.defineProperty(exports, "HookSystemImpl", {
20296
20297
  enumerable: true,
20297
- get: function () { return chunk3KYKEXV7_cjs.HookSystemImpl; }
20298
+ get: function () { return chunkMKKGA3C4_cjs.HookSystemImpl; }
20298
20299
  });
20299
20300
  Object.defineProperty(exports, "HookUtils", {
20300
20301
  enumerable: true,
20301
- get: function () { return chunk3KYKEXV7_cjs.HookUtils; }
20302
+ get: function () { return chunkMKKGA3C4_cjs.HookUtils; }
20302
20303
  });
20303
20304
  Object.defineProperty(exports, "PluginDependencyCycleError", {
20304
20305
  enumerable: true,
20305
- get: function () { return chunk3KYKEXV7_cjs.PluginDependencyCycleError; }
20306
+ get: function () { return chunkMKKGA3C4_cjs.PluginDependencyCycleError; }
20306
20307
  });
20307
20308
  Object.defineProperty(exports, "PluginManagerClass", {
20308
20309
  enumerable: true,
20309
- get: function () { return chunk3KYKEXV7_cjs.PluginManager; }
20310
+ get: function () { return chunkMKKGA3C4_cjs.PluginManager; }
20310
20311
  });
20311
20312
  Object.defineProperty(exports, "PluginRegistryImpl", {
20312
20313
  enumerable: true,
20313
- get: function () { return chunk3KYKEXV7_cjs.PluginRegistryImpl; }
20314
+ get: function () { return chunkMKKGA3C4_cjs.PluginRegistryImpl; }
20314
20315
  });
20315
20316
  Object.defineProperty(exports, "PluginValidatorClass", {
20316
20317
  enumerable: true,
20317
- get: function () { return chunk3KYKEXV7_cjs.PluginValidator; }
20318
+ get: function () { return chunkMKKGA3C4_cjs.PluginValidator; }
20318
20319
  });
20319
20320
  Object.defineProperty(exports, "RegisterPluginsError", {
20320
20321
  enumerable: true,
20321
- get: function () { return chunk3KYKEXV7_cjs.RegisterPluginsError; }
20322
+ get: function () { return chunkMKKGA3C4_cjs.RegisterPluginsError; }
20322
20323
  });
20323
20324
  Object.defineProperty(exports, "ScopedHookSystemClass", {
20324
20325
  enumerable: true,
20325
- get: function () { return chunk3KYKEXV7_cjs.ScopedHookSystem; }
20326
+ get: function () { return chunkMKKGA3C4_cjs.ScopedHookSystem; }
20326
20327
  });
20327
20328
  Object.defineProperty(exports, "collectCronSchedules", {
20328
20329
  enumerable: true,
20329
- get: function () { return chunk3KYKEXV7_cjs.collectCronSchedules; }
20330
+ get: function () { return chunkMKKGA3C4_cjs.collectCronSchedules; }
20330
20331
  });
20331
20332
  Object.defineProperty(exports, "collectCrons", {
20332
20333
  enumerable: true,
20333
- get: function () { return chunk3KYKEXV7_cjs.collectCrons; }
20334
+ get: function () { return chunkMKKGA3C4_cjs.collectCrons; }
20334
20335
  });
20335
20336
  Object.defineProperty(exports, "createScheduledHandler", {
20336
20337
  enumerable: true,
20337
- get: function () { return chunk3KYKEXV7_cjs.createScheduledHandler; }
20338
+ get: function () { return chunkMKKGA3C4_cjs.createScheduledHandler; }
20338
20339
  });
20339
20340
  Object.defineProperty(exports, "dispatchCronTick", {
20340
20341
  enumerable: true,
20341
- get: function () { return chunk3KYKEXV7_cjs.dispatchCronTick; }
20342
+ get: function () { return chunkMKKGA3C4_cjs.dispatchCronTick; }
20342
20343
  });
20343
20344
  Object.defineProperty(exports, "getPluginMenu", {
20344
20345
  enumerable: true,
20345
- get: function () { return chunk3KYKEXV7_cjs.getPluginMenu; }
20346
+ get: function () { return chunkMKKGA3C4_cjs.getPluginMenu; }
20346
20347
  });
20347
20348
  Object.defineProperty(exports, "registerPlugins", {
20348
20349
  enumerable: true,
20349
- get: function () { return chunk3KYKEXV7_cjs.registerPlugins; }
20350
+ get: function () { return chunkMKKGA3C4_cjs.registerPlugins; }
20350
20351
  });
20351
20352
  Object.defineProperty(exports, "resetPluginMenu", {
20352
20353
  enumerable: true,
20353
- get: function () { return chunk3KYKEXV7_cjs.resetPluginMenu; }
20354
+ get: function () { return chunkMKKGA3C4_cjs.resetPluginMenu; }
20354
20355
  });
20355
20356
  Object.defineProperty(exports, "resolvePluginMenuItems", {
20356
20357
  enumerable: true,
20357
- get: function () { return chunk3KYKEXV7_cjs.resolvePluginMenuItems; }
20358
+ get: function () { return chunkMKKGA3C4_cjs.resolvePluginMenuItems; }
20358
20359
  });
20359
20360
  Object.defineProperty(exports, "setPluginMenu", {
20360
20361
  enumerable: true,
20361
- get: function () { return chunk3KYKEXV7_cjs.setPluginMenu; }
20362
+ get: function () { return chunkMKKGA3C4_cjs.setPluginMenu; }
20362
20363
  });
20363
20364
  Object.defineProperty(exports, "topoSort", {
20364
20365
  enumerable: true,
20365
- get: function () { return chunk3KYKEXV7_cjs.topoSort; }
20366
+ get: function () { return chunkMKKGA3C4_cjs.topoSort; }
20366
20367
  });
20367
20368
  Object.defineProperty(exports, "applySchemaDefaults", {
20368
20369
  enumerable: true,
20369
- get: function () { return chunkPMGOBS6X_cjs.applySchemaDefaults; }
20370
+ get: function () { return chunkUHRHZXVR_cjs.applySchemaDefaults; }
20370
20371
  });
20371
20372
  Object.defineProperty(exports, "definePlugin", {
20372
20373
  enumerable: true,
20373
- get: function () { return chunkPMGOBS6X_cjs.definePlugin; }
20374
+ get: function () { return chunkUHRHZXVR_cjs.definePlugin; }
20374
20375
  });
20375
20376
  Object.defineProperty(exports, "isDefinedPlugin", {
20376
20377
  enumerable: true,
20377
- get: function () { return chunkPMGOBS6X_cjs.isDefinedPlugin; }
20378
+ get: function () { return chunkUHRHZXVR_cjs.isDefinedPlugin; }
20378
20379
  });
20379
20380
  Object.defineProperty(exports, "parseConfigSchema", {
20380
20381
  enumerable: true,
20381
- get: function () { return chunkPMGOBS6X_cjs.parseConfigSchema; }
20382
+ get: function () { return chunkUHRHZXVR_cjs.parseConfigSchema; }
20382
20383
  });
20383
20384
  Object.defineProperty(exports, "parseFormDataToSettings", {
20384
20385
  enumerable: true,
20385
- get: function () { return chunkPMGOBS6X_cjs.parseFormDataToSettings; }
20386
+ get: function () { return chunkUHRHZXVR_cjs.parseFormDataToSettings; }
20386
20387
  });
20387
20388
  Object.defineProperty(exports, "renderSchemaFields", {
20388
20389
  enumerable: true,
20389
- get: function () { return chunkPMGOBS6X_cjs.renderSchemaFields; }
20390
+ get: function () { return chunkUHRHZXVR_cjs.renderSchemaFields; }
20390
20391
  });
20391
20392
  Object.defineProperty(exports, "getHookSystem", {
20392
20393
  enumerable: true,
@@ -20434,11 +20435,11 @@ Object.defineProperty(exports, "metricsTracker", {
20434
20435
  });
20435
20436
  Object.defineProperty(exports, "SONICJS_VERSION", {
20436
20437
  enumerable: true,
20437
- get: function () { return chunkF67UK75A_cjs.SONICJS_VERSION; }
20438
+ get: function () { return chunkKV3CM5RK_cjs.SONICJS_VERSION; }
20438
20439
  });
20439
20440
  Object.defineProperty(exports, "getCoreVersion", {
20440
20441
  enumerable: true,
20441
- get: function () { return chunkF67UK75A_cjs.getCoreVersion; }
20442
+ get: function () { return chunkKV3CM5RK_cjs.getCoreVersion; }
20442
20443
  });
20443
20444
  Object.defineProperty(exports, "escapeHtml", {
20444
20445
  enumerable: true,