@sonicjs-cms/core 3.0.0-beta.24 → 3.0.0-beta.26

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 (163) hide show
  1. package/bin/db-reset.js +39 -22
  2. package/dist/admin-documents-form.template-JWV5GITD.js +6 -0
  3. package/dist/{admin-documents-form.template-55V2ZGWT.js.map → admin-documents-form.template-JWV5GITD.js.map} +1 -1
  4. package/dist/admin-documents-form.template-UWKGVAMW.cjs +19 -0
  5. package/dist/{admin-layout-catalyst.template-6UQGLCKI.js.map → admin-documents-form.template-UWKGVAMW.cjs.map} +1 -1
  6. package/dist/admin-layout-catalyst.template-MOQ3BBXA.cjs +21 -0
  7. package/dist/{admin-layout-catalyst.template-3XZXDGF7.cjs.map → admin-layout-catalyst.template-MOQ3BBXA.cjs.map} +1 -1
  8. package/dist/admin-layout-catalyst.template-WCYMQVTZ.js +7 -0
  9. package/dist/{admin-documents-form.template-YNAVMJCV.cjs.map → admin-layout-catalyst.template-WCYMQVTZ.js.map} +1 -1
  10. package/dist/{app-01M0dIwt.d.ts → app-BP5IlK94.d.ts} +7 -7
  11. package/dist/{app-aj39TGHB.d.cts → app-fdq4K3vw.d.cts} +7 -7
  12. package/dist/catalog-56DR6OXI.cjs +41 -0
  13. package/dist/catalog-56DR6OXI.cjs.map +1 -0
  14. package/dist/catalog-6MB37KY7.js +4 -0
  15. package/dist/catalog-6MB37KY7.js.map +1 -0
  16. package/dist/{chunk-QCJHCSOK.cjs → chunk-4DHPR7KR.cjs} +77 -17
  17. package/dist/chunk-4DHPR7KR.cjs.map +1 -0
  18. package/dist/{chunk-UIHIXTIS.js → chunk-5YSFQO7X.js} +40 -13
  19. package/dist/chunk-5YSFQO7X.js.map +1 -0
  20. package/dist/{chunk-GMMCCIQO.cjs → chunk-6UAI4SGN.cjs} +3 -3
  21. package/dist/{chunk-GMMCCIQO.cjs.map → chunk-6UAI4SGN.cjs.map} +1 -1
  22. package/dist/{chunk-2XAQTPAE.js → chunk-6X22VFEV.js} +8 -2
  23. package/dist/chunk-6X22VFEV.js.map +1 -0
  24. package/dist/{chunk-URIBTX27.js → chunk-73RTFFMX.js} +3 -3
  25. package/dist/{chunk-URIBTX27.js.map → chunk-73RTFFMX.js.map} +1 -1
  26. package/dist/{chunk-QJUJNTIU.cjs → chunk-A22RBHO7.cjs} +43 -12
  27. package/dist/chunk-A22RBHO7.cjs.map +1 -0
  28. package/dist/{chunk-QZGABF2M.js → chunk-AMP4BSJE.js} +18 -7
  29. package/dist/chunk-AMP4BSJE.js.map +1 -0
  30. package/dist/{chunk-37V3RET3.cjs → chunk-BRKXMRMB.cjs} +99 -98
  31. package/dist/chunk-BRKXMRMB.cjs.map +1 -0
  32. package/dist/{chunk-36Z3AKX3.cjs → chunk-C5LDQ3SH.cjs} +8 -2
  33. package/dist/chunk-C5LDQ3SH.cjs.map +1 -0
  34. package/dist/{chunk-BBEKHLTW.cjs → chunk-CN3T3TDI.cjs} +9 -9
  35. package/dist/{chunk-BBEKHLTW.cjs.map → chunk-CN3T3TDI.cjs.map} +1 -1
  36. package/dist/{chunk-BHND5PEV.js → chunk-E3TQG7AA.js} +3 -3
  37. package/dist/{chunk-BHND5PEV.js.map → chunk-E3TQG7AA.js.map} +1 -1
  38. package/dist/{chunk-FHPEM77Y.js → chunk-EEA476CJ.js} +88 -83
  39. package/dist/chunk-EEA476CJ.js.map +1 -0
  40. package/dist/chunk-F6BTBE4S.js +119 -0
  41. package/dist/chunk-F6BTBE4S.js.map +1 -0
  42. package/dist/chunk-FZGIU5AZ.cjs +128 -0
  43. package/dist/chunk-FZGIU5AZ.cjs.map +1 -0
  44. package/dist/{chunk-BJROXF4N.js → chunk-HSDJDWLV.js} +19 -4
  45. package/dist/chunk-HSDJDWLV.js.map +1 -0
  46. package/dist/{chunk-VGEZNFWH.js → chunk-JD7BZU3A.js} +5 -4
  47. package/dist/chunk-JD7BZU3A.js.map +1 -0
  48. package/dist/{chunk-SOZUG52O.js → chunk-JG5J434C.js} +3 -3
  49. package/dist/{chunk-SOZUG52O.js.map → chunk-JG5J434C.js.map} +1 -1
  50. package/dist/{chunk-BP52BFIV.cjs → chunk-KWQNB6UM.cjs} +6 -5
  51. package/dist/chunk-KWQNB6UM.cjs.map +1 -0
  52. package/dist/{chunk-UYJQDDEE.cjs → chunk-MI2YXCK4.cjs} +14 -8
  53. package/dist/chunk-MI2YXCK4.cjs.map +1 -0
  54. package/dist/{chunk-VC5XVPLM.js → chunk-OJFIQGZB.js} +512 -148
  55. package/dist/chunk-OJFIQGZB.js.map +1 -0
  56. package/dist/{chunk-LTZ5WYOK.cjs → chunk-OLEOKHDX.cjs} +25 -2
  57. package/dist/chunk-OLEOKHDX.cjs.map +1 -0
  58. package/dist/{chunk-E66UVONV.cjs → chunk-OUBUS74I.cjs} +24 -9
  59. package/dist/chunk-OUBUS74I.cjs.map +1 -0
  60. package/dist/{chunk-A2SN3RVL.cjs → chunk-PAS7GZBS.cjs} +40 -13
  61. package/dist/chunk-PAS7GZBS.cjs.map +1 -0
  62. package/dist/{chunk-RJ2O5IIE.js → chunk-RVOX2WH2.js} +74 -18
  63. package/dist/chunk-RVOX2WH2.js.map +1 -0
  64. package/dist/{chunk-3TMTYJAJ.js → chunk-RXLI3ADU.js} +25 -2
  65. package/dist/chunk-RXLI3ADU.js.map +1 -0
  66. package/dist/{chunk-I767LVN7.cjs → chunk-S2QN4LFD.cjs} +881 -515
  67. package/dist/chunk-S2QN4LFD.cjs.map +1 -0
  68. package/dist/{chunk-IXUHXTHW.cjs → chunk-SFGYZUWU.cjs} +18 -7
  69. package/dist/chunk-SFGYZUWU.cjs.map +1 -0
  70. package/dist/{chunk-THFZSDIU.js → chunk-SXC4HPK6.js} +14 -8
  71. package/dist/chunk-SXC4HPK6.js.map +1 -0
  72. package/dist/{chunk-JMJM7DMM.cjs → chunk-TT3TQSCZ.cjs} +5 -5
  73. package/dist/{chunk-JMJM7DMM.cjs.map → chunk-TT3TQSCZ.cjs.map} +1 -1
  74. package/dist/{chunk-LNI3FYSI.js → chunk-UB5QSRO7.js} +9 -14
  75. package/dist/chunk-UB5QSRO7.js.map +1 -0
  76. package/dist/{chunk-VYQVDL2M.js → chunk-UKIDWRA3.js} +36 -5
  77. package/dist/chunk-UKIDWRA3.js.map +1 -0
  78. package/dist/{chunk-KKNEYIZJ.cjs → chunk-XZUEGFXE.cjs} +9 -14
  79. package/dist/chunk-XZUEGFXE.cjs.map +1 -0
  80. package/dist/{collection-config-BTzAvKt2.d.cts → collection-config-U2dydD_O.d.cts} +14 -0
  81. package/dist/{collection-config-BTzAvKt2.d.ts → collection-config-U2dydD_O.d.ts} +14 -0
  82. package/dist/config-DOAWXZBG.js +6 -0
  83. package/dist/{config-6FB2BXMP.js.map → config-DOAWXZBG.js.map} +1 -1
  84. package/dist/{config-OCH7S4WK.cjs → config-VLU73ZW7.cjs} +5 -5
  85. package/dist/{config-OCH7S4WK.cjs.map → config-VLU73ZW7.cjs.map} +1 -1
  86. package/dist/{define-plugin-D_6D9vVZ.d.ts → define-plugin-DDe8a_bh.d.ts} +3 -0
  87. package/dist/{define-plugin-DMcvEy_C.d.cts → define-plugin-rjXmGOgu.d.cts} +3 -0
  88. package/dist/index.cjs +698 -392
  89. package/dist/index.cjs.map +1 -1
  90. package/dist/index.d.cts +27 -12
  91. package/dist/index.d.ts +27 -12
  92. package/dist/index.js +340 -35
  93. package/dist/index.js.map +1 -1
  94. package/dist/middleware.cjs +47 -47
  95. package/dist/middleware.d.cts +10 -10
  96. package/dist/middleware.d.ts +10 -10
  97. package/dist/middleware.js +6 -6
  98. package/dist/migrations-6M6772UC.cjs +13 -0
  99. package/dist/{migrations-FGXZPKDC.cjs.map → migrations-6M6772UC.cjs.map} +1 -1
  100. package/dist/migrations-GZ2HIB4I.js +4 -0
  101. package/dist/{migrations-Z6D27NAW.js.map → migrations-GZ2HIB4I.js.map} +1 -1
  102. package/dist/{plugin-bootstrap-BHWQ2df8.d.cts → plugin-bootstrap-CfVILQeP.d.ts} +1 -1
  103. package/dist/{plugin-bootstrap-Bj4fxX1q.d.ts → plugin-bootstrap-RY5pkoOT.d.cts} +1 -1
  104. package/dist/plugins.cjs +40 -40
  105. package/dist/plugins.d.cts +1 -1
  106. package/dist/plugins.d.ts +1 -1
  107. package/dist/plugins.js +3 -3
  108. package/dist/rbac-TFUOYIVN.cjs +14 -0
  109. package/dist/{rbac-7QZ4JZ2E.cjs.map → rbac-TFUOYIVN.cjs.map} +1 -1
  110. package/dist/rbac-XSNP76CV.js +5 -0
  111. package/dist/{rbac-Y43IEQOP.js.map → rbac-XSNP76CV.js.map} +1 -1
  112. package/dist/routes.cjs +33 -32
  113. package/dist/routes.d.cts +3 -5
  114. package/dist/routes.d.ts +3 -5
  115. package/dist/routes.js +13 -12
  116. package/dist/services.cjs +30 -30
  117. package/dist/services.d.cts +10 -3
  118. package/dist/services.d.ts +10 -3
  119. package/dist/services.js +3 -3
  120. package/dist/{telemetry-Cku1ax74.d.cts → telemetry-QFlTv9f8.d.cts} +1 -1
  121. package/dist/{telemetry-Cku1ax74.d.ts → telemetry-QFlTv9f8.d.ts} +1 -1
  122. package/dist/templates.cjs +17 -17
  123. package/dist/templates.js +3 -3
  124. package/dist/types.d.cts +2 -2
  125. package/dist/types.d.ts +2 -2
  126. package/dist/utils.cjs +12 -12
  127. package/dist/utils.d.cts +2 -2
  128. package/dist/utils.d.ts +2 -2
  129. package/dist/utils.js +2 -2
  130. package/package.json +7 -12
  131. package/dist/admin-documents-form.template-55V2ZGWT.js +0 -6
  132. package/dist/admin-documents-form.template-YNAVMJCV.cjs +0 -19
  133. package/dist/admin-layout-catalyst.template-3XZXDGF7.cjs +0 -21
  134. package/dist/admin-layout-catalyst.template-6UQGLCKI.js +0 -7
  135. package/dist/chunk-2XAQTPAE.js.map +0 -1
  136. package/dist/chunk-36Z3AKX3.cjs.map +0 -1
  137. package/dist/chunk-37V3RET3.cjs.map +0 -1
  138. package/dist/chunk-3TMTYJAJ.js.map +0 -1
  139. package/dist/chunk-A2SN3RVL.cjs.map +0 -1
  140. package/dist/chunk-BJROXF4N.js.map +0 -1
  141. package/dist/chunk-BP52BFIV.cjs.map +0 -1
  142. package/dist/chunk-E66UVONV.cjs.map +0 -1
  143. package/dist/chunk-FHPEM77Y.js.map +0 -1
  144. package/dist/chunk-I767LVN7.cjs.map +0 -1
  145. package/dist/chunk-IXUHXTHW.cjs.map +0 -1
  146. package/dist/chunk-KKNEYIZJ.cjs.map +0 -1
  147. package/dist/chunk-LNI3FYSI.js.map +0 -1
  148. package/dist/chunk-LTZ5WYOK.cjs.map +0 -1
  149. package/dist/chunk-QCJHCSOK.cjs.map +0 -1
  150. package/dist/chunk-QJUJNTIU.cjs.map +0 -1
  151. package/dist/chunk-QZGABF2M.js.map +0 -1
  152. package/dist/chunk-RJ2O5IIE.js.map +0 -1
  153. package/dist/chunk-THFZSDIU.js.map +0 -1
  154. package/dist/chunk-UIHIXTIS.js.map +0 -1
  155. package/dist/chunk-UYJQDDEE.cjs.map +0 -1
  156. package/dist/chunk-VC5XVPLM.js.map +0 -1
  157. package/dist/chunk-VGEZNFWH.js.map +0 -1
  158. package/dist/chunk-VYQVDL2M.js.map +0 -1
  159. package/dist/config-6FB2BXMP.js +0 -6
  160. package/dist/migrations-FGXZPKDC.cjs +0 -13
  161. package/dist/migrations-Z6D27NAW.js +0 -4
  162. package/dist/rbac-7QZ4JZ2E.cjs +0 -14
  163. package/dist/rbac-Y43IEQOP.js +0 -5
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/templates/alert.template.ts","../src/templates/confirmation-dialog.template.ts","../src/templates/pagination.template.ts","../src/templates/table.template.ts","../src/templates/layouts/admin-layout-v2.template.ts","../src/templates/pages/admin-checkboxes.template.ts","../src/templates/form.template.ts"],"names":["renderAdminLayoutCatalyst"],"mappings":";;;;;AAaO,SAAS,YAAY,IAAA,EAAyB;AACnD,EAAA,MAAM,WAAA,GAAc;AAAA,IAClB,OAAA,EAAS,sFAAA;AAAA,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AA,CAAM,QAAA,GAAW,OAAO,EAAE;AAAA;AAAA,MAAA,EAE1C,SAAS;AAAA,MAAA,EACT,MAAM,QAAA,GAAW,CAAA,yDAAA,EAA4D,KAAA,CAAM,QAAQ,SAAS,EAAE;AAAA;AAAA,EAAA,CAAA;AAG9G","file":"chunk-BJROXF4N.js","sourcesContent":["import { escapeHtml } from '../utils/sanitize'\n\nexport type AlertType = 'success' | 'error' | 'warning' | 'info'\n\nexport interface AlertData {\n type: AlertType\n title?: string\n message: string\n dismissible?: boolean\n className?: string\n icon?: boolean\n}\n\nexport function renderAlert(data: AlertData): string {\n const typeClasses = {\n success: 'bg-green-50 dark:bg-green-500/10 border border-green-600/20 dark:border-green-500/20',\n error: 'bg-error/10 border border-red-600/20 dark:border-red-500/20',\n warning: 'bg-amber-50 dark:bg-amber-500/10 border border-amber-600/20 dark:border-amber-500/20',\n info: 'bg-blue-50 dark:bg-blue-500/10 border border-blue-600/20 dark:border-blue-500/20'\n }\n\n const iconClasses = {\n success: 'text-green-600 dark:text-green-400',\n error: 'text-red-600 dark:text-red-400',\n warning: 'text-amber-600 dark:text-amber-400',\n info: 'text-blue-600 dark:text-blue-400'\n }\n\n const textClasses = {\n success: 'text-green-900 dark:text-green-300',\n error: 'text-red-900 dark:text-red-300',\n warning: 'text-amber-900 dark:text-amber-300',\n info: 'text-blue-900 dark:text-blue-300'\n }\n\n const messageTextClasses = {\n success: 'text-green-700 dark:text-green-400',\n error: 'text-red-700 dark:text-red-400',\n warning: 'text-amber-700 dark:text-amber-400',\n info: 'text-blue-700 dark:text-blue-400'\n }\n\n const icons = {\n success: `<path fill-rule=\"evenodd\" d=\"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z\" clip-rule=\"evenodd\" />`,\n error: `<path fill-rule=\"evenodd\" d=\"M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z\" clip-rule=\"evenodd\" />`,\n warning: `<path fill-rule=\"evenodd\" d=\"M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z\" clip-rule=\"evenodd\" />`,\n info: `<path fill-rule=\"evenodd\" d=\"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z\" clip-rule=\"evenodd\" />`\n }\n\n return `\n <div class=\"rounded-lg p-4 ${typeClasses[data.type]} ${data.className || ''}\" ${data.dismissible ? 'id=\"dismissible-alert\"' : ''}>\n <div class=\"flex\">\n ${data.icon !== false ? `\n <div class=\"flex-shrink-0\">\n <svg class=\"h-5 w-5 ${iconClasses[data.type]}\" viewBox=\"0 0 20 20\" fill=\"currentColor\">\n ${icons[data.type]}\n </svg>\n </div>\n ` : ''}\n <div class=\"${data.icon !== false ? 'ml-3' : ''}\">\n ${data.title ? `\n <h3 class=\"text-sm font-semibold ${textClasses[data.type]}\">\n ${escapeHtml(data.title)}\n </h3>\n ` : ''}\n <div class=\"${data.title ? 'mt-1 text-sm' : 'text-sm'} ${messageTextClasses[data.type]}\">\n <p>${escapeHtml(data.message)}</p>\n </div>\n </div>\n ${data.dismissible ? `\n <div class=\"ml-auto pl-3\">\n <div class=\"-mx-1.5 -my-1.5\">\n <button\n type=\"button\"\n class=\"inline-flex rounded-md p-1.5 ${iconClasses[data.type]} hover:bg-opacity-20 focus:outline-none focus:ring-2 focus:ring-offset-2\"\n onclick=\"document.getElementById('dismissible-alert').remove()\"\n >\n <span class=\"sr-only\">Dismiss</span>\n <svg class=\"h-5 w-5\" viewBox=\"0 0 20 20\" fill=\"currentColor\">\n <path fill-rule=\"evenodd\" d=\"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z\" clip-rule=\"evenodd\" />\n </svg>\n </button>\n </div>\n </div>\n ` : ''}\n </div>\n </div>\n `\n}\n\nexport function renderSuccessAlert(message: string, title?: string): string {\n return renderAlert({ type: 'success', message, title })\n}\n\nexport function renderErrorAlert(message: string, title?: string): string {\n return renderAlert({ type: 'error', message, title })\n}\n\nexport function renderWarningAlert(message: string, title?: string): string {\n return renderAlert({ type: 'warning', message, title })\n}\n\nexport function renderInfoAlert(message: string, title?: string): string {\n return renderAlert({ type: 'info', message, title })\n}","export interface ConfirmationDialogOptions {\n id: string\n title: string\n message: string\n confirmText?: string\n cancelText?: string\n confirmClass?: string\n iconColor?: 'red' | 'yellow' | 'blue'\n onConfirm?: string // JavaScript code to execute on confirm\n}\n\nexport function renderConfirmationDialog(options: ConfirmationDialogOptions): string {\n const {\n id,\n title,\n message,\n confirmText = 'Confirm',\n cancelText = 'Cancel',\n confirmClass = 'bg-red-500 hover:bg-red-400',\n iconColor = 'red',\n onConfirm = ''\n } = options\n\n const iconColorClasses = {\n red: 'bg-red-500/10 text-red-400',\n yellow: 'bg-yellow-500/10 text-yellow-400',\n blue: 'bg-blue-500/10 text-blue-400'\n }\n\n return `\n <el-dialog>\n <dialog\n id=\"${id}\"\n aria-labelledby=\"${id}-title\"\n class=\"fixed inset-0 m-0 size-auto max-h-none max-w-none overflow-y-auto bg-transparent p-0 backdrop:bg-transparent\"\n >\n <el-dialog-backdrop class=\"fixed inset-0 bg-gray-900/50 transition-opacity data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in\"></el-dialog-backdrop>\n\n <div tabindex=\"0\" class=\"flex min-h-full items-end justify-center p-4 text-center focus:outline focus:outline-0 sm:items-center sm:p-0\">\n <el-dialog-panel class=\"relative transform overflow-hidden rounded-lg bg-gray-800 px-4 pb-4 pt-5 text-left shadow-xl outline outline-1 -outline-offset-1 outline-white/10 transition-all data-[closed]:translate-y-4 data-[closed]:opacity-0 data-[enter]:duration-300 data-[leave]:duration-200 data-[enter]:ease-out data-[leave]:ease-in sm:my-8 sm:w-full sm:max-w-lg sm:p-6 data-[closed]:sm:translate-y-0 data-[closed]:sm:scale-95\">\n <div class=\"sm:flex sm:items-start\">\n <div class=\"mx-auto flex size-12 shrink-0 items-center justify-center rounded-full ${iconColorClasses[iconColor]} sm:mx-0 sm:size-10\">\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" data-slot=\"icon\" aria-hidden=\"true\" class=\"size-6\">\n <path d=\"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126ZM12 15.75h.007v.008H12v-.008Z\" stroke-linecap=\"round\" stroke-linejoin=\"round\" />\n </svg>\n </div>\n <div class=\"mt-3 text-center sm:ml-4 sm:mt-0 sm:text-left\">\n <h3 id=\"${id}-title\" class=\"text-base font-semibold text-white\">${title}</h3>\n <div class=\"mt-2\">\n <p class=\"text-sm text-gray-400\">${message}</p>\n </div>\n </div>\n </div>\n <div class=\"mt-5 sm:mt-4 sm:flex sm:flex-row-reverse\">\n <button\n type=\"button\"\n onclick=\"${onConfirm}; document.getElementById('${id}').close()\"\n command=\"close\"\n commandfor=\"${id}\"\n class=\"confirm-button inline-flex w-full justify-center rounded-md ${confirmClass} px-3 py-2 text-sm font-semibold text-white sm:ml-3 sm:w-auto\"\n >\n ${confirmText}\n </button>\n <button\n type=\"button\"\n command=\"close\"\n commandfor=\"${id}\"\n class=\"mt-3 inline-flex w-full justify-center rounded-md bg-white/10 px-3 py-2 text-sm font-semibold text-white ring-1 ring-inset ring-white/5 hover:bg-white/20 sm:mt-0 sm:w-auto\"\n >\n ${cancelText}\n </button>\n </div>\n </el-dialog-panel>\n </div>\n </dialog>\n </el-dialog>\n `\n}\n\n/**\n * Helper function to show a confirmation dialog programmatically\n * Usage in templates: Add this script and call showConfirmDialog()\n */\nexport function getConfirmationDialogScript(): string {\n return `\n <script src=\"https://cdn.jsdelivr.net/npm/@tailwindplus/elements@1\" type=\"module\"></script>\n <script>\n function showConfirmDialog(dialogId) {\n const dialog = document.getElementById(dialogId);\n if (dialog) {\n dialog.showModal();\n }\n }\n </script>\n `\n}\n","export interface PaginationData {\n currentPage: number\n totalPages: number\n totalItems: number\n itemsPerPage: number\n startItem: number\n endItem: number\n baseUrl: string\n queryParams?: Record<string, string>\n showPageNumbers?: boolean\n maxPageNumbers?: number\n showPageSizeSelector?: boolean\n pageSizeOptions?: number[]\n}\n\nexport function renderPagination(data: PaginationData): string {\n // Show pagination if there are multiple pages OR if page size selector is enabled\n const shouldShowPagination = data.totalPages > 1 || (data.showPageSizeSelector !== false && data.totalItems > 0)\n\n if (!shouldShowPagination) {\n return ''\n }\n\n const buildUrl = (page: number, limit?: number): string => {\n const params = new URLSearchParams(data.queryParams || {})\n params.set('page', page.toString())\n if (limit) {\n params.set('limit', limit.toString())\n } else if (data.itemsPerPage !== 20) {\n params.set('limit', data.itemsPerPage.toString())\n }\n return `${data.baseUrl}?${params.toString()}`\n }\n\n const buildPageSizeUrl = (limit: number): string => {\n const params = new URLSearchParams(data.queryParams || {})\n params.set('page', '1') // Reset to page 1 when changing page size\n params.set('limit', limit.toString())\n return `${data.baseUrl}?${params.toString()}`\n }\n\n const generatePageNumbers = (): number[] => {\n const maxNumbers = data.maxPageNumbers || 5\n const half = Math.floor(maxNumbers / 2)\n let start = Math.max(1, data.currentPage - half)\n let end = Math.min(data.totalPages, start + maxNumbers - 1)\n\n // Adjust start if we're near the end\n if (end - start + 1 < maxNumbers) {\n start = Math.max(1, end - maxNumbers + 1)\n }\n\n const pages: number[] = []\n for (let i = start; i <= end; i++) {\n pages.push(i)\n }\n return pages\n }\n\n return `\n <div class=\"rounded-xl bg-white dark:bg-zinc-900 shadow-sm ring-1 ring-zinc-950/5 dark:ring-white/10 px-4 py-3 flex items-center justify-between mt-4\">\n ${data.totalPages > 1 ? `\n <!-- Mobile Pagination -->\n <div class=\"flex-1 flex justify-between sm:hidden\">\n ${data.currentPage > 1 ? `\n <a href=\"${buildUrl(data.currentPage - 1)}\" class=\"inline-flex items-center rounded-lg bg-white dark:bg-zinc-800 px-3 py-2 text-sm font-semibold text-zinc-950 dark:text-white shadow-sm ring-1 ring-inset ring-zinc-950/10 dark:ring-white/10 hover:bg-zinc-50 dark:hover:bg-zinc-700 transition-colors\">\n Previous\n </a>\n ` : `\n <span class=\"inline-flex items-center rounded-lg bg-white dark:bg-zinc-800 px-3 py-2 text-sm font-semibold text-zinc-400 dark:text-zinc-600 shadow-sm ring-1 ring-inset ring-zinc-950/10 dark:ring-white/10 opacity-50 cursor-not-allowed\">Previous</span>\n `}\n\n ${data.currentPage < data.totalPages ? `\n <a href=\"${buildUrl(data.currentPage + 1)}\" class=\"inline-flex items-center rounded-lg bg-white dark:bg-zinc-800 px-3 py-2 text-sm font-semibold text-zinc-950 dark:text-white shadow-sm ring-1 ring-inset ring-zinc-950/10 dark:ring-white/10 hover:bg-zinc-50 dark:hover:bg-zinc-700 transition-colors\">\n Next\n </a>\n ` : `\n <span class=\"inline-flex items-center rounded-lg bg-white dark:bg-zinc-800 px-3 py-2 text-sm font-semibold text-zinc-400 dark:text-zinc-600 shadow-sm ring-1 ring-inset ring-zinc-950/10 dark:ring-white/10 opacity-50 cursor-not-allowed\">Next</span>\n `}\n </div>\n ` : ''}\n\n <!-- Desktop Pagination -->\n <div class=\"hidden sm:flex-1 sm:flex sm:items-center sm:justify-between\">\n <div class=\"flex items-center gap-4\">\n <p class=\"text-sm text-zinc-500 dark:text-zinc-400\">\n Showing <span class=\"font-medium text-zinc-950 dark:text-white\">${data.startItem}</span> to\n <span class=\"font-medium text-zinc-950 dark:text-white\">${data.endItem}</span> of\n <span class=\"font-medium text-zinc-950 dark:text-white\">${data.totalItems}</span> results\n </p>\n ${data.showPageSizeSelector !== false ? `\n <div class=\"flex items-center gap-2\">\n <label for=\"page-size\" class=\"text-sm text-zinc-500 dark:text-zinc-400\">Per page:</label>\n <div class=\"grid grid-cols-1\">\n <select\n id=\"page-size\"\n onchange=\"window.location.href = this.value\"\n class=\"col-start-1 row-start-1 w-full appearance-none rounded-md bg-white/5 dark:bg-white/5 py-1.5 pl-3 pr-8 text-sm text-zinc-950 dark:text-white outline outline-1 -outline-offset-1 outline-zinc-500/30 dark:outline-zinc-400/30 *:bg-white dark:*:bg-zinc-800 focus-visible:outline focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-zinc-500 dark:focus-visible:outline-zinc-400\"\n >\n ${(data.pageSizeOptions || [10, 20, 50, 100]).map(size => `\n <option value=\"${buildPageSizeUrl(size)}\" ${size === data.itemsPerPage ? 'selected' : ''}>\n ${size}\n </option>\n `).join('')}\n </select>\n <svg viewBox=\"0 0 16 16\" fill=\"currentColor\" aria-hidden=\"true\" class=\"pointer-events-none col-start-1 row-start-1 mr-2 size-4 self-center justify-self-end text-zinc-600 dark:text-zinc-400\">\n <path d=\"M4.22 6.22a.75.75 0 0 1 1.06 0L8 8.94l2.72-2.72a.75.75 0 1 1 1.06 1.06l-3.25 3.25a.75.75 0 0 1-1.06 0L4.22 7.28a.75.75 0 0 1 0-1.06Z\" clip-rule=\"evenodd\" fill-rule=\"evenodd\" />\n </svg>\n </div>\n </div>\n ` : ''}\n </div>\n\n ${data.totalPages > 1 ? `\n <div class=\"flex items-center gap-x-1\">\n <!-- Previous Button -->\n ${data.currentPage > 1 ? `\n <a href=\"${buildUrl(data.currentPage - 1)}\"\n class=\"rounded-lg bg-white dark:bg-zinc-800 px-3 py-2 text-sm font-semibold text-zinc-950 dark:text-white shadow-sm ring-1 ring-inset ring-zinc-950/10 dark:ring-white/10 hover:bg-zinc-50 dark:hover:bg-zinc-700 transition-colors\">\n Previous\n </a>\n ` : ''}\n\n <!-- Page Numbers -->\n ${data.showPageNumbers !== false ? `\n <!-- First page if not in range -->\n ${(() => {\n const pageNumbers = generatePageNumbers()\n const firstPage = pageNumbers.length > 0 ? pageNumbers[0] : null\n return firstPage && firstPage > 1 ? `\n <a href=\"${buildUrl(1)}\"\n class=\"rounded-lg bg-white dark:bg-zinc-800 px-3 py-2 text-sm font-semibold text-zinc-950 dark:text-white shadow-sm ring-1 ring-inset ring-zinc-950/10 dark:ring-white/10 hover:bg-zinc-50 dark:hover:bg-zinc-700 transition-colors\">\n 1\n </a>\n ${firstPage > 2 ? `\n <span class=\"px-2 text-sm text-zinc-500 dark:text-zinc-400\">...</span>\n ` : ''}\n ` : ''\n })()}\n\n <!-- Page number buttons -->\n ${generatePageNumbers().map(pageNum => `\n ${pageNum === data.currentPage ? `\n <span class=\"rounded-lg bg-zinc-950 dark:bg-white px-3 py-2 text-sm font-semibold text-white dark:text-zinc-950\">\n ${pageNum}\n </span>\n ` : `\n <a href=\"${buildUrl(pageNum)}\"\n class=\"rounded-lg bg-white dark:bg-zinc-800 px-3 py-2 text-sm font-semibold text-zinc-950 dark:text-white shadow-sm ring-1 ring-inset ring-zinc-950/10 dark:ring-white/10 hover:bg-zinc-50 dark:hover:bg-zinc-700 transition-colors\">\n ${pageNum}\n </a>\n `}\n `).join('')}\n\n <!-- Last page if not in range -->\n ${(() => {\n const pageNumbers = generatePageNumbers()\n const lastPageNum = pageNumbers.length > 0 ? pageNumbers.slice(-1)[0] : null\n return lastPageNum && lastPageNum < data.totalPages ? `\n ${lastPageNum < data.totalPages - 1 ? `\n <span class=\"px-2 text-sm text-zinc-500 dark:text-zinc-400\">...</span>\n ` : ''}\n <a href=\"${buildUrl(data.totalPages)}\"\n class=\"rounded-lg bg-white dark:bg-zinc-800 px-3 py-2 text-sm font-semibold text-zinc-950 dark:text-white shadow-sm ring-1 ring-inset ring-zinc-950/10 dark:ring-white/10 hover:bg-zinc-50 dark:hover:bg-zinc-700 transition-colors\">\n ${data.totalPages}\n </a>\n ` : ''\n })()}\n ` : ''}\n\n <!-- Next Button -->\n ${data.currentPage < data.totalPages ? `\n <a href=\"${buildUrl(data.currentPage + 1)}\"\n class=\"rounded-lg bg-white dark:bg-zinc-800 px-3 py-2 text-sm font-semibold text-zinc-950 dark:text-white shadow-sm ring-1 ring-inset ring-zinc-950/10 dark:ring-white/10 hover:bg-zinc-50 dark:hover:bg-zinc-700 transition-colors\">\n Next\n </a>\n ` : ''}\n </div>\n ` : ''}\n </div>\n </div>\n `\n}","export interface TableColumn {\n key: string\n label: string\n sortable?: boolean\n className?: string\n sortType?: 'string' | 'number' | 'date' | 'boolean'\n render?: (value: any, row: any) => string\n}\n\nexport interface TableData<T = any> {\n columns: TableColumn[]\n rows: T[]\n selectable?: boolean\n className?: string\n emptyMessage?: string\n tableId?: string\n title?: string\n rowClickable?: boolean\n rowClickUrl?: (row: T) => string\n}\n\nexport function renderTable<T = any>(data: TableData<T>): string {\n const tableId = data.tableId || `table-${Math.random().toString(36).substr(2, 9)}`\n\n if (data.rows.length === 0) {\n return `\n <div class=\"rounded-xl bg-white dark:bg-zinc-900 shadow-sm ring-1 ring-zinc-950/5 dark:ring-white/10 p-8 text-center\">\n <div class=\"text-zinc-500 dark:text-zinc-400\">\n <svg class=\"mx-auto h-12 w-12 text-zinc-400 dark:text-zinc-500\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z\" />\n </svg>\n <p class=\"mt-2 text-sm text-zinc-500 dark:text-zinc-400\">${data.emptyMessage || 'No data available'}</p>\n </div>\n </div>\n `\n }\n\n return `\n <div class=\"${data.className || ''}\" id=\"${tableId}\">\n ${data.title ? `\n <div class=\"px-4 sm:px-0 mb-4\">\n <h3 class=\"text-base font-semibold text-zinc-950 dark:text-white\">${data.title}</h3>\n </div>\n ` : ''}\n <div class=\"overflow-x-auto\">\n <table class=\"min-w-full sortable-table\">\n <thead>\n <tr>\n ${data.selectable ? `\n <th class=\"px-4 py-3.5 text-center sm:pl-0\">\n <div class=\"flex items-center justify-center\">\n <div class=\"group grid size-4 grid-cols-1\">\n <input type=\"checkbox\" id=\"select-all-${tableId}\" class=\"col-start-1 row-start-1 appearance-none rounded border border-white/10 bg-white/5 checked:border-cyan-500 checked:bg-cyan-500 indeterminate:border-cyan-500 indeterminate:bg-cyan-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-cyan-500 disabled:border-white/5 disabled:bg-white/10 disabled:checked:bg-white/10 forced-colors:appearance-auto row-checkbox\" />\n <svg viewBox=\"0 0 14 14\" fill=\"none\" class=\"pointer-events-none col-start-1 row-start-1 size-3.5 self-center justify-self-center stroke-white group-has-[:disabled]:stroke-white/25\">\n <path d=\"M3 8L6 11L11 3.5\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" class=\"opacity-0 group-has-[:checked]:opacity-100\" />\n <path d=\"M3 7H11\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" class=\"opacity-0 group-has-[:indeterminate]:opacity-100\" />\n </svg>\n </div>\n </div>\n </th>\n ` : ''}\n ${data.columns.map((column, index) => {\n const isFirst = index === 0 && !data.selectable\n const isLast = index === data.columns.length - 1\n return `\n <th class=\"px-4 py-3.5 text-left text-sm font-semibold text-zinc-950 dark:text-white ${isFirst ? 'sm:pl-0' : ''} ${isLast ? 'sm:pr-0' : ''} ${column.className || ''}\">\n ${column.sortable ? `\n <button\n class=\"flex items-center gap-x-2 hover:text-zinc-700 dark:hover:text-zinc-300 transition-colors sort-btn text-left\"\n data-column=\"${column.key}\"\n data-sort-type=\"${column.sortType || 'string'}\"\n data-sort-direction=\"none\"\n onclick=\"sortTable('${tableId}', '${column.key}', '${column.sortType || 'string'}')\"\n >\n <span>${column.label}</span>\n <div class=\"sort-icons flex flex-col\">\n <svg class=\"w-3 h-3 sort-up opacity-30\" fill=\"currentColor\" viewBox=\"0 0 20 20\">\n <path fill-rule=\"evenodd\" d=\"M14.707 12.707a1 1 0 01-1.414 0L10 9.414l-3.293 3.293a1 1 0 01-1.414-1.414l4-4a1 1 0 011.414 0l4 4a1 1 0 010 1.414z\" clip-rule=\"evenodd\" />\n </svg>\n <svg class=\"w-3 h-3 sort-down opacity-30 -mt-1\" fill=\"currentColor\" viewBox=\"0 0 20 20\">\n <path fill-rule=\"evenodd\" d=\"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z\" clip-rule=\"evenodd\" />\n </svg>\n </div>\n </button>\n ` : column.label}\n </th>\n `}).join('')}\n </tr>\n </thead>\n <tbody>\n ${data.rows.map((row) => {\n if (!row) return ''\n const clickableClass = data.rowClickable ? 'cursor-pointer' : ''\n const clickHandler = data.rowClickable && data.rowClickUrl ? `onclick=\"window.location.href='${data.rowClickUrl(row)}'\"` : ''\n return `\n <tr class=\"group border-t border-zinc-950/5 dark:border-white/5 hover:bg-gradient-to-r hover:from-cyan-50/50 hover:via-blue-50/30 hover:to-purple-50/50 dark:hover:from-cyan-900/20 dark:hover:via-blue-900/10 dark:hover:to-purple-900/20 hover:shadow-sm hover:shadow-cyan-500/5 dark:hover:shadow-cyan-400/5 transition-all duration-300 ${clickableClass}\" ${clickHandler}>\n ${data.selectable ? `\n <td class=\"px-4 py-4 sm:pl-0\" onclick=\"event.stopPropagation()\">\n <div class=\"flex items-center justify-center\">\n <div class=\"group grid size-4 grid-cols-1\">\n <input type=\"checkbox\" value=\"${(row as any).id || ''}\" class=\"col-start-1 row-start-1 appearance-none rounded border border-white/10 bg-white/5 checked:border-cyan-500 checked:bg-cyan-500 indeterminate:border-cyan-500 indeterminate:bg-cyan-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-cyan-500 disabled:border-white/5 disabled:bg-white/10 disabled:checked:bg-white/10 forced-colors:appearance-auto row-checkbox\" />\n <svg viewBox=\"0 0 14 14\" fill=\"none\" class=\"pointer-events-none col-start-1 row-start-1 size-3.5 self-center justify-self-center stroke-white group-has-[:disabled]:stroke-white/25\">\n <path d=\"M3 8L6 11L11 3.5\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" class=\"opacity-0 group-has-[:checked]:opacity-100\" />\n <path d=\"M3 7H11\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" class=\"opacity-0 group-has-[:indeterminate]:opacity-100\" />\n </svg>\n </div>\n </div>\n </td>\n ` : ''}\n ${data.columns.map((column, colIndex) => {\n const value = (row as any)[column.key]\n const displayValue = column.render ? column.render(value, row) : value\n const stopPropagation = column.key === 'actions' ? 'onclick=\"event.stopPropagation()\"' : ''\n const isFirst = colIndex === 0 && !data.selectable\n const isLast = colIndex === data.columns.length - 1\n return `\n <td class=\"px-4 py-4 text-sm text-zinc-500 dark:text-zinc-400 ${isFirst ? 'sm:pl-0 font-medium text-zinc-950 dark:text-white' : ''} ${isLast ? 'sm:pr-0' : ''} ${column.className || ''}\" ${stopPropagation}>\n ${displayValue || ''}\n </td>\n `\n }).join('')}\n </tr>\n `\n }).join('')}\n </tbody>\n </table>\n </div>\n\n <script>\n // Table sorting functionality\n window.sortTable = function(tableId, column, sortType) {\n const tableContainer = document.getElementById(tableId);\n const table = tableContainer.querySelector('.sortable-table');\n const tbody = table.querySelector('tbody');\n const rows = Array.from(tbody.querySelectorAll('tr'));\n const headerBtn = table.querySelector(\\`[data-column=\"\\${column}\"]\\`);\n\n // Get current sort direction\n let direction = headerBtn.getAttribute('data-sort-direction');\n\n // Reset all sort indicators\n table.querySelectorAll('.sort-btn').forEach(btn => {\n btn.setAttribute('data-sort-direction', 'none');\n btn.querySelectorAll('.sort-up, .sort-down').forEach(icon => {\n icon.classList.add('opacity-30');\n icon.classList.remove('opacity-100', 'text-zinc-950', 'dark:text-white');\n });\n });\n\n // Determine new direction\n if (direction === 'none' || direction === 'desc') {\n direction = 'asc';\n } else {\n direction = 'desc';\n }\n\n // Update current header\n headerBtn.setAttribute('data-sort-direction', direction);\n const upIcon = headerBtn.querySelector('.sort-up');\n const downIcon = headerBtn.querySelector('.sort-down');\n\n if (direction === 'asc') {\n upIcon.classList.remove('opacity-30');\n upIcon.classList.add('opacity-100', 'text-zinc-950', 'dark:text-white');\n downIcon.classList.add('opacity-30');\n downIcon.classList.remove('opacity-100', 'text-zinc-950', 'dark:text-white');\n } else {\n downIcon.classList.remove('opacity-30');\n downIcon.classList.add('opacity-100', 'text-zinc-950', 'dark:text-white');\n upIcon.classList.add('opacity-30');\n upIcon.classList.remove('opacity-100', 'text-zinc-950', 'dark:text-white');\n }\n\n // Find column index (accounting for potential select column)\n const headers = Array.from(table.querySelectorAll('th'));\n const selectableOffset = table.querySelector('input[id^=\"select-all\"]') ? 1 : 0;\n const columnIndex = headers.findIndex(th => th.querySelector(\\`[data-column=\"\\${column}\"]\\`)) - selectableOffset;\n\n // Sort rows\n rows.sort((a, b) => {\n const aCell = a.children[columnIndex + selectableOffset];\n const bCell = b.children[columnIndex + selectableOffset];\n\n if (!aCell || !bCell) return 0;\n\n let aValue = aCell.textContent.trim();\n let bValue = bCell.textContent.trim();\n\n // Handle different sort types\n switch (sortType) {\n case 'number':\n aValue = parseFloat(aValue.replace(/[^0-9.-]/g, '')) || 0;\n bValue = parseFloat(bValue.replace(/[^0-9.-]/g, '')) || 0;\n break;\n case 'date':\n aValue = new Date(aValue).getTime() || 0;\n bValue = new Date(bValue).getTime() || 0;\n break;\n case 'boolean':\n aValue = aValue.toLowerCase() === 'true' || aValue.toLowerCase() === 'published' || aValue.toLowerCase() === 'active';\n bValue = bValue.toLowerCase() === 'true' || bValue.toLowerCase() === 'published' || bValue.toLowerCase() === 'active';\n break;\n default: // string\n aValue = aValue.toLowerCase();\n bValue = bValue.toLowerCase();\n }\n\n if (aValue < bValue) return direction === 'asc' ? -1 : 1;\n if (aValue > bValue) return direction === 'asc' ? 1 : -1;\n return 0;\n });\n\n // Re-append sorted rows\n rows.forEach(row => tbody.appendChild(row));\n };\n\n // Select all functionality\n document.addEventListener('DOMContentLoaded', function() {\n document.querySelectorAll('[id^=\"select-all\"]').forEach(selectAll => {\n selectAll.addEventListener('change', function() {\n const tableId = this.id.replace('select-all-', '');\n const table = document.getElementById(tableId);\n if (table) {\n const checkboxes = table.querySelectorAll('.row-checkbox');\n checkboxes.forEach(checkbox => {\n checkbox.checked = this.checked;\n });\n }\n });\n });\n });\n </script>\n </div>\n `\n}","import { HtmlEscapedString } from \"hono/utils/html\";\nimport { renderLogo } from \"../components/logo.template\";\n\nexport interface AdminLayoutData {\n title: string;\n pageTitle?: string;\n currentPath?: string;\n version?: string;\n enableExperimentalFeatures?: boolean;\n user?: {\n name: string;\n email: string;\n role: string;\n };\n scripts?: string[];\n styles?: string[];\n content: string | HtmlEscapedString;\n dynamicMenuItems?: Array<{\n label: string;\n path: string;\n icon: string;\n }>;\n}\n\nexport function renderAdminLayout(data: AdminLayoutData): string {\n // Import and use the new Catalyst layout\n const {\n renderAdminLayoutCatalyst,\n } = require(\"./admin-layout-catalyst.template\");\n return renderAdminLayoutCatalyst(data);\n}\n\nexport function adminLayoutV2(data: AdminLayoutData): string {\n return `<!DOCTYPE html>\n<html lang=\"en\" class=\"dark\">\n<head>\n <meta charset=\"UTF-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n <title>${data.title} - SonicJS AI Admin</title>\n <link rel=\"icon\" type=\"image/svg+xml\" href=\"/favicon.svg\">\n \n <!-- Tailwind CSS -->\n <script src=\"https://cdn.tailwindcss.com\"></script>\n <script>\n tailwind.config = {\n darkMode: 'class',\n theme: {\n extend: {\n backdropBlur: {\n xs: '2px',\n },\n colors: {\n primary: '#465FFF',\n secondary: '#212A3E',\n dark: '#1C1C24',\n 'dark-2': '#1A1A27',\n 'dark-3': '#2C2C54',\n 'dark-4': '#40407A',\n 'dark-5': '#706FD3',\n 'gray-1': '#F7F9FC',\n 'gray-2': '#E4E6EA',\n 'gray-3': '#D2D4D9',\n 'gray-4': '#9CA3AF',\n 'gray-5': '#6B7280',\n 'gray-6': '#4B5563',\n 'gray-7': '#374151',\n 'gray-8': '#1F2937',\n 'gray-9': '#111827',\n success: '#10B981',\n warning: '#F59E0B',\n error: '#EF4444',\n info: '#3B82F6'\n },\n fontFamily: {\n satoshi: ['Satoshi', 'sans-serif'],\n },\n spacing: {\n '4.5': '1.125rem',\n '5.5': '1.375rem',\n '6.5': '1.625rem',\n '7.5': '1.875rem'\n },\n boxShadow: {\n 'default': '0px 8px 13px -3px rgba(0, 0, 0, 0.07)',\n 'card': '0px 1px 3px rgba(0, 0, 0, 0.12)',\n 'card-2': '0px 1px 2px rgba(0, 0, 0, 0.05)',\n 'switcher': '0px 2px 4px rgba(0, 0, 0, 0.2), inset 0px 2px 2px #FFFFFF, inset 0px -1px 1px rgba(0, 0, 0, 0.1)',\n },\n dropShadow: {\n 1: '0px 1px 0px #E2E8F0',\n 2: '0px 1px 4px rgba(0, 0, 0, 0.12)',\n }\n }\n }\n }\n </script>\n \n <!-- Additional Styles -->\n <style>\n @import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');\n \n * {\n margin: 0;\n padding: 0;\n box-sizing: border-box;\n }\n \n body {\n font-family: 'Inter', system-ui, -apple-system, sans-serif;\n }\n \n /* Custom scrollbar */\n ::-webkit-scrollbar {\n width: 6px;\n }\n \n ::-webkit-scrollbar-track {\n background: #1F2937;\n }\n \n ::-webkit-scrollbar-thumb {\n background: #465FFF;\n border-radius: 3px;\n }\n \n ::-webkit-scrollbar-thumb:hover {\n background: #3B4EE8;\n }\n \n /* Sidebar animations */\n .sidebar-item {\n transition: all 0.3s ease;\n }\n \n .sidebar-item:hover {\n transform: translateX(4px);\n }\n \n /* Card animations */\n .card-hover {\n transition: all 0.3s ease;\n }\n \n .card-hover:hover {\n transform: translateY(-2px);\n box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);\n }\n \n /* Button gradients */\n .btn-gradient {\n background: linear-gradient(135deg, #465FFF 0%, #9333EA 100%);\n }\n \n .btn-gradient:hover {\n background: linear-gradient(135deg, #3B4EE8 0%, #7C2D12 100%);\n }\n \n /* Dark mode form elements */\n .form-input {\n background-color: #1F2937;\n border-color: #374151;\n color: #F9FAFB;\n }\n \n .form-input:focus {\n border-color: #465FFF;\n box-shadow: 0 0 0 3px rgba(70, 95, 255, 0.1);\n }\n \n /* Notification styles */\n .notification {\n -webkit-backdrop-filter: blur(15px);\n backdrop-filter: blur(15px);\n animation: slideInRight 0.3s ease-out;\n }\n \n @keyframes slideInRight {\n from {\n transform: translateX(100%);\n opacity: 0;\n }\n to {\n transform: translateX(0);\n opacity: 1;\n }\n }\n \n /* Custom slider styles */\n .slider::-webkit-slider-thumb {\n appearance: none;\n height: 16px;\n width: 16px;\n border-radius: 50%;\n background: #465FFF;\n cursor: pointer;\n border: 2px solid white;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);\n }\n \n .slider::-moz-range-thumb {\n height: 16px;\n width: 16px;\n border-radius: 50%;\n background: #465FFF;\n cursor: pointer;\n border: 2px solid white;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);\n }\n \n .slider::-webkit-slider-track {\n height: 8px;\n border-radius: 4px;\n background: rgba(255, 255, 255, 0.2);\n }\n \n .slider::-moz-range-track {\n height: 8px;\n border-radius: 4px;\n background: rgba(255, 255, 255, 0.2);\n border: none;\n }\n \n /* PNG Background Images */\n .svg-pattern-blue-waves {\n background-color: #111827;\n background-image: url('/images/backgrounds/blue-waves.png');\n background-size: cover;\n background-position: center;\n background-repeat: no-repeat;\n }\n \n .svg-pattern-blue-crescent {\n background-color: #111827;\n background-image: url('/images/backgrounds/blue-crescent.png');\n background-size: cover;\n background-position: center;\n background-repeat: no-repeat;\n }\n \n .svg-pattern-blue-stars {\n background-color: #111827;\n background-image: url('/images/backgrounds/blue-stars.png');\n background-size: cover;\n background-position: center;\n background-repeat: no-repeat;\n }\n \n .svg-pattern-blue-waves-3d {\n background-color: #111827;\n background-image: url('/images/backgrounds/blue-waves-3d.png');\n background-size: cover;\n background-position: center;\n background-repeat: no-repeat;\n }\n </style>\n \n <!-- Scripts -->\n <script src=\"https://unpkg.com/htmx.org@2.0.3\"></script>\n <script src=\"https://unpkg.com/alpinejs@3.x.x/dist/cdn.min.js\" defer></script>\n <script src=\"https://cdn.jsdelivr.net/npm/chart.js@4.4.0/dist/chart.umd.min.js\"></script>\n \n ${data.styles ? data.styles.map((style) => `<link rel=\"stylesheet\" href=\"${style}\">`).join(\"\\n \") : \"\"}\n ${data.scripts ? data.scripts.map((script) => `<script src=\"${script}\"></script>`).join(\"\\n \") : \"\"}\n</head>\n<body class=\"bg-gradient-to-br from-slate-900 via-gray-900 to-black min-h-screen text-gray-1\">\n <!-- Background overlay with glass effect -->\n <div id=\"background-overlay\" class=\"fixed inset-0 backdrop-blur-sm\" style=\"background-color: rgba(0, 0, 0, 0.2);\"></div>\n <!-- Main container -->\n <div class=\"relative z-10 min-h-screen\">\n <!-- Header -->\n ${renderTopBar(data.pageTitle || \"Dashboard\", data.user)}\n\n <!-- Main content area -->\n <div class=\"px-4 sm:px-6 lg:px-8 py-8\">\n <div class=\"grid grid-cols-1 lg:grid-cols-5 gap-6\">\n <!-- Sidebar -->\n <div class=\"lg:col-span-1\">\n ${renderSidebar(data.currentPath || \"/\", data.user, data.dynamicMenuItems)}\n </div>\n \n <!-- Main content -->\n <div class=\"lg:col-span-4\">\n ${data.content}\n </div>\n </div>\n </div>\n </div>\n \n <!-- Notification Container -->\n <div id=\"notification-container\" class=\"fixed top-4 right-4 z-50 space-y-2\"></div>\n \n <script>\n // Dark mode toggle functionality\n function toggleDarkMode() {\n document.documentElement.classList.toggle('dark');\n localStorage.setItem('darkMode', document.documentElement.classList.contains('dark'));\n }\n \n // Initialize dark mode from localStorage\n if (localStorage.getItem('darkMode') === 'true' || (!('darkMode' in localStorage) && window.matchMedia('(prefers-color-scheme: dark)').matches)) {\n document.documentElement.classList.add('dark');\n }\n \n // Sidebar toggle for mobile\n function toggleSidebar() {\n const sidebar = document.getElementById('sidebar');\n const overlay = document.getElementById('sidebar-overlay');\n sidebar.classList.toggle('-translate-x-full');\n overlay.classList.toggle('hidden');\n }\n \n // Close sidebar on overlay click\n function closeSidebar() {\n const sidebar = document.getElementById('sidebar');\n const overlay = document.getElementById('sidebar-overlay');\n sidebar.classList.add('-translate-x-full');\n overlay.classList.add('hidden');\n }\n \n // User dropdown toggle\n function toggleUserDropdown() {\n const dropdowns = document.querySelectorAll('.userDropdown');\n dropdowns.forEach(function(dropdown) {\n dropdown.classList.toggle('hidden');\n });\n }\n \n // Close dropdown when clicking outside\n document.addEventListener('click', function(event) {\n const dropdowns = document.querySelectorAll('.userDropdown');\n const button = event.target.closest('button');\n if (!button || !button.getAttribute('onclick')) {\n dropdowns.forEach(function(dropdown) {\n dropdown.classList.add('hidden');\n });\n }\n });\n \n // Show notification\n function showNotification(message, type = 'info') {\n const container = document.getElementById('notification-container');\n const notification = document.createElement('div');\n const colors = {\n success: 'bg-success text-white',\n error: 'bg-error text-white',\n warning: 'bg-warning text-white',\n info: 'bg-info text-white'\n };\n \n notification.className = \\`notification px-6 py-4 rounded-lg shadow-lg \\${colors[type] || colors.info} max-w-sm\\`;\n notification.innerHTML = \\`\n <div class=\"flex items-center justify-between\">\n <span>\\${message}</span>\n <button onclick=\"this.parentElement.parentElement.remove()\" class=\"ml-4 text-white/80 hover:text-white\">\n <svg class=\"w-4 h-4\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M6 18L18 6M6 6l12 12\"></path>\n </svg>\n </button>\n </div>\n \\`;\n \n container.appendChild(notification);\n \n // Auto remove after 5 seconds\n setTimeout(() => {\n if (notification.parentElement) {\n notification.remove();\n }\n }, 5000);\n }\n \n // Background customizer functionality\n function toggleBackgroundCustomizer() {\n const dropdown = document.getElementById('backgroundCustomizer');\n dropdown.classList.toggle('hidden');\n }\n \n // Background themes\n const backgroundThemes = {\n 'default': 'bg-gradient-to-br from-slate-900 via-gray-900 to-black',\n 'cosmic-blue': 'bg-gradient-to-br from-slate-900 via-blue-900 to-indigo-900',\n 'matrix-green': 'bg-gradient-to-br from-gray-900 via-emerald-900 to-green-900',\n 'cyber-pink': 'bg-gradient-to-br from-gray-900 via-pink-900 to-rose-900',\n 'neon-orange': 'bg-gradient-to-br from-gray-900 via-orange-900 to-amber-900',\n 'purple-space': 'bg-gradient-to-br from-gray-900 via-purple-900 to-violet-800',\n 'blue-waves': 'svg-pattern-blue-waves',\n 'blue-crescent': 'svg-pattern-blue-crescent',\n 'blue-stars': 'svg-pattern-blue-stars',\n 'blue-waves-3d': 'svg-pattern-blue-waves-3d'\n };\n \n // Set background theme\n function setBackground(theme) {\n const body = document.body;\n \n // Remove all existing background classes and SVG patterns\n Object.values(backgroundThemes).forEach(bgClass => {\n if (bgClass.startsWith('svg-pattern-')) {\n body.classList.remove(bgClass);\n } else {\n body.classList.remove(...bgClass.split(' ').slice(1)); // Remove 'bg-gradient-to-br' prefix\n }\n });\n body.classList.remove('bg-gradient-to-br');\n \n // Add new background\n const themeClass = backgroundThemes[theme];\n if (themeClass.startsWith('svg-pattern-')) {\n body.classList.add(themeClass);\n } else {\n const newClasses = themeClass.split(' ').slice(1); // Remove 'bg-gradient-to-br' prefix\n body.classList.add('bg-gradient-to-br', ...newClasses);\n }\n \n // Save preference\n localStorage.setItem('backgroundTheme', theme);\n \n // Close dropdown\n toggleBackgroundCustomizer();\n \n // Show notification\n showNotification('Background changed to ' + theme.replace('-', ' '), 'success');\n }\n \n // Adjust background darkness\n function adjustDarkness(value) {\n const overlay = document.getElementById('background-overlay');\n if (overlay) {\n const opacity = value / 100; // Convert percentage to decimal\n overlay.style.backgroundColor = 'rgba(0, 0, 0, ' + opacity + ')';\n localStorage.setItem('backgroundDarkness', value);\n console.log('Darkness adjusted to:', value + '%', 'Opacity:', opacity);\n } else {\n console.log('Overlay element not found');\n }\n }\n \n // Initialize background on page load\n function initializeBackground() {\n const savedTheme = localStorage.getItem('backgroundTheme') || 'default';\n const savedDarkness = localStorage.getItem('backgroundDarkness') || '20';\n \n // Set background theme\n if (savedTheme !== 'default') {\n const body = document.body;\n const themeClass = backgroundThemes[savedTheme];\n \n // Remove all existing backgrounds first\n Object.values(backgroundThemes).forEach(bgClass => {\n if (bgClass.startsWith('svg-pattern-')) {\n body.classList.remove(bgClass);\n } else {\n body.classList.remove(...bgClass.split(' ').slice(1));\n }\n });\n body.classList.remove('bg-gradient-to-br');\n \n // Apply saved theme\n if (themeClass.startsWith('svg-pattern-')) {\n body.classList.add(themeClass);\n } else {\n const newClasses = themeClass.split(' ').slice(1);\n body.classList.add('bg-gradient-to-br', ...newClasses);\n }\n }\n \n // Set darkness\n const overlay = document.getElementById('background-overlay');\n if (overlay) {\n const opacity = savedDarkness / 100;\n overlay.style.backgroundColor = 'rgba(0, 0, 0, ' + opacity + ')';\n }\n \n // Set slider value\n const slider = document.getElementById('darknessSlider');\n if (slider) {\n slider.value = savedDarkness;\n }\n }\n \n // Close dropdown when clicking outside\n document.addEventListener('click', function(event) {\n const dropdown = document.getElementById('backgroundCustomizer');\n const button = event.target.closest('button');\n const slider = event.target.closest('#darknessSlider');\n const dropdownContainer = event.target.closest('#backgroundCustomizer');\n \n // Don't close if clicking inside the dropdown, on the toggle button, or on the slider\n if (!button?.getAttribute('onclick')?.includes('toggleBackgroundCustomizer') && \n !slider && !dropdownContainer) {\n dropdown?.classList.add('hidden');\n }\n });\n \n // Initialize background when page loads\n document.addEventListener('DOMContentLoaded', initializeBackground);\n </script>\n</body>\n</html>`;\n}\n\nfunction renderSidebar(\n currentPath: string,\n user?: any,\n dynamicMenuItems?: Array<{\n label: string;\n path: string;\n icon: string;\n }>\n): string {\n const baseMenuItems = [\n {\n label: \"Content\",\n path: \"/admin/content\",\n icon: `<svg class=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 20 20\">\n <path d=\"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z\"/>\n </svg>`,\n },\n {\n label: \"Collections\",\n path: \"/admin/collections\",\n icon: `<svg class=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 20 20\">\n <path d=\"M13 6a3 3 0 11-6 0 3 3 0 016 0zM18 8a2 2 0 11-4 0 2 2 0 014 0zM14 15a4 4 0 00-8 0v3h8v-3z\"/>\n </svg>`,\n },\n {\n label: \"Media\",\n path: \"/admin/media\",\n icon: `<svg class=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 20 20\">\n <path fill-rule=\"evenodd\" d=\"M3 3a1 1 0 000 2v8a2 2 0 002 2h2.586l-1.293 1.293a1 1 0 101.414 1.414L10 15.414l2.293 2.293a1 1 0 001.414-1.414L12.414 15H15a2 2 0 002-2V5a1 1 0 100-2H3zm11.707 4.707a1 1 0 00-1.414-1.414L10 9.586 8.707 8.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z\" clip-rule=\"evenodd\"/>\n </svg>`,\n },\n {\n label: \"Users\",\n path: \"/admin/users\",\n icon: `<svg class=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 20 20\">\n <path d=\"M13 6a3 3 0 11-6 0 3 3 0 016 0zM18 8a2 2 0 11-4 0 2 2 0 014 0zM14 15a4 4 0 00-8 0v3h8v-3z\"/>\n </svg>`,\n },\n {\n label: \"Plugins\",\n path: \"/admin/plugins\",\n icon: `<svg class=\"w-5 h-5\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10\"/>\n </svg>`,\n },\n {\n label: \"Cache\",\n path: \"/admin/cache\",\n icon: `<svg class=\"w-5 h-5\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M13 10V3L4 14h7v7l9-11h-7z\"/>\n </svg>`,\n },\n {\n label: \"Logs\",\n path: \"/admin/logs\",\n icon: `<svg class=\"w-5 h-5\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z\"/>\n </svg>`,\n },\n {\n label: \"Settings\",\n path: \"/admin/settings\",\n icon: `<svg class=\"w-5 h-5\" fill=\"currentColor\" viewBox=\"0 0 20 20\">\n <path fill-rule=\"evenodd\" d=\"M11.49 3.17c-.38-1.56-2.6-1.56-2.98 0a1.532 1.532 0 01-2.286.948c-1.372-.836-2.942.734-2.106 2.106.54.886.061 2.042-.947 2.287-1.561.379-1.561 2.6 0 2.978a1.532 1.532 0 01.947 2.287c-.836 1.372.734 2.942 2.106 2.106a1.532 1.532 0 012.287.947c.379 1.561 2.6 1.561 2.978 0a1.533 1.533 0 012.287-.947c1.372.836 2.942-.734 2.106-2.106a1.533 1.533 0 01.947-2.287c1.561-.379 1.561-2.6 0-2.978a1.532 1.532 0 01-.947-2.287c.836-1.372-.734-2.942-2.106-2.106a1.532 1.532 0 01-2.287-.947zM10 13a3 3 0 100-6 3 3 0 000 6z\" clip-rule=\"evenodd\"/>\n </svg>`,\n },\n {\n label: \"API Reference\",\n path: \"/admin/api-reference\",\n icon: `<svg class=\"w-5 h-5\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M10 20l4-16m4 4l4 4-4 4M6 16l-4-4 4-4\"/>\n </svg>`,\n },\n {\n label: \"Field Types\",\n path: \"/admin/field-types\",\n icon: `<svg class=\"w-5 h-5\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M9 5H7a2 2 0 00-2 2v10a2 2 0 002 2h8a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"/>\n </svg>`,\n },\n {\n label: \"API Spec\",\n path: \"/api\",\n target: \"_blank\",\n icon: `<svg class=\"w-5 h-5\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z\"/>\n </svg>`,\n },\n ];\n\n // Combine base menu items with dynamic menu items from active plugins\n const allMenuItems = [...baseMenuItems];\n\n // Insert dynamic menu items after \"Users\"\n if (dynamicMenuItems && dynamicMenuItems.length > 0) {\n const usersIndex = allMenuItems.findIndex(\n (item) => item.path === \"/admin/users\"\n );\n if (usersIndex !== -1) {\n allMenuItems.splice(usersIndex + 1, 0, ...dynamicMenuItems);\n } else {\n // Fallback: add to end if Users not found\n allMenuItems.push(...dynamicMenuItems);\n }\n }\n\n return `\n <nav class=\"backdrop-blur-md bg-black/30 rounded-xl border border-white/10 shadow-xl p-6 h-[calc(100vh-9.5rem)] sticky top-8\">\n <div class=\"space-y-4\">\n ${allMenuItems\n .map((item) => {\n const isActive =\n currentPath === item.path ||\n (item.path !== \"/admin\" && currentPath.startsWith(item.path));\n const targetAttr = (item as any).target\n ? ` target=\"${(item as any).target}\"`\n : \"\";\n return `\n <a href=\"${item.path}\"${targetAttr} class=\"flex items-center space-x-3 ${isActive ? \"text-white bg-white/20\" : \"text-gray-300 hover:text-white\"} rounded-lg px-3 py-2 transition-all hover:bg-white/10\">\n ${item.icon}\n <span>${item.label}</span>\n </a>\n `;\n })\n .join(\"\")}\n </div>\n </nav>\n `;\n}\n\nfunction renderTopBar(pageTitle: string, user?: any): string {\n return `\n <header class=\"backdrop-blur-md bg-white/10 border-b border-white/20 shadow-lg relative z-[9998]\">\n <div class=\"px-4 sm:px-6 lg:px-8\">\n <div class=\"flex justify-between items-center py-4\">\n <div class=\"flex items-center space-x-4\">\n ${renderLogo({ size: \"md\", showText: true, variant: \"white\" })}\n </div>\n \n <div class=\"flex items-center space-x-4\">\n <!-- Notifications -->\n <button class=\"p-2 text-gray-300 hover:text-white transition-colors rounded-lg hover:bg-white/10 relative\">\n <svg class=\"w-5 h-5\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M15 17h5l-1.405-1.405A2.032 2.032 0 0118 14.158V11a6.002 6.002 0 00-4-5.659V5a2 2 0 10-4 0v.341C7.67 6.165 6 8.388 6 11v3.159c0 .538-.214 1.055-.595 1.436L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9\"/>\n </svg>\n <span class=\"absolute top-1 right-1 w-2 h-2 bg-red-400 rounded-full\"></span>\n </button>\n\n <!-- Background Customizer -->\n <div class=\"relative z-[9999]\">\n <button class=\"p-2 text-gray-300 hover:text-white transition-colors rounded-lg hover:bg-white/10\" onclick=\"toggleBackgroundCustomizer()\">\n <svg class=\"w-5 h-5\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4.098 19.902a3.75 3.75 0 0 0 5.304 0l6.401-6.402M6.75 21A3.75 3.75 0 0 1 3 17.25V4.125C3 3.504 3.504 3 4.125 3h5.25c.621 0 1.125.504 1.125 1.125v4.072M6.75 21a3.75 3.75 0 0 0 3.75-3.75V8.197M6.75 21h13.125c.621 0 1.125-.504 1.125-1.125v-5.25c0-.621-.504-1.125-1.125-1.125h-4.072M10.5 8.197l2.88-2.88c.438-.439 1.15-.439 1.59 0l3.712 3.713c.44.44.44 1.152 0 1.59l-2.879 2.88M6.75 17.25h.008v.008H6.75v-.008Z\" />\n </svg>\n </button>\n \n <!-- Background Customizer Dropdown -->\n <div id=\"backgroundCustomizer\" class=\"hidden absolute right-0 mt-2 w-80 backdrop-blur-md bg-black/95 rounded-xl border border-white/10 shadow-xl z-[9999]\">\n <div class=\"p-6\">\n <div class=\"flex items-center justify-between mb-4\">\n <h3 class=\"text-lg font-semibold text-white\">Background Themes</h3>\n <button onclick=\"toggleBackgroundCustomizer()\" class=\"text-gray-400 hover:text-white\">\n <svg class=\"w-5 h-5\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M6 18L18 6M6 6l12 12\"/>\n </svg>\n </button>\n </div>\n \n <!-- Background Options -->\n <div class=\"space-y-3 mb-6\">\n <div class=\"grid grid-cols-2 gap-3\">\n <!-- Default (Deep Space) -->\n <button onclick=\"setBackground('default')\" class=\"bg-preview bg-gradient-to-br from-slate-900 via-gray-900 to-black h-16 rounded-lg border-2 border-white/20 hover:border-white/40 transition-all relative group\">\n <div class=\"absolute inset-0 bg-black/20 rounded-lg\"></div>\n <div class=\"absolute bottom-1 left-2 text-xs text-white font-medium\">Default</div>\n </button>\n \n <!-- Cosmic Blue -->\n <button onclick=\"setBackground('cosmic-blue')\" class=\"bg-preview bg-gradient-to-br from-slate-900 via-blue-900 to-indigo-900 h-16 rounded-lg border-2 border-white/20 hover:border-white/40 transition-all relative group\">\n <div class=\"absolute inset-0 bg-black/20 rounded-lg\"></div>\n <div class=\"absolute bottom-1 left-2 text-xs text-white font-medium\">Cosmic</div>\n </button>\n \n <!-- Matrix Green -->\n <button onclick=\"setBackground('matrix-green')\" class=\"bg-preview bg-gradient-to-br from-gray-900 via-emerald-900 to-green-900 h-16 rounded-lg border-2 border-white/20 hover:border-white/40 transition-all relative group\">\n <div class=\"absolute inset-0 bg-black/20 rounded-lg\"></div>\n <div class=\"absolute bottom-1 left-2 text-xs text-white font-medium\">Matrix</div>\n </button>\n \n <!-- Cyber Pink -->\n <button onclick=\"setBackground('cyber-pink')\" class=\"bg-preview bg-gradient-to-br from-gray-900 via-pink-900 to-rose-900 h-16 rounded-lg border-2 border-white/20 hover:border-white/40 transition-all relative group\">\n <div class=\"absolute inset-0 bg-black/20 rounded-lg\"></div>\n <div class=\"absolute bottom-1 left-2 text-xs text-white font-medium\">Cyber</div>\n </button>\n \n <!-- Neon Orange -->\n <button onclick=\"setBackground('neon-orange')\" class=\"bg-preview bg-gradient-to-br from-gray-900 via-orange-900 to-amber-900 h-16 rounded-lg border-2 border-white/20 hover:border-white/40 transition-all relative group\">\n <div class=\"absolute inset-0 bg-black/20 rounded-lg\"></div>\n <div class=\"absolute bottom-1 left-2 text-xs text-white font-medium\">Neon</div>\n </button>\n \n <!-- Purple Space -->\n <button onclick=\"setBackground('purple-space')\" class=\"bg-preview bg-gradient-to-br from-gray-900 via-purple-900 to-violet-800 h-16 rounded-lg border-2 border-white/20 hover:border-white/40 transition-all relative group\">\n <div class=\"absolute inset-0 bg-black/20 rounded-lg\"></div>\n <div class=\"absolute bottom-1 left-2 text-xs text-white font-medium\">Purple</div>\n </button>\n </div>\n \n <!-- Custom Backgrounds -->\n <div class=\"mt-4\">\n <h4 class=\"text-sm font-medium text-gray-300 mb-3\">Custom Backgrounds</h4>\n <div class=\"grid grid-cols-2 gap-3\">\n <!-- Blue Waves -->\n <button onclick=\"setBackground('blue-waves')\" class=\"h-16 rounded-lg border-2 border-white/20 hover:border-white/40 transition-all relative group overflow-hidden\">\n <div class=\"absolute inset-0\">\n <img src=\"/images/backgrounds/blue-waves.png\" alt=\"Blue Waves\" class=\"w-full h-full object-cover opacity-60\">\n </div>\n <div class=\"absolute bottom-1 left-2 text-xs text-white font-medium bg-black/50 px-2 py-1 rounded\">Waves</div>\n </button>\n \n <!-- Blue Crescent -->\n <button onclick=\"setBackground('blue-crescent')\" class=\"h-16 rounded-lg border-2 border-white/20 hover:border-white/40 transition-all relative group overflow-hidden\">\n <div class=\"absolute inset-0\">\n <img src=\"/images/backgrounds/blue-crescent.png\" alt=\"Blue Crescent\" class=\"w-full h-full object-cover opacity-60\">\n </div>\n <div class=\"absolute bottom-1 left-2 text-xs text-white font-medium bg-black/50 px-2 py-1 rounded\">Crescent</div>\n </button>\n \n <!-- Blue Stars -->\n <button onclick=\"setBackground('blue-stars')\" class=\"h-16 rounded-lg border-2 border-white/20 hover:border-white/40 transition-all relative group overflow-hidden\">\n <div class=\"absolute inset-0\">\n <img src=\"/images/backgrounds/blue-stars.png\" alt=\"Blue Stars\" class=\"w-full h-full object-cover opacity-60\">\n </div>\n <div class=\"absolute bottom-1 left-2 text-xs text-white font-medium bg-black/50 px-2 py-1 rounded\">Stars</div>\n </button>\n \n <!-- Blue Waves 3D -->\n <button onclick=\"setBackground('blue-waves-3d')\" class=\"h-16 rounded-lg border-2 border-white/20 hover:border-white/40 transition-all relative group overflow-hidden\">\n <div class=\"absolute inset-0\">\n <img src=\"/images/backgrounds/blue-waves-3d.png\" alt=\"Blue Waves 3D\" class=\"w-full h-full object-cover opacity-60\">\n </div>\n <div class=\"absolute bottom-1 left-2 text-xs text-white font-medium bg-black/50 px-2 py-1 rounded\">3D Waves</div>\n </button>\n </div>\n </div>\n </div>\n \n <!-- Darkness Slider -->\n <div class=\"space-y-3\">\n <label class=\"block text-sm font-medium text-white\">Background Darkness</label>\n <div class=\"flex items-center space-x-3\">\n <svg class=\"w-4 h-4 text-gray-400\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M12 3v1m0 16v1m9-9h-1M4 12H3m15.364 6.364l-.707-.707M6.343 6.343l-.707-.707m12.728 0l-.707.707M6.343 17.657l-.707.707\"/>\n </svg>\n <input \n type=\"range\" \n id=\"darknessSlider\" \n min=\"10\" \n max=\"100\" \n value=\"20\" \n class=\"flex-1 h-2 bg-white/20 rounded-lg appearance-none cursor-pointer slider\"\n oninput=\"adjustDarkness(this.value)\"\n onchange=\"adjustDarkness(this.value)\"\n >\n <svg class=\"w-4 h-4 text-gray-400\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M20.354 15.354A9 9 0 018.646 3.646 9.003 9.003 0 0012 21a9.003 9.003 0 008.354-5.646z\"/>\n </svg>\n </div>\n <div class=\"text-xs text-gray-400 text-center\">Adjust overlay darkness</div>\n </div>\n </div>\n </div>\n </div>\n \n <!-- User Dropdown -->\n ${\n user\n ? `\n <div class=\"relative z-[9999]\">\n <button class=\"flex items-center space-x-3 p-2 rounded-lg hover:bg-white/10 transition-colors group\" onclick=\"toggleUserDropdown()\">\n <div class=\"w-8 h-8 bg-gradient-to-br from-green-400 to-blue-500 rounded-full flex items-center justify-center\">\n <span class=\"text-white text-sm font-medium\">${(user.name || user.email || \"U\").charAt(0).toUpperCase()}</span>\n </div>\n <div class=\"hidden md:block text-left\">\n <div class=\"text-white text-sm font-medium\">${user.name || user.email || \"User\"}</div>\n <div class=\"text-gray-400 text-xs\">${user.role || \"Administrator\"}</div>\n </div>\n <svg class=\"w-4 h-4 text-gray-400 group-hover:text-white transition-colors\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M19 9l-7 7-7-7\"/>\n </svg>\n </button>\n \n <!-- Dropdown Menu -->\n <div class=\"userDropdown hidden absolute right-0 mt-2 w-48 backdrop-blur-md bg-black/95 rounded-xl border border-white/10 shadow-xl z-[9999]\">\n <div class=\"py-2\">\n <div class=\"px-4 py-2 border-b border-white/10\">\n <p class=\"text-sm font-medium text-gray-1\">${user.name || user.email || \"User\"}</p>\n <p class=\"text-xs text-gray-4\">${user.email || \"\"}</p>\n </div>\n <a href=\"/admin/profile\" class=\"flex items-center gap-3 px-4 py-2 text-sm text-gray-300 hover:bg-white/10 hover:text-white transition-colors\">\n <svg class=\"w-4 h-4\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z\"/>\n </svg>\n My Profile\n </a>\n <a href=\"/auth/logout\" class=\"flex items-center gap-3 px-4 py-2 text-sm text-red-300 hover:bg-red-500/10 hover:text-red-200 transition-colors\">\n <svg class=\"w-4 h-4\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1\"/>\n </svg>\n Sign Out\n </a>\n </div>\n </div>\n </div>\n `\n : `\n <a href=\"/auth/login\" class=\"backdrop-blur-md bg-white/10 px-4 py-2 rounded-lg text-white font-medium hover:bg-white/20 transition-all\">\n Sign In\n </a>\n `\n }\n </div>\n </div>\n </header>\n `;\n}\n","import { renderAdminLayoutCatalyst, AdminLayoutCatalystData } from '../layouts/admin-layout-catalyst.template'\n\nexport interface CheckboxPageData {\n user?: {\n name: string\n email: string\n role: string\n }\n}\n\nexport function renderCheckboxPage(data: CheckboxPageData): string {\n const pageContent = `\n <div class=\"space-y-8\">\n <!-- Header -->\n <div class=\"sm:flex sm:items-center sm:justify-between\">\n <div>\n <h1 class=\"text-2xl/8 font-semibold text-zinc-950 dark:text-white sm:text-xl/8\">Catalyst Checkboxes</h1>\n <p class=\"mt-2 text-sm/6 text-zinc-500 dark:text-zinc-400\">\n Interactive examples using the official Catalyst checkbox component\n </p>\n </div>\n <div class=\"mt-4 sm:mt-0\">\n <a\n href=\"/admin\"\n class=\"inline-flex items-center gap-x-2 rounded-lg bg-white dark:bg-zinc-800 px-3.5 py-2.5 text-sm font-semibold text-zinc-950 dark:text-white hover:bg-zinc-50 dark:hover:bg-zinc-700 ring-1 ring-inset ring-zinc-950/10 dark:ring-white/10 transition-colors shadow-sm\"\n >\n <svg class=\"w-4 h-4\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M15 19l-7-7 7-7\"/>\n </svg>\n Back to Admin\n </a>\n </div>\n </div>\n\n <!-- Example 1: Discoverability -->\n <div class=\"rounded-xl bg-white dark:bg-zinc-900 shadow-sm ring-1 ring-zinc-950/5 dark:ring-white/10 p-8\">\n <h3 class=\"text-base/6 font-semibold text-zinc-950 dark:text-white mb-2\">Discoverability</h3>\n <p class=\"text-sm/6 text-zinc-500 dark:text-zinc-400 mb-6\">Decide where your events can be found across the web.</p>\n\n <fieldset>\n <legend class=\"sr-only\">Discoverability</legend>\n <div class=\"space-y-5\">\n <div class=\"flex gap-3\">\n <div class=\"flex h-6 shrink-0 items-center\">\n <div class=\"group grid size-4 grid-cols-1\">\n <input id=\"show_on_events_page\" type=\"checkbox\" name=\"discoverability\" checked aria-describedby=\"show-description\" class=\"col-start-1 row-start-1 appearance-none rounded border border-zinc-950/10 dark:border-white/10 bg-white dark:bg-white/5 checked:border-indigo-500 checked:bg-indigo-500 indeterminate:border-indigo-500 indeterminate:bg-indigo-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-500 disabled:border-zinc-950/5 dark:disabled:border-white/5 disabled:bg-zinc-950/10 dark:disabled:bg-white/10 disabled:checked:bg-zinc-950/10 dark:disabled:checked:bg-white/10 forced-colors:appearance-auto\" />\n <svg viewBox=\"0 0 14 14\" fill=\"none\" class=\"pointer-events-none col-start-1 row-start-1 size-3.5 self-center justify-self-center stroke-white dark:stroke-white group-has-[:disabled]:stroke-zinc-950/25 dark:group-has-[:disabled]:stroke-white/25\">\n <path d=\"M3 8L6 11L11 3.5\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" class=\"opacity-0 group-has-[:checked]:opacity-100\" />\n <path d=\"M3 7H11\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" class=\"opacity-0 group-has-[:indeterminate]:opacity-100\" />\n </svg>\n </div>\n </div>\n <div class=\"text-sm/6\">\n <label for=\"show_on_events_page\" class=\"font-medium text-zinc-950 dark:text-white\">Show on events page</label>\n <p id=\"show-description\" class=\"text-zinc-500 dark:text-zinc-400\">Make this event visible on your profile.</p>\n </div>\n </div>\n <div class=\"flex gap-3\">\n <div class=\"flex h-6 shrink-0 items-center\">\n <div class=\"group grid size-4 grid-cols-1\">\n <input id=\"allow_embedding\" type=\"checkbox\" name=\"discoverability\" aria-describedby=\"embedding-description\" class=\"col-start-1 row-start-1 appearance-none rounded border border-zinc-950/10 dark:border-white/10 bg-white dark:bg-white/5 checked:border-indigo-500 checked:bg-indigo-500 indeterminate:border-indigo-500 indeterminate:bg-indigo-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-500 disabled:border-zinc-950/5 dark:disabled:border-white/5 disabled:bg-zinc-950/10 dark:disabled:bg-white/10 disabled:checked:bg-zinc-950/10 dark:disabled:checked:bg-white/10 forced-colors:appearance-auto\" />\n <svg viewBox=\"0 0 14 14\" fill=\"none\" class=\"pointer-events-none col-start-1 row-start-1 size-3.5 self-center justify-self-center stroke-white dark:stroke-white group-has-[:disabled]:stroke-zinc-950/25 dark:group-has-[:disabled]:stroke-white/25\">\n <path d=\"M3 8L6 11L11 3.5\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" class=\"opacity-0 group-has-[:checked]:opacity-100\" />\n <path d=\"M3 7H11\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" class=\"opacity-0 group-has-[:indeterminate]:opacity-100\" />\n </svg>\n </div>\n </div>\n <div class=\"text-sm/6\">\n <label for=\"allow_embedding\" class=\"font-medium text-zinc-950 dark:text-white\">Allow embedding</label>\n <p id=\"embedding-description\" class=\"text-zinc-500 dark:text-zinc-400\">Allow others to embed your event details on their own site.</p>\n </div>\n </div>\n </div>\n </fieldset>\n </div>\n\n <!-- Example 2: Newsletter Preferences -->\n <div class=\"rounded-xl bg-white dark:bg-zinc-900 shadow-sm ring-1 ring-zinc-950/5 dark:ring-white/10 p-8\">\n <h3 class=\"text-base/6 font-semibold text-zinc-950 dark:text-white mb-2\">Newsletter Preferences</h3>\n <p class=\"text-sm/6 text-zinc-500 dark:text-zinc-400 mb-6\">Choose which updates you'd like to receive.</p>\n\n <fieldset>\n <legend class=\"sr-only\">Newsletter Preferences</legend>\n <div class=\"space-y-5\">\n <div class=\"flex gap-3\">\n <div class=\"flex h-6 shrink-0 items-center\">\n <div class=\"group grid size-4 grid-cols-1\">\n <input id=\"product_updates\" type=\"checkbox\" name=\"newsletter\" checked aria-describedby=\"product-description\" class=\"col-start-1 row-start-1 appearance-none rounded border border-zinc-950/10 dark:border-white/10 bg-white dark:bg-white/5 checked:border-indigo-500 checked:bg-indigo-500 indeterminate:border-indigo-500 indeterminate:bg-indigo-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-500 disabled:border-zinc-950/5 dark:disabled:border-white/5 disabled:bg-zinc-950/10 dark:disabled:bg-white/10 disabled:checked:bg-zinc-950/10 dark:disabled:checked:bg-white/10 forced-colors:appearance-auto\" />\n <svg viewBox=\"0 0 14 14\" fill=\"none\" class=\"pointer-events-none col-start-1 row-start-1 size-3.5 self-center justify-self-center stroke-white dark:stroke-white group-has-[:disabled]:stroke-zinc-950/25 dark:group-has-[:disabled]:stroke-white/25\">\n <path d=\"M3 8L6 11L11 3.5\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" class=\"opacity-0 group-has-[:checked]:opacity-100\" />\n <path d=\"M3 7H11\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" class=\"opacity-0 group-has-[:indeterminate]:opacity-100\" />\n </svg>\n </div>\n </div>\n <div class=\"text-sm/6\">\n <label for=\"product_updates\" class=\"font-medium text-zinc-950 dark:text-white\">Product Updates</label>\n <p id=\"product-description\" class=\"text-zinc-500 dark:text-zinc-400\">Get notified about new features and improvements.</p>\n </div>\n </div>\n <div class=\"flex gap-3\">\n <div class=\"flex h-6 shrink-0 items-center\">\n <div class=\"group grid size-4 grid-cols-1\">\n <input id=\"weekly_digest\" type=\"checkbox\" name=\"newsletter\" aria-describedby=\"weekly-description\" class=\"col-start-1 row-start-1 appearance-none rounded border border-zinc-950/10 dark:border-white/10 bg-white dark:bg-white/5 checked:border-indigo-500 checked:bg-indigo-500 indeterminate:border-indigo-500 indeterminate:bg-indigo-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-500 disabled:border-zinc-950/5 dark:disabled:border-white/5 disabled:bg-zinc-950/10 dark:disabled:bg-white/10 disabled:checked:bg-zinc-950/10 dark:disabled:checked:bg-white/10 forced-colors:appearance-auto\" />\n <svg viewBox=\"0 0 14 14\" fill=\"none\" class=\"pointer-events-none col-start-1 row-start-1 size-3.5 self-center justify-self-center stroke-white dark:stroke-white group-has-[:disabled]:stroke-zinc-950/25 dark:group-has-[:disabled]:stroke-white/25\">\n <path d=\"M3 8L6 11L11 3.5\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" class=\"opacity-0 group-has-[:checked]:opacity-100\" />\n <path d=\"M3 7H11\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" class=\"opacity-0 group-has-[:indeterminate]:opacity-100\" />\n </svg>\n </div>\n </div>\n <div class=\"text-sm/6\">\n <label for=\"weekly_digest\" class=\"font-medium text-zinc-950 dark:text-white\">Weekly Digest</label>\n <p id=\"weekly-description\" class=\"text-zinc-500 dark:text-zinc-400\">Receive a summary of activity every week.</p>\n </div>\n </div>\n <div class=\"flex gap-3\">\n <div class=\"flex h-6 shrink-0 items-center\">\n <div class=\"group grid size-4 grid-cols-1\">\n <input id=\"marketing\" type=\"checkbox\" name=\"newsletter\" aria-describedby=\"marketing-description\" class=\"col-start-1 row-start-1 appearance-none rounded border border-zinc-950/10 dark:border-white/10 bg-white dark:bg-white/5 checked:border-indigo-500 checked:bg-indigo-500 indeterminate:border-indigo-500 indeterminate:bg-indigo-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-500 disabled:border-zinc-950/5 dark:disabled:border-white/5 disabled:bg-zinc-950/10 dark:disabled:bg-white/10 disabled:checked:bg-zinc-950/10 dark:disabled:checked:bg-white/10 forced-colors:appearance-auto\" />\n <svg viewBox=\"0 0 14 14\" fill=\"none\" class=\"pointer-events-none col-start-1 row-start-1 size-3.5 self-center justify-self-center stroke-white dark:stroke-white group-has-[:disabled]:stroke-zinc-950/25 dark:group-has-[:disabled]:stroke-white/25\">\n <path d=\"M3 8L6 11L11 3.5\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" class=\"opacity-0 group-has-[:checked]:opacity-100\" />\n <path d=\"M3 7H11\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" class=\"opacity-0 group-has-[:indeterminate]:opacity-100\" />\n </svg>\n </div>\n </div>\n <div class=\"text-sm/6\">\n <label for=\"marketing\" class=\"font-medium text-zinc-950 dark:text-white\">Marketing Emails</label>\n <p id=\"marketing-description\" class=\"text-zinc-500 dark:text-zinc-400\">Special offers and promotional content.</p>\n </div>\n </div>\n </div>\n </fieldset>\n </div>\n\n <!-- Example 3: Privacy Settings -->\n <div class=\"rounded-xl bg-white dark:bg-zinc-900 shadow-sm ring-1 ring-zinc-950/5 dark:ring-white/10 p-8\">\n <h3 class=\"text-base/6 font-semibold text-zinc-950 dark:text-white mb-2\">Privacy Settings</h3>\n <p class=\"text-sm/6 text-zinc-500 dark:text-zinc-400 mb-6\">Control your privacy and data sharing preferences.</p>\n\n <fieldset>\n <legend class=\"sr-only\">Privacy Settings</legend>\n <div class=\"space-y-5\">\n <div class=\"flex gap-3\">\n <div class=\"flex h-6 shrink-0 items-center\">\n <div class=\"group grid size-4 grid-cols-1\">\n <input id=\"profile_public\" type=\"checkbox\" name=\"privacy\" checked aria-describedby=\"profile-description\" class=\"col-start-1 row-start-1 appearance-none rounded border border-zinc-950/10 dark:border-white/10 bg-white dark:bg-white/5 checked:border-indigo-500 checked:bg-indigo-500 indeterminate:border-indigo-500 indeterminate:bg-indigo-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-500 disabled:border-zinc-950/5 dark:disabled:border-white/5 disabled:bg-zinc-950/10 dark:disabled:bg-white/10 disabled:checked:bg-zinc-950/10 dark:disabled:checked:bg-white/10 forced-colors:appearance-auto\" />\n <svg viewBox=\"0 0 14 14\" fill=\"none\" class=\"pointer-events-none col-start-1 row-start-1 size-3.5 self-center justify-self-center stroke-white dark:stroke-white group-has-[:disabled]:stroke-zinc-950/25 dark:group-has-[:disabled]:stroke-white/25\">\n <path d=\"M3 8L6 11L11 3.5\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" class=\"opacity-0 group-has-[:checked]:opacity-100\" />\n <path d=\"M3 7H11\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" class=\"opacity-0 group-has-[:indeterminate]:opacity-100\" />\n </svg>\n </div>\n </div>\n <div class=\"text-sm/6\">\n <label for=\"profile_public\" class=\"font-medium text-zinc-950 dark:text-white\">Public Profile</label>\n <p id=\"profile-description\" class=\"text-zinc-500 dark:text-zinc-400\">Make your profile visible to other users.</p>\n </div>\n </div>\n <div class=\"flex gap-3\">\n <div class=\"flex h-6 shrink-0 items-center\">\n <div class=\"group grid size-4 grid-cols-1\">\n <input id=\"show_activity\" type=\"checkbox\" name=\"privacy\" checked aria-describedby=\"activity-description\" class=\"col-start-1 row-start-1 appearance-none rounded border border-zinc-950/10 dark:border-white/10 bg-white dark:bg-white/5 checked:border-indigo-500 checked:bg-indigo-500 indeterminate:border-indigo-500 indeterminate:bg-indigo-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-500 disabled:border-zinc-950/5 dark:disabled:border-white/5 disabled:bg-zinc-950/10 dark:disabled:bg-white/10 disabled:checked:bg-zinc-950/10 dark:disabled:checked:bg-white/10 forced-colors:appearance-auto\" />\n <svg viewBox=\"0 0 14 14\" fill=\"none\" class=\"pointer-events-none col-start-1 row-start-1 size-3.5 self-center justify-self-center stroke-white dark:stroke-white group-has-[:disabled]:stroke-zinc-950/25 dark:group-has-[:disabled]:stroke-white/25\">\n <path d=\"M3 8L6 11L11 3.5\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" class=\"opacity-0 group-has-[:checked]:opacity-100\" />\n <path d=\"M3 7H11\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" class=\"opacity-0 group-has-[:indeterminate]:opacity-100\" />\n </svg>\n </div>\n </div>\n <div class=\"text-sm/6\">\n <label for=\"show_activity\" class=\"font-medium text-zinc-950 dark:text-white\">Show Activity</label>\n <p id=\"activity-description\" class=\"text-zinc-500 dark:text-zinc-400\">Display your recent activity on your profile.</p>\n </div>\n </div>\n <div class=\"flex gap-3\">\n <div class=\"flex h-6 shrink-0 items-center\">\n <div class=\"group grid size-4 grid-cols-1\">\n <input id=\"analytics\" type=\"checkbox\" name=\"privacy\" aria-describedby=\"analytics-description\" class=\"col-start-1 row-start-1 appearance-none rounded border border-zinc-950/10 dark:border-white/10 bg-white dark:bg-white/5 checked:border-indigo-500 checked:bg-indigo-500 indeterminate:border-indigo-500 indeterminate:bg-indigo-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-500 disabled:border-zinc-950/5 dark:disabled:border-white/5 disabled:bg-zinc-950/10 dark:disabled:bg-white/10 disabled:checked:bg-zinc-950/10 dark:disabled:checked:bg-white/10 forced-colors:appearance-auto\" />\n <svg viewBox=\"0 0 14 14\" fill=\"none\" class=\"pointer-events-none col-start-1 row-start-1 size-3.5 self-center justify-self-center stroke-white dark:stroke-white group-has-[:disabled]:stroke-zinc-950/25 dark:group-has-[:disabled]:stroke-white/25\">\n <path d=\"M3 8L6 11L11 3.5\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" class=\"opacity-0 group-has-[:checked]:opacity-100\" />\n <path d=\"M3 7H11\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" class=\"opacity-0 group-has-[:indeterminate]:opacity-100\" />\n </svg>\n </div>\n </div>\n <div class=\"text-sm/6\">\n <label for=\"analytics\" class=\"font-medium text-zinc-950 dark:text-white\">Analytics</label>\n <p id=\"analytics-description\" class=\"text-zinc-500 dark:text-zinc-400\">Help us improve by sharing anonymous usage data.</p>\n </div>\n </div>\n </div>\n </fieldset>\n </div>\n </div>\n `\n\n const layoutData: AdminLayoutCatalystData = {\n title: 'Catalyst Checkboxes',\n pageTitle: 'Catalyst Checkboxes',\n currentPath: '/admin/checkboxes',\n user: data.user,\n content: pageContent\n }\n\n return renderAdminLayoutCatalyst(layoutData)\n}\n","export interface FormField {\n name: string\n label: string\n type: 'text' | 'email' | 'textarea' | 'select' | 'checkbox' | 'rich_text' | 'number' | 'date' | 'multi_select' | 'file'\n value?: any\n placeholder?: string\n required?: boolean\n readonly?: boolean\n helpText?: string\n options?: Array<{ value: string; label: string; selected?: boolean }>\n rows?: number\n className?: string\n validation?: {\n min?: number\n max?: number\n pattern?: string\n }\n}\n\nexport interface FormData {\n id?: string\n action?: string\n method?: string\n hxPost?: string\n hxPut?: string\n hxTarget?: string\n fields: FormField[]\n submitButtons: Array<{\n label: string\n type?: 'submit' | 'button'\n value?: string\n name?: string\n className?: string\n onclick?: string\n }>\n title?: string\n description?: string\n className?: string\n csrfToken?: string\n}\n\nexport function renderForm(data: FormData): string {\n return `\n <form \n ${data.id ? `id=\"${data.id}\"` : ''}\n ${data.hxPost ? `hx-post=\"${data.hxPost}\"` : data.hxPut ? `hx-put=\"${data.hxPut}\"` : data.action ? `action=\"${data.action}\"` : ''}\n ${data.hxTarget ? `hx-target=\"${data.hxTarget}\"` : ''}\n method=\"${data.method || 'POST'}\"\n class=\"${data.className || 'space-y-6'}\"\n ${data.fields.some(f => f.type === 'file') ? 'enctype=\"multipart/form-data\"' : ''}\n >\n ${data.csrfToken ? `<input type=\"hidden\" name=\"_csrf\" value=\"${data.csrfToken}\">` : ''}\n ${data.title ? `\n <div class=\"mb-6\">\n <h2 class=\"text-lg font-medium text-gray-1\">${data.title}</h2>\n ${data.description ? `<p class=\"mt-1 text-sm text-gray-4\">${data.description}</p>` : ''}\n </div>\n ` : ''}\n \n <div id=\"form-messages\"></div>\n \n ${data.fields.map(field => renderFormField(field)).join('')}\n \n <div class=\"flex justify-between items-center pt-6 border-t border-gray-7\">\n <div class=\"flex space-x-4\">\n ${data.submitButtons.map(button => `\n <button \n type=\"${button.type || 'submit'}\"\n ${button.name ? `name=\"${button.name}\"` : ''}\n ${button.value ? `value=\"${button.value}\"` : ''}\n ${button.onclick ? `onclick=\"${button.onclick}\"` : ''}\n class=\"btn ${button.className || 'btn-primary'}\"\n >\n ${button.label}\n </button>\n `).join('')}\n </div>\n </div>\n </form>\n `\n}\n\nexport function renderFormField(field: FormField): string {\n const fieldId = `field-${field.name}`\n const required = field.required ? 'required' : ''\n const readonly = field.readonly ? 'readonly' : ''\n const placeholder = field.placeholder ? `placeholder=\"${field.placeholder}\"` : ''\n\n let fieldHTML = ''\n\n switch (field.type) {\n case 'text':\n case 'email':\n case 'number':\n case 'date':\n fieldHTML = `\n <input\n type=\"${field.type === 'date' ? 'datetime-local' : field.type}\"\n id=\"${fieldId}\"\n name=\"${field.name}\"\n value=\"${field.value || ''}\"\n class=\"form-input ${field.className || ''}\"\n ${placeholder}\n ${required}\n ${readonly}\n ${field.validation?.min !== undefined ? `min=\"${field.validation.min}\"` : ''}\n ${field.validation?.max !== undefined ? `max=\"${field.validation.max}\"` : ''}\n ${field.validation?.pattern ? `pattern=\"${field.validation.pattern}\"` : ''}\n >\n `\n break\n \n case 'textarea':\n fieldHTML = `\n <textarea \n id=\"${fieldId}\"\n name=\"${field.name}\" \n class=\"form-textarea ${field.className || ''}\" \n rows=\"${field.rows || 4}\"\n ${placeholder}\n ${required}\n >${field.value || ''}</textarea>\n `\n break\n \n case 'rich_text':\n const uniqueId = `${field.name}-${Date.now()}`\n fieldHTML = `\n <div class=\"markdown-field\">\n <textarea id=\"${uniqueId}\" name=\"${field.name}\" class=\"form-textarea\" rows=\"8\">${field.value || ''}</textarea>\n <script>\n if (typeof EasyMDE !== 'undefined') {\n new EasyMDE({\n element: document.getElementById('${uniqueId}'),\n minHeight: '300px',\n spellChecker: false,\n status: ['autosave', 'lines', 'words', 'cursor'],\n autosave: {\n enabled: true,\n uniqueId: '${uniqueId}',\n delay: 1000\n },\n renderingConfig: {\n singleLineBreaks: false,\n codeSyntaxHighlighting: true\n }\n });\n }\n </script>\n </div>\n `\n break\n \n case 'select':\n fieldHTML = `\n <select \n id=\"${fieldId}\"\n name=\"${field.name}\" \n class=\"form-input ${field.className || ''}\" \n ${required}\n >\n ${field.options ? field.options.map(option => `\n <option value=\"${option.value}\" ${option.selected || field.value === option.value ? 'selected' : ''}>\n ${option.label}\n </option>\n `).join('') : ''}\n </select>\n `\n break\n \n case 'multi_select':\n fieldHTML = `\n <select \n id=\"${fieldId}\"\n name=\"${field.name}\" \n class=\"form-input ${field.className || ''}\" \n multiple \n ${required}\n >\n ${field.options ? field.options.map(option => `\n <option value=\"${option.value}\" ${option.selected ? 'selected' : ''}>\n ${option.label}\n </option>\n `).join('') : ''}\n </select>\n `\n break\n \n case 'checkbox':\n fieldHTML = `\n <input\n type=\"checkbox\"\n id=\"${fieldId}\"\n name=\"${field.name}\"\n value=\"1\"\n class=\"size-4 rounded border border-white/15 bg-white/5 checked:border-transparent checked:bg-white disabled:opacity-50 focus:outline-none focus:ring-2 focus:ring-white/20 focus:ring-offset-2 ${field.className || ''}\"\n ${field.value ? 'checked' : ''}\n ${required}\n >\n <label for=\"${fieldId}\" class=\"ml-2 text-sm text-white\">${field.label}</label>\n `\n break\n \n default:\n fieldHTML = `\n <input \n type=\"text\" \n id=\"${fieldId}\"\n name=\"${field.name}\" \n value=\"${field.value || ''}\"\n class=\"form-input ${field.className || ''}\" \n ${placeholder} \n ${required}\n >\n `\n break\n }\n \n // For checkbox, we handle the label differently\n if (field.type === 'checkbox') {\n return `\n <div class=\"form-group\">\n <div class=\"flex items-center\">\n ${fieldHTML}\n </div>\n ${field.helpText ? `<p class=\"text-sm text-zinc-500 dark:text-zinc-400 mt-1 ml-6\">${field.helpText}</p>` : ''}\n </div>\n `\n }\n\n return `\n <div class=\"form-group\">\n <label for=\"${fieldId}\" class=\"form-label\">\n ${field.label}${field.required ? ' *' : ''}\n </label>\n ${fieldHTML}\n ${field.helpText ? `<p class=\"text-sm text-zinc-500 dark:text-zinc-400 mt-1\">${field.helpText}</p>` : ''}\n </div>\n `\n}"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/plugins/singletons/service-singleton.ts","../src/plugins/capabilities.ts","../src/plugins/sdk/define-plugin.ts","../src/plugins/sdk/config-schema.ts","../src/services/plugin-menu-singleton.ts","../src/services/plugin-definition-registry.ts"],"names":["createTypedHooks","getCoreVersion","escapeHtml"],"mappings":";;;;;;;AAiCO,SAAS,uBAA0B,KAAA,EAAoC;AAC5E,EAAA,IAAI,OAAA;AACJ,EAAA,OAAO;AAAA,IACL,IAAI,QAAA,EAAa;AACf,MAAA,OAAA,GAAU,QAAA;AAAA,IACZ,CAAA;AAAA,IACA,GAAA,GAAS;AACP,MAAA,IAAI,YAAY,MAAA,EAAW;AACzB,QAAA,MAAM,IAAI,KAAA;AAAA,UACR,GAAG,KAAK,CAAA,mHAAA;AAAA,SACV;AAAA,MACF;AACA,MAAA,OAAO,OAAA;AAAA,IACT,CAAA;AAAA,IACA,GAAA,GAAe;AACb,MAAA,OAAO,OAAA,KAAY,MAAA;AAAA,IACrB,CAAA;AAAA,IACA,KAAA,GAAQ;AACN,MAAA,OAAA,GAAU,MAAA;AAAA,IACZ;AAAA,GACF;AACF;;;AC7BO,IAAM,kBAAA,GAAqB;AAAA,EAChC,YAAA;AAAA,EACA,YAAA;AAAA,EACA,aAAA;AAAA,EACA,YAAA;AAAA,EACA,aAAA;AAAA,EACA,YAAA;AAAA,EACA,eAAA;AAAA,EACA,YAAA;AAAA,EACA,sBAAA;AAAA,EACA,yBAAA;AAAA;AAAA;AAAA;AAAA,EAIA;AACF;AAUA,IAAM,gBAAA,GAAmB,6BAAA;AAGlB,SAAS,kBAAkB,IAAA,EAAkC;AAClE,EAAA,OAAQ,mBAAyC,QAAA,CAAS,IAAI,CAAA,IAAK,gBAAA,CAAiB,KAAK,IAAI,CAAA;AAC/F;AA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,GAAA,CAAI,CAAC,CAAC,CAAA;AAAA,EACnD,CAAC,CAAA,CACA,KAAA,EAAM,CACN,IAAA,CAAK,CAAC,CAAA,EAAG,CAAA,KAAA,CAAO,CAAA,CAAE,KAAA,IAAS,QAAQ,CAAA,CAAE,KAAA,IAAS,IAAI,CAAA,CAClD,GAAA,CAAI,CAAC,CAAA,MAAO;AAAA,IACX,OAAO,CAAA,CAAE,KAAA;AAAA,IACT,MAAM,CAAA,CAAE,IAAA;AAAA,IACR,IAAA,EAAM,WAAA,CAAY,CAAA,CAAE,IAAI,CAAA;AAAA,IACxB,KAAA,EAAO,EAAE,KAAA,IAAS;AAAA,GACpB,CAAE,CAAA;AACN;;;AC/FA,IAAI,QAAA,uBAAwD,GAAA,EAAI;AAEzD,SAAS,qBAAqB,OAAA,EAAkD;AACrF,EAAA,MAAM,IAAA,uBAAW,GAAA,EAAgC;AACjD,EAAA,KAAA,MAAW,KAAK,OAAA,EAAS,IAAA,CAAK,GAAA,CAAI,CAAA,CAAE,IAAI,CAAC,CAAA;AACzC,EAAA,QAAA,GAAW,IAAA;AACb;AAEO,SAAS,oBAAoB,EAAA,EAA4C;AAC9E,EAAA,OAAO,QAAA,CAAS,IAAI,EAAE,CAAA;AACxB","file":"chunk-BP52BFIV.cjs","sourcesContent":["/**\n * Generic service-singleton factory\n *\n * Generalizes the hook-system-singleton pattern: a process-wide slot for a\n * service that code outside the HTTP request context — most importantly cron /\n * `scheduled()` handlers, which have no per-request `c.env` — can reach without\n * threading it through every call.\n *\n * Contract (same as the hook-system singleton):\n * - `get()` throws if read before `set()` (throw-before-get) so wiring-order\n * bugs surface loudly rather than silently no-oping.\n * - `set()` is idempotent (last write wins) so constructing multiple apps in one\n * process (e.g. across tests) never throws.\n * - `reset()` clears the slot for test isolation.\n */\n\nexport interface ServiceSingleton<T> {\n /** Set the process-wide instance. Last write wins. */\n set(instance: T): void\n /** Get the instance; throws if not yet set. */\n get(): T\n /** True if an instance has been set. */\n has(): boolean\n /** Clear the slot (test isolation). */\n reset(): void\n}\n\n/**\n * Create a service singleton.\n *\n * @param label Human-readable name used in the throw-before-get error message\n * (e.g. `'EmailService'`).\n */\nexport function createServiceSingleton<T>(label: string): ServiceSingleton<T> {\n let current: T | undefined\n return {\n set(instance: T) {\n current = instance\n },\n get(): T {\n if (current === undefined) {\n throw new Error(\n `${label} has not been initialized. Its setter must be called (the app factory does this at construction) before reading it.`\n )\n }\n return current\n },\n has(): boolean {\n return current !== undefined\n },\n reset() {\n current = undefined\n },\n }\n}\n","/**\n * Plugin capabilities\n *\n * A plugin declares the capabilities it needs (`capabilities: ['email:send']`).\n * The host then hands it a context whose powerful accessors are *gated* by those\n * declarations: reaching `ctx.email` without having declared `email:send` throws\n * `SonicCapabilityError` immediately, instead of failing deep inside a send.\n *\n * This is the isolation boundary that Strapi (namespacing only) and Payload (full\n * config access) don't have: capabilities make a plugin's blast radius explicit\n * and enforceable, and double as documentation of what a plugin can touch.\n *\n * Phase 1 vocabulary. Payment/queue/scheduled-fetch capabilities are intentionally\n * deferred to Phase 2 (see the overhaul plan §8.4 / open question 2).\n */\n\n// Type-only import (no runtime coupling) so a const-narrowed `ctx.cap.email`\n// resolves to the real EmailService type instead of `unknown`.\nimport type { EmailService } from '../services/email/email-service'\nimport type { HookEventName } from './hooks/catalog'\n\n/**\n * Fixed capability names. `db:<table>` is parameterized (a plugin owns specific\n * tables), so it is matched by pattern rather than listed here.\n */\nexport const FIXED_CAPABILITIES = [\n 'email:send',\n 'cache:read',\n 'cache:write',\n 'media:read',\n 'media:write',\n 'http:fetch',\n 'cron:register',\n 'admin:menu',\n 'hooks.auth:subscribe',\n 'hooks.content:subscribe',\n // Reserved: gates subscription to the email event family once those events are\n // dispatched. Declared now so the canonical vocabulary is stable and the\n // Infowall rename target resolves.\n 'hooks.email:subscribe',\n] as const\n\nexport type FixedCapability = (typeof FIXED_CAPABILITIES)[number]\n\n/** A scoped database capability, e.g. `db:email_log`. */\nexport type DbCapability = `db:${string}`\n\n/** Any declarable capability. */\nexport type Capability = FixedCapability | DbCapability\n\nconst DB_CAPABILITY_RE = /^db:[a-zA-Z_][a-zA-Z0-9_]*$/\n\n/** True if `name` is a recognized capability (fixed name or a valid `db:<table>`). */\nexport function isKnownCapability(name: string): name is Capability {\n return (FIXED_CAPABILITIES as readonly string[]).includes(name) || DB_CAPABILITY_RE.test(name)\n}\n\n/**\n * Thrown when a plugin uses a capability it did not declare.\n */\nexport class SonicCapabilityError extends Error {\n readonly capability: string\n readonly plugin?: string\n /** The API surface the plugin tried to access (e.g. 'ctx.cap.email'). Optional. */\n readonly accessedApi?: string\n constructor(capability: string, plugin?: string, accessedApi?: string) {\n super(\n `${plugin ? `Plugin \"${plugin}\"` : 'Plugin'} used capability \"${capability}\" without declaring it. ` +\n `Add \"${capability}\" to the plugin's capabilities.`\n )\n this.name = 'SonicCapabilityError'\n this.capability = capability\n this.plugin = plugin\n this.accessedApi = accessedApi\n }\n}\n\n/** True if `capability` is in the granted set. */\nexport function hasCapability(granted: readonly string[], capability: string): boolean {\n return granted.includes(capability)\n}\n\n/**\n * Assert a capability is granted, throwing {@link SonicCapabilityError} otherwise.\n */\nexport function assertCapability(granted: readonly string[], capability: string, plugin?: string): void {\n if (!hasCapability(granted, capability)) {\n throw new SonicCapabilityError(capability, plugin)\n }\n}\n\n/**\n * Validate a plugin's declared capability list. Returns the unknown entries (empty\n * array = all valid). Callers decide whether to warn or hard-fail.\n *\n * Apply {@link normalizeCapabilities} first if the input may contain deprecated\n * spellings (e.g. from an older SDK or a sibling fork's manifest).\n */\nexport function validateCapabilities(declared: readonly string[]): string[] {\n return declared.filter((c) => !isKnownCapability(c))\n}\n\n// ── Capability rename / normalization (cross-version & cross-fork portability) ─\n//\n// Lets a plugin authored against a different/older SDK spelling load against the\n// canonical vocabulary without code changes. The map is deprecated→canonical; it\n// is applied before the known-capability check. Seeded with the sibling fork's\n// (Infowall) spellings so plugins built there are portable here.\n\nexport const CAPABILITY_RENAMES = {\n // storage:* → media:* (this fork scopes the media library as `media`)\n 'storage:read': 'media:read',\n 'storage:write': 'media:write',\n // cron is a direct registration, not a hook subscription, here\n 'hooks.cron:register': 'cron:register',\n // `:register` → `:subscribe` verb; content read/write granularity lives in the\n // event name (before/after), so both collapse to one subscription capability\n 'hooks.auth:register': 'hooks.auth:subscribe',\n 'hooks.content-read:register': 'hooks.content:subscribe',\n 'hooks.content-write:register': 'hooks.content:subscribe',\n 'hooks.email-events:register': 'hooks.email:subscribe',\n // NOTE: Infowall's `request:intercept` has no canonical target — there is no\n // middleware-insertion surface to gate yet, so it is intentionally absent\n // (a plugin declaring it will surface as unknown rather than silently no-op).\n} as const satisfies Record<string, Capability>\n\n/**\n * Resolve a (possibly deprecated) capability string to its canonical form, or\n * `null` if it is unknown after rename resolution. Renames apply first, then the\n * result is checked against the known vocabulary.\n */\nexport function normalizeCapability(input: string): Capability | null {\n const renamed: string = (CAPABILITY_RENAMES as Record<string, Capability>)[input] ?? input\n return isKnownCapability(renamed) ? (renamed as Capability) : null\n}\n\n/**\n * Normalize a list of capability strings. Returns the canonical capabilities plus\n * the inputs that remained unknown after rename resolution, so the caller can warn\n * (production) or reject (strict).\n */\nexport function normalizeCapabilities(declared: readonly string[]): {\n capabilities: Capability[]\n unknown: string[]\n} {\n const capabilities: Capability[] = []\n const unknown: string[] = []\n for (const raw of declared) {\n const canonical = normalizeCapability(raw)\n if (canonical) {\n if (!capabilities.includes(canonical)) capabilities.push(canonical)\n } else {\n unknown.push(raw)\n }\n }\n return { capabilities, unknown }\n}\n\n// ── Capability-gated context ─────────────────────────────────────────────────\n\n/** Provider factories for capability-backed accessors. Each is called lazily. */\nexport interface CapabilityProviders {\n email?: () => EmailService\n cache?: () => unknown\n http?: () => typeof fetch\n}\n\n// ── Type-level capability narrowing ──────────────────────────────────────────\ndeclare const CAP_NOT_DECLARED: unique symbol\n/**\n * The type of a capability accessor the plugin did NOT declare. Deliberately a\n * branded type (not `never`, which is assignable to everything): using it where a\n * service is expected is a compile error, so `ctx.cap.email` without `email:send`\n * fails to type-check instead of silently passing.\n */\nexport type CapabilityNotDeclared<C extends string = string> = {\n readonly [CAP_NOT_DECLARED]: C\n}\n\n// `T` if the declared tuple `Caps` contains `C`, else the branded not-declared type.\ntype WhenGranted<Caps extends readonly Capability[], C extends string, T> =\n C extends Caps[number] ? T : CapabilityNotDeclared<C>\n// `T` if `Caps` contains ANY of the union `C`, else the branded not-declared type.\ntype WhenGrantedAny<Caps extends readonly Capability[], C extends string, T> =\n Extract<Caps[number], C> extends never ? CapabilityNotDeclared<C> : T\n\n/**\n * The gated context handed to a plugin. Accessors throw at runtime unless the\n * backing capability was declared; with a const-narrowed `Caps` tuple they are\n * also *typed* to the service (or `never`) at compile time, so `ctx.cap.email`\n * is `EmailService` only when `'email:send'` was declared.\n */\nexport interface CapabilityContext<Caps extends readonly Capability[] = readonly Capability[]> {\n /** The capabilities granted to this plugin. */\n readonly capabilities: readonly string[]\n /** True if the plugin declared `capability`. */\n has(capability: string): boolean\n /** Throw {@link SonicCapabilityError} unless `capability` was declared. */\n require(capability: string): void\n /** Email service. `EmailService` when `email:send` is declared, else `never`. */\n readonly email: WhenGranted<Caps, 'email:send', EmailService>\n /** Cache service. Present when `cache:read` or `cache:write` is declared. */\n readonly cache: WhenGrantedAny<Caps, 'cache:read' | 'cache:write', unknown>\n /** Outbound fetch. Present when `http:fetch` is declared. */\n readonly http: WhenGranted<Caps, 'http:fetch', typeof fetch>\n}\n\n/** The un-narrowed gated context (every accessor typed as its service). */\nexport type PluginCapabilityContext = CapabilityContext</** all */ readonly Capability[]>\n\n\n/**\n * Build a capability-gated context.\n *\n * Accessors are lazy getters: they check the grant (and that a provider was\n * supplied) at access time, so merely constructing the context is cheap and\n * holding a reference to a capability you never use costs nothing.\n *\n * @param granted Capabilities the plugin declared.\n * @param providers Backing service factories (only the granted ones get called).\n * @param plugin Plugin name, for clearer errors.\n */\nexport function createCapabilityContext<const Caps extends readonly Capability[]>(\n granted: Caps,\n providers: CapabilityProviders = {},\n plugin?: string\n): CapabilityContext<Caps> {\n // `any` so the lazy getters satisfy the narrowed accessor types (the provider\n // returns the real service at runtime; gating is enforced dynamically below).\n const gate = (capability: string, anyOf: string[], provider: (() => unknown) | undefined): any => {\n const ok = anyOf.some((c) => hasCapability(granted, c))\n if (!ok) throw new SonicCapabilityError(capability, plugin)\n if (!provider) {\n throw new Error(\n `Capability \"${capability}\" is declared by ${plugin ?? 'the plugin'} but no provider was supplied by the host.`\n )\n }\n return provider()\n }\n\n const ctx: CapabilityContext<Caps> = {\n capabilities: [...granted],\n has: (capability) => hasCapability(granted, capability),\n require: (capability) => assertCapability(granted, capability, plugin),\n get email() {\n return gate('email:send', ['email:send'], providers.email)\n },\n get cache() {\n return gate('cache:read', ['cache:read', 'cache:write'], providers.cache)\n },\n get http() {\n return gate('http:fetch', ['http:fetch'], providers.http)\n },\n }\n return ctx\n}\n\n// ── Hook-subscription capability map ────────────────────────────────────────\n//\n// Maps each catalog event to the capability a plugin must declare in order to\n// subscribe to it. Used by the wire phase (Phase A) to gate declarative hook\n// registrations. Plugins that don't declare the required capability have the\n// offending hook skipped (warn in prod, error in strict).\n\nexport const HOOK_CAPABILITY_MAP: Record<HookEventName, Capability> = {\n 'content:read': 'hooks.content:subscribe',\n 'content:before:create': 'hooks.content:subscribe',\n 'content:before:update': 'hooks.content:subscribe',\n 'content:before:delete': 'hooks.content:subscribe',\n 'content:after:create': 'hooks.content:subscribe',\n 'content:after:update': 'hooks.content:subscribe',\n 'content:after:delete': 'hooks.content:subscribe',\n 'content:after:publish': 'hooks.content:subscribe',\n 'auth:registration:completed': 'hooks.auth:subscribe',\n 'auth:password-reset:requested': 'hooks.auth:subscribe',\n 'auth:password-reset:completed': 'hooks.auth:subscribe',\n 'auth:magic-link:consumed': 'hooks.auth:subscribe',\n 'auth:otp:verified': 'hooks.auth:subscribe',\n}\n","/**\n * definePlugin() — the v3 plugin authoring entry point\n *\n * A plugin is authored as a single typed declaration and consumed, unchanged, by\n * every part of the runtime:\n *\n * export const emailPlugin = definePlugin({\n * id: 'email',\n * version: '3.0.0',\n * capabilities: ['email:send', 'hooks.auth:subscribe', 'cron:register'],\n * register(app) { app.route('/admin/plugins/email', emailRoutes) }, // SYNC\n * async onBoot(ctx) { // ASYNC\n * ctx.hooks.on('auth:registration:completed', (p) => { ... }) // typed\n * ctx.cap.email // gated\n * },\n * crons: [{ schedule: '*\\/15 * * * *', hookFamily: 'email-reconciliation' }],\n * async onCronTick(event, ctx) { ... },\n * })\n *\n * The object it returns satisfies the structural contracts the runtime already\n * uses — `MountablePlugin` (mount.ts), `WirablePlugin` (wire.ts), `CronablePlugin`\n * (cron.ts) — plus the legacy `Plugin` metadata fields the admin/registry read.\n * No adapters: a defined plugin drops straight into `plugins.register` or the core\n * plugin list.\n *\n * The value definePlugin adds over a hand-written object is the enriched context:\n * inside `onBoot`/`onCronTick` the author gets a *typed* hook facade (`ctx.hooks`)\n * and the *capability-gated* service context (`ctx.cap`), instead of the raw\n * string-keyed hook system. See the two-phase boot contract: `register` is\n * synchronous (routes only); everything env-dependent lives in `onBoot`.\n */\n\nimport type { Hono } from 'hono'\nimport type { Capability } from '../capabilities'\nimport {\n createCapabilityContext,\n normalizeCapabilities,\n type CapabilityProviders,\n type CapabilityContext,\n} from '../capabilities'\nimport { createTypedHooks, type TypedHooks, type TypedHookHandler } from '../hooks/typed-hooks'\nimport type { HookEventName } from '../hooks/catalog'\nimport type { PluginBootContext, WirableHook } from '../wire'\nimport type { CronContext, CronDeclaration, CronTickEvent } from '../cron'\nimport type { MountableRoute } from '../mount'\nimport { getCoreVersion } from '../../utils/version'\nimport type { ConfigSchema } from './config-schema'\nimport type { PluginMenuEntry } from '../../services/plugin-menu-singleton'\n\n// ── Minimal semver helpers (no external dep — Workers are bundle-size constrained) ─\n\n/** True if `v` is a valid semver string (X.Y.Z with optional pre-release). */\nfunction isSemver(v: string): boolean {\n return /^\\d+\\.\\d+\\.\\d+(-[\\w.]+)?(\\+[\\w.]+)?$/.test(v.trim())\n}\n\n/**\n * Very lightweight semver range satisfier. Handles the most common range forms:\n * exact (`1.2.3`), caret (`^1.2.3` = compatible major), tilde (`~1.2.3` = compatible\n * minor), comparators (`>=1.0.0`, `>1`, `<2.0.0`), and space-separated AND chains.\n * Not a full semver implementation — use the `semver` npm package if you need\n * full range syntax in a non-Workers environment.\n */\nfunction semverSatisfies(version: string, range: string): boolean {\n try {\n const [major, minor, patch] = version.trim().split('-')[0]!.split('.').map(Number)\n const v = major! * 1_000_000 + (minor ?? 0) * 1_000 + (patch ?? 0)\n\n const toInt = (s: string) => {\n const [a, b, c] = s.split('.').map(Number)\n return a! * 1_000_000 + (b ?? 0) * 1_000 + (c ?? 0)\n }\n\n // AND chain: all clauses must pass.\n return range\n .trim()\n .split(/\\s+(?=[><=^~])|\\s+(?=\\d)/)\n .filter(Boolean)\n .every((clause) => {\n const c = clause.trim()\n if (c.startsWith('^')) {\n const base = toInt(c.slice(1))\n const nextMajor = Math.floor(base / 1_000_000 + 1) * 1_000_000\n return v >= base && v < nextMajor\n }\n if (c.startsWith('~')) {\n const base = toInt(c.slice(1))\n const nextMinor = Math.floor(base / 1_000 + 1) * 1_000\n return v >= base && v < nextMinor\n }\n if (c.startsWith('>=')) return v >= toInt(c.slice(2))\n if (c.startsWith('<=')) return v <= toInt(c.slice(2))\n if (c.startsWith('>')) return v > toInt(c.slice(1))\n if (c.startsWith('<')) return v < toInt(c.slice(1))\n return v === toInt(c) // exact\n })\n } catch {\n return true // fail open — don't block a plugin on a parse error\n }\n}\n\n/**\n * Declarative typed hook subscriptions: a map of canonical event name → handler,\n * each narrowed to that event's payload. Flattened into the plugin's `hooks[]`\n * and subscribed during the wire phase. Use `onBoot`'s `ctx.hooks.on()` instead\n * for dynamic/conditional subscriptions.\n */\nexport type DeclarativeHooks = {\n [E in HookEventName]?: TypedHookHandler<E>\n}\n\n/**\n * Context handed to a defined plugin's `onBoot` / `onCronTick`.\n *\n * Enriches the raw boot/cron context with a typed hook facade and the gated\n * capability context, while keeping `raw` and `env` available as an escape hatch.\n */\nexport interface DefinedPluginContext<Caps extends readonly Capability[] = readonly Capability[]> {\n /** Typed hook facade — `ctx.hooks.on('auth:registration:completed', …)`. */\n hooks: TypedHooks\n /**\n * Capability-gated services. With a const-narrowed `Caps`, `ctx.cap.email` is\n * typed `EmailService` only when `'email:send'` was declared (else `never`),\n * and throws `SonicCapabilityError` at runtime if accessed undeclared.\n */\n cap: CapabilityContext<Caps>\n /** Runtime bindings, when available (absent during construction). */\n env?: Record<string, unknown>\n /** The unwrapped context the runtime passed. */\n raw: PluginBootContext | CronContext\n}\n\n/** Input to {@link definePlugin}. */\nexport interface DefinePluginInput<Caps extends readonly Capability[] = readonly []> {\n /** Unique, stable plugin id (kebab-case). Becomes the plugin `name`. */\n id: string\n /** Human-readable display name. Defaults to `id`. */\n name?: string\n /**\n * Semantic version of this plugin (e.g. `'1.2.3'`). Must be a valid semver\n * string — invalid values emit a console.warn at definition time.\n */\n version: string\n /**\n * A semver range expressing which SonicJS core versions this plugin supports\n * (e.g. `'^3.0.0'` or `'>=3.1.0 <4.0.0'`). Checked against the running\n * core version at registration; a mismatch logs a compatibility warning but\n * does not block activation (plugins remain resilient by default).\n */\n sonicjsVersionRange?: string\n description?: string\n author?: { name: string; email?: string; url?: string }\n /** Other plugin ids this one needs (load-order / activation). */\n dependencies?: string[]\n /**\n * Capabilities this plugin declares. The gated `ctx.cap` accessors throw for\n * anything not listed here. Pass as a literal (`['email:send'] as const` is not\n * needed — the `const` type param infers the tuple) to get `ctx.cap` narrowed.\n * Unknown/deprecated names are normalized then warned about at definition.\n */\n capabilities?: Caps\n\n // ── Synchronous registration (routes only) ──\n /** Declarative routes (mounted before the /admin catch-all). */\n routes?: MountableRoute[]\n /**\n * Imperative route registration. MUST be synchronous (Hono's router locks after\n * the first request). Async work belongs in `onBoot`.\n */\n register?: (app: Hono) => void\n\n // ── Asynchronous wiring ──\n /**\n * Declarative typed hook subscriptions (`{ 'content:after:create': (p) => … }`).\n * Subscribed during the wire phase; each handler is narrowed to its event payload.\n */\n hooks?: DeclarativeHooks\n /**\n * Run once on first request, after every plugin has registered. The place for\n * dynamic hook subscriptions (`ctx.hooks.on(...)`) and env-dependent setup.\n */\n onBoot?: (context: DefinedPluginContext<Caps>) => void | Promise<void>\n\n // ── Cron ──\n /** Scheduled-work declarations (also list the expressions in wrangler.toml). */\n crons?: CronDeclaration[]\n /** Handler for a fired cron; branch on `event.hookFamily`. */\n onCronTick?: (event: CronTickEvent, context: DefinedPluginContext<Caps>) => void | Promise<void>\n\n // ── Lifecycle (DB/schema only — never touches routes) ──\n install?: (context: unknown) => void | Promise<void>\n uninstall?: (context: unknown) => void | Promise<void>\n activate?: (context: unknown) => void | Promise<void>\n deactivate?: (context: unknown) => void | Promise<void>\n\n // ── Declarative admin surface ──\n /**\n * Declarative admin-sidebar entries collected by registerPlugins. The catalyst\n * sidebar renders them automatically; no per-plugin `addMenuItem(...)` call\n * required.\n */\n menu?: PluginMenuEntry[]\n /**\n * Schema-driven settings. Declaring this auto-renders the admin form at\n * `/admin/settings/plugins/:id`, parses FormData back into typed values, and\n * persists them via the plugin-service. Authors no longer hand-roll settings\n * routes/templates.\n */\n configSchema?: ConfigSchema\n /**\n * Custom settings-tab renderer for the plugin detail page (`/admin/plugins/:id`).\n * `loadData` is called server-side with the D1 database before the page renders;\n * its result is forwarded to `render` as `data`. Plugins that need DB access\n * (e.g. fetching their own document records) declare `loadData`; static content\n * can omit it and read only from `plugin` / `settings`.\n */\n settingsTabContent?: {\n loadData?: (db: any) => Promise<any>\n render: (props: { plugin: any; settings: any; data?: any }) => string\n }\n}\n\n/**\n * The runtime shape produced by {@link definePlugin}. Carries the legacy metadata\n * fields plus the v3 surfaces; structurally satisfies `MountablePlugin`,\n * `WirablePlugin`, and `CronablePlugin`.\n */\nexport interface DefinedPlugin {\n id: string\n name: string\n version: string\n /** The semver range for SonicJS core compatibility declared by the author. */\n sonicjsVersionRange?: string\n description?: string\n author?: { name: string; email?: string; url?: string }\n dependencies?: string[]\n capabilities: Capability[]\n routes?: MountableRoute[]\n register?: (app: Hono) => void\n /** Declarative hook subscriptions, flattened for the wire phase. */\n hooks?: WirableHook[]\n /** Wrapped onBoot accepting the runtime's raw boot context. */\n onBoot?: (context: PluginBootContext) => void | Promise<void>\n crons?: CronDeclaration[]\n /** Wrapped onCronTick accepting the runtime's raw cron context. */\n onCronTick?: (event: CronTickEvent, context: CronContext) => void | Promise<void>\n install?: (context: unknown) => void | Promise<void>\n uninstall?: (context: unknown) => void | Promise<void>\n activate?: (context: unknown) => void | Promise<void>\n deactivate?: (context: unknown) => void | Promise<void>\n /** Declarative admin sidebar entries. registerPlugins collects + sets the menu singleton. */\n menu?: PluginMenuEntry[]\n /** Schema-driven settings. Renders the admin settings form for this plugin. */\n configSchema?: ConfigSchema\n /** Custom settings-tab renderer. loadData runs server-side; render produces the tab HTML. */\n settingsTabContent?: {\n loadData?: (db: any) => Promise<any>\n render: (props: { plugin: any; settings: any; data?: any }) => string\n }\n /** Marker so tooling/tests can detect a v3-defined plugin. */\n // eslint-disable-next-line @typescript-eslint/naming-convention -- intentional internal marker\n readonly __sonicV3: true\n}\n\n/**\n * Build the enriched context from whatever raw context the runtime passed.\n *\n * Capability providers ride on the raw context (`raw.providers`) — the host\n * supplies real `email`/`cache`/`http` factories there. When none are supplied, a\n * declared-but-used capability throws \"no provider supplied by host\", which is the\n * correct signal during early bring-up.\n */\nfunction enrich<Caps extends readonly Capability[]>(\n raw: PluginBootContext | CronContext,\n runtimeCaps: readonly Capability[],\n pluginName: string\n): DefinedPluginContext<Caps> {\n const providers = (raw as { providers?: CapabilityProviders }).providers ?? {}\n return {\n hooks: createTypedHooks(raw.hooks),\n // Runtime gating uses the normalized capability set; the context TYPE reflects\n // the declared `Caps` tuple (the narrowing the author sees).\n cap: createCapabilityContext(runtimeCaps as unknown as Caps, providers, pluginName),\n env: raw.env,\n raw,\n }\n}\n\n/**\n * Define a v3 plugin. Validates declared capabilities (warns on unknown), then\n * returns a runtime-ready plugin whose `onBoot`/`onCronTick` receive the enriched,\n * typed, capability-gated context. The `const Caps` type parameter captures the\n * declared capability tuple so `ctx.cap` is narrowed at the author's call site.\n */\nexport function definePlugin<const Caps extends readonly Capability[] = readonly []>(\n input: DefinePluginInput<Caps>\n): DefinedPlugin {\n if (!input.id) throw new Error('definePlugin: `id` is required')\n if (!input.version) throw new Error(`definePlugin: \\`version\\` is required (plugin \"${input.id}\")`)\n\n // Semver validation: warn if the plugin's own version is not a valid semver string.\n if (!isSemver(input.version)) {\n // eslint-disable-next-line no-console\n console.warn(\n `[plugins] Plugin \"${input.id}\" has an invalid version: \"${input.version}\". ` +\n `Use a valid semver string (e.g. \"1.0.0\") to participate in version-range checks.`\n )\n }\n\n // SonicJS core compatibility range check.\n if (input.sonicjsVersionRange) {\n const coreVersion = getCoreVersion()\n if (!semverSatisfies(coreVersion, input.sonicjsVersionRange)) {\n // eslint-disable-next-line no-console\n console.warn(\n `[plugins] Plugin \"${input.id}\" declares sonicjsVersionRange \"${input.sonicjsVersionRange}\" ` +\n `but running core version is \"${coreVersion}\". ` +\n `The plugin may not work correctly. Consider updating the plugin or the version range.`\n )\n }\n }\n\n // Normalize declared capabilities to canonical names first (resolves deprecated\n // / cross-fork spellings like `storage:write` → `media:write`), then warn on any\n // that remain unknown. Strict-reject at registration is layered in Phase 5d.\n const { capabilities, unknown } = normalizeCapabilities(input.capabilities ?? [])\n if (unknown.length > 0) {\n // eslint-disable-next-line no-console\n console.warn(\n `[plugins] Plugin \"${input.id}\" declares unknown capabilities: ${unknown.join(', ')}. ` +\n `These will gate nothing. Check for typos or update the capability vocabulary.`\n )\n }\n\n const name = input.id\n\n const onBoot = input.onBoot\n ? (raw: PluginBootContext) => input.onBoot!(enrich(raw, capabilities, name))\n : undefined\n\n const onCronTick = input.onCronTick\n ? (event: CronTickEvent, raw: CronContext) => input.onCronTick!(event, enrich(raw, capabilities, name))\n : undefined\n\n // Flatten the declarative typed `hooks` map into the wirable `hooks[]` array.\n // Each handler is wrapped to the raw (data, context) shape, coalescing a void\n // return back to the incoming payload (matching createTypedHooks().on()).\n const hooks: WirableHook[] | undefined = input.hooks\n ? Object.entries(input.hooks)\n .filter(([, h]) => typeof h === 'function')\n .map(([eventName, h]) => ({\n name: eventName,\n handler: async (data: any, context: any) => {\n const result = await (h as TypedHookHandler<HookEventName>)(data, context ?? {})\n return result === undefined ? data : result\n },\n }))\n : undefined\n\n return {\n id: input.id,\n name,\n version: input.version,\n sonicjsVersionRange: input.sonicjsVersionRange,\n description: input.description,\n author: input.author,\n dependencies: input.dependencies,\n capabilities,\n routes: input.routes,\n register: input.register,\n hooks,\n onBoot,\n crons: input.crons,\n onCronTick,\n install: input.install,\n uninstall: input.uninstall,\n activate: input.activate,\n deactivate: input.deactivate,\n menu: input.menu,\n configSchema: input.configSchema,\n settingsTabContent: input.settingsTabContent,\n // eslint-disable-next-line @typescript-eslint/naming-convention -- intentional internal marker\n __sonicV3: true,\n }\n}\n\n/** True if `plugin` was produced by {@link definePlugin}. */\nexport function isDefinedPlugin(plugin: unknown): plugin is DefinedPlugin {\n // eslint-disable-next-line @typescript-eslint/naming-convention -- intentional internal marker\n return !!plugin && typeof plugin === 'object' && (plugin as { __sonicV3?: unknown }).__sonicV3 === true\n}\n","/**\n * Schema-driven plugin settings.\n *\n * Plugins declare `configSchema: { key: ConfigSchemaField }` on definePlugin.\n * The host renders the admin settings UI from the schema, parses FormData back\n * into typed values, and exposes the resulting record via `ctx.settings.load()`.\n *\n * Field kinds: 'string' | 'number' | 'boolean' | 'select'. New kinds get added\n * here once and every consumer picks them up.\n *\n * Phase 1 — settings UI only. The renderer emits plain HTML strings designed to\n * compose into the existing admin layout (no client-side JS). FormData parsing\n * coalesces unchecked-checkbox omission into `false` (the only browser quirk\n * the renderer must account for).\n */\n\nimport { escapeHtml } from '../../utils/sanitize'\n\n// ── Field model ──────────────────────────────────────────────────────────────\n\ninterface BaseField {\n label: string\n description?: string\n required?: boolean\n}\n\nexport interface StringField extends BaseField {\n type: 'string'\n default?: string\n format?: 'email' | 'url' | 'password'\n /** Render as `<input type=\"password\">`. Implied when `format === 'password'`. */\n sensitive?: boolean\n placeholder?: string\n minLength?: number\n maxLength?: number\n}\n\nexport interface NumberField extends BaseField {\n type: 'number'\n default?: number\n min?: number\n max?: number\n step?: number\n}\n\nexport interface BooleanField extends BaseField {\n type: 'boolean'\n default?: boolean\n}\n\nexport interface SelectField extends BaseField {\n type: 'select'\n default?: string\n /** Either `['us','eu']` shorthand or `[{ value, label }]` for distinct display strings. */\n options: readonly string[] | readonly { value: string; label: string }[]\n}\n\nexport type ConfigSchemaField = StringField | NumberField | BooleanField | SelectField\n\nexport type ConfigSchema = Record<string, ConfigSchemaField>\n\n/** Parsed shape — typed record inferred from the schema. */\nexport type SettingsFor<S extends ConfigSchema> = {\n [K in keyof S]: S[K] extends StringField\n ? string\n : S[K] extends NumberField\n ? number\n : S[K] extends BooleanField\n ? boolean\n : S[K] extends SelectField\n ? string\n : never\n}\n\n// ── Parse ────────────────────────────────────────────────────────────────────\n\nexport interface ParsedField {\n key: string\n field: ConfigSchemaField\n}\n\n/** Stable, ordered field list (preserves declaration order). */\nexport function parseConfigSchema(schema: ConfigSchema): ParsedField[] {\n return Object.entries(schema).map(([key, field]) => ({ key, field }))\n}\n\n// ── Render ───────────────────────────────────────────────────────────────────\n\n/**\n * Render all fields as HTML controls. Output is a sequence of `<div class=\"field\">…</div>`\n * blocks designed to drop into the admin form template (no surrounding `<form>` or\n * submit button — those belong to the page that calls this).\n */\nexport function renderSchemaFields(\n schema: ConfigSchema,\n currentValues: Record<string, unknown> = {}\n): string {\n return parseConfigSchema(schema)\n .map(({ key, field }) => {\n const value = key in currentValues ? currentValues[key] : (field as { default?: unknown }).default\n return renderField(key, field, value)\n })\n .join('\\n')\n}\n\nfunction renderField(key: string, field: ConfigSchemaField, value: unknown): string {\n const id = `field-${key}`\n const requiredAttr = field.required ? ' required' : ''\n const labelHtml = `${escapeHtml(field.label)}${field.required ? ' *' : ''}`\n const helpHtml = field.description ? `<p class=\"help text-sm text-gray-400 mt-1\">${escapeHtml(field.description)}</p>` : ''\n\n switch (field.type) {\n case 'string': {\n const isPassword = field.sensitive === true || field.format === 'password'\n const inputType = isPassword ? 'password' : field.format === 'email' ? 'email' : field.format === 'url' ? 'url' : 'text'\n const placeholder = field.placeholder ? ` placeholder=\"${escapeHtml(field.placeholder)}\"` : ''\n const min = field.minLength != null ? ` minlength=\"${field.minLength}\"` : ''\n const max = field.maxLength != null ? ` maxlength=\"${field.maxLength}\"` : ''\n return `\n<div class=\"field mb-4\">\n <label for=\"${id}\" class=\"block text-sm font-medium mb-1\">${labelHtml}</label>\n <input id=\"${id}\" name=\"${escapeHtml(key)}\" type=\"${inputType}\"\n class=\"w-full rounded border border-gray-700 bg-gray-800 px-3 py-2 text-sm\"\n value=\"${escapeHtml(String(value ?? ''))}\"${placeholder}${min}${max}${requiredAttr} />\n ${helpHtml}\n</div>`.trim()\n }\n case 'number': {\n const min = field.min != null ? ` min=\"${field.min}\"` : ''\n const max = field.max != null ? ` max=\"${field.max}\"` : ''\n const step = field.step != null ? ` step=\"${field.step}\"` : ''\n return `\n<div class=\"field mb-4\">\n <label for=\"${id}\" class=\"block text-sm font-medium mb-1\">${labelHtml}</label>\n <input id=\"${id}\" name=\"${escapeHtml(key)}\" type=\"number\"\n class=\"w-full rounded border border-gray-700 bg-gray-800 px-3 py-2 text-sm\"\n value=\"${value == null ? '' : escapeHtml(String(value))}\"${min}${max}${step}${requiredAttr} />\n ${helpHtml}\n</div>`.trim()\n }\n case 'boolean': {\n const checked = value === true ? ' checked' : ''\n return `\n<div class=\"field mb-4\">\n <label class=\"flex items-center gap-2 text-sm font-medium\">\n <input name=\"${escapeHtml(key)}\" type=\"checkbox\" class=\"rounded\"${checked} />\n ${labelHtml}\n </label>\n ${helpHtml}\n</div>`.trim()\n }\n case 'select': {\n const optionsHtml = field.options\n .map((o) => {\n const opt = typeof o === 'string' ? { value: o, label: o } : o\n const selected = opt.value === value ? ' selected' : ''\n return `<option value=\"${escapeHtml(opt.value)}\"${selected}>${escapeHtml(opt.label)}</option>`\n })\n .join('')\n return `\n<div class=\"field mb-4\">\n <label for=\"${id}\" class=\"block text-sm font-medium mb-1\">${labelHtml}</label>\n <select id=\"${id}\" name=\"${escapeHtml(key)}\"\n class=\"w-full rounded border border-gray-700 bg-gray-800 px-3 py-2 text-sm\"${requiredAttr}>\n ${optionsHtml}\n </select>\n ${helpHtml}\n</div>`.trim()\n }\n }\n}\n\n// ── FormData → settings ──────────────────────────────────────────────────────\n\n/**\n * Coerce FormData entries into typed settings per the schema. Notably:\n * - Unchecked checkboxes are omitted by the browser; we coalesce to `false`.\n * - Numbers parse via `Number()` and fall back to the field's default if invalid.\n * - Strings preserve empty string (NOT default) so an admin can intentionally clear.\n */\nexport function parseFormDataToSettings(schema: ConfigSchema, form: FormData): Record<string, unknown> {\n const result: Record<string, unknown> = {}\n for (const { key, field } of parseConfigSchema(schema)) {\n switch (field.type) {\n case 'string': {\n const raw = form.get(key)\n result[key] = raw == null ? field.default ?? '' : String(raw)\n break\n }\n case 'number': {\n const raw = form.get(key)\n if (raw == null || raw === '') {\n result[key] = field.default\n } else {\n const n = Number(raw)\n result[key] = Number.isFinite(n) ? n : field.default\n }\n break\n }\n case 'boolean': {\n // Unchecked checkbox → not present in FormData → false.\n result[key] = form.get(key) != null\n break\n }\n case 'select': {\n const raw = form.get(key)\n result[key] = raw == null ? field.default ?? '' : String(raw)\n break\n }\n }\n }\n return result\n}\n\n// ── Defaults ─────────────────────────────────────────────────────────────────\n\n/** Fill missing keys with field defaults. Existing keys (incl. `false`/`0`/'') win. */\nexport function applySchemaDefaults<S extends ConfigSchema>(\n schema: S,\n stored: Record<string, unknown>\n): Record<string, unknown> {\n const result: Record<string, unknown> = { ...stored }\n for (const { key, field } of parseConfigSchema(schema)) {\n if (result[key] === undefined) {\n const def = (field as { default?: unknown }).default\n if (def !== undefined) result[key] = def\n }\n }\n return result\n}\n","/**\n * Plugin admin-sidebar menu registry.\n *\n * Plugins declare `menu: PluginMenuEntry[]` on definePlugin. registerPlugins\n * collects every entry into this module singleton; the admin layout reads via\n * `resolvePluginMenuItems(user)` to render the sidebar.\n *\n * Phase 1 — strings + paths only. No custom React/HTMX components in menu\n * entries (icons are name strings looked up by the sidebar's icon map).\n */\n\nexport interface PluginMenuEntry {\n /** Display label. */\n label: string\n /** Admin URL the entry navigates to (e.g. `/admin/email`). */\n path: string\n /** Icon name from the admin icon map. Default: `puzzle-piece`. */\n icon?: string\n /** Sort key (ASC). Default 100. */\n order?: number\n /** Required permission slugs; if any matches the user's permissions, the entry is shown. */\n permissions?: readonly string[]\n}\n\n/**\n * Resolved entry — guaranteed `icon` + `order`, ready to render. Same shape\n * the catalyst sidebar consumes via `dynamicMenuItems`. `icon` is the rendered\n * SVG HTML string (resolved via {@link MENU_ICON_MAP} when the entry supplied\n * a name; passed through verbatim when the entry supplied raw SVG/HTML).\n */\nexport interface ResolvedPluginMenuEntry {\n label: string\n path: string\n icon: string\n order: number\n}\n\n// ── Icon name → SVG map ──────────────────────────────────────────────────────\n//\n// Plugins declare icons by name (`icon: 'envelope'`); the layout never has to\n// import a per-plugin SVG. Names match heroicons-mini style. Unknown names\n// fall through to the generic puzzle-piece. Names containing `<svg` are\n// treated as raw SVG and passed through unchanged (escape hatch for one-off\n// custom icons).\n\nconst PUZZLE_PIECE = `<svg class=\"h-5 w-5\" fill=\"currentColor\" viewBox=\"0 0 20 20\"><path d=\"M14.5 2A1.5 1.5 0 0013 3.5V4H8.5A1.5 1.5 0 007 5.5V10h-.5a1.5 1.5 0 100 3H7v4.5A1.5 1.5 0 008.5 19H13v-.5a1.5 1.5 0 113 0V19h.5a1.5 1.5 0 001.5-1.5V13h-.5a1.5 1.5 0 110-3h.5V5.5A1.5 1.5 0 0017 4h-.5v-.5A1.5 1.5 0 0014.5 2z\"/></svg>`\n\nconst MENU_ICON_MAP: Readonly<Record<string, string>> = {\n 'puzzle-piece': PUZZLE_PIECE,\n envelope: `<svg class=\"h-5 w-5\" fill=\"currentColor\" viewBox=\"0 0 20 20\"><path d=\"M2.003 5.884L10 9.882l7.997-3.998A2 2 0 0016 4H4a2 2 0 00-1.997 1.884z\"/><path d=\"M18 8.118l-8 4-8-4V14a2 2 0 002 2h12a2 2 0 002-2V8.118z\"/></svg>`,\n cog: `<svg class=\"h-5 w-5\" fill=\"currentColor\" viewBox=\"0 0 20 20\"><path fill-rule=\"evenodd\" d=\"M11.49 3.17c-.38-1.56-2.6-1.56-2.98 0a1.532 1.532 0 01-2.286.948c-1.372-.836-2.942.734-2.106 2.106.54.886.061 2.042-.947 2.287-1.561.379-1.561 2.6 0 2.978a1.532 1.532 0 01.947 2.287c-.836 1.372.734 2.942 2.106 2.106a1.532 1.532 0 012.287.947c.379 1.561 2.6 1.561 2.978 0a1.533 1.533 0 012.287-.947c1.372.836 2.942-.734 2.106-2.106a1.533 1.533 0 01.947-2.287c1.561-.379 1.561-2.6 0-2.978a1.532 1.532 0 01-.947-2.287c.836-1.372-.734-2.942-2.106-2.106a1.532 1.532 0 01-2.287-.947zM10 13a3 3 0 100-6 3 3 0 000 6z\" clip-rule=\"evenodd\"/></svg>`,\n chart: `<svg class=\"h-5 w-5\" fill=\"currentColor\" viewBox=\"0 0 20 20\"><path d=\"M2 11a1 1 0 011-1h2a1 1 0 011 1v5a1 1 0 01-1 1H3a1 1 0 01-1-1v-5zM8 7a1 1 0 011-1h2a1 1 0 011 1v9a1 1 0 01-1 1H9a1 1 0 01-1-1V7zM14 4a1 1 0 011-1h2a1 1 0 011 1v12a1 1 0 01-1 1h-2a1 1 0 01-1-1V4z\"/></svg>`,\n sparkles: `<svg class=\"h-5 w-5\" fill=\"currentColor\" viewBox=\"0 0 20 20\"><path d=\"M9 4.804A7.968 7.968 0 005.5 4c-1.255 0-2.443.29-3.5.804v10A7.969 7.969 0 015.5 14c1.669 0 3.218.51 4.5 1.385A7.962 7.962 0 0114.5 14c1.255 0 2.443.29 3.5.804v-10A7.968 7.968 0 0014.5 4c-1.255 0-2.443.29-3.5.804V12a1 1 0 11-2 0V4.804z\"/></svg>`,\n bolt: `<svg class=\"h-5 w-5\" fill=\"currentColor\" viewBox=\"0 0 20 20\"><path fill-rule=\"evenodd\" d=\"M11.3 1.046A1 1 0 0112 2v5h4a1 1 0 01.82 1.573l-7 10A1 1 0 018 18v-5H4a1 1 0 01-.82-1.573l7-10a1 1 0 011.12-.38z\" clip-rule=\"evenodd\"/></svg>`,\n document: `<svg class=\"h-5 w-5\" fill=\"currentColor\" viewBox=\"0 0 20 20\"><path fill-rule=\"evenodd\" d=\"M4 4a2 2 0 012-2h8a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V4zm3 1h6v2H7V5zm0 4h6v2H7V9zm0 4h4v2H7v-2z\" clip-rule=\"evenodd\"/></svg>`,\n lock: `<svg class=\"h-5 w-5\" fill=\"currentColor\" viewBox=\"0 0 20 20\"><path fill-rule=\"evenodd\" d=\"M5 9V7a5 5 0 0110 0v2a2 2 0 012 2v5a2 2 0 01-2 2H5a2 2 0 01-2-2v-5a2 2 0 012-2zm8-2v2H7V7a3 3 0 016 0z\" clip-rule=\"evenodd\"/></svg>`,\n photo: `<svg class=\"h-5 w-5\" fill=\"currentColor\" viewBox=\"0 0 20 20\"><path fill-rule=\"evenodd\" d=\"M4 3a2 2 0 00-2 2v10a2 2 0 002 2h12a2 2 0 002-2V5a2 2 0 00-2-2H4zm12 12H4l4-8 3 6 2-4 3 6z\" clip-rule=\"evenodd\"/></svg>`,\n 'globe-alt': `<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=\"M21 12a9 9 0 01-9 9m9-9a9 9 0 00-9-9m9 9H3m9 9a9 9 0 01-9-9m9 9c1.657 0 3-4.03 3-9s-1.343-9-3-9m0 18c-1.657 0-3-4.03-3-9s1.343-9 3-9m-9 9a9 9 0 019-9\"/></svg>`,\n}\n\nfunction resolveIcon(name: string | undefined): string {\n if (!name) return PUZZLE_PIECE\n if (name.startsWith('<svg')) return name // raw SVG escape hatch\n return MENU_ICON_MAP[name] ?? PUZZLE_PIECE\n}\n\nlet menuItems: readonly PluginMenuEntry[] = []\n\nexport function setPluginMenu(items: readonly PluginMenuEntry[]): void {\n menuItems = [...items]\n}\n\nexport function getPluginMenu(): readonly PluginMenuEntry[] {\n return menuItems\n}\n\nexport function resetPluginMenu(): void {\n menuItems = []\n}\n\n/**\n * Filter entries by user permissions, sort by `order` ASC, project to render-ready\n * shape with default icon. Pure function — same inputs, same output.\n *\n * Permission semantics: an entry with no `permissions` is always visible. An entry\n * with `permissions: ['x','y']` is visible if the user has ANY of `x` or `y`.\n * Users with `role: 'admin'` bypass all permission checks (admins see everything).\n */\nexport function resolvePluginMenuItems(\n user?: { permissions?: readonly string[]; role?: string }\n): ResolvedPluginMenuEntry[] {\n const isAdmin = user?.role === 'admin'\n const userPerms = new Set(user?.permissions ?? [])\n return menuItems\n .filter((m) => {\n if (!m.permissions || m.permissions.length === 0) return true\n if (isAdmin) return true\n return m.permissions.some((p) => userPerms.has(p))\n })\n .slice()\n .sort((a, b) => (a.order ?? 100) - (b.order ?? 100))\n .map((m) => ({\n label: m.label,\n path: m.path,\n icon: resolveIcon(m.icon),\n order: m.order ?? 100,\n }))\n}\n","/**\n * In-memory registry of registered plugin definitions, indexed by id.\n *\n * Populated by `registerPlugins()` at app construction. The admin settings\n * route uses it to look up a plugin's `configSchema` so the schema-driven\n * settings form can be auto-rendered without per-plugin glue code.\n *\n * Read by the admin layer; written ONLY by registerPlugins.\n */\n\nimport type { RegisterablePlugin } from '../plugins/sdk/register-plugins'\n\nlet registry: ReadonlyMap<string, RegisterablePlugin> = new Map()\n\nexport function setPluginDefinitions(plugins: ReadonlyArray<RegisterablePlugin>): void {\n const next = new Map<string, RegisterablePlugin>()\n for (const p of plugins) next.set(p.id, p)\n registry = next\n}\n\nexport function getPluginDefinition(id: string): RegisterablePlugin | undefined {\n return registry.get(id)\n}\n\nexport function getAllPluginDefinitions(): ReadonlyArray<RegisterablePlugin> {\n return Array.from(registry.values())\n}\n\nexport function resetPluginDefinitions(): void {\n registry = new Map()\n}\n"]}