@tulip-systems/core 0.5.1 → 0.5.3

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 (381) hide show
  1. package/dist/components/common/icons.d.mts +52 -52
  2. package/dist/components/common/icons.d.mts.map +1 -1
  3. package/dist/components/common/status.d.mts +3 -3
  4. package/dist/components/common/status.d.mts.map +1 -1
  5. package/dist/components/editor/components/content.client.d.mts +2 -2
  6. package/dist/components/editor/components/editor.client.d.mts +4 -4
  7. package/dist/components/editor/components/editor.client.mjs +2 -2
  8. package/dist/components/editor/components/editor.client.mjs.map +1 -1
  9. package/dist/components/editor/components/menu.client.d.mts +3 -3
  10. package/dist/components/editor/components/menu.client.mjs +3 -0
  11. package/dist/components/editor/components/menu.client.mjs.map +1 -1
  12. package/dist/components/editor/extensions/file-handler/extension.d.mts +21 -0
  13. package/dist/components/editor/extensions/file-handler/extension.d.mts.map +1 -0
  14. package/dist/components/editor/extensions/file-handler/extension.mjs +40 -0
  15. package/dist/components/editor/extensions/file-handler/extension.mjs.map +1 -0
  16. package/dist/components/editor/extensions/file-handler/strategy.d.mts +29 -0
  17. package/dist/components/editor/extensions/file-handler/strategy.d.mts.map +1 -0
  18. package/dist/components/editor/extensions/file-handler/strategy.mjs +111 -0
  19. package/dist/components/editor/extensions/file-handler/strategy.mjs.map +1 -0
  20. package/dist/components/editor/extensions/file-handler/utils.mjs +50 -0
  21. package/dist/components/editor/extensions/file-handler/utils.mjs.map +1 -0
  22. package/dist/components/editor/extensions/image/extension.d.mts +8 -0
  23. package/dist/components/editor/extensions/image/extension.d.mts.map +1 -0
  24. package/dist/components/editor/extensions/image/extension.mjs +52 -0
  25. package/dist/components/editor/extensions/image/extension.mjs.map +1 -0
  26. package/dist/components/editor/extensions/skeleton/extension.mjs +41 -0
  27. package/dist/components/editor/extensions/skeleton/extension.mjs.map +1 -0
  28. package/dist/components/editor/extensions/skeleton/renderer.mjs +25 -0
  29. package/dist/components/editor/extensions/skeleton/renderer.mjs.map +1 -0
  30. package/dist/components/editor/lib/constants.d.mts +29 -26
  31. package/dist/components/editor/lib/constants.d.mts.map +1 -1
  32. package/dist/components/editor/lib/constants.mjs +14 -2
  33. package/dist/components/editor/lib/constants.mjs.map +1 -1
  34. package/dist/components/editor/lib/extensions.d.mts +5 -1
  35. package/dist/components/editor/lib/extensions.d.mts.map +1 -1
  36. package/dist/components/editor/lib/extensions.mjs.map +1 -1
  37. package/dist/components/editor/lib/variants.mjs +10 -2
  38. package/dist/components/editor/lib/variants.mjs.map +1 -1
  39. package/dist/components/header/back-button.client.d.mts +2 -2
  40. package/dist/components/header/bottom-bar.client.d.mts +3 -3
  41. package/dist/components/header/breadcrumbs.client.d.mts +7 -7
  42. package/dist/components/header/header.client.d.mts +2 -2
  43. package/dist/components/header/mobile-nav-switcher.client.d.mts +2 -2
  44. package/dist/components/header/top-bar.client.d.mts +4 -4
  45. package/dist/components/layouts/admin-content.client.d.mts +2 -2
  46. package/dist/components/layouts/admin-layout.d.mts +2 -2
  47. package/dist/components/layouts/admin-loading.d.mts +2 -2
  48. package/dist/components/layouts/admin-loading.d.mts.map +1 -1
  49. package/dist/components/layouts/empty-page.d.mts +4 -4
  50. package/dist/components/layouts/empty-page.d.mts.map +1 -1
  51. package/dist/components/layouts/list-layout.d.mts +2 -2
  52. package/dist/components/layouts/list-layout.d.mts.map +1 -1
  53. package/dist/components/layouts/not-found-page.d.mts +3 -3
  54. package/dist/components/layouts/not-found-page.d.mts.map +1 -1
  55. package/dist/components/layouts/providers.client.d.mts +2 -2
  56. package/dist/components/layouts/root-layout.server.d.mts +2 -2
  57. package/dist/components/layouts/root-layout.server.d.mts.map +1 -1
  58. package/dist/components/layouts/root-loading.d.mts +2 -2
  59. package/dist/components/layouts/root-loading.d.mts.map +1 -1
  60. package/dist/components/layouts/tab-layout.d.mts +2 -2
  61. package/dist/components/layouts/tab-layout.d.mts.map +1 -1
  62. package/dist/components/lists/data-list.d.mts +5 -5
  63. package/dist/components/lists/data-list.d.mts.map +1 -1
  64. package/dist/components/lists/data-stack.d.mts +8 -8
  65. package/dist/components/navigation/admin-sidebar-paths.client.d.mts +10 -10
  66. package/dist/components/ui/accordion.d.mts +5 -5
  67. package/dist/components/ui/alert-dialog.d.mts +12 -12
  68. package/dist/components/ui/alert.d.mts +6 -6
  69. package/dist/components/ui/aspect-ratio.d.mts +2 -2
  70. package/dist/components/ui/avatar.client.d.mts +4 -4
  71. package/dist/components/ui/badge.d.mts +4 -4
  72. package/dist/components/ui/breadcrumb.d.mts +8 -8
  73. package/dist/components/ui/breadcrumb.d.mts.map +1 -1
  74. package/dist/components/ui/button.d.mts +5 -5
  75. package/dist/components/ui/button.d.mts.map +1 -1
  76. package/dist/components/ui/calendar.d.mts +3 -3
  77. package/dist/components/ui/calendar.d.mts.map +1 -1
  78. package/dist/components/ui/card.d.mts +7 -7
  79. package/dist/components/ui/card.d.mts.map +1 -1
  80. package/dist/components/ui/carousel.d.mts +6 -6
  81. package/dist/components/ui/carousel.d.mts.map +1 -1
  82. package/dist/components/ui/chart.client.d.mts +5 -5
  83. package/dist/components/ui/checkbox.d.mts +2 -2
  84. package/dist/components/ui/checkbox.d.mts.map +1 -1
  85. package/dist/components/ui/collapsible.client.d.mts +4 -4
  86. package/dist/components/ui/color-picker.client.d.mts +2 -2
  87. package/dist/components/ui/combobox-dropdown.client.d.mts +2 -2
  88. package/dist/components/ui/combobox.client.d.mts +2 -2
  89. package/dist/components/ui/command.d.mts +10 -10
  90. package/dist/components/ui/command.d.mts.map +1 -1
  91. package/dist/components/ui/context-menu.d.mts +16 -16
  92. package/dist/components/ui/date-picker.client.d.mts +2 -2
  93. package/dist/components/ui/dialog.client.d.mts +11 -11
  94. package/dist/components/ui/drawer.client.d.mts +11 -11
  95. package/dist/components/ui/dropdown-menu.d.mts +16 -16
  96. package/dist/components/ui/form.client.d.mts +7 -7
  97. package/dist/components/ui/hover-card.client.d.mts +4 -4
  98. package/dist/components/ui/input-recipient.d.mts +2 -2
  99. package/dist/components/ui/input.d.mts +2 -2
  100. package/dist/components/ui/label.d.mts +2 -2
  101. package/dist/components/ui/navigation-menu.d.mts +11 -11
  102. package/dist/components/ui/pagination.d.mts +8 -8
  103. package/dist/components/ui/popover.d.mts +5 -5
  104. package/dist/components/ui/popover.d.mts.map +1 -1
  105. package/dist/components/ui/progress.client.d.mts +2 -2
  106. package/dist/components/ui/radio-group.d.mts +3 -3
  107. package/dist/components/ui/resizable.client.d.mts +4 -4
  108. package/dist/components/ui/scroll-area.d.mts +3 -3
  109. package/dist/components/ui/select.client.d.mts +11 -11
  110. package/dist/components/ui/separator.d.mts +2 -2
  111. package/dist/components/ui/sheet.client.d.mts +9 -9
  112. package/dist/components/ui/sidebar.client.d.mts +24 -24
  113. package/dist/components/ui/skeleton.d.mts +2 -2
  114. package/dist/components/ui/slider.d.mts +2 -2
  115. package/dist/components/ui/sonner.client.d.mts +2 -2
  116. package/dist/components/ui/switch.d.mts +2 -2
  117. package/dist/components/ui/tabs.d.mts +5 -5
  118. package/dist/components/ui/textarea.d.mts +2 -2
  119. package/dist/components/ui/time-input.client.d.mts +2 -2
  120. package/dist/components/ui/toggle-group.client.d.mts +3 -3
  121. package/dist/components/ui/toggle.d.mts +2 -2
  122. package/dist/components/ui/tooltip.client.d.mts +5 -5
  123. package/dist/components.d.mts +2 -1
  124. package/dist/components.mjs +3 -2
  125. package/dist/data-tables.d.mts +2 -2
  126. package/dist/data-tables.mjs +2 -2
  127. package/dist/inline-edit/client.d.mts +2 -3
  128. package/dist/inline-edit/client.mjs +1 -2
  129. package/dist/lib/client.d.mts +2 -2
  130. package/dist/lib/client.mjs +2 -2
  131. package/dist/lib/hooks/use-action.d.mts +2 -2
  132. package/dist/lib/hooks/use-indicator.d.mts +11 -3
  133. package/dist/lib/hooks/use-indicator.d.mts.map +1 -1
  134. package/dist/lib/hooks/use-indicator.mjs +19 -8
  135. package/dist/lib/hooks/use-indicator.mjs.map +1 -1
  136. package/dist/modules/auth/components/allowed.client.d.mts +2 -2
  137. package/dist/modules/auth/components/allowed.client.d.mts.map +1 -1
  138. package/dist/modules/auth/components/auth-layout.server.d.mts +2 -2
  139. package/dist/modules/auth/components/auth-layout.server.d.mts.map +1 -1
  140. package/dist/modules/auth/components/auth-loading.d.mts +2 -2
  141. package/dist/modules/auth/components/create-first-user-page.client.d.mts +2 -2
  142. package/dist/modules/auth/components/create-first-user-page.client.d.mts.map +1 -1
  143. package/dist/modules/auth/components/forget-password-page.client.d.mts +2 -2
  144. package/dist/modules/auth/components/forget-password-page.client.d.mts.map +1 -1
  145. package/dist/modules/auth/components/guard-first-user.server.d.mts +2 -2
  146. package/dist/modules/auth/components/guard-first-user.server.d.mts.map +1 -1
  147. package/dist/modules/auth/components/guard.server.d.mts +2 -2
  148. package/dist/modules/auth/components/guard.server.d.mts.map +1 -1
  149. package/dist/modules/auth/components/login-page.client.d.mts +2 -2
  150. package/dist/modules/auth/components/login-page.client.d.mts.map +1 -1
  151. package/dist/modules/auth/components/reset-password-page.client.d.mts +2 -2
  152. package/dist/modules/auth/components/reset-password-page.client.d.mts.map +1 -1
  153. package/dist/modules/auth/components/update-password-command.d.mts +2 -2
  154. package/dist/modules/auth/components/update-password-command.d.mts.map +1 -1
  155. package/dist/modules/auth/db/schema.d.mts +73 -73
  156. package/dist/modules/auth/db/schema.d.mts.map +1 -1
  157. package/dist/modules/auth/handler/client.client.d.mts +8 -8
  158. package/dist/modules/auth/hooks/use-permission.d.mts +2 -2
  159. package/dist/modules/auth/hooks/use-session.d.mts +4 -4
  160. package/dist/modules/auth/lib/validators.d.mts +2 -2
  161. package/dist/modules/auth/lib/validators.d.mts.map +1 -1
  162. package/dist/modules/commands/components/alert-dialog-command.client.d.mts +10 -10
  163. package/dist/modules/commands/components/alert-dialog-command.client.d.mts.map +1 -1
  164. package/dist/modules/commands/components/click-command.client.d.mts +2 -2
  165. package/dist/modules/commands/components/click-command.client.d.mts.map +1 -1
  166. package/dist/modules/commands/components/command-trigger.client.d.mts +6 -6
  167. package/dist/modules/commands/components/command-trigger.client.d.mts.map +1 -1
  168. package/dist/modules/commands/components/dialog-command.client.d.mts +8 -8
  169. package/dist/modules/commands/components/dialog-command.client.d.mts.map +1 -1
  170. package/dist/modules/commands/components/dropdown-command.client.d.mts +5 -5
  171. package/dist/modules/commands/components/dropdown-command.client.d.mts.map +1 -1
  172. package/dist/modules/commands/components/empty-command.client.d.mts +2 -2
  173. package/dist/modules/commands/components/empty-command.client.d.mts.map +1 -1
  174. package/dist/modules/commands/components/form-dialog-command.client.d.mts +11 -11
  175. package/dist/modules/commands/components/form-dialog-command.client.d.mts.map +1 -1
  176. package/dist/modules/commands/hooks/use-command-mutation.client.d.mts +2 -2
  177. package/dist/modules/commands/menus/context-menu.client.d.mts +2 -2
  178. package/dist/modules/commands/menus/context-menu.client.d.mts.map +1 -1
  179. package/dist/modules/commands/menus/dropdown-menu.client.d.mts +3 -3
  180. package/dist/modules/commands/menus/dropdown-menu.client.d.mts.map +1 -1
  181. package/dist/modules/commands/menus/inline-menu.client.d.mts +3 -3
  182. package/dist/modules/commands/menus/inline-menu.client.d.mts.map +1 -1
  183. package/dist/modules/commands/menus/responsive-menu.client.d.mts +3 -3
  184. package/dist/modules/commands/menus/responsive-menu.client.d.mts.map +1 -1
  185. package/dist/modules/commands/utils/archive-command.client.d.mts +3 -3
  186. package/dist/modules/commands/utils/archive-command.client.d.mts.map +1 -1
  187. package/dist/modules/commands/utils/delete-command.client.d.mts +3 -3
  188. package/dist/modules/commands/utils/delete-command.client.d.mts.map +1 -1
  189. package/dist/modules/config/db/helpers.d.mts +5 -5
  190. package/dist/modules/config/db/helpers.d.mts.map +1 -1
  191. package/dist/modules/data-tables/components/cell/common.client.d.mts +5 -5
  192. package/dist/modules/data-tables/components/cell/common.client.d.mts.map +1 -1
  193. package/dist/modules/data-tables/components/column-header.d.mts +2 -2
  194. package/dist/modules/data-tables/components/filters/combobox.client.d.mts +2 -2
  195. package/dist/modules/data-tables/components/filters/combobox.client.d.mts.map +1 -1
  196. package/dist/modules/data-tables/components/filters/slider.client.d.mts +2 -2
  197. package/dist/modules/data-tables/components/filters/slider.client.d.mts.map +1 -1
  198. package/dist/modules/data-tables/components/header.d.mts +4 -4
  199. package/dist/modules/data-tables/components/layout.d.mts +2 -2
  200. package/dist/modules/data-tables/components/search-input.client.d.mts +2 -2
  201. package/dist/modules/data-tables/components/search-input.client.d.mts.map +1 -1
  202. package/dist/modules/data-tables/components/skeleton.d.mts +2 -2
  203. package/dist/modules/data-tables/components/table.d.mts +7 -7
  204. package/dist/modules/data-tables/components/toolbar.d.mts +3 -3
  205. package/dist/modules/data-tables/hooks/use-context.client.d.mts +2 -2
  206. package/dist/modules/data-tables/hooks/use-context.client.d.mts.map +1 -1
  207. package/dist/modules/data-tables/lib/filters/parsers.d.mts +6 -1
  208. package/dist/modules/data-tables/lib/filters/parsers.d.mts.map +1 -1
  209. package/dist/modules/data-tables/lib/filters/parsers.mjs +6 -1
  210. package/dist/modules/data-tables/lib/filters/parsers.mjs.map +1 -1
  211. package/dist/modules/data-tables/tables/data-table/components/table.d.mts +2 -2
  212. package/dist/modules/data-tables/tables/data-table/components/table.d.mts.map +1 -1
  213. package/dist/modules/data-tables/tables/inline-table/components/cells/common.d.mts +2 -2
  214. package/dist/modules/data-tables/tables/inline-table/components/cells/common.d.mts.map +1 -1
  215. package/dist/modules/data-tables/tables/inline-table/components/cells/drag-handle.client.d.mts +2 -2
  216. package/dist/modules/data-tables/tables/inline-table/components/cells/drag-handle.client.d.mts.map +1 -1
  217. package/dist/modules/data-tables/tables/inline-table/components/inputs/advanced-select.client.d.mts +2 -2
  218. package/dist/modules/data-tables/tables/inline-table/components/inputs/advanced-select.client.d.mts.map +1 -1
  219. package/dist/modules/data-tables/tables/inline-table/components/inputs/combobox.client.d.mts +2 -2
  220. package/dist/modules/data-tables/tables/inline-table/components/inputs/combobox.client.d.mts.map +1 -1
  221. package/dist/modules/data-tables/tables/inline-table/components/inputs/input.client.d.mts +3 -3
  222. package/dist/modules/data-tables/tables/inline-table/components/inputs/input.client.d.mts.map +1 -1
  223. package/dist/modules/data-tables/tables/inline-table/components/inputs/read-only.d.mts +2 -2
  224. package/dist/modules/data-tables/tables/inline-table/components/inputs/read-only.d.mts.map +1 -1
  225. package/dist/modules/data-tables/tables/inline-table/components/inputs/select.client.d.mts +2 -2
  226. package/dist/modules/data-tables/tables/inline-table/components/inputs/select.client.d.mts.map +1 -1
  227. package/dist/modules/data-tables/tables/inline-table/components/table.d.mts +2 -2
  228. package/dist/modules/data-tables/tables/inline-table/components/table.d.mts.map +1 -1
  229. package/dist/modules/data-tables/tables/inline-table/hooks/context.client.d.mts +2 -2
  230. package/dist/modules/data-tables/tables/inline-table/hooks/context.client.d.mts.map +1 -1
  231. package/dist/modules/inline-edit/components/combobox-dropdown.client.d.mts +6 -4
  232. package/dist/modules/inline-edit/components/combobox-dropdown.client.d.mts.map +1 -1
  233. package/dist/modules/inline-edit/components/combobox-dropdown.client.mjs +11 -6
  234. package/dist/modules/inline-edit/components/combobox-dropdown.client.mjs.map +1 -1
  235. package/dist/modules/inline-edit/components/combobox.client.d.mts +6 -4
  236. package/dist/modules/inline-edit/components/combobox.client.d.mts.map +1 -1
  237. package/dist/modules/inline-edit/components/combobox.client.mjs +7 -5
  238. package/dist/modules/inline-edit/components/combobox.client.mjs.map +1 -1
  239. package/dist/modules/inline-edit/components/date-input.client.d.mts +5 -3
  240. package/dist/modules/inline-edit/components/date-input.client.d.mts.map +1 -1
  241. package/dist/modules/inline-edit/components/date-input.client.mjs +26 -13
  242. package/dist/modules/inline-edit/components/date-input.client.mjs.map +1 -1
  243. package/dist/modules/inline-edit/components/date-picker.client.d.mts +6 -4
  244. package/dist/modules/inline-edit/components/date-picker.client.d.mts.map +1 -1
  245. package/dist/modules/inline-edit/components/date-picker.client.mjs +12 -7
  246. package/dist/modules/inline-edit/components/date-picker.client.mjs.map +1 -1
  247. package/dist/modules/inline-edit/components/editor.client.d.mts +6 -4
  248. package/dist/modules/inline-edit/components/editor.client.d.mts.map +1 -1
  249. package/dist/modules/inline-edit/components/editor.client.mjs +11 -6
  250. package/dist/modules/inline-edit/components/editor.client.mjs.map +1 -1
  251. package/dist/modules/inline-edit/components/input-recipient.client.d.mts +6 -4
  252. package/dist/modules/inline-edit/components/input-recipient.client.d.mts.map +1 -1
  253. package/dist/modules/inline-edit/components/input-recipient.client.mjs +11 -6
  254. package/dist/modules/inline-edit/components/input-recipient.client.mjs.map +1 -1
  255. package/dist/modules/inline-edit/components/input-toggle.client.d.mts +6 -4
  256. package/dist/modules/inline-edit/components/input-toggle.client.d.mts.map +1 -1
  257. package/dist/modules/inline-edit/components/input-toggle.client.mjs +9 -7
  258. package/dist/modules/inline-edit/components/input-toggle.client.mjs.map +1 -1
  259. package/dist/modules/inline-edit/components/input.client.d.mts +13 -10
  260. package/dist/modules/inline-edit/components/input.client.d.mts.map +1 -1
  261. package/dist/modules/inline-edit/components/input.client.mjs +35 -19
  262. package/dist/modules/inline-edit/components/input.client.mjs.map +1 -1
  263. package/dist/modules/inline-edit/components/select.client.d.mts +10 -9
  264. package/dist/modules/inline-edit/components/select.client.d.mts.map +1 -1
  265. package/dist/modules/inline-edit/components/select.client.mjs +14 -7
  266. package/dist/modules/inline-edit/components/select.client.mjs.map +1 -1
  267. package/dist/modules/inline-edit/components/switch.client.d.mts +5 -3
  268. package/dist/modules/inline-edit/components/switch.client.d.mts.map +1 -1
  269. package/dist/modules/inline-edit/components/switch.client.mjs +8 -6
  270. package/dist/modules/inline-edit/components/switch.client.mjs.map +1 -1
  271. package/dist/modules/inline-edit/components/toggle.client.d.mts +6 -4
  272. package/dist/modules/inline-edit/components/toggle.client.d.mts.map +1 -1
  273. package/dist/modules/inline-edit/components/toggle.client.mjs +9 -7
  274. package/dist/modules/inline-edit/components/toggle.client.mjs.map +1 -1
  275. package/dist/modules/inline-edit/hooks/use-inline.client.d.mts +35 -3
  276. package/dist/modules/inline-edit/hooks/use-inline.client.d.mts.map +1 -1
  277. package/dist/modules/inline-edit/hooks/use-inline.client.mjs +71 -9
  278. package/dist/modules/inline-edit/hooks/use-inline.client.mjs.map +1 -1
  279. package/dist/modules/inline-edit/lib/variants.d.mts +1 -0
  280. package/dist/modules/inline-edit/lib/variants.d.mts.map +1 -1
  281. package/dist/modules/inline-edit/lib/variants.mjs +12 -4
  282. package/dist/modules/inline-edit/lib/variants.mjs.map +1 -1
  283. package/dist/modules/router/handler/init.server.d.mts +6 -6
  284. package/dist/modules/router/handler/init.server.d.mts.map +1 -1
  285. package/dist/modules/router/lib/query-client.server.d.mts +2 -2
  286. package/dist/modules/storage/components/dropzone-context.client.d.mts +2 -2
  287. package/dist/modules/storage/components/dropzone-context.client.d.mts.map +1 -1
  288. package/dist/modules/storage/components/dropzone.client.d.mts +5 -5
  289. package/dist/modules/storage/components/dropzone.client.d.mts.map +1 -1
  290. package/dist/modules/storage/components/dropzone.client.mjs +1 -1
  291. package/dist/modules/storage/components/image-grid.client.d.mts +3 -3
  292. package/dist/modules/storage/components/image-grid.client.d.mts.map +1 -1
  293. package/dist/modules/storage/components/image-grid.client.mjs +3 -3
  294. package/dist/modules/storage/components/image-grid.client.mjs.map +1 -1
  295. package/dist/modules/storage/components/upload-zone-context.client.d.mts +3 -11
  296. package/dist/modules/storage/components/upload-zone-context.client.d.mts.map +1 -1
  297. package/dist/modules/storage/components/upload-zone-context.client.mjs.map +1 -1
  298. package/dist/modules/storage/components/upload-zone.client.d.mts +10 -31
  299. package/dist/modules/storage/components/upload-zone.client.d.mts.map +1 -1
  300. package/dist/modules/storage/components/upload-zone.client.mjs +19 -91
  301. package/dist/modules/storage/components/upload-zone.client.mjs.map +1 -1
  302. package/dist/modules/storage/config/filters.d.mts +2 -0
  303. package/dist/modules/storage/config/filters.d.mts.map +1 -1
  304. package/dist/modules/storage/config/filters.mjs +3 -1
  305. package/dist/modules/storage/config/filters.mjs.map +1 -1
  306. package/dist/modules/storage/lib/create-upload.client.d.mts +56 -0
  307. package/dist/modules/storage/lib/create-upload.client.d.mts.map +1 -0
  308. package/dist/modules/storage/lib/create-upload.client.mjs +98 -0
  309. package/dist/modules/storage/lib/create-upload.client.mjs.map +1 -0
  310. package/dist/modules/storage/lib/helpers.d.mts +2 -2
  311. package/dist/modules/storage/lib/helpers.d.mts.map +1 -1
  312. package/dist/modules/storage/lib/helpers.mjs +1 -0
  313. package/dist/modules/storage/lib/helpers.mjs.map +1 -1
  314. package/dist/modules/storage/lib/router.server.d.mts +4181 -2283
  315. package/dist/modules/storage/lib/router.server.d.mts.map +1 -1
  316. package/dist/modules/storage/lib/router.server.mjs +5 -2
  317. package/dist/modules/storage/lib/router.server.mjs.map +1 -1
  318. package/dist/modules/storage/lib/schema.d.mts +156 -88
  319. package/dist/modules/storage/lib/schema.d.mts.map +1 -1
  320. package/dist/modules/storage/lib/schema.mjs +3 -1
  321. package/dist/modules/storage/lib/schema.mjs.map +1 -1
  322. package/dist/modules/storage/lib/service.server.d.mts +54 -38
  323. package/dist/modules/storage/lib/service.server.d.mts.map +1 -1
  324. package/dist/modules/storage/lib/service.server.mjs +11 -5
  325. package/dist/modules/storage/lib/service.server.mjs.map +1 -1
  326. package/dist/modules/storage/lib/validators.d.mts +232 -71
  327. package/dist/modules/storage/lib/validators.d.mts.map +1 -1
  328. package/dist/modules/storage/lib/validators.mjs +16 -25
  329. package/dist/modules/storage/lib/validators.mjs.map +1 -1
  330. package/dist/storage/client.d.mts +2 -1
  331. package/dist/storage/client.mjs +2 -8
  332. package/dist/storage.d.mts +3 -3
  333. package/dist/storage.mjs +3 -3
  334. package/package.json +2 -1
  335. package/src/components/editor/components/editor.client.tsx +7 -2
  336. package/src/components/editor/components/menu.client.tsx +26 -0
  337. package/src/components/editor/extensions/file-handler/extension.ts +69 -0
  338. package/src/components/editor/extensions/file-handler/strategy.ts +167 -0
  339. package/src/components/editor/extensions/file-handler/utils.ts +51 -0
  340. package/src/components/editor/extensions/image/extension.ts +57 -0
  341. package/src/components/editor/extensions/skeleton/extension.ts +35 -0
  342. package/src/components/editor/extensions/skeleton/renderer.tsx +14 -0
  343. package/src/components/editor/lib/constants.ts +16 -2
  344. package/src/components/editor/lib/extensions.ts +4 -1
  345. package/src/components/editor/lib/utils.ts +32 -0
  346. package/src/components/editor/lib/variants.ts +72 -1
  347. package/src/components/entry.ts +2 -1
  348. package/src/lib/hooks/use-indicator.tsx +27 -18
  349. package/src/modules/data-tables/lib/filters/parsers.ts +14 -0
  350. package/src/modules/inline-edit/components/combobox-dropdown.client.tsx +21 -12
  351. package/src/modules/inline-edit/components/combobox.client.tsx +13 -6
  352. package/src/modules/inline-edit/components/date-input.client.tsx +29 -13
  353. package/src/modules/inline-edit/components/date-picker.client.tsx +13 -9
  354. package/src/modules/inline-edit/components/editor.client.tsx +14 -14
  355. package/src/modules/inline-edit/components/input-recipient.client.tsx +15 -8
  356. package/src/modules/inline-edit/components/input-toggle.client.tsx +16 -9
  357. package/src/modules/inline-edit/components/input.client.tsx +38 -24
  358. package/src/modules/inline-edit/components/select.client.tsx +16 -9
  359. package/src/modules/inline-edit/components/switch.client.tsx +10 -6
  360. package/src/modules/inline-edit/components/toggle.client.tsx +13 -9
  361. package/src/modules/inline-edit/entry.client.ts +0 -1
  362. package/src/modules/inline-edit/hooks/use-inline.client copy.tsx +97 -0
  363. package/src/modules/inline-edit/hooks/use-inline.client.tsx +139 -20
  364. package/src/modules/inline-edit/lib/variants.ts +7 -0
  365. package/src/modules/storage/components/image-grid.client.tsx +2 -2
  366. package/src/modules/storage/components/upload-zone-context.client.tsx +3 -4
  367. package/src/modules/storage/components/upload-zone.client.tsx +17 -113
  368. package/src/modules/storage/config/filters.ts +2 -0
  369. package/src/modules/storage/entry.client.ts +2 -1
  370. package/src/modules/storage/lib/create-upload.client.ts +134 -0
  371. package/src/modules/storage/lib/helpers.ts +3 -2
  372. package/src/modules/storage/lib/router.server.ts +1 -0
  373. package/src/modules/storage/lib/schema.ts +2 -0
  374. package/src/modules/storage/lib/service.server.ts +18 -4
  375. package/src/modules/storage/lib/validators.ts +21 -31
  376. package/dist/modules/inline-edit/components/deprecated-editor.client.d.mts +0 -21
  377. package/dist/modules/inline-edit/components/deprecated-editor.client.d.mts.map +0 -1
  378. package/dist/modules/inline-edit/components/deprecated-editor.client.mjs +0 -37
  379. package/dist/modules/inline-edit/components/deprecated-editor.client.mjs.map +0 -1
  380. package/dist/storage/client.mjs.map +0 -1
  381. package/src/modules/inline-edit/components/deprecated-editor.client.tsx +0 -48
