@btst/stack 1.5.1 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (461) hide show
  1. package/dist/node_modules/.pnpm/@dnd-kit_accessibility@3.1.1_react@19.2.0/node_modules/@dnd-kit/accessibility/dist/accessibility.esm.cjs +68 -0
  2. package/dist/node_modules/.pnpm/@dnd-kit_accessibility@3.1.1_react@19.2.0/node_modules/@dnd-kit/accessibility/dist/accessibility.esm.mjs +60 -0
  3. package/dist/node_modules/.pnpm/@dnd-kit_core@6.3.1_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@dnd-kit/core/dist/core.esm.cjs +3937 -0
  4. package/dist/node_modules/.pnpm/@dnd-kit_core@6.3.1_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@dnd-kit/core/dist/core.esm.mjs +3907 -0
  5. package/dist/node_modules/.pnpm/@dnd-kit_modifiers@9.0.0_@dnd-kit_core@6.3.1_react-dom@19.2.0_react@19.2.0__react@19.2.0__react@19.2.0/node_modules/@dnd-kit/modifiers/dist/modifiers.esm.cjs +30 -0
  6. package/dist/node_modules/.pnpm/@dnd-kit_modifiers@9.0.0_@dnd-kit_core@6.3.1_react-dom@19.2.0_react@19.2.0__react@19.2.0__react@19.2.0/node_modules/@dnd-kit/modifiers/dist/modifiers.esm.mjs +28 -0
  7. package/dist/node_modules/.pnpm/@dnd-kit_sortable@10.0.0_@dnd-kit_core@6.3.1_react-dom@19.2.0_react@19.2.0__react@19.2.0__react@19.2.0/node_modules/@dnd-kit/sortable/dist/sortable.esm.cjs +675 -0
  8. package/dist/node_modules/.pnpm/@dnd-kit_sortable@10.0.0_@dnd-kit_core@6.3.1_react-dom@19.2.0_react@19.2.0__react@19.2.0__react@19.2.0/node_modules/@dnd-kit/sortable/dist/sortable.esm.mjs +661 -0
  9. package/dist/node_modules/.pnpm/@dnd-kit_utilities@3.2.2_react@19.2.0/node_modules/@dnd-kit/utilities/dist/utilities.esm.cjs +358 -0
  10. package/dist/node_modules/.pnpm/@dnd-kit_utilities@3.2.2_react@19.2.0/node_modules/@dnd-kit/utilities/dist/utilities.esm.mjs +332 -0
  11. package/dist/node_modules/.pnpm/@radix-ui_react-tabs@1.1.13_@types_react-dom@19.2.3_@types_react@19.2.6__@types_react@1_865f042350eb43f3338b0fffb33f6246/node_modules/@radix-ui/react-tabs/dist/index.cjs +211 -0
  12. package/dist/node_modules/.pnpm/@radix-ui_react-tabs@1.1.13_@types_react-dom@19.2.3_@types_react@19.2.6__@types_react@1_865f042350eb43f3338b0fffb33f6246/node_modules/@radix-ui/react-tabs/dist/index.mjs +188 -0
  13. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/DayPicker.cjs +14 -2
  14. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/DayPicker.mjs +14 -2
  15. package/dist/node_modules/.pnpm/react-day-picker@9.13.0_react@19.2.0/node_modules/react-day-picker/dist/esm/noonDateLib.cjs +162 -0
  16. package/dist/node_modules/.pnpm/react-day-picker@9.13.0_react@19.2.0/node_modules/react-day-picker/dist/esm/noonDateLib.mjs +160 -0
  17. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/utils/convertMatchersToTimeZone.cjs +12 -8
  18. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/utils/convertMatchersToTimeZone.mjs +12 -8
  19. package/dist/packages/better-stack/src/plugins/cms/api/plugin.cjs +36 -6
  20. package/dist/packages/better-stack/src/plugins/cms/api/plugin.mjs +36 -6
  21. package/dist/packages/better-stack/src/plugins/cms/client/components/forms/content-form.cjs +39 -154
  22. package/dist/packages/better-stack/src/plugins/cms/client/components/forms/content-form.mjs +37 -152
  23. package/dist/packages/better-stack/src/plugins/cms/client/components/forms/file-upload.cjs +2 -2
  24. package/dist/packages/better-stack/src/plugins/cms/client/components/forms/file-upload.mjs +2 -2
  25. package/dist/packages/better-stack/src/plugins/cms/db.cjs +4 -0
  26. package/dist/packages/better-stack/src/plugins/cms/db.mjs +4 -0
  27. package/dist/packages/better-stack/src/plugins/cms/schemas.cjs +0 -1
  28. package/dist/packages/better-stack/src/plugins/cms/schemas.mjs +0 -1
  29. package/dist/packages/better-stack/src/plugins/form-builder/api/plugin.cjs +588 -0
  30. package/dist/packages/better-stack/src/plugins/form-builder/api/plugin.mjs +586 -0
  31. package/dist/packages/better-stack/src/plugins/form-builder/client/components/forms/form-renderer.cjs +131 -0
  32. package/dist/packages/better-stack/src/plugins/form-builder/client/components/forms/form-renderer.mjs +129 -0
  33. package/dist/packages/better-stack/src/plugins/form-builder/client/components/loading/form-builder-skeleton.cjs +32 -0
  34. package/dist/packages/better-stack/src/plugins/form-builder/client/components/loading/form-builder-skeleton.mjs +30 -0
  35. package/dist/packages/better-stack/src/plugins/form-builder/client/components/loading/form-list-skeleton.cjs +21 -0
  36. package/dist/packages/better-stack/src/plugins/form-builder/client/components/loading/form-list-skeleton.mjs +19 -0
  37. package/dist/packages/better-stack/src/plugins/form-builder/client/components/loading/submissions-skeleton.cjs +34 -0
  38. package/dist/packages/better-stack/src/plugins/form-builder/client/components/loading/submissions-skeleton.mjs +32 -0
  39. package/dist/packages/better-stack/src/plugins/form-builder/client/components/pages/404-page.cjs +20 -0
  40. package/dist/packages/better-stack/src/plugins/form-builder/client/components/pages/404-page.mjs +18 -0
  41. package/dist/packages/better-stack/src/plugins/form-builder/client/components/pages/form-builder-page.cjs +19 -0
  42. package/dist/packages/better-stack/src/plugins/form-builder/client/components/pages/form-builder-page.internal.cjs +186 -0
  43. package/dist/packages/better-stack/src/plugins/form-builder/client/components/pages/form-builder-page.internal.mjs +184 -0
  44. package/dist/packages/better-stack/src/plugins/form-builder/client/components/pages/form-builder-page.mjs +17 -0
  45. package/dist/packages/better-stack/src/plugins/form-builder/client/components/pages/form-list-page.cjs +19 -0
  46. package/dist/packages/better-stack/src/plugins/form-builder/client/components/pages/form-list-page.internal.cjs +165 -0
  47. package/dist/packages/better-stack/src/plugins/form-builder/client/components/pages/form-list-page.internal.mjs +163 -0
  48. package/dist/packages/better-stack/src/plugins/form-builder/client/components/pages/form-list-page.mjs +17 -0
  49. package/dist/packages/better-stack/src/plugins/form-builder/client/components/pages/submissions-page.cjs +19 -0
  50. package/dist/packages/better-stack/src/plugins/form-builder/client/components/pages/submissions-page.internal.cjs +177 -0
  51. package/dist/packages/better-stack/src/plugins/form-builder/client/components/pages/submissions-page.internal.mjs +175 -0
  52. package/dist/packages/better-stack/src/plugins/form-builder/client/components/pages/submissions-page.mjs +17 -0
  53. package/dist/packages/better-stack/src/plugins/form-builder/client/components/shared/default-error.cjs +17 -0
  54. package/dist/packages/better-stack/src/plugins/form-builder/client/components/shared/default-error.mjs +15 -0
  55. package/dist/packages/better-stack/src/plugins/form-builder/client/components/shared/empty-state.cjs +16 -0
  56. package/dist/packages/better-stack/src/plugins/form-builder/client/components/shared/empty-state.mjs +14 -0
  57. package/dist/packages/better-stack/src/plugins/form-builder/client/components/shared/page-wrapper.cjs +27 -0
  58. package/dist/packages/better-stack/src/plugins/form-builder/client/components/shared/page-wrapper.mjs +25 -0
  59. package/dist/packages/better-stack/src/plugins/form-builder/client/components/shared/pagination.cjs +39 -0
  60. package/dist/packages/better-stack/src/plugins/form-builder/client/components/shared/pagination.mjs +37 -0
  61. package/dist/packages/better-stack/src/plugins/form-builder/client/hooks/form-builder-hooks.cjs +551 -0
  62. package/dist/packages/better-stack/src/plugins/form-builder/client/hooks/form-builder-hooks.mjs +537 -0
  63. package/dist/packages/better-stack/src/plugins/form-builder/client/localization/form-builder-common.cjs +36 -0
  64. package/dist/packages/better-stack/src/plugins/form-builder/client/localization/form-builder-common.mjs +34 -0
  65. package/dist/packages/better-stack/src/plugins/form-builder/client/localization/form-builder-editor.cjs +19 -0
  66. package/dist/packages/better-stack/src/plugins/form-builder/client/localization/form-builder-editor.mjs +17 -0
  67. package/dist/packages/better-stack/src/plugins/form-builder/client/localization/form-builder-list.cjs +21 -0
  68. package/dist/packages/better-stack/src/plugins/form-builder/client/localization/form-builder-list.mjs +19 -0
  69. package/dist/packages/better-stack/src/plugins/form-builder/client/localization/form-builder-submissions.cjs +19 -0
  70. package/dist/packages/better-stack/src/plugins/form-builder/client/localization/form-builder-submissions.mjs +17 -0
  71. package/dist/packages/better-stack/src/plugins/form-builder/client/localization/form-builder-toasts.cjs +14 -0
  72. package/dist/packages/better-stack/src/plugins/form-builder/client/localization/form-builder-toasts.mjs +12 -0
  73. package/dist/packages/better-stack/src/plugins/form-builder/client/localization/index.cjs +17 -0
  74. package/dist/packages/better-stack/src/plugins/form-builder/client/localization/index.mjs +15 -0
  75. package/dist/packages/better-stack/src/plugins/form-builder/client/plugin.cjs +278 -0
  76. package/dist/packages/better-stack/src/plugins/form-builder/client/plugin.mjs +276 -0
  77. package/dist/packages/better-stack/src/plugins/form-builder/db.cjs +99 -0
  78. package/dist/packages/better-stack/src/plugins/form-builder/db.mjs +97 -0
  79. package/dist/packages/better-stack/src/plugins/form-builder/schemas.cjs +82 -0
  80. package/dist/packages/better-stack/src/plugins/form-builder/schemas.mjs +74 -0
  81. package/dist/packages/better-stack/src/plugins/form-builder/utils.cjs +37 -0
  82. package/dist/packages/better-stack/src/plugins/form-builder/utils.mjs +29 -0
  83. package/dist/packages/ui/src/components/{ui/auto-form → auto-form}/common/label.cjs +2 -2
  84. package/dist/packages/ui/src/components/{ui/auto-form → auto-form}/common/label.mjs +2 -2
  85. package/dist/packages/ui/src/components/{ui/auto-form → auto-form}/config.cjs +0 -2
  86. package/dist/packages/ui/src/components/{ui/auto-form → auto-form}/config.mjs +0 -2
  87. package/dist/packages/ui/src/components/{ui/auto-form → auto-form}/fields/array.cjs +15 -29
  88. package/dist/packages/ui/src/components/{ui/auto-form → auto-form}/fields/array.mjs +16 -16
  89. package/dist/packages/ui/src/components/{ui/auto-form → auto-form}/fields/checkbox.cjs +2 -2
  90. package/dist/packages/ui/src/components/{ui/auto-form → auto-form}/fields/checkbox.mjs +2 -2
  91. package/dist/packages/ui/src/components/{ui/auto-form → auto-form}/fields/date.cjs +29 -5
  92. package/dist/packages/ui/src/components/auto-form/fields/date.mjs +59 -0
  93. package/dist/packages/ui/src/components/{ui/auto-form → auto-form}/fields/enum.cjs +2 -2
  94. package/dist/packages/ui/src/components/{ui/auto-form → auto-form}/fields/enum.mjs +2 -2
  95. package/dist/packages/ui/src/components/{ui/auto-form → auto-form}/fields/input.cjs +2 -2
  96. package/dist/packages/ui/src/components/{ui/auto-form → auto-form}/fields/input.mjs +2 -2
  97. package/dist/packages/ui/src/components/{ui/auto-form → auto-form}/fields/number.cjs +2 -2
  98. package/dist/packages/ui/src/components/{ui/auto-form → auto-form}/fields/number.mjs +2 -2
  99. package/dist/packages/ui/src/components/{ui/auto-form → auto-form}/fields/object.cjs +7 -4
  100. package/dist/packages/ui/src/components/{ui/auto-form → auto-form}/fields/object.mjs +8 -5
  101. package/dist/packages/ui/src/components/{ui/auto-form → auto-form}/fields/radio-group.cjs +2 -2
  102. package/dist/packages/ui/src/components/{ui/auto-form → auto-form}/fields/radio-group.mjs +2 -2
  103. package/dist/packages/ui/src/components/{ui/auto-form → auto-form}/fields/switch.cjs +2 -2
  104. package/dist/packages/ui/src/components/{ui/auto-form → auto-form}/fields/switch.mjs +2 -2
  105. package/dist/packages/ui/src/components/{ui/auto-form → auto-form}/fields/textarea.cjs +2 -2
  106. package/dist/packages/ui/src/components/{ui/auto-form → auto-form}/fields/textarea.mjs +2 -2
  107. package/dist/packages/ui/src/components/{ui/auto-form → auto-form}/index.cjs +4 -14
  108. package/dist/packages/ui/src/components/{ui/auto-form → auto-form}/index.mjs +4 -11
  109. package/dist/packages/ui/src/components/auto-form/stepped-auto-form.cjs +377 -0
  110. package/dist/packages/ui/src/components/auto-form/stepped-auto-form.mjs +368 -0
  111. package/dist/packages/ui/src/components/{ui/auto-form → auto-form}/utils.cjs +83 -11
  112. package/dist/packages/ui/src/components/{ui/auto-form → auto-form}/utils.mjs +82 -11
  113. package/dist/packages/ui/src/components/calendar.cjs +2 -2
  114. package/dist/packages/ui/src/components/calendar.mjs +2 -2
  115. package/dist/packages/ui/src/components/form-builder/canvas.cjs +111 -0
  116. package/dist/packages/ui/src/components/form-builder/canvas.mjs +109 -0
  117. package/dist/packages/ui/src/components/form-builder/components/index.cjs +570 -0
  118. package/dist/packages/ui/src/components/form-builder/components/index.mjs +553 -0
  119. package/dist/packages/ui/src/components/form-builder/edit-field-dialog.cjs +131 -0
  120. package/dist/packages/ui/src/components/form-builder/edit-field-dialog.mjs +129 -0
  121. package/dist/packages/ui/src/components/form-builder/form-preview.cjs +73 -0
  122. package/dist/packages/ui/src/components/form-builder/form-preview.mjs +71 -0
  123. package/dist/packages/ui/src/components/form-builder/index.cjs +353 -0
  124. package/dist/packages/ui/src/components/form-builder/index.mjs +344 -0
  125. package/dist/packages/ui/src/components/form-builder/nested-field-editor-dialog.cjs +263 -0
  126. package/dist/packages/ui/src/components/form-builder/nested-field-editor-dialog.mjs +261 -0
  127. package/dist/packages/ui/src/components/form-builder/palette.cjs +52 -0
  128. package/dist/packages/ui/src/components/form-builder/palette.mjs +49 -0
  129. package/dist/packages/ui/src/components/form-builder/schema-utils.cjs +120 -0
  130. package/dist/packages/ui/src/components/form-builder/schema-utils.mjs +114 -0
  131. package/dist/packages/ui/src/components/form-builder/sortable-field.cjs +151 -0
  132. package/dist/packages/ui/src/components/form-builder/sortable-field.mjs +148 -0
  133. package/dist/packages/ui/src/components/form-builder/step-tabs.cjs +180 -0
  134. package/dist/packages/ui/src/components/form-builder/step-tabs.mjs +178 -0
  135. package/dist/packages/ui/src/components/form-builder/types.cjs +7 -0
  136. package/dist/packages/ui/src/components/form-builder/types.mjs +5 -0
  137. package/dist/packages/ui/src/components/form-builder/validation-schemas.cjs +67 -0
  138. package/dist/packages/ui/src/components/form-builder/validation-schemas.mjs +56 -0
  139. package/dist/packages/ui/src/components/tabs.cjs +70 -0
  140. package/dist/packages/ui/src/components/tabs.mjs +65 -0
  141. package/dist/packages/ui/src/lib/schema-converter.cjs +130 -0
  142. package/dist/packages/ui/src/lib/schema-converter.mjs +124 -0
  143. package/dist/plugins/blog/api/index.d.cts +1 -1
  144. package/dist/plugins/blog/api/index.d.mts +1 -1
  145. package/dist/plugins/blog/api/index.d.ts +1 -1
  146. package/dist/plugins/blog/client/hooks/index.d.cts +2 -2
  147. package/dist/plugins/blog/client/hooks/index.d.mts +2 -2
  148. package/dist/plugins/blog/client/hooks/index.d.ts +2 -2
  149. package/dist/plugins/blog/client/index.d.cts +1 -1
  150. package/dist/plugins/blog/client/index.d.mts +1 -1
  151. package/dist/plugins/blog/client/index.d.ts +1 -1
  152. package/dist/plugins/blog/query-keys.d.cts +2 -2
  153. package/dist/plugins/blog/query-keys.d.mts +2 -2
  154. package/dist/plugins/blog/query-keys.d.ts +2 -2
  155. package/dist/plugins/cms/api/index.d.cts +2 -4
  156. package/dist/plugins/cms/api/index.d.mts +2 -4
  157. package/dist/plugins/cms/api/index.d.ts +2 -4
  158. package/dist/plugins/cms/client/hooks/index.d.cts +1 -4
  159. package/dist/plugins/cms/client/hooks/index.d.mts +1 -4
  160. package/dist/plugins/cms/client/hooks/index.d.ts +1 -4
  161. package/dist/plugins/cms/client/index.cjs +6 -0
  162. package/dist/plugins/cms/client/index.d.cts +2 -1
  163. package/dist/plugins/cms/client/index.d.mts +2 -1
  164. package/dist/plugins/cms/client/index.d.ts +2 -1
  165. package/dist/plugins/cms/client/index.mjs +1 -0
  166. package/dist/plugins/cms/query-keys.d.cts +1 -4
  167. package/dist/plugins/cms/query-keys.d.mts +1 -4
  168. package/dist/plugins/cms/query-keys.d.ts +1 -4
  169. package/dist/plugins/form-builder/api/index.cjs +7 -0
  170. package/dist/plugins/form-builder/api/index.d.cts +141 -0
  171. package/dist/plugins/form-builder/api/index.d.mts +141 -0
  172. package/dist/plugins/form-builder/api/index.d.ts +141 -0
  173. package/dist/plugins/form-builder/api/index.mjs +1 -0
  174. package/dist/plugins/form-builder/client/components/index.cjs +29 -0
  175. package/dist/plugins/form-builder/client/components/index.d.cts +93 -0
  176. package/dist/plugins/form-builder/client/components/index.d.mts +93 -0
  177. package/dist/plugins/form-builder/client/components/index.d.ts +93 -0
  178. package/dist/plugins/form-builder/client/components/index.mjs +18 -0
  179. package/dist/plugins/form-builder/client/hooks/index.cjs +19 -0
  180. package/dist/plugins/form-builder/client/hooks/index.d.cts +154 -0
  181. package/dist/plugins/form-builder/client/hooks/index.d.mts +154 -0
  182. package/dist/plugins/form-builder/client/hooks/index.d.ts +154 -0
  183. package/dist/plugins/form-builder/client/hooks/index.mjs +1 -0
  184. package/dist/plugins/form-builder/client/index.cjs +13 -0
  185. package/dist/plugins/form-builder/client/index.d.cts +381 -0
  186. package/dist/plugins/form-builder/client/index.d.mts +381 -0
  187. package/dist/plugins/form-builder/client/index.d.ts +381 -0
  188. package/dist/plugins/form-builder/client/index.mjs +2 -0
  189. package/dist/plugins/form-builder/client.css +3 -0
  190. package/dist/plugins/form-builder/query-keys.cjs +143 -0
  191. package/dist/plugins/form-builder/query-keys.d.cts +74 -0
  192. package/dist/plugins/form-builder/query-keys.d.mts +74 -0
  193. package/dist/plugins/form-builder/query-keys.d.ts +74 -0
  194. package/dist/plugins/form-builder/query-keys.mjs +141 -0
  195. package/dist/plugins/form-builder/style.css +19 -0
  196. package/dist/shared/stack.AX5nZ6A3.d.cts +86 -0
  197. package/dist/shared/stack.AX5nZ6A3.d.mts +86 -0
  198. package/dist/shared/stack.AX5nZ6A3.d.ts +86 -0
  199. package/dist/shared/stack.BIh2AXaW.d.cts +123 -0
  200. package/dist/shared/stack.BIh2AXaW.d.mts +123 -0
  201. package/dist/shared/stack.BIh2AXaW.d.ts +123 -0
  202. package/dist/shared/stack.DzH_wcvr.d.cts +195 -0
  203. package/dist/shared/stack.DzH_wcvr.d.mts +195 -0
  204. package/dist/shared/stack.DzH_wcvr.d.ts +195 -0
  205. package/dist/shared/{stack.DwnJA87a.d.ts → stack.L-UFwz2G.d.cts} +14 -14
  206. package/dist/shared/{stack.BwkyFwF8.d.cts → stack.L-UFwz2G.d.mts} +14 -14
  207. package/dist/shared/{stack.DBqxCs0V.d.mts → stack.L-UFwz2G.d.ts} +14 -14
  208. package/package.json +54 -1
  209. package/src/plugins/cms/__tests__/schema-roundtrip.test.ts +195 -0
  210. package/src/plugins/cms/api/plugin.ts +73 -7
  211. package/src/plugins/cms/client/components/forms/content-form.tsx +66 -252
  212. package/src/plugins/cms/client/components/forms/file-upload.tsx +3 -3
  213. package/src/plugins/cms/client/index.ts +12 -1
  214. package/src/plugins/cms/client/overrides.ts +1 -1
  215. package/src/plugins/cms/db.ts +4 -0
  216. package/src/plugins/cms/schemas.ts +1 -1
  217. package/src/plugins/cms/types.ts +14 -17
  218. package/src/plugins/form-builder/api/index.ts +1 -0
  219. package/src/plugins/form-builder/api/plugin.ts +776 -0
  220. package/src/plugins/form-builder/client/components/forms/form-renderer.tsx +253 -0
  221. package/src/plugins/form-builder/client/components/index.tsx +24 -0
  222. package/src/plugins/form-builder/client/components/loading/form-builder-skeleton.tsx +42 -0
  223. package/src/plugins/form-builder/client/components/loading/form-list-skeleton.tsx +25 -0
  224. package/src/plugins/form-builder/client/components/loading/index.tsx +3 -0
  225. package/src/plugins/form-builder/client/components/loading/submissions-skeleton.tsx +40 -0
  226. package/src/plugins/form-builder/client/components/pages/404-page.tsx +28 -0
  227. package/src/plugins/form-builder/client/components/pages/form-builder-page.internal.tsx +253 -0
  228. package/src/plugins/form-builder/client/components/pages/form-builder-page.tsx +26 -0
  229. package/src/plugins/form-builder/client/components/pages/form-list-page.internal.tsx +231 -0
  230. package/src/plugins/form-builder/client/components/pages/form-list-page.tsx +22 -0
  231. package/src/plugins/form-builder/client/components/pages/submissions-page.internal.tsx +268 -0
  232. package/src/plugins/form-builder/client/components/pages/submissions-page.tsx +26 -0
  233. package/src/plugins/form-builder/client/components/shared/default-error.tsx +30 -0
  234. package/src/plugins/form-builder/client/components/shared/empty-state.tsx +26 -0
  235. package/src/plugins/form-builder/client/components/shared/page-wrapper.tsx +32 -0
  236. package/src/plugins/form-builder/client/components/shared/pagination.tsx +52 -0
  237. package/src/plugins/form-builder/client/hooks/form-builder-hooks.tsx +799 -0
  238. package/src/plugins/form-builder/client/hooks/index.tsx +1 -0
  239. package/src/plugins/form-builder/client/index.ts +22 -0
  240. package/src/plugins/form-builder/client/localization/form-builder-common.ts +36 -0
  241. package/src/plugins/form-builder/client/localization/form-builder-editor.ts +18 -0
  242. package/src/plugins/form-builder/client/localization/form-builder-list.ts +17 -0
  243. package/src/plugins/form-builder/client/localization/form-builder-submissions.ts +17 -0
  244. package/src/plugins/form-builder/client/localization/form-builder-toasts.ts +10 -0
  245. package/src/plugins/form-builder/client/localization/index.ts +15 -0
  246. package/src/plugins/form-builder/client/overrides.ts +146 -0
  247. package/src/plugins/form-builder/client/plugin.tsx +488 -0
  248. package/src/plugins/form-builder/client.css +3 -0
  249. package/src/plugins/form-builder/db.ts +99 -0
  250. package/src/plugins/form-builder/query-keys.ts +198 -0
  251. package/src/plugins/form-builder/schemas.ts +122 -0
  252. package/src/plugins/form-builder/style.css +19 -0
  253. package/src/plugins/form-builder/types.ts +317 -0
  254. package/src/plugins/form-builder/utils.ts +63 -0
  255. package/dist/packages/ui/src/components/ui/auto-form/fields/date.mjs +0 -35
  256. package/dist/packages/ui/src/components/ui/auto-form/fields/file.cjs +0 -63
  257. package/dist/packages/ui/src/components/ui/auto-form/fields/file.mjs +0 -61
  258. package/dist/shared/stack.NZJogTUn.d.cts +0 -66
  259. package/dist/shared/stack.NZJogTUn.d.mts +0 -66
  260. package/dist/shared/stack.NZJogTUn.d.ts +0 -66
  261. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/UI.cjs +0 -0
  262. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/UI.mjs +0 -0
  263. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/classes/CalendarDay.cjs +0 -0
  264. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/classes/CalendarDay.mjs +0 -0
  265. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/classes/CalendarMonth.cjs +0 -0
  266. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/classes/CalendarMonth.mjs +0 -0
  267. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/classes/CalendarWeek.cjs +0 -0
  268. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/classes/CalendarWeek.mjs +0 -0
  269. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/classes/DateLib.cjs +0 -0
  270. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/classes/DateLib.mjs +0 -0
  271. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/components/Button.cjs +0 -0
  272. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/components/Button.mjs +0 -0
  273. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/components/CaptionLabel.cjs +0 -0
  274. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/components/CaptionLabel.mjs +0 -0
  275. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/components/Chevron.cjs +0 -0
  276. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/components/Chevron.mjs +0 -0
  277. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/components/Day.cjs +0 -0
  278. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/components/Day.mjs +0 -0
  279. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/components/DayButton.cjs +0 -0
  280. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/components/DayButton.mjs +0 -0
  281. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/components/Dropdown.cjs +0 -0
  282. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/components/Dropdown.mjs +0 -0
  283. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/components/DropdownNav.cjs +0 -0
  284. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/components/DropdownNav.mjs +0 -0
  285. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/components/Footer.cjs +0 -0
  286. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/components/Footer.mjs +0 -0
  287. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/components/Month.cjs +0 -0
  288. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/components/Month.mjs +0 -0
  289. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/components/MonthCaption.cjs +0 -0
  290. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/components/MonthCaption.mjs +0 -0
  291. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/components/MonthGrid.cjs +0 -0
  292. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/components/MonthGrid.mjs +0 -0
  293. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/components/Months.cjs +0 -0
  294. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/components/Months.mjs +0 -0
  295. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/components/MonthsDropdown.cjs +0 -0
  296. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/components/MonthsDropdown.mjs +0 -0
  297. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/components/Nav.cjs +0 -0
  298. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/components/Nav.mjs +0 -0
  299. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/components/NextMonthButton.cjs +0 -0
  300. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/components/NextMonthButton.mjs +0 -0
  301. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/components/Option.cjs +0 -0
  302. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/components/Option.mjs +0 -0
  303. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/components/PreviousMonthButton.cjs +0 -0
  304. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/components/PreviousMonthButton.mjs +0 -0
  305. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/components/Root.cjs +0 -0
  306. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/components/Root.mjs +0 -0
  307. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/components/Select.cjs +0 -0
  308. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/components/Select.mjs +0 -0
  309. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/components/Week.cjs +0 -0
  310. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/components/Week.mjs +0 -0
  311. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/components/WeekNumber.cjs +0 -0
  312. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/components/WeekNumber.mjs +0 -0
  313. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/components/WeekNumberHeader.cjs +0 -0
  314. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/components/WeekNumberHeader.mjs +0 -0
  315. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/components/Weekday.cjs +0 -0
  316. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/components/Weekday.mjs +0 -0
  317. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/components/Weekdays.cjs +0 -0
  318. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/components/Weekdays.mjs +0 -0
  319. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/components/Weeks.cjs +0 -0
  320. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/components/Weeks.mjs +0 -0
  321. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/components/YearsDropdown.cjs +0 -0
  322. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/components/YearsDropdown.mjs +0 -0
  323. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/components/custom-components.cjs +0 -0
  324. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/components/custom-components.mjs +0 -0
  325. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/formatters/formatCaption.cjs +0 -0
  326. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/formatters/formatCaption.mjs +0 -0
  327. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/formatters/formatDay.cjs +0 -0
  328. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/formatters/formatDay.mjs +0 -0
  329. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/formatters/formatMonthDropdown.cjs +0 -0
  330. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/formatters/formatMonthDropdown.mjs +0 -0
  331. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/formatters/formatWeekNumber.cjs +0 -0
  332. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/formatters/formatWeekNumber.mjs +0 -0
  333. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/formatters/formatWeekNumberHeader.cjs +0 -0
  334. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/formatters/formatWeekNumberHeader.mjs +0 -0
  335. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/formatters/formatWeekdayName.cjs +0 -0
  336. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/formatters/formatWeekdayName.mjs +0 -0
  337. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/formatters/formatYearDropdown.cjs +0 -0
  338. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/formatters/formatYearDropdown.mjs +0 -0
  339. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/formatters/index.cjs +0 -0
  340. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/formatters/index.mjs +0 -0
  341. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/helpers/calculateFocusTarget.cjs +0 -0
  342. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/helpers/calculateFocusTarget.mjs +0 -0
  343. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/helpers/createGetModifiers.cjs +0 -0
  344. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/helpers/createGetModifiers.mjs +0 -0
  345. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/helpers/endOfBroadcastWeek.cjs +0 -0
  346. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/helpers/endOfBroadcastWeek.mjs +0 -0
  347. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/helpers/getBroadcastWeeksInMonth.cjs +0 -0
  348. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/helpers/getBroadcastWeeksInMonth.mjs +0 -0
  349. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/helpers/getClassNamesForModifiers.cjs +0 -0
  350. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/helpers/getClassNamesForModifiers.mjs +0 -0
  351. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/helpers/getComponents.cjs +0 -0
  352. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/helpers/getComponents.mjs +0 -0
  353. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/helpers/getDataAttributes.cjs +0 -0
  354. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/helpers/getDataAttributes.mjs +0 -0
  355. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/helpers/getDates.cjs +0 -0
  356. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/helpers/getDates.mjs +0 -0
  357. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/helpers/getDays.cjs +0 -0
  358. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/helpers/getDays.mjs +0 -0
  359. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/helpers/getDefaultClassNames.cjs +0 -0
  360. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/helpers/getDefaultClassNames.mjs +0 -0
  361. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/helpers/getDisplayMonths.cjs +0 -0
  362. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/helpers/getDisplayMonths.mjs +0 -0
  363. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/helpers/getFocusableDate.cjs +0 -0
  364. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/helpers/getFocusableDate.mjs +0 -0
  365. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/helpers/getFormatters.cjs +0 -0
  366. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/helpers/getFormatters.mjs +0 -0
  367. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/helpers/getInitialMonth.cjs +0 -0
  368. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/helpers/getInitialMonth.mjs +0 -0
  369. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/helpers/getLabels.cjs +0 -0
  370. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/helpers/getLabels.mjs +0 -0
  371. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/helpers/getMonthOptions.cjs +0 -0
  372. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/helpers/getMonthOptions.mjs +0 -0
  373. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/helpers/getMonths.cjs +0 -0
  374. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/helpers/getMonths.mjs +0 -0
  375. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/helpers/getNavMonth.cjs +0 -0
  376. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/helpers/getNavMonth.mjs +0 -0
  377. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/helpers/getNextFocus.cjs +0 -0
  378. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/helpers/getNextFocus.mjs +0 -0
  379. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/helpers/getNextMonth.cjs +0 -0
  380. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/helpers/getNextMonth.mjs +0 -0
  381. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/helpers/getPreviousMonth.cjs +0 -0
  382. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/helpers/getPreviousMonth.mjs +0 -0
  383. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/helpers/getStyleForModifiers.cjs +0 -0
  384. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/helpers/getStyleForModifiers.mjs +0 -0
  385. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/helpers/getWeekdays.cjs +0 -0
  386. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/helpers/getWeekdays.mjs +0 -0
  387. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/helpers/getWeeks.cjs +0 -0
  388. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/helpers/getWeeks.mjs +0 -0
  389. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/helpers/getYearOptions.cjs +0 -0
  390. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/helpers/getYearOptions.mjs +0 -0
  391. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/helpers/startOfBroadcastWeek.cjs +0 -0
  392. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/helpers/startOfBroadcastWeek.mjs +0 -0
  393. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/helpers/useControlledValue.cjs +0 -0
  394. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/helpers/useControlledValue.mjs +0 -0
  395. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/labels/index.cjs +0 -0
  396. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/labels/index.mjs +0 -0
  397. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/labels/labelDayButton.cjs +0 -0
  398. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/labels/labelDayButton.mjs +0 -0
  399. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/labels/labelGrid.cjs +0 -0
  400. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/labels/labelGrid.mjs +0 -0
  401. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/labels/labelGridcell.cjs +0 -0
  402. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/labels/labelGridcell.mjs +0 -0
  403. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/labels/labelMonthDropdown.cjs +0 -0
  404. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/labels/labelMonthDropdown.mjs +0 -0
  405. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/labels/labelNav.cjs +0 -0
  406. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/labels/labelNav.mjs +0 -0
  407. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/labels/labelNext.cjs +0 -0
  408. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/labels/labelNext.mjs +0 -0
  409. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/labels/labelPrevious.cjs +0 -0
  410. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/labels/labelPrevious.mjs +0 -0
  411. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/labels/labelWeekNumber.cjs +0 -0
  412. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/labels/labelWeekNumber.mjs +0 -0
  413. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/labels/labelWeekNumberHeader.cjs +0 -0
  414. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/labels/labelWeekNumberHeader.mjs +0 -0
  415. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/labels/labelWeekday.cjs +0 -0
  416. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/labels/labelWeekday.mjs +0 -0
  417. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/labels/labelYearDropdown.cjs +0 -0
  418. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/labels/labelYearDropdown.mjs +0 -0
  419. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/locale/en-US.cjs +0 -0
  420. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/locale/en-US.mjs +0 -0
  421. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/selection/useMulti.cjs +0 -0
  422. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/selection/useMulti.mjs +0 -0
  423. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/selection/useRange.cjs +0 -0
  424. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/selection/useRange.mjs +0 -0
  425. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/selection/useSingle.cjs +0 -0
  426. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/selection/useSingle.mjs +0 -0
  427. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/useAnimation.cjs +0 -0
  428. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/useAnimation.mjs +0 -0
  429. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/useCalendar.cjs +0 -0
  430. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/useCalendar.mjs +0 -0
  431. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/useDayPicker.cjs +0 -0
  432. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/useDayPicker.mjs +0 -0
  433. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/useFocus.cjs +0 -0
  434. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/useFocus.mjs +0 -0
  435. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/useSelection.cjs +0 -0
  436. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/useSelection.mjs +0 -0
  437. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/utils/addToRange.cjs +0 -0
  438. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/utils/addToRange.mjs +0 -0
  439. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/utils/dateMatchModifiers.cjs +0 -0
  440. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/utils/dateMatchModifiers.mjs +0 -0
  441. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/utils/rangeContainsDayOfWeek.cjs +0 -0
  442. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/utils/rangeContainsDayOfWeek.mjs +0 -0
  443. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/utils/rangeContainsModifiers.cjs +0 -0
  444. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/utils/rangeContainsModifiers.mjs +0 -0
  445. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/utils/rangeIncludesDate.cjs +0 -0
  446. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/utils/rangeIncludesDate.mjs +0 -0
  447. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/utils/rangeOverlaps.cjs +0 -0
  448. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/utils/rangeOverlaps.mjs +0 -0
  449. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/utils/toTimeZone.cjs +0 -0
  450. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/utils/toTimeZone.mjs +0 -0
  451. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/utils/typeguards.cjs +0 -0
  452. package/dist/node_modules/.pnpm/{react-day-picker@9.12.0_react@19.2.0 → react-day-picker@9.13.0_react@19.2.0}/node_modules/react-day-picker/dist/esm/utils/typeguards.mjs +0 -0
  453. package/dist/packages/ui/src/components/{ui/auto-form → auto-form}/common/tooltip.cjs +0 -0
  454. package/dist/packages/ui/src/components/{ui/auto-form → auto-form}/common/tooltip.mjs +0 -0
  455. package/dist/packages/ui/src/components/{ui/auto-form → auto-form}/dependencies.cjs +0 -0
  456. package/dist/packages/ui/src/components/{ui/auto-form → auto-form}/dependencies.mjs +0 -0
  457. package/dist/packages/ui/src/components/{ui/auto-form → auto-form}/types.cjs +0 -0
  458. package/dist/packages/ui/src/components/{ui/auto-form → auto-form}/types.mjs +0 -0
  459. package/dist/shared/{stack.DLhzx1-D.d.cts → stack.CcI4sYJP.d.cts} +1 -1
  460. package/dist/shared/{stack.DLhzx1-D.d.mts → stack.CcI4sYJP.d.mts} +1 -1
  461. package/dist/shared/{stack.DLhzx1-D.d.ts → stack.CcI4sYJP.d.ts} +1 -1