@@ -1 +1 @@
1
- {"version":3,"file":"router.server.d.mts","names":[],"sources":["../../../../src/modules/storage/lib/router.server.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;iBAoBgB,yBAAA,CAAA;;;;;;MAAA,IAAA,EAAA,OAAA;MAAyB,MAAA,EAAA,SAAA;;cAAA,qBAAA,CAAA"}
1
+ {"version":3,"file":"router.server.d.mts","names":[],"sources":["../../../../src/modules/storage/lib/router.server.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;iBAoBgB,yBAAA,CAAA;;;;;;MAAA,IAAA,EAAA,OAAA;MAAyB,MAAA,EAAA,SAAA;;cAAA,sBAAA,CAAA"}
@@ -1,7 +1,7 @@
1
+ import { isFolder } from "./helpers.mjs";
1
2
  import { ServerError } from "../../router/lib/error.server.mjs";
2
3
  import { bulkActionSchema } from "../../router/lib/validators.mjs";
3
4
  import { initRPC } from "../../router/handler/init.server.mjs";
4
- import { isFolder } from "./helpers.mjs";
5
5
  import { nodes } from "./schema.mjs";
6
6
  import { createFolderNodeSchema, getFileURLSchema, getNodesByParentIdSchema, presignFileSchema, selectNodeSchema, selectNodeWithChildrenSchema, updateNodeSchema } from "./validators.mjs";
7
7
  import { z as z$1 } from "zod";
@@ -50,7 +50,10 @@ function createDriveBaseProcedures() {
50
50
  if (!node) return null;
51
51
  return await context.storage.getSignedURL(node, options);
52
52
  }),
53
- presign: protectedProcedure.input(presignFileSchema).handler(async ({ context, input }) => context.storage.presignUpload(input)),
53
+ presign: protectedProcedure.input(presignFileSchema).output(z$1.object({
54
+ id: z$1.string(),
55
+ presignedUrl: z$1.string()
56
+ })).handler(async ({ context, input }) => context.storage.presignUpload(input)),
54
57
  confirm: protectedProcedure.input(z$1.object({ id: z$1.string() })).output(selectNodeSchema).handler(async ({ context, input }) => context.storage.confirmUpload(input)),
55
58
  createFolder: protectedProcedure.input(createFolderNodeSchema).output(selectNodeSchema).handler(async ({ context, input }) => context.storage.createFolder(input)),
56
59
  updateNode: protectedProcedure.input(z$1.object({
@@ -1 +1 @@
1
- {"version":3,"file":"router.server.mjs","names":["z"],"sources":["../../../../src/modules/storage/lib/router.server.ts"],"sourcesContent":["import { bulkActionSchema } from \"@/modules/router/entry\";\nimport { ServerError } from \"@/modules/router/entry.server\";\nimport { initRPC } from \"@/modules/router/handler/init.server\";\nimport { and, eq, sql } from \"drizzle-orm\";\nimport { z } from \"zod\";\nimport { isFolder } from \"./helpers\";\nimport { DriveSchema, nodes } from \"./schema\";\nimport {\n createFolderNodeSchema,\n getFileURLSchema,\n getNodesByParentIdSchema,\n presignFileSchema,\n selectNodeSchema,\n selectNodeWithChildrenSchema,\n updateNodeSchema,\n} from \"./validators\";\n\n/**\n * Create Drive base procedures\n */\nexport function createDriveBaseProcedures() {\n const { protectedProcedure } = initRPC<DriveSchema>();\n\n return {\n /**\n * Get node and its children\n */\n getNodeById: protectedProcedure\n .input(z.object({ id: z.string(), namespace: z.string() }))\n .output(selectNodeWithChildrenSchema.optional())\n .handler(async ({ context, input }) =>\n context.db.query.nodes.findFirst({\n where: and(eq(nodes.id, input.id), eq(nodes.namespace, input.namespace)),\n with: { children: true },\n }),\n ),\n /**\n * Get folders by parent id\n */\n getNodesByParentId: protectedProcedure\n .input(getNodesByParentIdSchema)\n .output(z.array(selectNodeSchema))\n .handler(async ({ context, input }) => context.storage.getNodesByParentId(input)),\n /**\n * Get parents of a folder\n */\n getFolderParents: protectedProcedure\n .input(z.object({ id: z.string().nullable(), namespace: z.string() }))\n .handler(async ({ context, input }) => {\n if (!input.id) return [];\n\n const startNodeQuery = context.db\n .select({\n id: nodes.id,\n name: nodes.name,\n parentId: nodes.parentId,\n depth: sql<number>`0`.as(\"depth\"),\n })\n .from(nodes)\n .where(and(eq(nodes.id, input.id), eq(nodes.namespace, input.namespace)));\n\n const alias = \"parent_nodes\";\n const parentNodesQueryAlias = startNodeQuery.as(alias);\n const recursiveQueryName = sql.raw(`\"${alias}\"`);\n\n const recursiveQuery = startNodeQuery.unionAll(\n context.db\n .select({\n id: nodes.id,\n name: nodes.name,\n parentId: nodes.parentId,\n depth: sql<number>`${parentNodesQueryAlias.depth} + 1`,\n })\n .from(nodes)\n .innerJoin(recursiveQueryName, eq(nodes.id, parentNodesQueryAlias.parentId)),\n );\n\n const result = (await context.db.execute(\n sql`WITH RECURSIVE ${recursiveQueryName} AS ${recursiveQuery}\n SELECT * FROM ${recursiveQueryName}`,\n )) as Awaited<ReturnType<(typeof recursiveQuery)[\"execute\"]>>;\n\n return result.toSorted((a, b) => Number(b.depth) - Number(a.depth));\n }),\n /**\n * Get presigned url for opening a file\n */\n getSignedURL: protectedProcedure\n .input(getFileURLSchema.extend({ id: z.string() }))\n .output(z.string().nullable())\n .handler(async ({ context, input: { id, ...options } }) => {\n const [node] = await context.db.select().from(nodes).where(eq(nodes.id, id));\n if (!node) return null;\n\n return await context.storage.getSignedURL(node, options);\n }),\n\n /**\n * Get presigned url for uploading a file\n */\n presign: protectedProcedure\n .input(presignFileSchema)\n .handler(async ({ context, input }) => context.storage.presignUpload(input)),\n /**\n * Confirm the upload\n */\n confirm: protectedProcedure\n .input(z.object({ id: z.string() }))\n .output(selectNodeSchema)\n .handler(async ({ context, input }) => context.storage.confirmUpload(input)),\n /**\n * Create a folder\n */\n createFolder: protectedProcedure\n .input(createFolderNodeSchema)\n .output(selectNodeSchema)\n .handler(async ({ context, input }) => context.storage.createFolder(input)),\n /**\n * Update node\n */\n updateNode: protectedProcedure\n .input(z.object({ id: z.string(), data: updateNodeSchema }))\n .output(selectNodeSchema)\n .handler(async ({ context, input }) => context.storage.updateNode(input)),\n /**\n * Change node parent\n */\n changeParent: protectedProcedure\n .input(z.object({ id: z.string(), parentId: z.string().nullish() }))\n .handler(async ({ context, input }) => {\n const [parent, node] = await Promise.all([\n input.parentId &&\n (await context.db.query.nodes.findFirst({\n where: eq(nodes.id, input.parentId),\n })),\n context.db.query.nodes.findFirst({\n where: eq(nodes.id, input.id),\n }),\n ]);\n\n /**\n * Validate\n */\n if (node?.readonly) {\n throw new ServerError(\"BAD_REQUEST\", {\n message: \"Deze node is alleen leesbaar en kan niet worden gewijzigd\",\n });\n }\n\n if (input.parentId && !parent)\n throw new ServerError(\"BAD_REQUEST\", { message: \"Parent not found\" });\n if (!node) throw new ServerError(\"BAD_REQUEST\", { message: \"Node not found\" });\n\n if (parent && !isFolder(parent)) {\n throw new ServerError(\"BAD_REQUEST\", { message: \"Parent is not a folder\" });\n }\n\n if (parent && parent.namespace !== node.namespace) {\n throw new ServerError(\"BAD_REQUEST\", {\n message: \"Parent is not in the same namespace\",\n });\n }\n\n /**\n * Update the parent\n */\n await context.db\n .update(nodes)\n .set({ parentId: input.parentId })\n .where(eq(nodes.id, input.id));\n }),\n /**\n * Delete nodes\n */\n deleteNodes: protectedProcedure\n .input(bulkActionSchema)\n .output(z.void())\n .handler(async ({ context, input }) => context.storage.deleteNodes(input)),\n };\n}\n"],"mappings":";;;;;;;;;;;;;AAoBA,SAAgB,4BAA4B;CAC1C,MAAM,EAAE,uBAAuB,SAAsB;AAErD,QAAO;EAIL,aAAa,mBACV,MAAMA,IAAE,OAAO;GAAE,IAAIA,IAAE,QAAQ;GAAE,WAAWA,IAAE,QAAQ;GAAE,CAAC,CAAC,CAC1D,OAAO,6BAA6B,UAAU,CAAC,CAC/C,QAAQ,OAAO,EAAE,SAAS,YACzB,QAAQ,GAAG,MAAM,MAAM,UAAU;GAC/B,OAAO,IAAI,GAAG,MAAM,IAAI,MAAM,GAAG,EAAE,GAAG,MAAM,WAAW,MAAM,UAAU,C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CAAC,EACJ,QAAQ,GAAG,MAAM,MAAM,UAAU,EAC/B,OAAO,GAAG,MAAM,IAAI,MAAM,GAAG,EAC9B,CAAC,CACH,CAAC;;;;AAKF,OAAI,MAAM,SACR,OAAM,IAAI,YAAY,eAAe,EACnC,SAAS,6DACV,CAAC;AAGJ,OAAI,MAAM,YAAY,CAAC,OACrB,OAAM,IAAI,YAAY,eAAe,EAAE,SAAS,oBAAoB,CAAC;AACvE,OAAI,CAAC,KAAM,OAAM,IAAI,YAAY,eAAe,EAAE,SAAS,kBAAkB,CAAC;AAE9E,OAAI,UAAU,CAAC,SAAS,OAAO,CAC7B,OAAM,IAAI,YAAY,eAAe,EAAE,SAAS,0BAA0B,CAAC;AAG7E,OAAI,UAAU,OAAO,cAAc,KAAK,UACtC,OAAM,IAAI,YAAY,eAAe,EACnC,SAAS,uCACV,CAAC;;;;AAMJ,SAAM,QAAQ,GACX,OAAO,MAAM,CACb,IAAI,EAAE,UAAU,MAAM,UAAU,CAAC,CACjC,MAAM,GAAG,MAAM,IAAI,MAAM,GAAG,CAAC;IAChC;EAIJ,aAAa,mBACV,MAAM,iBAAiB,CACvB,OAAOA,IAAE,MAAM,CAAC,CAChB,QAAQ,OAAO,EAAE,SAAS,YAAY,QAAQ,QAAQ,YAAY,MAAM,CAAC;EAC7E"}
1
+ {"version":3,"file":"router.server.mjs","names":["z"],"sources":["../../../../src/modules/storage/lib/router.server.ts"],"sourcesContent":["import { bulkActionSchema } from \"@/modules/router/entry\";\nimport { ServerError } from \"@/modules/router/entry.server\";\nimport { initRPC } from \"@/modules/router/handler/init.server\";\nimport { and, eq, sql } from \"drizzle-orm\";\nimport { z } from \"zod\";\nimport { isFolder } from \"./helpers\";\nimport { DriveSchema, nodes } from \"./schema\";\nimport {\n createFolderNodeSchema,\n getFileURLSchema,\n getNodesByParentIdSchema,\n presignFileSchema,\n selectNodeSchema,\n selectNodeWithChildrenSchema,\n updateNodeSchema,\n} from \"./validators\";\n\n/**\n * Create Drive base procedures\n */\nexport function createDriveBaseProcedures() {\n const { protectedProcedure } = initRPC<DriveSchema>();\n\n return {\n /**\n * Get node and its children\n */\n getNodeById: protectedProcedure\n .input(z.object({ id: z.string(), namespace: z.string() }))\n .output(selectNodeWithChildrenSchema.optional())\n .handler(async ({ context, input }) =>\n context.db.query.nodes.findFirst({\n where: and(eq(nodes.id, input.id), eq(nodes.namespace, input.namespace)),\n with: { children: true },\n }),\n ),\n /**\n * Get folders by parent id\n */\n getNodesByParentId: protectedProcedure\n .input(getNodesByParentIdSchema)\n .output(z.array(selectNodeSchema))\n .handler(async ({ context, input }) => context.storage.getNodesByParentId(input)),\n /**\n * Get parents of a folder\n */\n getFolderParents: protectedProcedure\n .input(z.object({ id: z.string().nullable(), namespace: z.string() }))\n .handler(async ({ context, input }) => {\n if (!input.id) return [];\n\n const startNodeQuery = context.db\n .select({\n id: nodes.id,\n name: nodes.name,\n parentId: nodes.parentId,\n depth: sql<number>`0`.as(\"depth\"),\n })\n .from(nodes)\n .where(and(eq(nodes.id, input.id), eq(nodes.namespace, input.namespace)));\n\n const alias = \"parent_nodes\";\n const parentNodesQueryAlias = startNodeQuery.as(alias);\n const recursiveQueryName = sql.raw(`\"${alias}\"`);\n\n const recursiveQuery = startNodeQuery.unionAll(\n context.db\n .select({\n id: nodes.id,\n name: nodes.name,\n parentId: nodes.parentId,\n depth: sql<number>`${parentNodesQueryAlias.depth} + 1`,\n })\n .from(nodes)\n .innerJoin(recursiveQueryName, eq(nodes.id, parentNodesQueryAlias.parentId)),\n );\n\n const result = (await context.db.execute(\n sql`WITH RECURSIVE ${recursiveQueryName} AS ${recursiveQuery}\n SELECT * FROM ${recursiveQueryName}`,\n )) as Awaited<ReturnType<(typeof recursiveQuery)[\"execute\"]>>;\n\n return result.toSorted((a, b) => Number(b.depth) - Number(a.depth));\n }),\n /**\n * Get presigned url for opening a file\n */\n getSignedURL: protectedProcedure\n .input(getFileURLSchema.extend({ id: z.string() }))\n .output(z.string().nullable())\n .handler(async ({ context, input: { id, ...options } }) => {\n const [node] = await context.db.select().from(nodes).where(eq(nodes.id, id));\n if (!node) return null;\n\n return await context.storage.getSignedURL(node, options);\n }),\n\n /**\n * Get presigned url for uploading a file\n */\n presign: protectedProcedure\n .input(presignFileSchema)\n .output(z.object({ id: z.string(), presignedUrl: z.string() }))\n .handler(async ({ context, input }) => context.storage.presignUpload(input)),\n /**\n * Confirm the upload\n */\n confirm: protectedProcedure\n .input(z.object({ id: z.string() }))\n .output(selectNodeSchema)\n .handler(async ({ context, input }) => context.storage.confirmUpload(input)),\n /**\n * Create a folder\n */\n createFolder: protectedProcedure\n .input(createFolderNodeSchema)\n .output(selectNodeSchema)\n .handler(async ({ context, input }) => context.storage.createFolder(input)),\n /**\n * Update node\n */\n updateNode: protectedProcedure\n .input(z.object({ id: z.string(), data: updateNodeSchema }))\n .output(selectNodeSchema)\n .handler(async ({ context, input }) => context.storage.updateNode(input)),\n /**\n * Change node parent\n */\n changeParent: protectedProcedure\n .input(z.object({ id: z.string(), parentId: z.string().nullish() }))\n .handler(async ({ context, input }) => {\n const [parent, node] = await Promise.all([\n input.parentId &&\n (await context.db.query.nodes.findFirst({\n where: eq(nodes.id, input.parentId),\n })),\n context.db.query.nodes.findFirst({\n where: eq(nodes.id, input.id),\n }),\n ]);\n\n /**\n * Validate\n */\n if (node?.readonly) {\n throw new ServerError(\"BAD_REQUEST\", {\n message: \"Deze node is alleen leesbaar en kan niet worden gewijzigd\",\n });\n }\n\n if (input.parentId && !parent)\n throw new ServerError(\"BAD_REQUEST\", { message: \"Parent not found\" });\n if (!node) throw new ServerError(\"BAD_REQUEST\", { message: \"Node not found\" });\n\n if (parent && !isFolder(parent)) {\n throw new ServerError(\"BAD_REQUEST\", { message: \"Parent is not a folder\" });\n }\n\n if (parent && parent.namespace !== node.namespace) {\n throw new ServerError(\"BAD_REQUEST\", {\n message: \"Parent is not in the same namespace\",\n });\n }\n\n /**\n * Update the parent\n */\n await context.db\n .update(nodes)\n .set({ parentId: input.parentId })\n .where(eq(nodes.id, input.id));\n }),\n /**\n * Delete nodes\n */\n deleteNodes: protectedProcedure\n .input(bulkActionSchema)\n .output(z.void())\n .handler(async ({ context, input }) => context.storage.deleteNodes(input)),\n };\n}\n"],"mappings":";;;;;;;;;;;;;AAoBA,SAAgB,4BAA4B;CAC1C,MAAM,EAAE,uBAAuB,SAAsB;AAErD,QAAO;EAIL,aAAa,mBACV,MAAMA,IAAE,OAAO;GAAE,IAAIA,IAAE,QAAQ;GAAE,WAAWA,IAAE,QAAQ;GAAE,CAAC,CAAC,CAC1D,OAAO,6BAA6B,UAAU,CAAC,CAC/C,QAAQ,OAAO,EAAE,SAAS,YACzB,QAAQ,GAAG,MAAM,MAAM,UAAU;GAC/B,OAAO,IAAI,GAAG,MAAM,IAAI,MAAM,GAAG,EAAE,GAAG,MAAM,WAAW,MAAM,UAAU,CAAC;GACxE,MAAM,EAAE,UAAU,MAAM;GACzB,CAAC,CACH;EAIH,oBAAoB,mBACjB,MAAM,yBAAyB,CAC/B,OAAOA,IAAE,MAAM,iBAAiB,CAAC,CACjC,QAAQ,OAAO,EAAE,SAAS,YAAY,QAAQ,QAAQ,mBAAmB,MAAM,CAAC;EAInF,kBAAkB,mBACf,MAAMA,IAAE,OAAO;GAAE,IAAIA,IAAE,QAAQ,CAAC,UAAU;GAAE,WAAWA,IAAE,QAAQ;GAAE,CAAC,CAAC,CACrE,QAAQ,OAAO,EAAE,SAAS,YAAY;AACrC,OAAI,CAAC,MAAM,GAAI,QAAO,EAAE;GAExB,MAAM,iBAAiB,QAAQ,GAC5B,OAAO;IACN,IAAI,MAAM;IACV,MAAM,MAAM;IACZ,UAAU,MAAM;IAChB,OAAO,GAAW,IAAI,GAAG,QAAQ;IAClC,CAAC,CACD,KAAK,MAAM,CACX,MAAM,IAAI,GAAG,MAAM,IAAI,MAAM,GAAG,EAAE,GAAG,MAAM,WAAW,MAAM,UAAU,CAAC,CAAC;GAE3E,MAAM,QAAQ;GACd,MAAM,wBAAw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