@@ -0,0 +1,3937 @@
1
+ 'use strict';
2
+
3
+ const React = require('react');
4
+ const ReactDOM = require('react-dom');
5
+ const utilities_esm = require('../../../../../@dnd-kit_utilities@3.2.2_react@19.2.0/node_modules/@dnd-kit/utilities/dist/utilities.esm.cjs');
6
+ const accessibility_esm = require('../../../../../@dnd-kit_accessibility@3.1.1_react@19.2.0/node_modules/@dnd-kit/accessibility/dist/accessibility.esm.cjs');
7
+
8
+ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; }
9
+
10
+ const React__default = /*#__PURE__*/_interopDefaultCompat(React);
11
+
12
+ const DndMonitorContext = /*#__PURE__*/React.createContext(null);
13
+
14
+ function useDndMonitor(listener) {
15
+ const registerListener = React.useContext(DndMonitorContext);
16
+ React.useEffect(() => {
17
+ if (!registerListener) {
18
+ throw new Error('useDndMonitor must be used within a children of <DndContext>');
19
+ }
20
+
21
+ const unsubscribe = registerListener(listener);
22
+ return unsubscribe;
23
+ }, [listener, registerListener]);
24
+ }
25
+
26
+ function useDndMonitorProvider() {
27
+ const [listeners] = React.useState(() => new Set());
28
+ const registerListener = React.useCallback(listener => {
29
+ listeners.add(listener);
30
+ return () => listeners.delete(listener);
31
+ }, [listeners]);
32
+ const dispatch = React.useCallback(_ref => {
33
+ let {
34
+ type,
35
+ event
36
+ } = _ref;
37
+ listeners.forEach(listener => {
38
+ var _listener$type;
39
+
40
+ return (_listener$type = listener[type]) == null ? void 0 : _listener$type.call(listener, event);
41
+ });
42
+ }, [listeners]);
43
+ return [dispatch, registerListener];
44
+ }
45
+
46
+ const defaultScreenReaderInstructions = {
47
+ draggable: "\n To pick up a draggable item, press the space bar.\n While dragging, use the arrow keys to move the item.\n Press space again to drop the item in its new position, or press escape to cancel.\n "
48
+ };
49
+ const defaultAnnouncements = {
50
+ onDragStart(_ref) {
51
+ let {
52
+ active
53
+ } = _ref;
54
+ return "Picked up draggable item " + active.id + ".";
55
+ },
56
+
57
+ onDragOver(_ref2) {
58
+ let {
59
+ active,
60
+ over
61
+ } = _ref2;
62
+
63
+ if (over) {
64
+ return "Draggable item " + active.id + " was moved over droppable area " + over.id + ".";
65
+ }
66
+
67
+ return "Draggable item " + active.id + " is no longer over a droppable area.";
68
+ },
69
+
70
+ onDragEnd(_ref3) {
71
+ let {
72
+ active,
73
+ over
74
+ } = _ref3;
75
+
76
+ if (over) {
77
+ return "Draggable item " + active.id + " was dropped over droppable area " + over.id;
78
+ }
79
+
80
+ return "Draggable item " + active.id + " was dropped.";
81
+ },
82
+
83
+ onDragCancel(_ref4) {
84
+ let {
85
+ active
86
+ } = _ref4;
87
+ return "Dragging was cancelled. Draggable item " + active.id + " was dropped.";
88
+ }
89
+
90
+ };
91
+
92
+ function Accessibility(_ref) {
93
+ let {
94
+ announcements = defaultAnnouncements,
95
+ container,
96
+ hiddenTextDescribedById,
97
+ screenReaderInstructions = defaultScreenReaderInstructions
98
+ } = _ref;
99
+ const {
100
+ announce,
101
+ announcement
102
+ } = accessibility_esm.useAnnouncement();
103
+ const liveRegionId = utilities_esm.useUniqueId("DndLiveRegion");
104
+ const [mounted, setMounted] = React.useState(false);
105
+ React.useEffect(() => {
106
+ setMounted(true);
107
+ }, []);
108
+ useDndMonitor(React.useMemo(() => ({
109
+ onDragStart(_ref2) {
110
+ let {
111
+ active
112
+ } = _ref2;
113
+ announce(announcements.onDragStart({
114
+ active
115
+ }));
116
+ },
117
+
118
+ onDragMove(_ref3) {
119
+ let {
120
+ active,
121
+ over
122
+ } = _ref3;
123
+
124
+ if (announcements.onDragMove) {
125
+ announce(announcements.onDragMove({
126
+ active,
127
+ over
128
+ }));
129
+ }
130
+ },
131
+
132
+ onDragOver(_ref4) {
133
+ let {
134
+ active,
135
+ over
136
+ } = _ref4;
137
+ announce(announcements.onDragOver({
138
+ active,
139
+ over
140
+ }));
141
+ },
142
+
143
+ onDragEnd(_ref5) {
144
+ let {
145
+ active,
146
+ over
147
+ } = _ref5;
148
+ announce(announcements.onDragEnd({
149
+ active,
150
+ over
151
+ }));
152
+ },
153
+
154
+ onDragCancel(_ref6) {
155
+ let {
156
+ active,
157
+ over
158
+ } = _ref6;
159
+ announce(announcements.onDragCancel({
160
+ active,
161
+ over
162
+ }));
163
+ }
164
+
165
+ }), [announce, announcements]));
166
+
167
+ if (!mounted) {
168
+ return null;
169
+ }
170
+
171
+ const markup = React__default.createElement(React__default.Fragment, null, React__default.createElement(accessibility_esm.HiddenText, {
172
+ id: hiddenTextDescribedById,
173
+ value: screenReaderInstructions.draggable
174
+ }), React__default.createElement(accessibility_esm.LiveRegion, {
175
+ id: liveRegionId,
176
+ announcement: announcement
177
+ }));
178
+ return container ? ReactDOM.createPortal(markup, container) : markup;
179
+ }
180
+
181
+ var Action;
182
+
183
+ (function (Action) {
184
+ Action["DragStart"] = "dragStart";
185
+ Action["DragMove"] = "dragMove";
186
+ Action["DragEnd"] = "dragEnd";
187
+ Action["DragCancel"] = "dragCancel";
188
+ Action["DragOver"] = "dragOver";
189
+ Action["RegisterDroppable"] = "registerDroppable";
190
+ Action["SetDroppableDisabled"] = "setDroppableDisabled";
191
+ Action["UnregisterDroppable"] = "unregisterDroppable";
192
+ })(Action || (Action = {}));
193
+
194
+ function noop() {}
195
+
196
+ function useSensor(sensor, options) {
197
+ return React.useMemo(() => ({
198
+ sensor,
199
+ options: options != null ? options : {}
200
+ }), // eslint-disable-next-line react-hooks/exhaustive-deps
201
+ [sensor, options]);
202
+ }
203
+
204
+ function useSensors() {
205
+ for (var _len = arguments.length, sensors = new Array(_len), _key = 0; _key < _len; _key++) {
206
+ sensors[_key] = arguments[_key];
207
+ }
208
+
209
+ return React.useMemo(() => [...sensors].filter(sensor => sensor != null), // eslint-disable-next-line react-hooks/exhaustive-deps
210
+ [...sensors]);
211
+ }
212
+
213
+ const defaultCoordinates = /*#__PURE__*/Object.freeze({
214
+ x: 0,
215
+ y: 0
216
+ });
217
+
218
+ /**
219
+ * Returns the distance between two points
220
+ */
221
+ function distanceBetween(p1, p2) {
222
+ return Math.sqrt(Math.pow(p1.x - p2.x, 2) + Math.pow(p1.y - p2.y, 2));
223
+ }
224
+
225
+ function getRelativeTransformOrigin(event, rect) {
226
+ const eventCoordinates = utilities_esm.getEventCoordinates(event);
227
+
228
+ if (!eventCoordinates) {
229
+ return '0 0';
230
+ }
231
+
232
+ const transformOrigin = {
233
+ x: (eventCoordinates.x - rect.left) / rect.width * 100,
234
+ y: (eventCoordinates.y - rect.top) / rect.height * 100
235
+ };
236
+ return transformOrigin.x + "% " + transformOrigin.y + "%";
237
+ }
238
+
239
+ /**
240
+ * Sort collisions from smallest to greatest value
241
+ */
242
+ function sortCollisionsAsc(_ref, _ref2) {
243
+ let {
244
+ data: {
245
+ value: a
246
+ }
247
+ } = _ref;
248
+ let {
249
+ data: {
250
+ value: b
251
+ }
252
+ } = _ref2;
253
+ return a - b;
254
+ }
255
+ /**
256
+ * Sort collisions from greatest to smallest value
257
+ */
258
+
259
+ function sortCollisionsDesc(_ref3, _ref4) {
260
+ let {
261
+ data: {
262
+ value: a
263
+ }
264
+ } = _ref3;
265
+ let {
266
+ data: {
267
+ value: b
268
+ }
269
+ } = _ref4;
270
+ return b - a;
271
+ }
272
+ /**
273
+ * Returns the coordinates of the corners of a given rectangle:
274
+ * [TopLeft {x, y}, TopRight {x, y}, BottomLeft {x, y}, BottomRight {x, y}]
275
+ */
276
+
277
+ function cornersOfRectangle(_ref5) {
278
+ let {
279
+ left,
280
+ top,
281
+ height,
282
+ width
283
+ } = _ref5;
284
+ return [{
285
+ x: left,
286
+ y: top
287
+ }, {
288
+ x: left + width,
289
+ y: top
290
+ }, {
291
+ x: left,
292
+ y: top + height
293
+ }, {
294
+ x: left + width,
295
+ y: top + height
296
+ }];
297
+ }
298
+ function getFirstCollision(collisions, property) {
299
+ if (!collisions || collisions.length === 0) {
300
+ return null;
301
+ }
302
+
303
+ const [firstCollision] = collisions;
304
+ return firstCollision[property] ;
305
+ }
306
+
307
+ /**
308
+ * Returns the coordinates of the center of a given ClientRect
309
+ */
310
+
311
+ function centerOfRectangle(rect, left, top) {
312
+ if (left === void 0) {
313
+ left = rect.left;
314
+ }
315
+
316
+ if (top === void 0) {
317
+ top = rect.top;
318
+ }
319
+
320
+ return {
321
+ x: left + rect.width * 0.5,
322
+ y: top + rect.height * 0.5
323
+ };
324
+ }
325
+ /**
326
+ * Returns the closest rectangles from an array of rectangles to the center of a given
327
+ * rectangle.
328
+ */
329
+
330
+
331
+ const closestCenter = _ref => {
332
+ let {
333
+ collisionRect,
334
+ droppableRects,
335
+ droppableContainers
336
+ } = _ref;
337
+ const centerRect = centerOfRectangle(collisionRect, collisionRect.left, collisionRect.top);
338
+ const collisions = [];
339
+
340
+ for (const droppableContainer of droppableContainers) {
341
+ const {
342
+ id
343
+ } = droppableContainer;
344
+ const rect = droppableRects.get(id);
345
+
346
+ if (rect) {
347
+ const distBetween = distanceBetween(centerOfRectangle(rect), centerRect);
348
+ collisions.push({
349
+ id,
350
+ data: {
351
+ droppableContainer,
352
+ value: distBetween
353
+ }
354
+ });
355
+ }
356
+ }
357
+
358
+ return collisions.sort(sortCollisionsAsc);
359
+ };
360
+
361
+ /**
362
+ * Returns the closest rectangles from an array of rectangles to the corners of
363
+ * another rectangle.
364
+ */
365
+
366
+ const closestCorners = _ref => {
367
+ let {
368
+ collisionRect,
369
+ droppableRects,
370
+ droppableContainers
371
+ } = _ref;
372
+ const corners = cornersOfRectangle(collisionRect);
373
+ const collisions = [];
374
+
375
+ for (const droppableContainer of droppableContainers) {
376
+ const {
377
+ id
378
+ } = droppableContainer;
379
+ const rect = droppableRects.get(id);
380
+
381
+ if (rect) {
382
+ const rectCorners = cornersOfRectangle(rect);
383
+ const distances = corners.reduce((accumulator, corner, index) => {
384
+ return accumulator + distanceBetween(rectCorners[index], corner);
385
+ }, 0);
386
+ const effectiveDistance = Number((distances / 4).toFixed(4));
387
+ collisions.push({
388
+ id,
389
+ data: {
390
+ droppableContainer,
391
+ value: effectiveDistance
392
+ }
393
+ });
394
+ }
395
+ }
396
+
397
+ return collisions.sort(sortCollisionsAsc);
398
+ };
399
+
400
+ /**
401
+ * Returns the intersecting rectangle area between two rectangles
402
+ */
403
+
404
+ function getIntersectionRatio(entry, target) {
405
+ const top = Math.max(target.top, entry.top);
406
+ const left = Math.max(target.left, entry.left);
407
+ const right = Math.min(target.left + target.width, entry.left + entry.width);
408
+ const bottom = Math.min(target.top + target.height, entry.top + entry.height);
409
+ const width = right - left;
410
+ const height = bottom - top;
411
+
412
+ if (left < right && top < bottom) {
413
+ const targetArea = target.width * target.height;
414
+ const entryArea = entry.width * entry.height;
415
+ const intersectionArea = width * height;
416
+ const intersectionRatio = intersectionArea / (targetArea + entryArea - intersectionArea);
417
+ return Number(intersectionRatio.toFixed(4));
418
+ } // Rectangles do not overlap, or overlap has an area of zero (edge/corner overlap)
419
+
420
+
421
+ return 0;
422
+ }
423
+ /**
424
+ * Returns the rectangles that has the greatest intersection area with a given
425
+ * rectangle in an array of rectangles.
426
+ */
427
+
428
+ const rectIntersection = _ref => {
429
+ let {
430
+ collisionRect,
431
+ droppableRects,
432
+ droppableContainers
433
+ } = _ref;
434
+ const collisions = [];
435
+
436
+ for (const droppableContainer of droppableContainers) {
437
+ const {
438
+ id
439
+ } = droppableContainer;
440
+ const rect = droppableRects.get(id);
441
+
442
+ if (rect) {
443
+ const intersectionRatio = getIntersectionRatio(rect, collisionRect);
444
+
445
+ if (intersectionRatio > 0) {
446
+ collisions.push({
447
+ id,
448
+ data: {
449
+ droppableContainer,
450
+ value: intersectionRatio
451
+ }
452
+ });
453
+ }
454
+ }
455
+ }
456
+
457
+ return collisions.sort(sortCollisionsDesc);
458
+ };
459
+
460
+ function adjustScale(transform, rect1, rect2) {
461
+ return { ...transform,
462
+ scaleX: rect1 && rect2 ? rect1.width / rect2.width : 1,
463
+ scaleY: rect1 && rect2 ? rect1.height / rect2.height : 1
464
+ };
465
+ }
466
+
467
+ function getRectDelta(rect1, rect2) {
468
+ return rect1 && rect2 ? {
469
+ x: rect1.left - rect2.left,
470
+ y: rect1.top - rect2.top
471
+ } : defaultCoordinates;
472
+ }
473
+
474
+ function createRectAdjustmentFn(modifier) {
475
+ return function adjustClientRect(rect) {
476
+ for (var _len = arguments.length, adjustments = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
477
+ adjustments[_key - 1] = arguments[_key];
478
+ }
479
+
480
+ return adjustments.reduce((acc, adjustment) => ({ ...acc,
481
+ top: acc.top + modifier * adjustment.y,
482
+ bottom: acc.bottom + modifier * adjustment.y,
483
+ left: acc.left + modifier * adjustment.x,
484
+ right: acc.right + modifier * adjustment.x
485
+ }), { ...rect
486
+ });
487
+ };
488
+ }
489
+ const getAdjustedRect = /*#__PURE__*/createRectAdjustmentFn(1);
490
+
491
+ function parseTransform(transform) {
492
+ if (transform.startsWith('matrix3d(')) {
493
+ const transformArray = transform.slice(9, -1).split(/, /);
494
+ return {
495
+ x: +transformArray[12],
496
+ y: +transformArray[13],
497
+ scaleX: +transformArray[0],
498
+ scaleY: +transformArray[5]
499
+ };
500
+ } else if (transform.startsWith('matrix(')) {
501
+ const transformArray = transform.slice(7, -1).split(/, /);
502
+ return {
503
+ x: +transformArray[4],
504
+ y: +transformArray[5],
505
+ scaleX: +transformArray[0],
506
+ scaleY: +transformArray[3]
507
+ };
508
+ }
509
+
510
+ return null;
511
+ }
512
+
513
+ function inverseTransform(rect, transform, transformOrigin) {
514
+ const parsedTransform = parseTransform(transform);
515
+
516
+ if (!parsedTransform) {
517
+ return rect;
518
+ }
519
+
520
+ const {
521
+ scaleX,
522
+ scaleY,
523
+ x: translateX,
524
+ y: translateY
525
+ } = parsedTransform;
526
+ const x = rect.left - translateX - (1 - scaleX) * parseFloat(transformOrigin);
527
+ const y = rect.top - translateY - (1 - scaleY) * parseFloat(transformOrigin.slice(transformOrigin.indexOf(' ') + 1));
528
+ const w = scaleX ? rect.width / scaleX : rect.width;
529
+ const h = scaleY ? rect.height / scaleY : rect.height;
530
+ return {
531
+ width: w,
532
+ height: h,
533
+ top: y,
534
+ right: x + w,
535
+ bottom: y + h,
536
+ left: x
537
+ };
538
+ }
539
+
540
+ const defaultOptions = {
541
+ ignoreTransform: false
542
+ };
543
+ /**
544
+ * Returns the bounding client rect of an element relative to the viewport.
545
+ */
546
+
547
+ function getClientRect(element, options) {
548
+ if (options === void 0) {
549
+ options = defaultOptions;
550
+ }
551
+
552
+ let rect = element.getBoundingClientRect();
553
+
554
+ if (options.ignoreTransform) {
555
+ const {
556
+ transform,
557
+ transformOrigin
558
+ } = utilities_esm.getWindow(element).getComputedStyle(element);
559
+
560
+ if (transform) {
561
+ rect = inverseTransform(rect, transform, transformOrigin);
562
+ }
563
+ }
564
+
565
+ const {
566
+ top,
567
+ left,
568
+ width,
569
+ height,
570
+ bottom,
571
+ right
572
+ } = rect;
573
+ return {
574
+ top,
575
+ left,
576
+ width,
577
+ height,
578
+ bottom,
579
+ right
580
+ };
581
+ }
582
+ /**
583
+ * Returns the bounding client rect of an element relative to the viewport.
584
+ *
585
+ * @remarks
586
+ * The ClientRect returned by this method does not take into account transforms
587
+ * applied to the element it measures.
588
+ *
589
+ */
590
+
591
+ function getTransformAgnosticClientRect(element) {
592
+ return getClientRect(element, {
593
+ ignoreTransform: true
594
+ });
595
+ }
596
+
597
+ function getWindowClientRect(element) {
598
+ const width = element.innerWidth;
599
+ const height = element.innerHeight;
600
+ return {
601
+ top: 0,
602
+ left: 0,
603
+ right: width,
604
+ bottom: height,
605
+ width,
606
+ height
607
+ };
608
+ }
609
+
610
+ function isFixed(node, computedStyle) {
611
+ if (computedStyle === void 0) {
612
+ computedStyle = utilities_esm.getWindow(node).getComputedStyle(node);
613
+ }
614
+
615
+ return computedStyle.position === 'fixed';
616
+ }
617
+
618
+ function isScrollable(element, computedStyle) {
619
+ if (computedStyle === void 0) {
620
+ computedStyle = utilities_esm.getWindow(element).getComputedStyle(element);
621
+ }
622
+
623
+ const overflowRegex = /(auto|scroll|overlay)/;
624
+ const properties = ['overflow', 'overflowX', 'overflowY'];
625
+ return properties.some(property => {
626
+ const value = computedStyle[property];
627
+ return typeof value === 'string' ? overflowRegex.test(value) : false;
628
+ });
629
+ }
630
+
631
+ function getScrollableAncestors(element, limit) {
632
+ const scrollParents = [];
633
+
634
+ function findScrollableAncestors(node) {
635
+ if (limit != null && scrollParents.length >= limit) {
636
+ return scrollParents;
637
+ }
638
+
639
+ if (!node) {
640
+ return scrollParents;
641
+ }
642
+
643
+ if (utilities_esm.isDocument(node) && node.scrollingElement != null && !scrollParents.includes(node.scrollingElement)) {
644
+ scrollParents.push(node.scrollingElement);
645
+ return scrollParents;
646
+ }
647
+
648
+ if (!utilities_esm.isHTMLElement(node) || utilities_esm.isSVGElement(node)) {
649
+ return scrollParents;
650
+ }
651
+
652
+ if (scrollParents.includes(node)) {
653
+ return scrollParents;
654
+ }
655
+
656
+ const computedStyle = utilities_esm.getWindow(element).getComputedStyle(node);
657
+
658
+ if (node !== element) {
659
+ if (isScrollable(node, computedStyle)) {
660
+ scrollParents.push(node);
661
+ }
662
+ }
663
+
664
+ if (isFixed(node, computedStyle)) {
665
+ return scrollParents;
666
+ }
667
+
668
+ return findScrollableAncestors(node.parentNode);
669
+ }
670
+
671
+ if (!element) {
672
+ return scrollParents;
673
+ }
674
+
675
+ return findScrollableAncestors(element);
676
+ }
677
+ function getFirstScrollableAncestor(node) {
678
+ const [firstScrollableAncestor] = getScrollableAncestors(node, 1);
679
+ return firstScrollableAncestor != null ? firstScrollableAncestor : null;
680
+ }
681
+
682
+ function getScrollableElement(element) {
683
+ if (!utilities_esm.canUseDOM || !element) {
684
+ return null;
685
+ }
686
+
687
+ if (utilities_esm.isWindow(element)) {
688
+ return element;
689
+ }
690
+
691
+ if (!utilities_esm.isNode(element)) {
692
+ return null;
693
+ }
694
+
695
+ if (utilities_esm.isDocument(element) || element === utilities_esm.getOwnerDocument(element).scrollingElement) {
696
+ return window;
697
+ }
698
+
699
+ if (utilities_esm.isHTMLElement(element)) {
700
+ return element;
701
+ }
702
+
703
+ return null;
704
+ }
705
+
706
+ function getScrollXCoordinate(element) {
707
+ if (utilities_esm.isWindow(element)) {
708
+ return element.scrollX;
709
+ }
710
+
711
+ return element.scrollLeft;
712
+ }
713
+ function getScrollYCoordinate(element) {
714
+ if (utilities_esm.isWindow(element)) {
715
+ return element.scrollY;
716
+ }
717
+
718
+ return element.scrollTop;
719
+ }
720
+ function getScrollCoordinates(element) {
721
+ return {
722
+ x: getScrollXCoordinate(element),
723
+ y: getScrollYCoordinate(element)
724
+ };
725
+ }
726
+
727
+ var Direction;
728
+
729
+ (function (Direction) {
730
+ Direction[Direction["Forward"] = 1] = "Forward";
731
+ Direction[Direction["Backward"] = -1] = "Backward";
732
+ })(Direction || (Direction = {}));
733
+
734
+ function isDocumentScrollingElement(element) {
735
+ if (!utilities_esm.canUseDOM || !element) {
736
+ return false;
737
+ }
738
+
739
+ return element === document.scrollingElement;
740
+ }
741
+
742
+ function getScrollPosition(scrollingContainer) {
743
+ const minScroll = {
744
+ x: 0,
745
+ y: 0
746
+ };
747
+ const dimensions = isDocumentScrollingElement(scrollingContainer) ? {
748
+ height: window.innerHeight,
749
+ width: window.innerWidth
750
+ } : {
751
+ height: scrollingContainer.clientHeight,
752
+ width: scrollingContainer.clientWidth
753
+ };
754
+ const maxScroll = {
755
+ x: scrollingContainer.scrollWidth - dimensions.width,
756
+ y: scrollingContainer.scrollHeight - dimensions.height
757
+ };
758
+ const isTop = scrollingContainer.scrollTop <= minScroll.y;
759
+ const isLeft = scrollingContainer.scrollLeft <= minScroll.x;
760
+ const isBottom = scrollingContainer.scrollTop >= maxScroll.y;
761
+ const isRight = scrollingContainer.scrollLeft >= maxScroll.x;
762
+ return {
763
+ isTop,
764
+ isLeft,
765
+ isBottom,
766
+ isRight,
767
+ maxScroll,
768
+ minScroll
769
+ };
770
+ }
771
+
772
+ const defaultThreshold = {
773
+ x: 0.2,
774
+ y: 0.2
775
+ };
776
+ function getScrollDirectionAndSpeed(scrollContainer, scrollContainerRect, _ref, acceleration, thresholdPercentage) {
777
+ let {
778
+ top,
779
+ left,
780
+ right,
781
+ bottom
782
+ } = _ref;
783
+
784
+ if (acceleration === void 0) {
785
+ acceleration = 10;
786
+ }
787
+
788
+ if (thresholdPercentage === void 0) {
789
+ thresholdPercentage = defaultThreshold;
790
+ }
791
+
792
+ const {
793
+ isTop,
794
+ isBottom,
795
+ isLeft,
796
+ isRight
797
+ } = getScrollPosition(scrollContainer);
798
+ const direction = {
799
+ x: 0,
800
+ y: 0
801
+ };
802
+ const speed = {
803
+ x: 0,
804
+ y: 0
805
+ };
806
+ const threshold = {
807
+ height: scrollContainerRect.height * thresholdPercentage.y,
808
+ width: scrollContainerRect.width * thresholdPercentage.x
809
+ };
810
+
811
+ if (!isTop && top <= scrollContainerRect.top + threshold.height) {
812
+ // Scroll Up
813
+ direction.y = Direction.Backward;
814
+ speed.y = acceleration * Math.abs((scrollContainerRect.top + threshold.height - top) / threshold.height);
815
+ } else if (!isBottom && bottom >= scrollContainerRect.bottom - threshold.height) {
816
+ // Scroll Down
817
+ direction.y = Direction.Forward;
818
+ speed.y = acceleration * Math.abs((scrollContainerRect.bottom - threshold.height - bottom) / threshold.height);
819
+ }
820
+
821
+ if (!isRight && right >= scrollContainerRect.right - threshold.width) {
822
+ // Scroll Right
823
+ direction.x = Direction.Forward;
824
+ speed.x = acceleration * Math.abs((scrollContainerRect.right - threshold.width - right) / threshold.width);
825
+ } else if (!isLeft && left <= scrollContainerRect.left + threshold.width) {
826
+ // Scroll Left
827
+ direction.x = Direction.Backward;
828
+ speed.x = acceleration * Math.abs((scrollContainerRect.left + threshold.width - left) / threshold.width);
829
+ }
830
+
831
+ return {
832
+ direction,
833
+ speed
834
+ };
835
+ }
836
+
837
+ function getScrollElementRect(element) {
838
+ if (element === document.scrollingElement) {
839
+ const {
840
+ innerWidth,
841
+ innerHeight
842
+ } = window;
843
+ return {
844
+ top: 0,
845
+ left: 0,
846
+ right: innerWidth,
847
+ bottom: innerHeight,
848
+ width: innerWidth,
849
+ height: innerHeight
850
+ };
851
+ }
852
+
853
+ const {
854
+ top,
855
+ left,
856
+ right,
857
+ bottom
858
+ } = element.getBoundingClientRect();
859
+ return {
860
+ top,
861
+ left,
862
+ right,
863
+ bottom,
864
+ width: element.clientWidth,
865
+ height: element.clientHeight
866
+ };
867
+ }
868
+
869
+ function getScrollOffsets(scrollableAncestors) {
870
+ return scrollableAncestors.reduce((acc, node) => {
871
+ return utilities_esm.add(acc, getScrollCoordinates(node));
872
+ }, defaultCoordinates);
873
+ }
874
+ function getScrollXOffset(scrollableAncestors) {
875
+ return scrollableAncestors.reduce((acc, node) => {
876
+ return acc + getScrollXCoordinate(node);
877
+ }, 0);
878
+ }
879
+ function getScrollYOffset(scrollableAncestors) {
880
+ return scrollableAncestors.reduce((acc, node) => {
881
+ return acc + getScrollYCoordinate(node);
882
+ }, 0);
883
+ }
884
+
885
+ function scrollIntoViewIfNeeded(element, measure) {
886
+ if (measure === void 0) {
887
+ measure = getClientRect;
888
+ }
889
+
890
+ if (!element) {
891
+ return;
892
+ }
893
+
894
+ const {
895
+ top,
896
+ left,
897
+ bottom,
898
+ right
899
+ } = measure(element);
900
+ const firstScrollableAncestor = getFirstScrollableAncestor(element);
901
+
902
+ if (!firstScrollableAncestor) {
903
+ return;
904
+ }
905
+
906
+ if (bottom <= 0 || right <= 0 || top >= window.innerHeight || left >= window.innerWidth) {
907
+ element.scrollIntoView({
908
+ block: 'center',
909
+ inline: 'center'
910
+ });
911
+ }
912
+ }
913
+
914
+ const properties = [['x', ['left', 'right'], getScrollXOffset], ['y', ['top', 'bottom'], getScrollYOffset]];
915
+ class Rect {
916
+ constructor(rect, element) {
917
+ this.rect = void 0;
918
+ this.width = void 0;
919
+ this.height = void 0;
920
+ this.top = void 0;
921
+ this.bottom = void 0;
922
+ this.right = void 0;
923
+ this.left = void 0;
924
+ const scrollableAncestors = getScrollableAncestors(element);
925
+ const scrollOffsets = getScrollOffsets(scrollableAncestors);
926
+ this.rect = { ...rect
927
+ };
928
+ this.width = rect.width;
929
+ this.height = rect.height;
930
+
931
+ for (const [axis, keys, getScrollOffset] of properties) {
932
+ for (const key of keys) {
933
+ Object.defineProperty(this, key, {
934
+ get: () => {
935
+ const currentOffsets = getScrollOffset(scrollableAncestors);
936
+ const scrollOffsetsDeltla = scrollOffsets[axis] - currentOffsets;
937
+ return this.rect[key] + scrollOffsetsDeltla;
938
+ },
939
+ enumerable: true
940
+ });
941
+ }
942
+ }
943
+
944
+ Object.defineProperty(this, 'rect', {
945
+ enumerable: false
946
+ });
947
+ }
948
+
949
+ }
950
+
951
+ class Listeners {
952
+ constructor(target) {
953
+ this.target = void 0;
954
+ this.listeners = [];
955
+
956
+ this.removeAll = () => {
957
+ this.listeners.forEach(listener => {
958
+ var _this$target;
959
+
960
+ return (_this$target = this.target) == null ? void 0 : _this$target.removeEventListener(...listener);
961
+ });
962
+ };
963
+
964
+ this.target = target;
965
+ }
966
+
967
+ add(eventName, handler, options) {
968
+ var _this$target2;
969
+
970
+ (_this$target2 = this.target) == null ? void 0 : _this$target2.addEventListener(eventName, handler, options);
971
+ this.listeners.push([eventName, handler, options]);
972
+ }
973
+
974
+ }
975
+
976
+ function getEventListenerTarget(target) {
977
+ // If the `event.target` element is removed from the document events will still be targeted
978
+ // at it, and hence won't always bubble up to the window or document anymore.
979
+ // If there is any risk of an element being removed while it is being dragged,
980
+ // the best practice is to attach the event listeners directly to the target.
981
+ // https://developer.mozilla.org/en-US/docs/Web/API/EventTarget
982
+ const {
983
+ EventTarget
984
+ } = utilities_esm.getWindow(target);
985
+ return target instanceof EventTarget ? target : utilities_esm.getOwnerDocument(target);
986
+ }
987
+
988
+ function hasExceededDistance(delta, measurement) {
989
+ const dx = Math.abs(delta.x);
990
+ const dy = Math.abs(delta.y);
991
+
992
+ if (typeof measurement === 'number') {
993
+ return Math.sqrt(dx ** 2 + dy ** 2) > measurement;
994
+ }
995
+
996
+ if ('x' in measurement && 'y' in measurement) {
997
+ return dx > measurement.x && dy > measurement.y;
998
+ }
999
+
1000
+ if ('x' in measurement) {
1001
+ return dx > measurement.x;
1002
+ }
1003
+
1004
+ if ('y' in measurement) {
1005
+ return dy > measurement.y;
1006
+ }
1007
+
1008
+ return false;
1009
+ }
1010
+
1011
+ var EventName;
1012
+
1013
+ (function (EventName) {
1014
+ EventName["Click"] = "click";
1015
+ EventName["DragStart"] = "dragstart";
1016
+ EventName["Keydown"] = "keydown";
1017
+ EventName["ContextMenu"] = "contextmenu";
1018
+ EventName["Resize"] = "resize";
1019
+ EventName["SelectionChange"] = "selectionchange";
1020
+ EventName["VisibilityChange"] = "visibilitychange";
1021
+ })(EventName || (EventName = {}));
1022
+
1023
+ function preventDefault(event) {
1024
+ event.preventDefault();
1025
+ }
1026
+ function stopPropagation(event) {
1027
+ event.stopPropagation();
1028
+ }
1029
+
1030
+ exports.KeyboardCode = void 0;
1031
+
1032
+ (function (KeyboardCode) {
1033
+ KeyboardCode["Space"] = "Space";
1034
+ KeyboardCode["Down"] = "ArrowDown";
1035
+ KeyboardCode["Right"] = "ArrowRight";
1036
+ KeyboardCode["Left"] = "ArrowLeft";
1037
+ KeyboardCode["Up"] = "ArrowUp";
1038
+ KeyboardCode["Esc"] = "Escape";
1039
+ KeyboardCode["Enter"] = "Enter";
1040
+ KeyboardCode["Tab"] = "Tab";
1041
+ })(exports.KeyboardCode || (exports.KeyboardCode = {}));
1042
+
1043
+ const defaultKeyboardCodes = {
1044
+ start: [exports.KeyboardCode.Space, exports.KeyboardCode.Enter],
1045
+ cancel: [exports.KeyboardCode.Esc],
1046
+ end: [exports.KeyboardCode.Space, exports.KeyboardCode.Enter, exports.KeyboardCode.Tab]
1047
+ };
1048
+ const defaultKeyboardCoordinateGetter = (event, _ref) => {
1049
+ let {
1050
+ currentCoordinates
1051
+ } = _ref;
1052
+
1053
+ switch (event.code) {
1054
+ case exports.KeyboardCode.Right:
1055
+ return { ...currentCoordinates,
1056
+ x: currentCoordinates.x + 25
1057
+ };
1058
+
1059
+ case exports.KeyboardCode.Left:
1060
+ return { ...currentCoordinates,
1061
+ x: currentCoordinates.x - 25
1062
+ };
1063
+
1064
+ case exports.KeyboardCode.Down:
1065
+ return { ...currentCoordinates,
1066
+ y: currentCoordinates.y + 25
1067
+ };
1068
+
1069
+ case exports.KeyboardCode.Up:
1070
+ return { ...currentCoordinates,
1071
+ y: currentCoordinates.y - 25
1072
+ };
1073
+ }
1074
+
1075
+ return undefined;
1076
+ };
1077
+
1078
+ class KeyboardSensor {
1079
+ constructor(props) {
1080
+ this.props = void 0;
1081
+ this.autoScrollEnabled = false;
1082
+ this.referenceCoordinates = void 0;
1083
+ this.listeners = void 0;
1084
+ this.windowListeners = void 0;
1085
+ this.props = props;
1086
+ const {
1087
+ event: {
1088
+ target
1089
+ }
1090
+ } = props;
1091
+ this.props = props;
1092
+ this.listeners = new Listeners(utilities_esm.getOwnerDocument(target));
1093
+ this.windowListeners = new Listeners(utilities_esm.getWindow(target));
1094
+ this.handleKeyDown = this.handleKeyDown.bind(this);
1095
+ this.handleCancel = this.handleCancel.bind(this);
1096
+ this.attach();
1097
+ }
1098
+
1099
+ attach() {
1100
+ this.handleStart();
1101
+ this.windowListeners.add(EventName.Resize, this.handleCancel);
1102
+ this.windowListeners.add(EventName.VisibilityChange, this.handleCancel);
1103
+ setTimeout(() => this.listeners.add(EventName.Keydown, this.handleKeyDown));
1104
+ }
1105
+
1106
+ handleStart() {
1107
+ const {
1108
+ activeNode,
1109
+ onStart
1110
+ } = this.props;
1111
+ const node = activeNode.node.current;
1112
+
1113
+ if (node) {
1114
+ scrollIntoViewIfNeeded(node);
1115
+ }
1116
+
1117
+ onStart(defaultCoordinates);
1118
+ }
1119
+
1120
+ handleKeyDown(event) {
1121
+ if (utilities_esm.isKeyboardEvent(event)) {
1122
+ const {
1123
+ active,
1124
+ context,
1125
+ options
1126
+ } = this.props;
1127
+ const {
1128
+ keyboardCodes = defaultKeyboardCodes,
1129
+ coordinateGetter = defaultKeyboardCoordinateGetter,
1130
+ scrollBehavior = 'smooth'
1131
+ } = options;
1132
+ const {
1133
+ code
1134
+ } = event;
1135
+
1136
+ if (keyboardCodes.end.includes(code)) {
1137
+ this.handleEnd(event);
1138
+ return;
1139
+ }
1140
+
1141
+ if (keyboardCodes.cancel.includes(code)) {
1142
+ this.handleCancel(event);
1143
+ return;
1144
+ }
1145
+
1146
+ const {
1147
+ collisionRect
1148
+ } = context.current;
1149
+ const currentCoordinates = collisionRect ? {
1150
+ x: collisionRect.left,
1151
+ y: collisionRect.top
1152
+ } : defaultCoordinates;
1153
+
1154
+ if (!this.referenceCoordinates) {
1155
+ this.referenceCoordinates = currentCoordinates;
1156
+ }
1157
+
1158
+ const newCoordinates = coordinateGetter(event, {
1159
+ active,
1160
+ context: context.current,
1161
+ currentCoordinates
1162
+ });
1163
+
1164
+ if (newCoordinates) {
1165
+ const coordinatesDelta = utilities_esm.subtract(newCoordinates, currentCoordinates);
1166
+ const scrollDelta = {
1167
+ x: 0,
1168
+ y: 0
1169
+ };
1170
+ const {
1171
+ scrollableAncestors
1172
+ } = context.current;
1173
+
1174
+ for (const scrollContainer of scrollableAncestors) {
1175
+ const direction = event.code;
1176
+ const {
1177
+ isTop,
1178
+ isRight,
1179
+ isLeft,
1180
+ isBottom,
1181
+ maxScroll,
1182
+ minScroll
1183
+ } = getScrollPosition(scrollContainer);
1184
+ const scrollElementRect = getScrollElementRect(scrollContainer);
1185
+ const clampedCoordinates = {
1186
+ x: Math.min(direction === exports.KeyboardCode.Right ? scrollElementRect.right - scrollElementRect.width / 2 : scrollElementRect.right, Math.max(direction === exports.KeyboardCode.Right ? scrollElementRect.left : scrollElementRect.left + scrollElementRect.width / 2, newCoordinates.x)),
1187
+ y: Math.min(direction === exports.KeyboardCode.Down ? scrollElementRect.bottom - scrollElementRect.height / 2 : scrollElementRect.bottom, Math.max(direction === exports.KeyboardCode.Down ? scrollElementRect.top : scrollElementRect.top + scrollElementRect.height / 2, newCoordinates.y))
1188
+ };
1189
+ const canScrollX = direction === exports.KeyboardCode.Right && !isRight || direction === exports.KeyboardCode.Left && !isLeft;
1190
+ const canScrollY = direction === exports.KeyboardCode.Down && !isBottom || direction === exports.KeyboardCode.Up && !isTop;
1191
+
1192
+ if (canScrollX && clampedCoordinates.x !== newCoordinates.x) {
1193
+ const newScrollCoordinates = scrollContainer.scrollLeft + coordinatesDelta.x;
1194
+ const canScrollToNewCoordinates = direction === exports.KeyboardCode.Right && newScrollCoordinates <= maxScroll.x || direction === exports.KeyboardCode.Left && newScrollCoordinates >= minScroll.x;
1195
+
1196
+ if (canScrollToNewCoordinates && !coordinatesDelta.y) {
1197
+ // We don't need to update coordinates, the scroll adjustment alone will trigger
1198
+ // logic to auto-detect the new container we are over
1199
+ scrollContainer.scrollTo({
1200
+ left: newScrollCoordinates,
1201
+ behavior: scrollBehavior
1202
+ });
1203
+ return;
1204
+ }
1205
+
1206
+ if (canScrollToNewCoordinates) {
1207
+ scrollDelta.x = scrollContainer.scrollLeft - newScrollCoordinates;
1208
+ } else {
1209
+ scrollDelta.x = direction === exports.KeyboardCode.Right ? scrollContainer.scrollLeft - maxScroll.x : scrollContainer.scrollLeft - minScroll.x;
1210
+ }
1211
+
1212
+ if (scrollDelta.x) {
1213
+ scrollContainer.scrollBy({
1214
+ left: -scrollDelta.x,
1215
+ behavior: scrollBehavior
1216
+ });
1217
+ }
1218
+
1219
+ break;
1220
+ } else if (canScrollY && clampedCoordinates.y !== newCoordinates.y) {
1221
+ const newScrollCoordinates = scrollContainer.scrollTop + coordinatesDelta.y;
1222
+ const canScrollToNewCoordinates = direction === exports.KeyboardCode.Down && newScrollCoordinates <= maxScroll.y || direction === exports.KeyboardCode.Up && newScrollCoordinates >= minScroll.y;
1223
+
1224
+ if (canScrollToNewCoordinates && !coordinatesDelta.x) {
1225
+ // We don't need to update coordinates, the scroll adjustment alone will trigger
1226
+ // logic to auto-detect the new container we are over
1227
+ scrollContainer.scrollTo({
1228
+ top: newScrollCoordinates,
1229
+ behavior: scrollBehavior
1230
+ });
1231
+ return;
1232
+ }
1233
+
1234
+ if (canScrollToNewCoordinates) {
1235
+ scrollDelta.y = scrollContainer.scrollTop - newScrollCoordinates;
1236
+ } else {
1237
+ scrollDelta.y = direction === exports.KeyboardCode.Down ? scrollContainer.scrollTop - maxScroll.y : scrollContainer.scrollTop - minScroll.y;
1238
+ }
1239
+
1240
+ if (scrollDelta.y) {
1241
+ scrollContainer.scrollBy({
1242
+ top: -scrollDelta.y,
1243
+ behavior: scrollBehavior
1244
+ });
1245
+ }
1246
+
1247
+ break;
1248
+ }
1249
+ }
1250
+
1251
+ this.handleMove(event, utilities_esm.add(utilities_esm.subtract(newCoordinates, this.referenceCoordinates), scrollDelta));
1252
+ }
1253
+ }
1254
+ }
1255
+
1256
+ handleMove(event, coordinates) {
1257
+ const {
1258
+ onMove
1259
+ } = this.props;
1260
+ event.preventDefault();
1261
+ onMove(coordinates);
1262
+ }
1263
+
1264
+ handleEnd(event) {
1265
+ const {
1266
+ onEnd
1267
+ } = this.props;
1268
+ event.preventDefault();
1269
+ this.detach();
1270
+ onEnd();
1271
+ }
1272
+
1273
+ handleCancel(event) {
1274
+ const {
1275
+ onCancel
1276
+ } = this.props;
1277
+ event.preventDefault();
1278
+ this.detach();
1279
+ onCancel();
1280
+ }
1281
+
1282
+ detach() {
1283
+ this.listeners.removeAll();
1284
+ this.windowListeners.removeAll();
1285
+ }
1286
+
1287
+ }
1288
+ KeyboardSensor.activators = [{
1289
+ eventName: 'onKeyDown',
1290
+ handler: (event, _ref, _ref2) => {
1291
+ let {
1292
+ keyboardCodes = defaultKeyboardCodes,
1293
+ onActivation
1294
+ } = _ref;
1295
+ let {
1296
+ active
1297
+ } = _ref2;
1298
+ const {
1299
+ code
1300
+ } = event.nativeEvent;
1301
+
1302
+ if (keyboardCodes.start.includes(code)) {
1303
+ const activator = active.activatorNode.current;
1304
+
1305
+ if (activator && event.target !== activator) {
1306
+ return false;
1307
+ }
1308
+
1309
+ event.preventDefault();
1310
+ onActivation == null ? void 0 : onActivation({
1311
+ event: event.nativeEvent
1312
+ });
1313
+ return true;
1314
+ }
1315
+
1316
+ return false;
1317
+ }
1318
+ }];
1319
+
1320
+ function isDistanceConstraint(constraint) {
1321
+ return Boolean(constraint && 'distance' in constraint);
1322
+ }
1323
+
1324
+ function isDelayConstraint(constraint) {
1325
+ return Boolean(constraint && 'delay' in constraint);
1326
+ }
1327
+
1328
+ class AbstractPointerSensor {
1329
+ constructor(props, events, listenerTarget) {
1330
+ var _getEventCoordinates;
1331
+
1332
+ if (listenerTarget === void 0) {
1333
+ listenerTarget = getEventListenerTarget(props.event.target);
1334
+ }
1335
+
1336
+ this.props = void 0;
1337
+ this.events = void 0;
1338
+ this.autoScrollEnabled = true;
1339
+ this.document = void 0;
1340
+ this.activated = false;
1341
+ this.initialCoordinates = void 0;
1342
+ this.timeoutId = null;
1343
+ this.listeners = void 0;
1344
+ this.documentListeners = void 0;
1345
+ this.windowListeners = void 0;
1346
+ this.props = props;
1347
+ this.events = events;
1348
+ const {
1349
+ event
1350
+ } = props;
1351
+ const {
1352
+ target
1353
+ } = event;
1354
+ this.props = props;
1355
+ this.events = events;
1356
+ this.document = utilities_esm.getOwnerDocument(target);
1357
+ this.documentListeners = new Listeners(this.document);
1358
+ this.listeners = new Listeners(listenerTarget);
1359
+ this.windowListeners = new Listeners(utilities_esm.getWindow(target));
1360
+ this.initialCoordinates = (_getEventCoordinates = utilities_esm.getEventCoordinates(event)) != null ? _getEventCoordinates : defaultCoordinates;
1361
+ this.handleStart = this.handleStart.bind(this);
1362
+ this.handleMove = this.handleMove.bind(this);
1363
+ this.handleEnd = this.handleEnd.bind(this);
1364
+ this.handleCancel = this.handleCancel.bind(this);
1365
+ this.handleKeydown = this.handleKeydown.bind(this);
1366
+ this.removeTextSelection = this.removeTextSelection.bind(this);
1367
+ this.attach();
1368
+ }
1369
+
1370
+ attach() {
1371
+ const {
1372
+ events,
1373
+ props: {
1374
+ options: {
1375
+ activationConstraint,
1376
+ bypassActivationConstraint
1377
+ }
1378
+ }
1379
+ } = this;
1380
+ this.listeners.add(events.move.name, this.handleMove, {
1381
+ passive: false
1382
+ });
1383
+ this.listeners.add(events.end.name, this.handleEnd);
1384
+
1385
+ if (events.cancel) {
1386
+ this.listeners.add(events.cancel.name, this.handleCancel);
1387
+ }
1388
+
1389
+ this.windowListeners.add(EventName.Resize, this.handleCancel);
1390
+ this.windowListeners.add(EventName.DragStart, preventDefault);
1391
+ this.windowListeners.add(EventName.VisibilityChange, this.handleCancel);
1392
+ this.windowListeners.add(EventName.ContextMenu, preventDefault);
1393
+ this.documentListeners.add(EventName.Keydown, this.handleKeydown);
1394
+
1395
+ if (activationConstraint) {
1396
+ if (bypassActivationConstraint != null && bypassActivationConstraint({
1397
+ event: this.props.event,
1398
+ activeNode: this.props.activeNode,
1399
+ options: this.props.options
1400
+ })) {
1401
+ return this.handleStart();
1402
+ }
1403
+
1404
+ if (isDelayConstraint(activationConstraint)) {
1405
+ this.timeoutId = setTimeout(this.handleStart, activationConstraint.delay);
1406
+ this.handlePending(activationConstraint);
1407
+ return;
1408
+ }
1409
+
1410
+ if (isDistanceConstraint(activationConstraint)) {
1411
+ this.handlePending(activationConstraint);
1412
+ return;
1413
+ }
1414
+ }
1415
+
1416
+ this.handleStart();
1417
+ }
1418
+
1419
+ detach() {
1420
+ this.listeners.removeAll();
1421
+ this.windowListeners.removeAll(); // Wait until the next event loop before removing document listeners
1422
+ // This is necessary because we listen for `click` and `selection` events on the document
1423
+
1424
+ setTimeout(this.documentListeners.removeAll, 50);
1425
+
1426
+ if (this.timeoutId !== null) {
1427
+ clearTimeout(this.timeoutId);
1428
+ this.timeoutId = null;
1429
+ }
1430
+ }
1431
+
1432
+ handlePending(constraint, offset) {
1433
+ const {
1434
+ active,
1435
+ onPending
1436
+ } = this.props;
1437
+ onPending(active, constraint, this.initialCoordinates, offset);
1438
+ }
1439
+
1440
+ handleStart() {
1441
+ const {
1442
+ initialCoordinates
1443
+ } = this;
1444
+ const {
1445
+ onStart
1446
+ } = this.props;
1447
+
1448
+ if (initialCoordinates) {
1449
+ this.activated = true; // Stop propagation of click events once activation constraints are met
1450
+
1451
+ this.documentListeners.add(EventName.Click, stopPropagation, {
1452
+ capture: true
1453
+ }); // Remove any text selection from the document
1454
+
1455
+ this.removeTextSelection(); // Prevent further text selection while dragging
1456
+
1457
+ this.documentListeners.add(EventName.SelectionChange, this.removeTextSelection);
1458
+ onStart(initialCoordinates);
1459
+ }
1460
+ }
1461
+
1462
+ handleMove(event) {
1463
+ var _getEventCoordinates2;
1464
+
1465
+ const {
1466
+ activated,
1467
+ initialCoordinates,
1468
+ props
1469
+ } = this;
1470
+ const {
1471
+ onMove,
1472
+ options: {
1473
+ activationConstraint
1474
+ }
1475
+ } = props;
1476
+
1477
+ if (!initialCoordinates) {
1478
+ return;
1479
+ }
1480
+
1481
+ const coordinates = (_getEventCoordinates2 = utilities_esm.getEventCoordinates(event)) != null ? _getEventCoordinates2 : defaultCoordinates;
1482
+ const delta = utilities_esm.subtract(initialCoordinates, coordinates); // Constraint validation
1483
+
1484
+ if (!activated && activationConstraint) {
1485
+ if (isDistanceConstraint(activationConstraint)) {
1486
+ if (activationConstraint.tolerance != null && hasExceededDistance(delta, activationConstraint.tolerance)) {
1487
+ return this.handleCancel();
1488
+ }
1489
+
1490
+ if (hasExceededDistance(delta, activationConstraint.distance)) {
1491
+ return this.handleStart();
1492
+ }
1493
+ }
1494
+
1495
+ if (isDelayConstraint(activationConstraint)) {
1496
+ if (hasExceededDistance(delta, activationConstraint.tolerance)) {
1497
+ return this.handleCancel();
1498
+ }
1499
+ }
1500
+
1501
+ this.handlePending(activationConstraint, delta);
1502
+ return;
1503
+ }
1504
+
1505
+ if (event.cancelable) {
1506
+ event.preventDefault();
1507
+ }
1508
+
1509
+ onMove(coordinates);
1510
+ }
1511
+
1512
+ handleEnd() {
1513
+ const {
1514
+ onAbort,
1515
+ onEnd
1516
+ } = this.props;
1517
+ this.detach();
1518
+
1519
+ if (!this.activated) {
1520
+ onAbort(this.props.active);
1521
+ }
1522
+
1523
+ onEnd();
1524
+ }
1525
+
1526
+ handleCancel() {
1527
+ const {
1528
+ onAbort,
1529
+ onCancel
1530
+ } = this.props;
1531
+ this.detach();
1532
+
1533
+ if (!this.activated) {
1534
+ onAbort(this.props.active);
1535
+ }
1536
+
1537
+ onCancel();
1538
+ }
1539
+
1540
+ handleKeydown(event) {
1541
+ if (event.code === exports.KeyboardCode.Esc) {
1542
+ this.handleCancel();
1543
+ }
1544
+ }
1545
+
1546
+ removeTextSelection() {
1547
+ var _this$document$getSel;
1548
+
1549
+ (_this$document$getSel = this.document.getSelection()) == null ? void 0 : _this$document$getSel.removeAllRanges();
1550
+ }
1551
+
1552
+ }
1553
+
1554
+ const events = {
1555
+ cancel: {
1556
+ name: 'pointercancel'
1557
+ },
1558
+ move: {
1559
+ name: 'pointermove'
1560
+ },
1561
+ end: {
1562
+ name: 'pointerup'
1563
+ }
1564
+ };
1565
+ class PointerSensor extends AbstractPointerSensor {
1566
+ constructor(props) {
1567
+ const {
1568
+ event
1569
+ } = props; // Pointer events stop firing if the target is unmounted while dragging
1570
+ // Therefore we attach listeners to the owner document instead
1571
+
1572
+ const listenerTarget = utilities_esm.getOwnerDocument(event.target);
1573
+ super(props, events, listenerTarget);
1574
+ }
1575
+
1576
+ }
1577
+ PointerSensor.activators = [{
1578
+ eventName: 'onPointerDown',
1579
+ handler: (_ref, _ref2) => {
1580
+ let {
1581
+ nativeEvent: event
1582
+ } = _ref;
1583
+ let {
1584
+ onActivation
1585
+ } = _ref2;
1586
+
1587
+ if (!event.isPrimary || event.button !== 0) {
1588
+ return false;
1589
+ }
1590
+
1591
+ onActivation == null ? void 0 : onActivation({
1592
+ event
1593
+ });
1594
+ return true;
1595
+ }
1596
+ }];
1597
+
1598
+ const events$1 = {
1599
+ move: {
1600
+ name: 'mousemove'
1601
+ },
1602
+ end: {
1603
+ name: 'mouseup'
1604
+ }
1605
+ };
1606
+ var MouseButton;
1607
+
1608
+ (function (MouseButton) {
1609
+ MouseButton[MouseButton["RightClick"] = 2] = "RightClick";
1610
+ })(MouseButton || (MouseButton = {}));
1611
+
1612
+ class MouseSensor extends AbstractPointerSensor {
1613
+ constructor(props) {
1614
+ super(props, events$1, utilities_esm.getOwnerDocument(props.event.target));
1615
+ }
1616
+
1617
+ }
1618
+ MouseSensor.activators = [{
1619
+ eventName: 'onMouseDown',
1620
+ handler: (_ref, _ref2) => {
1621
+ let {
1622
+ nativeEvent: event
1623
+ } = _ref;
1624
+ let {
1625
+ onActivation
1626
+ } = _ref2;
1627
+
1628
+ if (event.button === MouseButton.RightClick) {
1629
+ return false;
1630
+ }
1631
+
1632
+ onActivation == null ? void 0 : onActivation({
1633
+ event
1634
+ });
1635
+ return true;
1636
+ }
1637
+ }];
1638
+
1639
+ const events$2 = {
1640
+ cancel: {
1641
+ name: 'touchcancel'
1642
+ },
1643
+ move: {
1644
+ name: 'touchmove'
1645
+ },
1646
+ end: {
1647
+ name: 'touchend'
1648
+ }
1649
+ };
1650
+ class TouchSensor extends AbstractPointerSensor {
1651
+ constructor(props) {
1652
+ super(props, events$2);
1653
+ }
1654
+
1655
+ static setup() {
1656
+ // Adding a non-capture and non-passive `touchmove` listener in order
1657
+ // to force `event.preventDefault()` calls to work in dynamically added
1658
+ // touchmove event handlers. This is required for iOS Safari.
1659
+ window.addEventListener(events$2.move.name, noop, {
1660
+ capture: false,
1661
+ passive: false
1662
+ });
1663
+ return function teardown() {
1664
+ window.removeEventListener(events$2.move.name, noop);
1665
+ }; // We create a new handler because the teardown function of another sensor
1666
+ // could remove our event listener if we use a referentially equal listener.
1667
+
1668
+ function noop() {}
1669
+ }
1670
+
1671
+ }
1672
+ TouchSensor.activators = [{
1673
+ eventName: 'onTouchStart',
1674
+ handler: (_ref, _ref2) => {
1675
+ let {
1676
+ nativeEvent: event
1677
+ } = _ref;
1678
+ let {
1679
+ onActivation
1680
+ } = _ref2;
1681
+ const {
1682
+ touches
1683
+ } = event;
1684
+
1685
+ if (touches.length > 1) {
1686
+ return false;
1687
+ }
1688
+
1689
+ onActivation == null ? void 0 : onActivation({
1690
+ event
1691
+ });
1692
+ return true;
1693
+ }
1694
+ }];
1695
+
1696
+ exports.AutoScrollActivator = void 0;
1697
+
1698
+ (function (AutoScrollActivator) {
1699
+ AutoScrollActivator[AutoScrollActivator["Pointer"] = 0] = "Pointer";
1700
+ AutoScrollActivator[AutoScrollActivator["DraggableRect"] = 1] = "DraggableRect";
1701
+ })(exports.AutoScrollActivator || (exports.AutoScrollActivator = {}));
1702
+
1703
+ exports.TraversalOrder = void 0;
1704
+
1705
+ (function (TraversalOrder) {
1706
+ TraversalOrder[TraversalOrder["TreeOrder"] = 0] = "TreeOrder";
1707
+ TraversalOrder[TraversalOrder["ReversedTreeOrder"] = 1] = "ReversedTreeOrder";
1708
+ })(exports.TraversalOrder || (exports.TraversalOrder = {}));
1709
+
1710
+ function useAutoScroller(_ref) {
1711
+ let {
1712
+ acceleration,
1713
+ activator = exports.AutoScrollActivator.Pointer,
1714
+ canScroll,
1715
+ draggingRect,
1716
+ enabled,
1717
+ interval = 5,
1718
+ order = exports.TraversalOrder.TreeOrder,
1719
+ pointerCoordinates,
1720
+ scrollableAncestors,
1721
+ scrollableAncestorRects,
1722
+ delta,
1723
+ threshold
1724
+ } = _ref;
1725
+ const scrollIntent = useScrollIntent({
1726
+ delta,
1727
+ disabled: !enabled
1728
+ });
1729
+ const [setAutoScrollInterval, clearAutoScrollInterval] = utilities_esm.useInterval();
1730
+ const scrollSpeed = React.useRef({
1731
+ x: 0,
1732
+ y: 0
1733
+ });
1734
+ const scrollDirection = React.useRef({
1735
+ x: 0,
1736
+ y: 0
1737
+ });
1738
+ const rect = React.useMemo(() => {
1739
+ switch (activator) {
1740
+ case exports.AutoScrollActivator.Pointer:
1741
+ return pointerCoordinates ? {
1742
+ top: pointerCoordinates.y,
1743
+ bottom: pointerCoordinates.y,
1744
+ left: pointerCoordinates.x,
1745
+ right: pointerCoordinates.x
1746
+ } : null;
1747
+
1748
+ case exports.AutoScrollActivator.DraggableRect:
1749
+ return draggingRect;
1750
+ }
1751
+ }, [activator, draggingRect, pointerCoordinates]);
1752
+ const scrollContainerRef = React.useRef(null);
1753
+ const autoScroll = React.useCallback(() => {
1754
+ const scrollContainer = scrollContainerRef.current;
1755
+
1756
+ if (!scrollContainer) {
1757
+ return;
1758
+ }
1759
+
1760
+ const scrollLeft = scrollSpeed.current.x * scrollDirection.current.x;
1761
+ const scrollTop = scrollSpeed.current.y * scrollDirection.current.y;
1762
+ scrollContainer.scrollBy(scrollLeft, scrollTop);
1763
+ }, []);
1764
+ const sortedScrollableAncestors = React.useMemo(() => order === exports.TraversalOrder.TreeOrder ? [...scrollableAncestors].reverse() : scrollableAncestors, [order, scrollableAncestors]);
1765
+ React.useEffect(() => {
1766
+ if (!enabled || !scrollableAncestors.length || !rect) {
1767
+ clearAutoScrollInterval();
1768
+ return;
1769
+ }
1770
+
1771
+ for (const scrollContainer of sortedScrollableAncestors) {
1772
+ if ((canScroll == null ? void 0 : canScroll(scrollContainer)) === false) {
1773
+ continue;
1774
+ }
1775
+
1776
+ const index = scrollableAncestors.indexOf(scrollContainer);
1777
+ const scrollContainerRect = scrollableAncestorRects[index];
1778
+
1779
+ if (!scrollContainerRect) {
1780
+ continue;
1781
+ }
1782
+
1783
+ const {
1784
+ direction,
1785
+ speed
1786
+ } = getScrollDirectionAndSpeed(scrollContainer, scrollContainerRect, rect, acceleration, threshold);
1787
+
1788
+ for (const axis of ['x', 'y']) {
1789
+ if (!scrollIntent[axis][direction[axis]]) {
1790
+ speed[axis] = 0;
1791
+ direction[axis] = 0;
1792
+ }
1793
+ }
1794
+
1795
+ if (speed.x > 0 || speed.y > 0) {
1796
+ clearAutoScrollInterval();
1797
+ scrollContainerRef.current = scrollContainer;
1798
+ setAutoScrollInterval(autoScroll, interval);
1799
+ scrollSpeed.current = speed;
1800
+ scrollDirection.current = direction;
1801
+ return;
1802
+ }
1803
+ }
1804
+
1805
+ scrollSpeed.current = {
1806
+ x: 0,
1807
+ y: 0
1808
+ };
1809
+ scrollDirection.current = {
1810
+ x: 0,
1811
+ y: 0
1812
+ };
1813
+ clearAutoScrollInterval();
1814
+ }, // eslint-disable-next-line react-hooks/exhaustive-deps
1815
+ [acceleration, autoScroll, canScroll, clearAutoScrollInterval, enabled, interval, // eslint-disable-next-line react-hooks/exhaustive-deps
1816
+ JSON.stringify(rect), // eslint-disable-next-line react-hooks/exhaustive-deps
1817
+ JSON.stringify(scrollIntent), setAutoScrollInterval, scrollableAncestors, sortedScrollableAncestors, scrollableAncestorRects, // eslint-disable-next-line react-hooks/exhaustive-deps
1818
+ JSON.stringify(threshold)]);
1819
+ }
1820
+ const defaultScrollIntent = {
1821
+ x: {
1822
+ [Direction.Backward]: false,
1823
+ [Direction.Forward]: false
1824
+ },
1825
+ y: {
1826
+ [Direction.Backward]: false,
1827
+ [Direction.Forward]: false
1828
+ }
1829
+ };
1830
+
1831
+ function useScrollIntent(_ref2) {
1832
+ let {
1833
+ delta,
1834
+ disabled
1835
+ } = _ref2;
1836
+ const previousDelta = utilities_esm.usePrevious(delta);
1837
+ return utilities_esm.useLazyMemo(previousIntent => {
1838
+ if (disabled || !previousDelta || !previousIntent) {
1839
+ // Reset scroll intent tracking when auto-scrolling is disabled
1840
+ return defaultScrollIntent;
1841
+ }
1842
+
1843
+ const direction = {
1844
+ x: Math.sign(delta.x - previousDelta.x),
1845
+ y: Math.sign(delta.y - previousDelta.y)
1846
+ }; // Keep track of the user intent to scroll in each direction for both axis
1847
+
1848
+ return {
1849
+ x: {
1850
+ [Direction.Backward]: previousIntent.x[Direction.Backward] || direction.x === -1,
1851
+ [Direction.Forward]: previousIntent.x[Direction.Forward] || direction.x === 1
1852
+ },
1853
+ y: {
1854
+ [Direction.Backward]: previousIntent.y[Direction.Backward] || direction.y === -1,
1855
+ [Direction.Forward]: previousIntent.y[Direction.Forward] || direction.y === 1
1856
+ }
1857
+ };
1858
+ }, [disabled, delta, previousDelta]);
1859
+ }
1860
+
1861
+ function useCachedNode(draggableNodes, id) {
1862
+ const draggableNode = id != null ? draggableNodes.get(id) : undefined;
1863
+ const node = draggableNode ? draggableNode.node.current : null;
1864
+ return utilities_esm.useLazyMemo(cachedNode => {
1865
+ var _ref;
1866
+
1867
+ if (id == null) {
1868
+ return null;
1869
+ } // In some cases, the draggable node can unmount while dragging
1870
+ // This is the case for virtualized lists. In those situations,
1871
+ // we fall back to the last known value for that node.
1872
+
1873
+
1874
+ return (_ref = node != null ? node : cachedNode) != null ? _ref : null;
1875
+ }, [node, id]);
1876
+ }
1877
+
1878
+ function useCombineActivators(sensors, getSyntheticHandler) {
1879
+ return React.useMemo(() => sensors.reduce((accumulator, sensor) => {
1880
+ const {
1881
+ sensor: Sensor
1882
+ } = sensor;
1883
+ const sensorActivators = Sensor.activators.map(activator => ({
1884
+ eventName: activator.eventName,
1885
+ handler: getSyntheticHandler(activator.handler, sensor)
1886
+ }));
1887
+ return [...accumulator, ...sensorActivators];
1888
+ }, []), [sensors, getSyntheticHandler]);
1889
+ }
1890
+
1891
+ exports.MeasuringStrategy = void 0;
1892
+
1893
+ (function (MeasuringStrategy) {
1894
+ MeasuringStrategy[MeasuringStrategy["Always"] = 0] = "Always";
1895
+ MeasuringStrategy[MeasuringStrategy["BeforeDragging"] = 1] = "BeforeDragging";
1896
+ MeasuringStrategy[MeasuringStrategy["WhileDragging"] = 2] = "WhileDragging";
1897
+ })(exports.MeasuringStrategy || (exports.MeasuringStrategy = {}));
1898
+
1899
+ exports.MeasuringFrequency = void 0;
1900
+
1901
+ (function (MeasuringFrequency) {
1902
+ MeasuringFrequency["Optimized"] = "optimized";
1903
+ })(exports.MeasuringFrequency || (exports.MeasuringFrequency = {}));
1904
+
1905
+ const defaultValue = /*#__PURE__*/new Map();
1906
+ function useDroppableMeasuring(containers, _ref) {
1907
+ let {
1908
+ dragging,
1909
+ dependencies,
1910
+ config
1911
+ } = _ref;
1912
+ const [queue, setQueue] = React.useState(null);
1913
+ const {
1914
+ frequency,
1915
+ measure,
1916
+ strategy
1917
+ } = config;
1918
+ const containersRef = React.useRef(containers);
1919
+ const disabled = isDisabled();
1920
+ const disabledRef = utilities_esm.useLatestValue(disabled);
1921
+ const measureDroppableContainers = React.useCallback(function (ids) {
1922
+ if (ids === void 0) {
1923
+ ids = [];
1924
+ }
1925
+
1926
+ if (disabledRef.current) {
1927
+ return;
1928
+ }
1929
+
1930
+ setQueue(value => {
1931
+ if (value === null) {
1932
+ return ids;
1933
+ }
1934
+
1935
+ return value.concat(ids.filter(id => !value.includes(id)));
1936
+ });
1937
+ }, [disabledRef]);
1938
+ const timeoutId = React.useRef(null);
1939
+ const droppableRects = utilities_esm.useLazyMemo(previousValue => {
1940
+ if (disabled && !dragging) {
1941
+ return defaultValue;
1942
+ }
1943
+
1944
+ if (!previousValue || previousValue === defaultValue || containersRef.current !== containers || queue != null) {
1945
+ const map = new Map();
1946
+
1947
+ for (let container of containers) {
1948
+ if (!container) {
1949
+ continue;
1950
+ }
1951
+
1952
+ if (queue && queue.length > 0 && !queue.includes(container.id) && container.rect.current) {
1953
+ // This container does not need to be re-measured
1954
+ map.set(container.id, container.rect.current);
1955
+ continue;
1956
+ }
1957
+
1958
+ const node = container.node.current;
1959
+ const rect = node ? new Rect(measure(node), node) : null;
1960
+ container.rect.current = rect;
1961
+
1962
+ if (rect) {
1963
+ map.set(container.id, rect);
1964
+ }
1965
+ }
1966
+
1967
+ return map;
1968
+ }
1969
+
1970
+ return previousValue;
1971
+ }, [containers, queue, dragging, disabled, measure]);
1972
+ React.useEffect(() => {
1973
+ containersRef.current = containers;
1974
+ }, [containers]);
1975
+ React.useEffect(() => {
1976
+ if (disabled) {
1977
+ return;
1978
+ }
1979
+
1980
+ measureDroppableContainers();
1981
+ }, // eslint-disable-next-line react-hooks/exhaustive-deps
1982
+ [dragging, disabled]);
1983
+ React.useEffect(() => {
1984
+ if (queue && queue.length > 0) {
1985
+ setQueue(null);
1986
+ }
1987
+ }, //eslint-disable-next-line react-hooks/exhaustive-deps
1988
+ [JSON.stringify(queue)]);
1989
+ React.useEffect(() => {
1990
+ if (disabled || typeof frequency !== 'number' || timeoutId.current !== null) {
1991
+ return;
1992
+ }
1993
+
1994
+ timeoutId.current = setTimeout(() => {
1995
+ measureDroppableContainers();
1996
+ timeoutId.current = null;
1997
+ }, frequency);
1998
+ }, // eslint-disable-next-line react-hooks/exhaustive-deps
1999
+ [frequency, disabled, measureDroppableContainers, ...dependencies]);
2000
+ return {
2001
+ droppableRects,
2002
+ measureDroppableContainers,
2003
+ measuringScheduled: queue != null
2004
+ };
2005
+
2006
+ function isDisabled() {
2007
+ switch (strategy) {
2008
+ case exports.MeasuringStrategy.Always:
2009
+ return false;
2010
+
2011
+ case exports.MeasuringStrategy.BeforeDragging:
2012
+ return dragging;
2013
+
2014
+ default:
2015
+ return !dragging;
2016
+ }
2017
+ }
2018
+ }
2019
+
2020
+ function useInitialValue(value, computeFn) {
2021
+ return utilities_esm.useLazyMemo(previousValue => {
2022
+ if (!value) {
2023
+ return null;
2024
+ }
2025
+
2026
+ if (previousValue) {
2027
+ return previousValue;
2028
+ }
2029
+
2030
+ return typeof computeFn === 'function' ? computeFn(value) : value;
2031
+ }, [computeFn, value]);
2032
+ }
2033
+
2034
+ function useInitialRect(node, measure) {
2035
+ return useInitialValue(node, measure);
2036
+ }
2037
+
2038
+ /**
2039
+ * Returns a new MutationObserver instance.
2040
+ * If `MutationObserver` is undefined in the execution environment, returns `undefined`.
2041
+ */
2042
+
2043
+ function useMutationObserver(_ref) {
2044
+ let {
2045
+ callback,
2046
+ disabled
2047
+ } = _ref;
2048
+ const handleMutations = utilities_esm.useEvent(callback);
2049
+ const mutationObserver = React.useMemo(() => {
2050
+ if (disabled || typeof window === 'undefined' || typeof window.MutationObserver === 'undefined') {
2051
+ return undefined;
2052
+ }
2053
+
2054
+ const {
2055
+ MutationObserver
2056
+ } = window;
2057
+ return new MutationObserver(handleMutations);
2058
+ }, [handleMutations, disabled]);
2059
+ React.useEffect(() => {
2060
+ return () => mutationObserver == null ? void 0 : mutationObserver.disconnect();
2061
+ }, [mutationObserver]);
2062
+ return mutationObserver;
2063
+ }
2064
+
2065
+ /**
2066
+ * Returns a new ResizeObserver instance bound to the `onResize` callback.
2067
+ * If `ResizeObserver` is undefined in the execution environment, returns `undefined`.
2068
+ */
2069
+
2070
+ function useResizeObserver(_ref) {
2071
+ let {
2072
+ callback,
2073
+ disabled
2074
+ } = _ref;
2075
+ const handleResize = utilities_esm.useEvent(callback);
2076
+ const resizeObserver = React.useMemo(() => {
2077
+ if (disabled || typeof window === 'undefined' || typeof window.ResizeObserver === 'undefined') {
2078
+ return undefined;
2079
+ }
2080
+
2081
+ const {
2082
+ ResizeObserver
2083
+ } = window;
2084
+ return new ResizeObserver(handleResize);
2085
+ }, // eslint-disable-next-line react-hooks/exhaustive-deps
2086
+ [disabled]);
2087
+ React.useEffect(() => {
2088
+ return () => resizeObserver == null ? void 0 : resizeObserver.disconnect();
2089
+ }, [resizeObserver]);
2090
+ return resizeObserver;
2091
+ }
2092
+
2093
+ function defaultMeasure(element) {
2094
+ return new Rect(getClientRect(element), element);
2095
+ }
2096
+
2097
+ function useRect(element, measure, fallbackRect) {
2098
+ if (measure === void 0) {
2099
+ measure = defaultMeasure;
2100
+ }
2101
+
2102
+ const [rect, setRect] = React.useState(null);
2103
+
2104
+ function measureRect() {
2105
+ setRect(currentRect => {
2106
+ if (!element) {
2107
+ return null;
2108
+ }
2109
+
2110
+ if (element.isConnected === false) {
2111
+ var _ref;
2112
+
2113
+ // Fall back to last rect we measured if the element is
2114
+ // no longer connected to the DOM.
2115
+ return (_ref = currentRect != null ? currentRect : fallbackRect) != null ? _ref : null;
2116
+ }
2117
+
2118
+ const newRect = measure(element);
2119
+
2120
+ if (JSON.stringify(currentRect) === JSON.stringify(newRect)) {
2121
+ return currentRect;
2122
+ }
2123
+
2124
+ return newRect;
2125
+ });
2126
+ }
2127
+
2128
+ const mutationObserver = useMutationObserver({
2129
+ callback(records) {
2130
+ if (!element) {
2131
+ return;
2132
+ }
2133
+
2134
+ for (const record of records) {
2135
+ const {
2136
+ type,
2137
+ target
2138
+ } = record;
2139
+
2140
+ if (type === 'childList' && target instanceof HTMLElement && target.contains(element)) {
2141
+ measureRect();
2142
+ break;
2143
+ }
2144
+ }
2145
+ }
2146
+
2147
+ });
2148
+ const resizeObserver = useResizeObserver({
2149
+ callback: measureRect
2150
+ });
2151
+ utilities_esm.useIsomorphicLayoutEffect(() => {
2152
+ measureRect();
2153
+
2154
+ if (element) {
2155
+ resizeObserver == null ? void 0 : resizeObserver.observe(element);
2156
+ mutationObserver == null ? void 0 : mutationObserver.observe(document.body, {
2157
+ childList: true,
2158
+ subtree: true
2159
+ });
2160
+ } else {
2161
+ resizeObserver == null ? void 0 : resizeObserver.disconnect();
2162
+ mutationObserver == null ? void 0 : mutationObserver.disconnect();
2163
+ }
2164
+ }, [element]);
2165
+ return rect;
2166
+ }
2167
+
2168
+ function useRectDelta(rect) {
2169
+ const initialRect = useInitialValue(rect);
2170
+ return getRectDelta(rect, initialRect);
2171
+ }
2172
+
2173
+ const defaultValue$1 = [];
2174
+ function useScrollableAncestors(node) {
2175
+ const previousNode = React.useRef(node);
2176
+ const ancestors = utilities_esm.useLazyMemo(previousValue => {
2177
+ if (!node) {
2178
+ return defaultValue$1;
2179
+ }
2180
+
2181
+ if (previousValue && previousValue !== defaultValue$1 && node && previousNode.current && node.parentNode === previousNode.current.parentNode) {
2182
+ return previousValue;
2183
+ }
2184
+
2185
+ return getScrollableAncestors(node);
2186
+ }, [node]);
2187
+ React.useEffect(() => {
2188
+ previousNode.current = node;
2189
+ }, [node]);
2190
+ return ancestors;
2191
+ }
2192
+
2193
+ function useScrollOffsets(elements) {
2194
+ const [scrollCoordinates, setScrollCoordinates] = React.useState(null);
2195
+ const prevElements = React.useRef(elements); // To-do: Throttle the handleScroll callback
2196
+
2197
+ const handleScroll = React.useCallback(event => {
2198
+ const scrollingElement = getScrollableElement(event.target);
2199
+
2200
+ if (!scrollingElement) {
2201
+ return;
2202
+ }
2203
+
2204
+ setScrollCoordinates(scrollCoordinates => {
2205
+ if (!scrollCoordinates) {
2206
+ return null;
2207
+ }
2208
+
2209
+ scrollCoordinates.set(scrollingElement, getScrollCoordinates(scrollingElement));
2210
+ return new Map(scrollCoordinates);
2211
+ });
2212
+ }, []);
2213
+ React.useEffect(() => {
2214
+ const previousElements = prevElements.current;
2215
+
2216
+ if (elements !== previousElements) {
2217
+ cleanup(previousElements);
2218
+ const entries = elements.map(element => {
2219
+ const scrollableElement = getScrollableElement(element);
2220
+
2221
+ if (scrollableElement) {
2222
+ scrollableElement.addEventListener('scroll', handleScroll, {
2223
+ passive: true
2224
+ });
2225
+ return [scrollableElement, getScrollCoordinates(scrollableElement)];
2226
+ }
2227
+
2228
+ return null;
2229
+ }).filter(entry => entry != null);
2230
+ setScrollCoordinates(entries.length ? new Map(entries) : null);
2231
+ prevElements.current = elements;
2232
+ }
2233
+
2234
+ return () => {
2235
+ cleanup(elements);
2236
+ cleanup(previousElements);
2237
+ };
2238
+
2239
+ function cleanup(elements) {
2240
+ elements.forEach(element => {
2241
+ const scrollableElement = getScrollableElement(element);
2242
+ scrollableElement == null ? void 0 : scrollableElement.removeEventListener('scroll', handleScroll);
2243
+ });
2244
+ }
2245
+ }, [handleScroll, elements]);
2246
+ return React.useMemo(() => {
2247
+ if (elements.length) {
2248
+ return scrollCoordinates ? Array.from(scrollCoordinates.values()).reduce((acc, coordinates) => utilities_esm.add(acc, coordinates), defaultCoordinates) : getScrollOffsets(elements);
2249
+ }
2250
+
2251
+ return defaultCoordinates;
2252
+ }, [elements, scrollCoordinates]);
2253
+ }
2254
+
2255
+ function useScrollOffsetsDelta(scrollOffsets, dependencies) {
2256
+ if (dependencies === void 0) {
2257
+ dependencies = [];
2258
+ }
2259
+
2260
+ const initialScrollOffsets = React.useRef(null);
2261
+ React.useEffect(() => {
2262
+ initialScrollOffsets.current = null;
2263
+ }, // eslint-disable-next-line react-hooks/exhaustive-deps
2264
+ dependencies);
2265
+ React.useEffect(() => {
2266
+ const hasScrollOffsets = scrollOffsets !== defaultCoordinates;
2267
+
2268
+ if (hasScrollOffsets && !initialScrollOffsets.current) {
2269
+ initialScrollOffsets.current = scrollOffsets;
2270
+ }
2271
+
2272
+ if (!hasScrollOffsets && initialScrollOffsets.current) {
2273
+ initialScrollOffsets.current = null;
2274
+ }
2275
+ }, [scrollOffsets]);
2276
+ return initialScrollOffsets.current ? utilities_esm.subtract(scrollOffsets, initialScrollOffsets.current) : defaultCoordinates;
2277
+ }
2278
+
2279
+ function useSensorSetup(sensors) {
2280
+ React.useEffect(() => {
2281
+ if (!utilities_esm.canUseDOM) {
2282
+ return;
2283
+ }
2284
+
2285
+ const teardownFns = sensors.map(_ref => {
2286
+ let {
2287
+ sensor
2288
+ } = _ref;
2289
+ return sensor.setup == null ? void 0 : sensor.setup();
2290
+ });
2291
+ return () => {
2292
+ for (const teardown of teardownFns) {
2293
+ teardown == null ? void 0 : teardown();
2294
+ }
2295
+ };
2296
+ }, // TO-DO: Sensors length could theoretically change which would not be a valid dependency
2297
+ // eslint-disable-next-line react-hooks/exhaustive-deps
2298
+ sensors.map(_ref2 => {
2299
+ let {
2300
+ sensor
2301
+ } = _ref2;
2302
+ return sensor;
2303
+ }));
2304
+ }
2305
+
2306
+ function useSyntheticListeners(listeners, id) {
2307
+ return React.useMemo(() => {
2308
+ return listeners.reduce((acc, _ref) => {
2309
+ let {
2310
+ eventName,
2311
+ handler
2312
+ } = _ref;
2313
+
2314
+ acc[eventName] = event => {
2315
+ handler(event, id);
2316
+ };
2317
+
2318
+ return acc;
2319
+ }, {});
2320
+ }, [listeners, id]);
2321
+ }
2322
+
2323
+ function useWindowRect(element) {
2324
+ return React.useMemo(() => element ? getWindowClientRect(element) : null, [element]);
2325
+ }
2326
+
2327
+ const defaultValue$2 = [];
2328
+ function useRects(elements, measure) {
2329
+ if (measure === void 0) {
2330
+ measure = getClientRect;
2331
+ }
2332
+
2333
+ const [firstElement] = elements;
2334
+ const windowRect = useWindowRect(firstElement ? utilities_esm.getWindow(firstElement) : null);
2335
+ const [rects, setRects] = React.useState(defaultValue$2);
2336
+
2337
+ function measureRects() {
2338
+ setRects(() => {
2339
+ if (!elements.length) {
2340
+ return defaultValue$2;
2341
+ }
2342
+
2343
+ return elements.map(element => isDocumentScrollingElement(element) ? windowRect : new Rect(measure(element), element));
2344
+ });
2345
+ }
2346
+
2347
+ const resizeObserver = useResizeObserver({
2348
+ callback: measureRects
2349
+ });
2350
+ utilities_esm.useIsomorphicLayoutEffect(() => {
2351
+ resizeObserver == null ? void 0 : resizeObserver.disconnect();
2352
+ measureRects();
2353
+ elements.forEach(element => resizeObserver == null ? void 0 : resizeObserver.observe(element));
2354
+ }, [elements]);
2355
+ return rects;
2356
+ }
2357
+
2358
+ function getMeasurableNode(node) {
2359
+ if (!node) {
2360
+ return null;
2361
+ }
2362
+
2363
+ if (node.children.length > 1) {
2364
+ return node;
2365
+ }
2366
+
2367
+ const firstChild = node.children[0];
2368
+ return utilities_esm.isHTMLElement(firstChild) ? firstChild : node;
2369
+ }
2370
+
2371
+ function useDragOverlayMeasuring(_ref) {
2372
+ let {
2373
+ measure
2374
+ } = _ref;
2375
+ const [rect, setRect] = React.useState(null);
2376
+ const handleResize = React.useCallback(entries => {
2377
+ for (const {
2378
+ target
2379
+ } of entries) {
2380
+ if (utilities_esm.isHTMLElement(target)) {
2381
+ setRect(rect => {
2382
+ const newRect = measure(target);
2383
+ return rect ? { ...rect,
2384
+ width: newRect.width,
2385
+ height: newRect.height
2386
+ } : newRect;
2387
+ });
2388
+ break;
2389
+ }
2390
+ }
2391
+ }, [measure]);
2392
+ const resizeObserver = useResizeObserver({
2393
+ callback: handleResize
2394
+ });
2395
+ const handleNodeChange = React.useCallback(element => {
2396
+ const node = getMeasurableNode(element);
2397
+ resizeObserver == null ? void 0 : resizeObserver.disconnect();
2398
+
2399
+ if (node) {
2400
+ resizeObserver == null ? void 0 : resizeObserver.observe(node);
2401
+ }
2402
+
2403
+ setRect(node ? measure(node) : null);
2404
+ }, [measure, resizeObserver]);
2405
+ const [nodeRef, setRef] = utilities_esm.useNodeRef(handleNodeChange);
2406
+ return React.useMemo(() => ({
2407
+ nodeRef,
2408
+ rect,
2409
+ setRef
2410
+ }), [rect, nodeRef, setRef]);
2411
+ }
2412
+
2413
+ const defaultSensors = [{
2414
+ sensor: PointerSensor,
2415
+ options: {}
2416
+ }, {
2417
+ sensor: KeyboardSensor,
2418
+ options: {}
2419
+ }];
2420
+ const defaultData = {
2421
+ current: {}
2422
+ };
2423
+ const defaultMeasuringConfiguration = {
2424
+ draggable: {
2425
+ measure: getTransformAgnosticClientRect
2426
+ },
2427
+ droppable: {
2428
+ measure: getTransformAgnosticClientRect,
2429
+ strategy: exports.MeasuringStrategy.WhileDragging,
2430
+ frequency: exports.MeasuringFrequency.Optimized
2431
+ },
2432
+ dragOverlay: {
2433
+ measure: getClientRect
2434
+ }
2435
+ };
2436
+
2437
+ class DroppableContainersMap extends Map {
2438
+ get(id) {
2439
+ var _super$get;
2440
+
2441
+ return id != null ? (_super$get = super.get(id)) != null ? _super$get : undefined : undefined;
2442
+ }
2443
+
2444
+ toArray() {
2445
+ return Array.from(this.values());
2446
+ }
2447
+
2448
+ getEnabled() {
2449
+ return this.toArray().filter(_ref => {
2450
+ let {
2451
+ disabled
2452
+ } = _ref;
2453
+ return !disabled;
2454
+ });
2455
+ }
2456
+
2457
+ getNodeFor(id) {
2458
+ var _this$get$node$curren, _this$get;
2459
+
2460
+ return (_this$get$node$curren = (_this$get = this.get(id)) == null ? void 0 : _this$get.node.current) != null ? _this$get$node$curren : undefined;
2461
+ }
2462
+
2463
+ }
2464
+
2465
+ const defaultPublicContext = {
2466
+ activatorEvent: null,
2467
+ active: null,
2468
+ activeNode: null,
2469
+ activeNodeRect: null,
2470
+ collisions: null,
2471
+ containerNodeRect: null,
2472
+ draggableNodes: /*#__PURE__*/new Map(),
2473
+ droppableRects: /*#__PURE__*/new Map(),
2474
+ droppableContainers: /*#__PURE__*/new DroppableContainersMap(),
2475
+ over: null,
2476
+ dragOverlay: {
2477
+ nodeRef: {
2478
+ current: null
2479
+ },
2480
+ rect: null,
2481
+ setRef: noop
2482
+ },
2483
+ scrollableAncestors: [],
2484
+ scrollableAncestorRects: [],
2485
+ measuringConfiguration: defaultMeasuringConfiguration,
2486
+ measureDroppableContainers: noop,
2487
+ windowRect: null,
2488
+ measuringScheduled: false
2489
+ };
2490
+ const defaultInternalContext = {
2491
+ activatorEvent: null,
2492
+ activators: [],
2493
+ active: null,
2494
+ activeNodeRect: null,
2495
+ ariaDescribedById: {
2496
+ draggable: ''
2497
+ },
2498
+ dispatch: noop,
2499
+ draggableNodes: /*#__PURE__*/new Map(),
2500
+ over: null,
2501
+ measureDroppableContainers: noop
2502
+ };
2503
+ const InternalContext = /*#__PURE__*/React.createContext(defaultInternalContext);
2504
+ const PublicContext = /*#__PURE__*/React.createContext(defaultPublicContext);
2505
+
2506
+ function getInitialState() {
2507
+ return {
2508
+ draggable: {
2509
+ active: null,
2510
+ initialCoordinates: {
2511
+ x: 0,
2512
+ y: 0
2513
+ },
2514
+ nodes: new Map(),
2515
+ translate: {
2516
+ x: 0,
2517
+ y: 0
2518
+ }
2519
+ },
2520
+ droppable: {
2521
+ containers: new DroppableContainersMap()
2522
+ }
2523
+ };
2524
+ }
2525
+ function reducer(state, action) {
2526
+ switch (action.type) {
2527
+ case Action.DragStart:
2528
+ return { ...state,
2529
+ draggable: { ...state.draggable,
2530
+ initialCoordinates: action.initialCoordinates,
2531
+ active: action.active
2532
+ }
2533
+ };
2534
+
2535
+ case Action.DragMove:
2536
+ if (state.draggable.active == null) {
2537
+ return state;
2538
+ }
2539
+
2540
+ return { ...state,
2541
+ draggable: { ...state.draggable,
2542
+ translate: {
2543
+ x: action.coordinates.x - state.draggable.initialCoordinates.x,
2544
+ y: action.coordinates.y - state.draggable.initialCoordinates.y
2545
+ }
2546
+ }
2547
+ };
2548
+
2549
+ case Action.DragEnd:
2550
+ case Action.DragCancel:
2551
+ return { ...state,
2552
+ draggable: { ...state.draggable,
2553
+ active: null,
2554
+ initialCoordinates: {
2555
+ x: 0,
2556
+ y: 0
2557
+ },
2558
+ translate: {
2559
+ x: 0,
2560
+ y: 0
2561
+ }
2562
+ }
2563
+ };
2564
+
2565
+ case Action.RegisterDroppable:
2566
+ {
2567
+ const {
2568
+ element
2569
+ } = action;
2570
+ const {
2571
+ id
2572
+ } = element;
2573
+ const containers = new DroppableContainersMap(state.droppable.containers);
2574
+ containers.set(id, element);
2575
+ return { ...state,
2576
+ droppable: { ...state.droppable,
2577
+ containers
2578
+ }
2579
+ };
2580
+ }
2581
+
2582
+ case Action.SetDroppableDisabled:
2583
+ {
2584
+ const {
2585
+ id,
2586
+ key,
2587
+ disabled
2588
+ } = action;
2589
+ const element = state.droppable.containers.get(id);
2590
+
2591
+ if (!element || key !== element.key) {
2592
+ return state;
2593
+ }
2594
+
2595
+ const containers = new DroppableContainersMap(state.droppable.containers);
2596
+ containers.set(id, { ...element,
2597
+ disabled
2598
+ });
2599
+ return { ...state,
2600
+ droppable: { ...state.droppable,
2601
+ containers
2602
+ }
2603
+ };
2604
+ }
2605
+
2606
+ case Action.UnregisterDroppable:
2607
+ {
2608
+ const {
2609
+ id,
2610
+ key
2611
+ } = action;
2612
+ const element = state.droppable.containers.get(id);
2613
+
2614
+ if (!element || key !== element.key) {
2615
+ return state;
2616
+ }
2617
+
2618
+ const containers = new DroppableContainersMap(state.droppable.containers);
2619
+ containers.delete(id);
2620
+ return { ...state,
2621
+ droppable: { ...state.droppable,
2622
+ containers
2623
+ }
2624
+ };
2625
+ }
2626
+
2627
+ default:
2628
+ {
2629
+ return state;
2630
+ }
2631
+ }
2632
+ }
2633
+
2634
+ function RestoreFocus(_ref) {
2635
+ let {
2636
+ disabled
2637
+ } = _ref;
2638
+ const {
2639
+ active,
2640
+ activatorEvent,
2641
+ draggableNodes
2642
+ } = React.useContext(InternalContext);
2643
+ const previousActivatorEvent = utilities_esm.usePrevious(activatorEvent);
2644
+ const previousActiveId = utilities_esm.usePrevious(active == null ? void 0 : active.id); // Restore keyboard focus on the activator node
2645
+
2646
+ React.useEffect(() => {
2647
+ if (disabled) {
2648
+ return;
2649
+ }
2650
+
2651
+ if (!activatorEvent && previousActivatorEvent && previousActiveId != null) {
2652
+ if (!utilities_esm.isKeyboardEvent(previousActivatorEvent)) {
2653
+ return;
2654
+ }
2655
+
2656
+ if (document.activeElement === previousActivatorEvent.target) {
2657
+ // No need to restore focus
2658
+ return;
2659
+ }
2660
+
2661
+ const draggableNode = draggableNodes.get(previousActiveId);
2662
+
2663
+ if (!draggableNode) {
2664
+ return;
2665
+ }
2666
+
2667
+ const {
2668
+ activatorNode,
2669
+ node
2670
+ } = draggableNode;
2671
+
2672
+ if (!activatorNode.current && !node.current) {
2673
+ return;
2674
+ }
2675
+
2676
+ requestAnimationFrame(() => {
2677
+ for (const element of [activatorNode.current, node.current]) {
2678
+ if (!element) {
2679
+ continue;
2680
+ }
2681
+
2682
+ const focusableNode = utilities_esm.findFirstFocusableNode(element);
2683
+
2684
+ if (focusableNode) {
2685
+ focusableNode.focus();
2686
+ break;
2687
+ }
2688
+ }
2689
+ });
2690
+ }
2691
+ }, [activatorEvent, disabled, draggableNodes, previousActiveId, previousActivatorEvent]);
2692
+ return null;
2693
+ }
2694
+
2695
+ function applyModifiers(modifiers, _ref) {
2696
+ let {
2697
+ transform,
2698
+ ...args
2699
+ } = _ref;
2700
+ return modifiers != null && modifiers.length ? modifiers.reduce((accumulator, modifier) => {
2701
+ return modifier({
2702
+ transform: accumulator,
2703
+ ...args
2704
+ });
2705
+ }, transform) : transform;
2706
+ }
2707
+
2708
+ function useMeasuringConfiguration(config) {
2709
+ return React.useMemo(() => ({
2710
+ draggable: { ...defaultMeasuringConfiguration.draggable,
2711
+ ...(config == null ? void 0 : config.draggable)
2712
+ },
2713
+ droppable: { ...defaultMeasuringConfiguration.droppable,
2714
+ ...(config == null ? void 0 : config.droppable)
2715
+ },
2716
+ dragOverlay: { ...defaultMeasuringConfiguration.dragOverlay,
2717
+ ...(config == null ? void 0 : config.dragOverlay)
2718
+ }
2719
+ }), // eslint-disable-next-line react-hooks/exhaustive-deps
2720
+ [config == null ? void 0 : config.draggable, config == null ? void 0 : config.droppable, config == null ? void 0 : config.dragOverlay]);
2721
+ }
2722
+
2723
+ function useLayoutShiftScrollCompensation(_ref) {
2724
+ let {
2725
+ activeNode,
2726
+ measure,
2727
+ initialRect,
2728
+ config = true
2729
+ } = _ref;
2730
+ const initialized = React.useRef(false);
2731
+ const {
2732
+ x,
2733
+ y
2734
+ } = typeof config === 'boolean' ? {
2735
+ x: config,
2736
+ y: config
2737
+ } : config;
2738
+ utilities_esm.useIsomorphicLayoutEffect(() => {
2739
+ const disabled = !x && !y;
2740
+
2741
+ if (disabled || !activeNode) {
2742
+ initialized.current = false;
2743
+ return;
2744
+ }
2745
+
2746
+ if (initialized.current || !initialRect) {
2747
+ // Return early if layout shift scroll compensation was already attempted
2748
+ // or if there is no initialRect to compare to.
2749
+ return;
2750
+ } // Get the most up to date node ref for the active draggable
2751
+
2752
+
2753
+ const node = activeNode == null ? void 0 : activeNode.node.current;
2754
+
2755
+ if (!node || node.isConnected === false) {
2756
+ // Return early if there is no attached node ref or if the node is
2757
+ // disconnected from the document.
2758
+ return;
2759
+ }
2760
+
2761
+ const rect = measure(node);
2762
+ const rectDelta = getRectDelta(rect, initialRect);
2763
+
2764
+ if (!x) {
2765
+ rectDelta.x = 0;
2766
+ }
2767
+
2768
+ if (!y) {
2769
+ rectDelta.y = 0;
2770
+ } // Only perform layout shift scroll compensation once
2771
+
2772
+
2773
+ initialized.current = true;
2774
+
2775
+ if (Math.abs(rectDelta.x) > 0 || Math.abs(rectDelta.y) > 0) {
2776
+ const firstScrollableAncestor = getFirstScrollableAncestor(node);
2777
+
2778
+ if (firstScrollableAncestor) {
2779
+ firstScrollableAncestor.scrollBy({
2780
+ top: rectDelta.y,
2781
+ left: rectDelta.x
2782
+ });
2783
+ }
2784
+ }
2785
+ }, [activeNode, x, y, initialRect, measure]);
2786
+ }
2787
+
2788
+ const ActiveDraggableContext = /*#__PURE__*/React.createContext({ ...defaultCoordinates,
2789
+ scaleX: 1,
2790
+ scaleY: 1
2791
+ });
2792
+ var Status;
2793
+
2794
+ (function (Status) {
2795
+ Status[Status["Uninitialized"] = 0] = "Uninitialized";
2796
+ Status[Status["Initializing"] = 1] = "Initializing";
2797
+ Status[Status["Initialized"] = 2] = "Initialized";
2798
+ })(Status || (Status = {}));
2799
+
2800
+ const DndContext = /*#__PURE__*/React.memo(function DndContext(_ref) {
2801
+ var _sensorContext$curren, _dragOverlay$nodeRef$, _dragOverlay$rect, _over$rect;
2802
+
2803
+ let {
2804
+ id,
2805
+ accessibility,
2806
+ autoScroll = true,
2807
+ children,
2808
+ sensors = defaultSensors,
2809
+ collisionDetection = rectIntersection,
2810
+ measuring,
2811
+ modifiers,
2812
+ ...props
2813
+ } = _ref;
2814
+ const store = React.useReducer(reducer, undefined, getInitialState);
2815
+ const [state, dispatch] = store;
2816
+ const [dispatchMonitorEvent, registerMonitorListener] = useDndMonitorProvider();
2817
+ const [status, setStatus] = React.useState(Status.Uninitialized);
2818
+ const isInitialized = status === Status.Initialized;
2819
+ const {
2820
+ draggable: {
2821
+ active: activeId,
2822
+ nodes: draggableNodes,
2823
+ translate
2824
+ },
2825
+ droppable: {
2826
+ containers: droppableContainers
2827
+ }
2828
+ } = state;
2829
+ const node = activeId != null ? draggableNodes.get(activeId) : null;
2830
+ const activeRects = React.useRef({
2831
+ initial: null,
2832
+ translated: null
2833
+ });
2834
+ const active = React.useMemo(() => {
2835
+ var _node$data;
2836
+
2837
+ return activeId != null ? {
2838
+ id: activeId,
2839
+ // It's possible for the active node to unmount while dragging
2840
+ data: (_node$data = node == null ? void 0 : node.data) != null ? _node$data : defaultData,
2841
+ rect: activeRects
2842
+ } : null;
2843
+ }, [activeId, node]);
2844
+ const activeRef = React.useRef(null);
2845
+ const [activeSensor, setActiveSensor] = React.useState(null);
2846
+ const [activatorEvent, setActivatorEvent] = React.useState(null);
2847
+ const latestProps = utilities_esm.useLatestValue(props, Object.values(props));
2848
+ const draggableDescribedById = utilities_esm.useUniqueId("DndDescribedBy", id);
2849
+ const enabledDroppableContainers = React.useMemo(() => droppableContainers.getEnabled(), [droppableContainers]);
2850
+ const measuringConfiguration = useMeasuringConfiguration(measuring);
2851
+ const {
2852
+ droppableRects,
2853
+ measureDroppableContainers,
2854
+ measuringScheduled
2855
+ } = useDroppableMeasuring(enabledDroppableContainers, {
2856
+ dragging: isInitialized,
2857
+ dependencies: [translate.x, translate.y],
2858
+ config: measuringConfiguration.droppable
2859
+ });
2860
+ const activeNode = useCachedNode(draggableNodes, activeId);
2861
+ const activationCoordinates = React.useMemo(() => activatorEvent ? utilities_esm.getEventCoordinates(activatorEvent) : null, [activatorEvent]);
2862
+ const autoScrollOptions = getAutoScrollerOptions();
2863
+ const initialActiveNodeRect = useInitialRect(activeNode, measuringConfiguration.draggable.measure);
2864
+ useLayoutShiftScrollCompensation({
2865
+ activeNode: activeId != null ? draggableNodes.get(activeId) : null,
2866
+ config: autoScrollOptions.layoutShiftCompensation,
2867
+ initialRect: initialActiveNodeRect,
2868
+ measure: measuringConfiguration.draggable.measure
2869
+ });
2870
+ const activeNodeRect = useRect(activeNode, measuringConfiguration.draggable.measure, initialActiveNodeRect);
2871
+ const containerNodeRect = useRect(activeNode ? activeNode.parentElement : null);
2872
+ const sensorContext = React.useRef({
2873
+ activatorEvent: null,
2874
+ active: null,
2875
+ activeNode,
2876
+ collisionRect: null,
2877
+ collisions: null,
2878
+ droppableRects,
2879
+ draggableNodes,
2880
+ draggingNode: null,
2881
+ draggingNodeRect: null,
2882
+ droppableContainers,
2883
+ over: null,
2884
+ scrollableAncestors: [],
2885
+ scrollAdjustedTranslate: null
2886
+ });
2887
+ const overNode = droppableContainers.getNodeFor((_sensorContext$curren = sensorContext.current.over) == null ? void 0 : _sensorContext$curren.id);
2888
+ const dragOverlay = useDragOverlayMeasuring({
2889
+ measure: measuringConfiguration.dragOverlay.measure
2890
+ }); // Use the rect of the drag overlay if it is mounted
2891
+
2892
+ const draggingNode = (_dragOverlay$nodeRef$ = dragOverlay.nodeRef.current) != null ? _dragOverlay$nodeRef$ : activeNode;
2893
+ const draggingNodeRect = isInitialized ? (_dragOverlay$rect = dragOverlay.rect) != null ? _dragOverlay$rect : activeNodeRect : null;
2894
+ const usesDragOverlay = Boolean(dragOverlay.nodeRef.current && dragOverlay.rect); // The delta between the previous and new position of the draggable node
2895
+ // is only relevant when there is no drag overlay
2896
+
2897
+ const nodeRectDelta = useRectDelta(usesDragOverlay ? null : activeNodeRect); // Get the window rect of the dragging node
2898
+
2899
+ const windowRect = useWindowRect(draggingNode ? utilities_esm.getWindow(draggingNode) : null); // Get scrollable ancestors of the dragging node
2900
+
2901
+ const scrollableAncestors = useScrollableAncestors(isInitialized ? overNode != null ? overNode : activeNode : null);
2902
+ const scrollableAncestorRects = useRects(scrollableAncestors); // Apply modifiers
2903
+
2904
+ const modifiedTranslate = applyModifiers(modifiers, {
2905
+ transform: {
2906
+ x: translate.x - nodeRectDelta.x,
2907
+ y: translate.y - nodeRectDelta.y,
2908
+ scaleX: 1,
2909
+ scaleY: 1
2910
+ },
2911
+ activatorEvent,
2912
+ active,
2913
+ activeNodeRect,
2914
+ containerNodeRect,
2915
+ draggingNodeRect,
2916
+ over: sensorContext.current.over,
2917
+ overlayNodeRect: dragOverlay.rect,
2918
+ scrollableAncestors,
2919
+ scrollableAncestorRects,
2920
+ windowRect
2921
+ });
2922
+ const pointerCoordinates = activationCoordinates ? utilities_esm.add(activationCoordinates, translate) : null;
2923
+ const scrollOffsets = useScrollOffsets(scrollableAncestors); // Represents the scroll delta since dragging was initiated
2924
+
2925
+ const scrollAdjustment = useScrollOffsetsDelta(scrollOffsets); // Represents the scroll delta since the last time the active node rect was measured
2926
+
2927
+ const activeNodeScrollDelta = useScrollOffsetsDelta(scrollOffsets, [activeNodeRect]);
2928
+ const scrollAdjustedTranslate = utilities_esm.add(modifiedTranslate, scrollAdjustment);
2929
+ const collisionRect = draggingNodeRect ? getAdjustedRect(draggingNodeRect, modifiedTranslate) : null;
2930
+ const collisions = active && collisionRect ? collisionDetection({
2931
+ active,
2932
+ collisionRect,
2933
+ droppableRects,
2934
+ droppableContainers: enabledDroppableContainers,
2935
+ pointerCoordinates
2936
+ }) : null;
2937
+ const overId = getFirstCollision(collisions, 'id');
2938
+ const [over, setOver] = React.useState(null); // When there is no drag overlay used, we need to account for the
2939
+ // window scroll delta
2940
+
2941
+ const appliedTranslate = usesDragOverlay ? modifiedTranslate : utilities_esm.add(modifiedTranslate, activeNodeScrollDelta);
2942
+ const transform = adjustScale(appliedTranslate, (_over$rect = over == null ? void 0 : over.rect) != null ? _over$rect : null, activeNodeRect);
2943
+ const activeSensorRef = React.useRef(null);
2944
+ const instantiateSensor = React.useCallback((event, _ref2) => {
2945
+ let {
2946
+ sensor: Sensor,
2947
+ options
2948
+ } = _ref2;
2949
+
2950
+ if (activeRef.current == null) {
2951
+ return;
2952
+ }
2953
+
2954
+ const activeNode = draggableNodes.get(activeRef.current);
2955
+
2956
+ if (!activeNode) {
2957
+ return;
2958
+ }
2959
+
2960
+ const activatorEvent = event.nativeEvent;
2961
+ const sensorInstance = new Sensor({
2962
+ active: activeRef.current,
2963
+ activeNode,
2964
+ event: activatorEvent,
2965
+ options,
2966
+ // Sensors need to be instantiated with refs for arguments that change over time
2967
+ // otherwise they are frozen in time with the stale arguments
2968
+ context: sensorContext,
2969
+
2970
+ onAbort(id) {
2971
+ const draggableNode = draggableNodes.get(id);
2972
+
2973
+ if (!draggableNode) {
2974
+ return;
2975
+ }
2976
+
2977
+ const {
2978
+ onDragAbort
2979
+ } = latestProps.current;
2980
+ const event = {
2981
+ id
2982
+ };
2983
+ onDragAbort == null ? void 0 : onDragAbort(event);
2984
+ dispatchMonitorEvent({
2985
+ type: 'onDragAbort',
2986
+ event
2987
+ });
2988
+ },
2989
+
2990
+ onPending(id, constraint, initialCoordinates, offset) {
2991
+ const draggableNode = draggableNodes.get(id);
2992
+
2993
+ if (!draggableNode) {
2994
+ return;
2995
+ }
2996
+
2997
+ const {
2998
+ onDragPending
2999
+ } = latestProps.current;
3000
+ const event = {
3001
+ id,
3002
+ constraint,
3003
+ initialCoordinates,
3004
+ offset
3005
+ };
3006
+ onDragPending == null ? void 0 : onDragPending(event);
3007
+ dispatchMonitorEvent({
3008
+ type: 'onDragPending',
3009
+ event
3010
+ });
3011
+ },
3012
+
3013
+ onStart(initialCoordinates) {
3014
+ const id = activeRef.current;
3015
+
3016
+ if (id == null) {
3017
+ return;
3018
+ }
3019
+
3020
+ const draggableNode = draggableNodes.get(id);
3021
+
3022
+ if (!draggableNode) {
3023
+ return;
3024
+ }
3025
+
3026
+ const {
3027
+ onDragStart
3028
+ } = latestProps.current;
3029
+ const event = {
3030
+ activatorEvent,
3031
+ active: {
3032
+ id,
3033
+ data: draggableNode.data,
3034
+ rect: activeRects
3035
+ }
3036
+ };
3037
+ ReactDOM.unstable_batchedUpdates(() => {
3038
+ onDragStart == null ? void 0 : onDragStart(event);
3039
+ setStatus(Status.Initializing);
3040
+ dispatch({
3041
+ type: Action.DragStart,
3042
+ initialCoordinates,
3043
+ active: id
3044
+ });
3045
+ dispatchMonitorEvent({
3046
+ type: 'onDragStart',
3047
+ event
3048
+ });
3049
+ setActiveSensor(activeSensorRef.current);
3050
+ setActivatorEvent(activatorEvent);
3051
+ });
3052
+ },
3053
+
3054
+ onMove(coordinates) {
3055
+ dispatch({
3056
+ type: Action.DragMove,
3057
+ coordinates
3058
+ });
3059
+ },
3060
+
3061
+ onEnd: createHandler(Action.DragEnd),
3062
+ onCancel: createHandler(Action.DragCancel)
3063
+ });
3064
+ activeSensorRef.current = sensorInstance;
3065
+
3066
+ function createHandler(type) {
3067
+ return async function handler() {
3068
+ const {
3069
+ active,
3070
+ collisions,
3071
+ over,
3072
+ scrollAdjustedTranslate
3073
+ } = sensorContext.current;
3074
+ let event = null;
3075
+
3076
+ if (active && scrollAdjustedTranslate) {
3077
+ const {
3078
+ cancelDrop
3079
+ } = latestProps.current;
3080
+ event = {
3081
+ activatorEvent,
3082
+ active: active,
3083
+ collisions,
3084
+ delta: scrollAdjustedTranslate,
3085
+ over
3086
+ };
3087
+
3088
+ if (type === Action.DragEnd && typeof cancelDrop === 'function') {
3089
+ const shouldCancel = await Promise.resolve(cancelDrop(event));
3090
+
3091
+ if (shouldCancel) {
3092
+ type = Action.DragCancel;
3093
+ }
3094
+ }
3095
+ }
3096
+
3097
+ activeRef.current = null;
3098
+ ReactDOM.unstable_batchedUpdates(() => {
3099
+ dispatch({
3100
+ type
3101
+ });
3102
+ setStatus(Status.Uninitialized);
3103
+ setOver(null);
3104
+ setActiveSensor(null);
3105
+ setActivatorEvent(null);
3106
+ activeSensorRef.current = null;
3107
+ const eventName = type === Action.DragEnd ? 'onDragEnd' : 'onDragCancel';
3108
+
3109
+ if (event) {
3110
+ const handler = latestProps.current[eventName];
3111
+ handler == null ? void 0 : handler(event);
3112
+ dispatchMonitorEvent({
3113
+ type: eventName,
3114
+ event
3115
+ });
3116
+ }
3117
+ });
3118
+ };
3119
+ }
3120
+ }, // eslint-disable-next-line react-hooks/exhaustive-deps
3121
+ [draggableNodes]);
3122
+ const bindActivatorToSensorInstantiator = React.useCallback((handler, sensor) => {
3123
+ return (event, active) => {
3124
+ const nativeEvent = event.nativeEvent;
3125
+ const activeDraggableNode = draggableNodes.get(active);
3126
+
3127
+ if ( // Another sensor is already instantiating
3128
+ activeRef.current !== null || // No active draggable
3129
+ !activeDraggableNode || // Event has already been captured
3130
+ nativeEvent.dndKit || nativeEvent.defaultPrevented) {
3131
+ return;
3132
+ }
3133
+
3134
+ const activationContext = {
3135
+ active: activeDraggableNode
3136
+ };
3137
+ const shouldActivate = handler(event, sensor.options, activationContext);
3138
+
3139
+ if (shouldActivate === true) {
3140
+ nativeEvent.dndKit = {
3141
+ capturedBy: sensor.sensor
3142
+ };
3143
+ activeRef.current = active;
3144
+ instantiateSensor(event, sensor);
3145
+ }
3146
+ };
3147
+ }, [draggableNodes, instantiateSensor]);
3148
+ const activators = useCombineActivators(sensors, bindActivatorToSensorInstantiator);
3149
+ useSensorSetup(sensors);
3150
+ utilities_esm.useIsomorphicLayoutEffect(() => {
3151
+ if (activeNodeRect && status === Status.Initializing) {
3152
+ setStatus(Status.Initialized);
3153
+ }
3154
+ }, [activeNodeRect, status]);
3155
+ React.useEffect(() => {
3156
+ const {
3157
+ onDragMove
3158
+ } = latestProps.current;
3159
+ const {
3160
+ active,
3161
+ activatorEvent,
3162
+ collisions,
3163
+ over
3164
+ } = sensorContext.current;
3165
+
3166
+ if (!active || !activatorEvent) {
3167
+ return;
3168
+ }
3169
+
3170
+ const event = {
3171
+ active,
3172
+ activatorEvent,
3173
+ collisions,
3174
+ delta: {
3175
+ x: scrollAdjustedTranslate.x,
3176
+ y: scrollAdjustedTranslate.y
3177
+ },
3178
+ over
3179
+ };
3180
+ ReactDOM.unstable_batchedUpdates(() => {
3181
+ onDragMove == null ? void 0 : onDragMove(event);
3182
+ dispatchMonitorEvent({
3183
+ type: 'onDragMove',
3184
+ event
3185
+ });
3186
+ });
3187
+ }, // eslint-disable-next-line react-hooks/exhaustive-deps
3188
+ [scrollAdjustedTranslate.x, scrollAdjustedTranslate.y]);
3189
+ React.useEffect(() => {
3190
+ const {
3191
+ active,
3192
+ activatorEvent,
3193
+ collisions,
3194
+ droppableContainers,
3195
+ scrollAdjustedTranslate
3196
+ } = sensorContext.current;
3197
+
3198
+ if (!active || activeRef.current == null || !activatorEvent || !scrollAdjustedTranslate) {
3199
+ return;
3200
+ }
3201
+
3202
+ const {
3203
+ onDragOver
3204
+ } = latestProps.current;
3205
+ const overContainer = droppableContainers.get(overId);
3206
+ const over = overContainer && overContainer.rect.current ? {
3207
+ id: overContainer.id,
3208
+ rect: overContainer.rect.current,
3209
+ data: overContainer.data,
3210
+ disabled: overContainer.disabled
3211
+ } : null;
3212
+ const event = {
3213
+ active,
3214
+ activatorEvent,
3215
+ collisions,
3216
+ delta: {
3217
+ x: scrollAdjustedTranslate.x,
3218
+ y: scrollAdjustedTranslate.y
3219
+ },
3220
+ over
3221
+ };
3222
+ ReactDOM.unstable_batchedUpdates(() => {
3223
+ setOver(over);
3224
+ onDragOver == null ? void 0 : onDragOver(event);
3225
+ dispatchMonitorEvent({
3226
+ type: 'onDragOver',
3227
+ event
3228
+ });
3229
+ });
3230
+ }, // eslint-disable-next-line react-hooks/exhaustive-deps
3231
+ [overId]);
3232
+ utilities_esm.useIsomorphicLayoutEffect(() => {
3233
+ sensorContext.current = {
3234
+ activatorEvent,
3235
+ active,
3236
+ activeNode,
3237
+ collisionRect,
3238
+ collisions,
3239
+ droppableRects,
3240
+ draggableNodes,
3241
+ draggingNode,
3242
+ draggingNodeRect,
3243
+ droppableContainers,
3244
+ over,
3245
+ scrollableAncestors,
3246
+ scrollAdjustedTranslate
3247
+ };
3248
+ activeRects.current = {
3249
+ initial: draggingNodeRect,
3250
+ translated: collisionRect
3251
+ };
3252
+ }, [active, activeNode, collisions, collisionRect, draggableNodes, draggingNode, draggingNodeRect, droppableRects, droppableContainers, over, scrollableAncestors, scrollAdjustedTranslate]);
3253
+ useAutoScroller({ ...autoScrollOptions,
3254
+ delta: translate,
3255
+ draggingRect: collisionRect,
3256
+ pointerCoordinates,
3257
+ scrollableAncestors,
3258
+ scrollableAncestorRects
3259
+ });
3260
+ const publicContext = React.useMemo(() => {
3261
+ const context = {
3262
+ active,
3263
+ activeNode,
3264
+ activeNodeRect,
3265
+ activatorEvent,
3266
+ collisions,
3267
+ containerNodeRect,
3268
+ dragOverlay,
3269
+ draggableNodes,
3270
+ droppableContainers,
3271
+ droppableRects,
3272
+ over,
3273
+ measureDroppableContainers,
3274
+ scrollableAncestors,
3275
+ scrollableAncestorRects,
3276
+ measuringConfiguration,
3277
+ measuringScheduled,
3278
+ windowRect
3279
+ };
3280
+ return context;
3281
+ }, [active, activeNode, activeNodeRect, activatorEvent, collisions, containerNodeRect, dragOverlay, draggableNodes, droppableContainers, droppableRects, over, measureDroppableContainers, scrollableAncestors, scrollableAncestorRects, measuringConfiguration, measuringScheduled, windowRect]);
3282
+ const internalContext = React.useMemo(() => {
3283
+ const context = {
3284
+ activatorEvent,
3285
+ activators,
3286
+ active,
3287
+ activeNodeRect,
3288
+ ariaDescribedById: {
3289
+ draggable: draggableDescribedById
3290
+ },
3291
+ dispatch,
3292
+ draggableNodes,
3293
+ over,
3294
+ measureDroppableContainers
3295
+ };
3296
+ return context;
3297
+ }, [activatorEvent, activators, active, activeNodeRect, dispatch, draggableDescribedById, draggableNodes, over, measureDroppableContainers]);
3298
+ return React__default.createElement(DndMonitorContext.Provider, {
3299
+ value: registerMonitorListener
3300
+ }, React__default.createElement(InternalContext.Provider, {
3301
+ value: internalContext
3302
+ }, React__default.createElement(PublicContext.Provider, {
3303
+ value: publicContext
3304
+ }, React__default.createElement(ActiveDraggableContext.Provider, {
3305
+ value: transform
3306
+ }, children)), React__default.createElement(RestoreFocus, {
3307
+ disabled: (accessibility == null ? void 0 : accessibility.restoreFocus) === false
3308
+ })), React__default.createElement(Accessibility, { ...accessibility,
3309
+ hiddenTextDescribedById: draggableDescribedById
3310
+ }));
3311
+
3312
+ function getAutoScrollerOptions() {
3313
+ const activeSensorDisablesAutoscroll = (activeSensor == null ? void 0 : activeSensor.autoScrollEnabled) === false;
3314
+ const autoScrollGloballyDisabled = typeof autoScroll === 'object' ? autoScroll.enabled === false : autoScroll === false;
3315
+ const enabled = isInitialized && !activeSensorDisablesAutoscroll && !autoScrollGloballyDisabled;
3316
+
3317
+ if (typeof autoScroll === 'object') {
3318
+ return { ...autoScroll,
3319
+ enabled
3320
+ };
3321
+ }
3322
+
3323
+ return {
3324
+ enabled
3325
+ };
3326
+ }
3327
+ });
3328
+
3329
+ const NullContext = /*#__PURE__*/React.createContext(null);
3330
+ const defaultRole = 'button';
3331
+ const ID_PREFIX = 'Draggable';
3332
+ function useDraggable(_ref) {
3333
+ let {
3334
+ id,
3335
+ data,
3336
+ disabled = false,
3337
+ attributes
3338
+ } = _ref;
3339
+ const key = utilities_esm.useUniqueId(ID_PREFIX);
3340
+ const {
3341
+ activators,
3342
+ activatorEvent,
3343
+ active,
3344
+ activeNodeRect,
3345
+ ariaDescribedById,
3346
+ draggableNodes,
3347
+ over
3348
+ } = React.useContext(InternalContext);
3349
+ const {
3350
+ role = defaultRole,
3351
+ roleDescription = 'draggable',
3352
+ tabIndex = 0
3353
+ } = attributes != null ? attributes : {};
3354
+ const isDragging = (active == null ? void 0 : active.id) === id;
3355
+ const transform = React.useContext(isDragging ? ActiveDraggableContext : NullContext);
3356
+ const [node, setNodeRef] = utilities_esm.useNodeRef();
3357
+ const [activatorNode, setActivatorNodeRef] = utilities_esm.useNodeRef();
3358
+ const listeners = useSyntheticListeners(activators, id);
3359
+ const dataRef = utilities_esm.useLatestValue(data);
3360
+ utilities_esm.useIsomorphicLayoutEffect(() => {
3361
+ draggableNodes.set(id, {
3362
+ id,
3363
+ key,
3364
+ node,
3365
+ activatorNode,
3366
+ data: dataRef
3367
+ });
3368
+ return () => {
3369
+ const node = draggableNodes.get(id);
3370
+
3371
+ if (node && node.key === key) {
3372
+ draggableNodes.delete(id);
3373
+ }
3374
+ };
3375
+ }, // eslint-disable-next-line react-hooks/exhaustive-deps
3376
+ [draggableNodes, id]);
3377
+ const memoizedAttributes = React.useMemo(() => ({
3378
+ role,
3379
+ tabIndex,
3380
+ 'aria-disabled': disabled,
3381
+ 'aria-pressed': isDragging && role === defaultRole ? true : undefined,
3382
+ 'aria-roledescription': roleDescription,
3383
+ 'aria-describedby': ariaDescribedById.draggable
3384
+ }), [disabled, role, tabIndex, isDragging, roleDescription, ariaDescribedById.draggable]);
3385
+ return {
3386
+ active,
3387
+ activatorEvent,
3388
+ activeNodeRect,
3389
+ attributes: memoizedAttributes,
3390
+ isDragging,
3391
+ listeners: disabled ? undefined : listeners,
3392
+ node,
3393
+ over,
3394
+ setNodeRef,
3395
+ setActivatorNodeRef,
3396
+ transform
3397
+ };
3398
+ }
3399
+
3400
+ function useDndContext() {
3401
+ return React.useContext(PublicContext);
3402
+ }
3403
+
3404
+ const ID_PREFIX$1 = 'Droppable';
3405
+ const defaultResizeObserverConfig = {
3406
+ timeout: 25
3407
+ };
3408
+ function useDroppable(_ref) {
3409
+ let {
3410
+ data,
3411
+ disabled = false,
3412
+ id,
3413
+ resizeObserverConfig
3414
+ } = _ref;
3415
+ const key = utilities_esm.useUniqueId(ID_PREFIX$1);
3416
+ const {
3417
+ active,
3418
+ dispatch,
3419
+ over,
3420
+ measureDroppableContainers
3421
+ } = React.useContext(InternalContext);
3422
+ const previous = React.useRef({
3423
+ disabled
3424
+ });
3425
+ const resizeObserverConnected = React.useRef(false);
3426
+ const rect = React.useRef(null);
3427
+ const callbackId = React.useRef(null);
3428
+ const {
3429
+ disabled: resizeObserverDisabled,
3430
+ updateMeasurementsFor,
3431
+ timeout: resizeObserverTimeout
3432
+ } = { ...defaultResizeObserverConfig,
3433
+ ...resizeObserverConfig
3434
+ };
3435
+ const ids = utilities_esm.useLatestValue(updateMeasurementsFor != null ? updateMeasurementsFor : id);
3436
+ const handleResize = React.useCallback(() => {
3437
+ if (!resizeObserverConnected.current) {
3438
+ // ResizeObserver invokes the `handleResize` callback as soon as `observe` is called,
3439
+ // assuming the element is rendered and displayed.
3440
+ resizeObserverConnected.current = true;
3441
+ return;
3442
+ }
3443
+
3444
+ if (callbackId.current != null) {
3445
+ clearTimeout(callbackId.current);
3446
+ }
3447
+
3448
+ callbackId.current = setTimeout(() => {
3449
+ measureDroppableContainers(Array.isArray(ids.current) ? ids.current : [ids.current]);
3450
+ callbackId.current = null;
3451
+ }, resizeObserverTimeout);
3452
+ }, //eslint-disable-next-line react-hooks/exhaustive-deps
3453
+ [resizeObserverTimeout]);
3454
+ const resizeObserver = useResizeObserver({
3455
+ callback: handleResize,
3456
+ disabled: resizeObserverDisabled || !active
3457
+ });
3458
+ const handleNodeChange = React.useCallback((newElement, previousElement) => {
3459
+ if (!resizeObserver) {
3460
+ return;
3461
+ }
3462
+
3463
+ if (previousElement) {
3464
+ resizeObserver.unobserve(previousElement);
3465
+ resizeObserverConnected.current = false;
3466
+ }
3467
+
3468
+ if (newElement) {
3469
+ resizeObserver.observe(newElement);
3470
+ }
3471
+ }, [resizeObserver]);
3472
+ const [nodeRef, setNodeRef] = utilities_esm.useNodeRef(handleNodeChange);
3473
+ const dataRef = utilities_esm.useLatestValue(data);
3474
+ React.useEffect(() => {
3475
+ if (!resizeObserver || !nodeRef.current) {
3476
+ return;
3477
+ }
3478
+
3479
+ resizeObserver.disconnect();
3480
+ resizeObserverConnected.current = false;
3481
+ resizeObserver.observe(nodeRef.current);
3482
+ }, [nodeRef, resizeObserver]);
3483
+ React.useEffect(() => {
3484
+ dispatch({
3485
+ type: Action.RegisterDroppable,
3486
+ element: {
3487
+ id,
3488
+ key,
3489
+ disabled,
3490
+ node: nodeRef,
3491
+ rect,
3492
+ data: dataRef
3493
+ }
3494
+ });
3495
+ return () => dispatch({
3496
+ type: Action.UnregisterDroppable,
3497
+ key,
3498
+ id
3499
+ });
3500
+ }, // eslint-disable-next-line react-hooks/exhaustive-deps
3501
+ [id]);
3502
+ React.useEffect(() => {
3503
+ if (disabled !== previous.current.disabled) {
3504
+ dispatch({
3505
+ type: Action.SetDroppableDisabled,
3506
+ id,
3507
+ key,
3508
+ disabled
3509
+ });
3510
+ previous.current.disabled = disabled;
3511
+ }
3512
+ }, [id, key, disabled, dispatch]);
3513
+ return {
3514
+ active,
3515
+ rect,
3516
+ isOver: (over == null ? void 0 : over.id) === id,
3517
+ node: nodeRef,
3518
+ over,
3519
+ setNodeRef
3520
+ };
3521
+ }
3522
+
3523
+ function AnimationManager(_ref) {
3524
+ let {
3525
+ animation,
3526
+ children
3527
+ } = _ref;
3528
+ const [clonedChildren, setClonedChildren] = React.useState(null);
3529
+ const [element, setElement] = React.useState(null);
3530
+ const previousChildren = utilities_esm.usePrevious(children);
3531
+
3532
+ if (!children && !clonedChildren && previousChildren) {
3533
+ setClonedChildren(previousChildren);
3534
+ }
3535
+
3536
+ utilities_esm.useIsomorphicLayoutEffect(() => {
3537
+ if (!element) {
3538
+ return;
3539
+ }
3540
+
3541
+ const key = clonedChildren == null ? void 0 : clonedChildren.key;
3542
+ const id = clonedChildren == null ? void 0 : clonedChildren.props.id;
3543
+
3544
+ if (key == null || id == null) {
3545
+ setClonedChildren(null);
3546
+ return;
3547
+ }
3548
+
3549
+ Promise.resolve(animation(id, element)).then(() => {
3550
+ setClonedChildren(null);
3551
+ });
3552
+ }, [animation, clonedChildren, element]);
3553
+ return React__default.createElement(React__default.Fragment, null, children, clonedChildren ? React.cloneElement(clonedChildren, {
3554
+ ref: setElement
3555
+ }) : null);
3556
+ }
3557
+
3558
+ const defaultTransform = {
3559
+ x: 0,
3560
+ y: 0,
3561
+ scaleX: 1,
3562
+ scaleY: 1
3563
+ };
3564
+ function NullifiedContextProvider(_ref) {
3565
+ let {
3566
+ children
3567
+ } = _ref;
3568
+ return React__default.createElement(InternalContext.Provider, {
3569
+ value: defaultInternalContext
3570
+ }, React__default.createElement(ActiveDraggableContext.Provider, {
3571
+ value: defaultTransform
3572
+ }, children));
3573
+ }
3574
+
3575
+ const baseStyles = {
3576
+ position: 'fixed',
3577
+ touchAction: 'none'
3578
+ };
3579
+
3580
+ const defaultTransition = activatorEvent => {
3581
+ const isKeyboardActivator = utilities_esm.isKeyboardEvent(activatorEvent);
3582
+ return isKeyboardActivator ? 'transform 250ms ease' : undefined;
3583
+ };
3584
+
3585
+ const PositionedOverlay = /*#__PURE__*/React.forwardRef((_ref, ref) => {
3586
+ let {
3587
+ as,
3588
+ activatorEvent,
3589
+ adjustScale,
3590
+ children,
3591
+ className,
3592
+ rect,
3593
+ style,
3594
+ transform,
3595
+ transition = defaultTransition
3596
+ } = _ref;
3597
+
3598
+ if (!rect) {
3599
+ return null;
3600
+ }
3601
+
3602
+ const scaleAdjustedTransform = adjustScale ? transform : { ...transform,
3603
+ scaleX: 1,
3604
+ scaleY: 1
3605
+ };
3606
+ const styles = { ...baseStyles,
3607
+ width: rect.width,
3608
+ height: rect.height,
3609
+ top: rect.top,
3610
+ left: rect.left,
3611
+ transform: utilities_esm.CSS.Transform.toString(scaleAdjustedTransform),
3612
+ transformOrigin: adjustScale && activatorEvent ? getRelativeTransformOrigin(activatorEvent, rect) : undefined,
3613
+ transition: typeof transition === 'function' ? transition(activatorEvent) : transition,
3614
+ ...style
3615
+ };
3616
+ return React__default.createElement(as, {
3617
+ className,
3618
+ style: styles,
3619
+ ref
3620
+ }, children);
3621
+ });
3622
+
3623
+ const defaultDropAnimationSideEffects = options => _ref => {
3624
+ let {
3625
+ active,
3626
+ dragOverlay
3627
+ } = _ref;
3628
+ const originalStyles = {};
3629
+ const {
3630
+ styles,
3631
+ className
3632
+ } = options;
3633
+
3634
+ if (styles != null && styles.active) {
3635
+ for (const [key, value] of Object.entries(styles.active)) {
3636
+ if (value === undefined) {
3637
+ continue;
3638
+ }
3639
+
3640
+ originalStyles[key] = active.node.style.getPropertyValue(key);
3641
+ active.node.style.setProperty(key, value);
3642
+ }
3643
+ }
3644
+
3645
+ if (styles != null && styles.dragOverlay) {
3646
+ for (const [key, value] of Object.entries(styles.dragOverlay)) {
3647
+ if (value === undefined) {
3648
+ continue;
3649
+ }
3650
+
3651
+ dragOverlay.node.style.setProperty(key, value);
3652
+ }
3653
+ }
3654
+
3655
+ if (className != null && className.active) {
3656
+ active.node.classList.add(className.active);
3657
+ }
3658
+
3659
+ if (className != null && className.dragOverlay) {
3660
+ dragOverlay.node.classList.add(className.dragOverlay);
3661
+ }
3662
+
3663
+ return function cleanup() {
3664
+ for (const [key, value] of Object.entries(originalStyles)) {
3665
+ active.node.style.setProperty(key, value);
3666
+ }
3667
+
3668
+ if (className != null && className.active) {
3669
+ active.node.classList.remove(className.active);
3670
+ }
3671
+ };
3672
+ };
3673
+
3674
+ const defaultKeyframeResolver = _ref2 => {
3675
+ let {
3676
+ transform: {
3677
+ initial,
3678
+ final
3679
+ }
3680
+ } = _ref2;
3681
+ return [{
3682
+ transform: utilities_esm.CSS.Transform.toString(initial)
3683
+ }, {
3684
+ transform: utilities_esm.CSS.Transform.toString(final)
3685
+ }];
3686
+ };
3687
+
3688
+ const defaultDropAnimationConfiguration = {
3689
+ duration: 250,
3690
+ easing: 'ease',
3691
+ keyframes: defaultKeyframeResolver,
3692
+ sideEffects: /*#__PURE__*/defaultDropAnimationSideEffects({
3693
+ styles: {
3694
+ active: {
3695
+ opacity: '0'
3696
+ }
3697
+ }
3698
+ })
3699
+ };
3700
+ function useDropAnimation(_ref3) {
3701
+ let {
3702
+ config,
3703
+ draggableNodes,
3704
+ droppableContainers,
3705
+ measuringConfiguration
3706
+ } = _ref3;
3707
+ return utilities_esm.useEvent((id, node) => {
3708
+ if (config === null) {
3709
+ return;
3710
+ }
3711
+
3712
+ const activeDraggable = draggableNodes.get(id);
3713
+
3714
+ if (!activeDraggable) {
3715
+ return;
3716
+ }
3717
+
3718
+ const activeNode = activeDraggable.node.current;
3719
+
3720
+ if (!activeNode) {
3721
+ return;
3722
+ }
3723
+
3724
+ const measurableNode = getMeasurableNode(node);
3725
+
3726
+ if (!measurableNode) {
3727
+ return;
3728
+ }
3729
+
3730
+ const {
3731
+ transform
3732
+ } = utilities_esm.getWindow(node).getComputedStyle(node);
3733
+ const parsedTransform = parseTransform(transform);
3734
+
3735
+ if (!parsedTransform) {
3736
+ return;
3737
+ }
3738
+
3739
+ const animation = typeof config === 'function' ? config : createDefaultDropAnimation(config);
3740
+ scrollIntoViewIfNeeded(activeNode, measuringConfiguration.draggable.measure);
3741
+ return animation({
3742
+ active: {
3743
+ id,
3744
+ data: activeDraggable.data,
3745
+ node: activeNode,
3746
+ rect: measuringConfiguration.draggable.measure(activeNode)
3747
+ },
3748
+ draggableNodes,
3749
+ dragOverlay: {
3750
+ node,
3751
+ rect: measuringConfiguration.dragOverlay.measure(measurableNode)
3752
+ },
3753
+ droppableContainers,
3754
+ measuringConfiguration,
3755
+ transform: parsedTransform
3756
+ });
3757
+ });
3758
+ }
3759
+
3760
+ function createDefaultDropAnimation(options) {
3761
+ const {
3762
+ duration,
3763
+ easing,
3764
+ sideEffects,
3765
+ keyframes
3766
+ } = { ...defaultDropAnimationConfiguration,
3767
+ ...options
3768
+ };
3769
+ return _ref4 => {
3770
+ let {
3771
+ active,
3772
+ dragOverlay,
3773
+ transform,
3774
+ ...rest
3775
+ } = _ref4;
3776
+
3777
+ if (!duration) {
3778
+ // Do not animate if animation duration is zero.
3779
+ return;
3780
+ }
3781
+
3782
+ const delta = {
3783
+ x: dragOverlay.rect.left - active.rect.left,
3784
+ y: dragOverlay.rect.top - active.rect.top
3785
+ };
3786
+ const scale = {
3787
+ scaleX: transform.scaleX !== 1 ? active.rect.width * transform.scaleX / dragOverlay.rect.width : 1,
3788
+ scaleY: transform.scaleY !== 1 ? active.rect.height * transform.scaleY / dragOverlay.rect.height : 1
3789
+ };
3790
+ const finalTransform = {
3791
+ x: transform.x - delta.x,
3792
+ y: transform.y - delta.y,
3793
+ ...scale
3794
+ };
3795
+ const animationKeyframes = keyframes({ ...rest,
3796
+ active,
3797
+ dragOverlay,
3798
+ transform: {
3799
+ initial: transform,
3800
+ final: finalTransform
3801
+ }
3802
+ });
3803
+ const [firstKeyframe] = animationKeyframes;
3804
+ const lastKeyframe = animationKeyframes[animationKeyframes.length - 1];
3805
+
3806
+ if (JSON.stringify(firstKeyframe) === JSON.stringify(lastKeyframe)) {
3807
+ // The start and end keyframes are the same, infer that there is no animation needed.
3808
+ return;
3809
+ }
3810
+
3811
+ const cleanup = sideEffects == null ? void 0 : sideEffects({
3812
+ active,
3813
+ dragOverlay,
3814
+ ...rest
3815
+ });
3816
+ const animation = dragOverlay.node.animate(animationKeyframes, {
3817
+ duration,
3818
+ easing,
3819
+ fill: 'forwards'
3820
+ });
3821
+ return new Promise(resolve => {
3822
+ animation.onfinish = () => {
3823
+ cleanup == null ? void 0 : cleanup();
3824
+ resolve();
3825
+ };
3826
+ });
3827
+ };
3828
+ }
3829
+
3830
+ let key = 0;
3831
+ function useKey(id) {
3832
+ return React.useMemo(() => {
3833
+ if (id == null) {
3834
+ return;
3835
+ }
3836
+
3837
+ key++;
3838
+ return key;
3839
+ }, [id]);
3840
+ }
3841
+
3842
+ const DragOverlay = /*#__PURE__*/React__default.memo(_ref => {
3843
+ let {
3844
+ adjustScale = false,
3845
+ children,
3846
+ dropAnimation: dropAnimationConfig,
3847
+ style,
3848
+ transition,
3849
+ modifiers,
3850
+ wrapperElement = 'div',
3851
+ className,
3852
+ zIndex = 999
3853
+ } = _ref;
3854
+ const {
3855
+ activatorEvent,
3856
+ active,
3857
+ activeNodeRect,
3858
+ containerNodeRect,
3859
+ draggableNodes,
3860
+ droppableContainers,
3861
+ dragOverlay,
3862
+ over,
3863
+ measuringConfiguration,
3864
+ scrollableAncestors,
3865
+ scrollableAncestorRects,
3866
+ windowRect
3867
+ } = useDndContext();
3868
+ const transform = React.useContext(ActiveDraggableContext);
3869
+ const key = useKey(active == null ? void 0 : active.id);
3870
+ const modifiedTransform = applyModifiers(modifiers, {
3871
+ activatorEvent,
3872
+ active,
3873
+ activeNodeRect,
3874
+ containerNodeRect,
3875
+ draggingNodeRect: dragOverlay.rect,
3876
+ over,
3877
+ overlayNodeRect: dragOverlay.rect,
3878
+ scrollableAncestors,
3879
+ scrollableAncestorRects,
3880
+ transform,
3881
+ windowRect
3882
+ });
3883
+ const initialRect = useInitialValue(activeNodeRect);
3884
+ const dropAnimation = useDropAnimation({
3885
+ config: dropAnimationConfig,
3886
+ draggableNodes,
3887
+ droppableContainers,
3888
+ measuringConfiguration
3889
+ }); // We need to wait for the active node to be measured before connecting the drag overlay ref
3890
+ // otherwise collisions can be computed against a mispositioned drag overlay
3891
+
3892
+ const ref = initialRect ? dragOverlay.setRef : undefined;
3893
+ return React__default.createElement(NullifiedContextProvider, null, React__default.createElement(AnimationManager, {
3894
+ animation: dropAnimation
3895
+ }, active && key ? React__default.createElement(PositionedOverlay, {
3896
+ key: key,
3897
+ id: active.id,
3898
+ ref: ref,
3899
+ as: wrapperElement,
3900
+ activatorEvent: activatorEvent,
3901
+ adjustScale: adjustScale,
3902
+ className: className,
3903
+ transition: transition,
3904
+ rect: initialRect,
3905
+ style: {
3906
+ zIndex,
3907
+ ...style
3908
+ },
3909
+ transform: modifiedTransform
3910
+ }, children) : null));
3911
+ });
3912
+
3913
+ exports.DndContext = DndContext;
3914
+ exports.DragOverlay = DragOverlay;
3915
+ exports.KeyboardSensor = KeyboardSensor;
3916
+ exports.MouseSensor = MouseSensor;
3917
+ exports.PointerSensor = PointerSensor;
3918
+ exports.TouchSensor = TouchSensor;
3919
+ exports.applyModifiers = applyModifiers;
3920
+ exports.closestCenter = closestCenter;
3921
+ exports.closestCorners = closestCorners;
3922
+ exports.defaultAnnouncements = defaultAnnouncements;
3923
+ exports.defaultCoordinates = defaultCoordinates;
3924
+ exports.defaultDropAnimation = defaultDropAnimationConfiguration;
3925
+ exports.defaultDropAnimationSideEffects = defaultDropAnimationSideEffects;
3926
+ exports.defaultKeyboardCoordinateGetter = defaultKeyboardCoordinateGetter;
3927
+ exports.defaultScreenReaderInstructions = defaultScreenReaderInstructions;
3928
+ exports.getClientRect = getClientRect;
3929
+ exports.getFirstCollision = getFirstCollision;
3930
+ exports.getScrollableAncestors = getScrollableAncestors;
3931
+ exports.rectIntersection = rectIntersection;
3932
+ exports.useDndContext = useDndContext;
3933
+ exports.useDndMonitor = useDndMonitor;
3934
+ exports.useDraggable = useDraggable;
3935
+ exports.useDroppable = useDroppable;
3936
+ exports.useSensor = useSensor;
3937
+ exports.useSensors = useSensors;