@vireo-ai/trellis-ui 0.1.60 → 0.1.61

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 (202) hide show
  1. package/README.md +0 -1
  2. package/THIRD_PARTY_NOTICES.md +2 -0
  3. package/package.json +45 -36
  4. package/packages/client/src/components/field/styles.css +2 -1
  5. package/packages/client/src/styles/components.css +1 -0
  6. package/packages/client/src/styles/static.css +0 -1
  7. package/packages/client/types/assets/full-runtime.generated.d.ts +1 -1
  8. package/packages/client/types/capabilities/anchor.d.ts +7 -0
  9. package/packages/client/types/capabilities/anchor.entry.generated.d.ts +3 -0
  10. package/packages/client/types/components/accordion/runtime-docs.d.ts +1 -0
  11. package/packages/client/types/components/checkbox/runtime-docs.d.ts +1 -0
  12. package/packages/client/types/components/data-grid/runtime-docs.d.ts +1 -0
  13. package/packages/client/types/components/date-picker/runtime-docs.d.ts +1 -0
  14. package/packages/client/types/components/direct-upload/runtime-docs.d.ts +1 -0
  15. package/packages/client/types/components/dropdown/runtime-docs.d.ts +1 -0
  16. package/packages/client/types/components/entry.generated.d.ts +1 -0
  17. package/packages/client/types/components/field/runtime-docs.d.ts +1 -0
  18. package/packages/client/types/components/file-upload/runtime-docs.d.ts +1 -0
  19. package/packages/client/types/components/formset/runtime-docs.d.ts +1 -0
  20. package/packages/client/types/components/modal/runtime-docs.d.ts +1 -0
  21. package/packages/client/types/components/panels/runtime-docs.d.ts +1 -0
  22. package/packages/client/types/components/radio/runtime-docs.d.ts +1 -0
  23. package/packages/client/types/components/scroll-area/runtime-docs.d.ts +1 -0
  24. package/packages/client/types/components/select/runtime-docs.d.ts +1 -0
  25. package/packages/client/types/components/sidebar/runtime-docs.d.ts +1 -0
  26. package/packages/client/types/components/slider/runtime-docs.d.ts +1 -0
  27. package/packages/client/types/components/switch/runtime-docs.d.ts +1 -0
  28. package/packages/client/types/components/tabs/runtime-docs.d.ts +1 -0
  29. package/packages/client/types/components/toast/runtime-docs.d.ts +1 -0
  30. package/packages/client/types/components/tooltip/runtime-docs.d.ts +1 -0
  31. package/packages/client/types/components/virtualizer/runtime-docs.d.ts +1 -0
  32. package/packages/client/types/directives/anchor.d.ts +26 -0
  33. package/packages/client/types/directives/index.d.ts +1 -0
  34. package/packages/client/types/runtime/anchored-popover.d.ts +4 -2
  35. package/packages/server/trellis_ui/static/trellis_ui/assets/css/{trellis-a1130be0a833.css → trellis-103fb43eb5e1.css} +23 -23
  36. package/packages/server/trellis_ui/static/trellis_ui/assets/css/trellis.css +23 -23
  37. package/packages/server/trellis_ui/static/trellis_ui/assets/css/trellis.min-584dec82495c.css +2 -0
  38. package/packages/server/trellis_ui/static/trellis_ui/assets/css/trellis.min.css +1 -1
  39. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/build-metadata.json +346 -318
  40. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/capabilities/anchor-B-CbpFFU.js +2 -0
  41. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/capabilities/anchor-B-CbpFFU.js.map +1 -0
  42. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/capabilities/anchor.js +2 -0
  43. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/capabilities/motion-CKiK3BQA.js +2 -0
  44. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/capabilities/{motion-B0MINJTL.js.map → motion-CKiK3BQA.js.map} +1 -1
  45. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/capabilities/motion.js +2 -2
  46. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/capabilities/{sortable-DQ4eUO2l.js → sortable-CbIOS4Lm.js} +2 -2
  47. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/capabilities/{sortable-DQ4eUO2l.js.map → sortable-CbIOS4Lm.js.map} +1 -1
  48. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/capabilities/sortable.js +2 -2
  49. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/capability-anchor-lhqk7hfo.js +2 -0
  50. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/capability-anchor-lhqk7hfo.js.map +1 -0
  51. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/capability-motion-B32HePGn.js +2 -0
  52. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{capability-motion-D_BJBnwB.js.map → capability-motion-B32HePGn.js.map} +1 -1
  53. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/capability-sortable-Bl6ng6Hd.js +5 -0
  54. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{capability-sortable-BDbURlVO.js.map → capability-sortable-Bl6ng6Hd.js.map} +1 -1
  55. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/controller-C8xqwkr0.js.map +1 -1
  56. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/core-BxNepYBE.js +2 -0
  57. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{core-Ybm_WmKr.js.map → core-BxNepYBE.js.map} +1 -1
  58. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-7hdXmBLE.js +2 -0
  59. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-7hdXmBLE.js.map +1 -0
  60. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-DDrayI_M.js → entry.generated-BRaKxvab.js} +2 -2
  61. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-DDrayI_M.js.map → entry.generated-BRaKxvab.js.map} +1 -1
  62. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-BnqcHAaF.js.map +1 -1
  63. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-OT_bt7F2.js → entry.generated-BzLNUDzF.js} +2 -2
  64. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-BzLNUDzF.js.map +1 -0
  65. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-CEfr2bmw.js +2 -0
  66. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-CEfr2bmw.js.map +1 -0
  67. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-ChoqPigj.js → entry.generated-CL4bjCqf.js} +2 -2
  68. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-CL4bjCqf.js.map +1 -0
  69. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-BgGSoQFS.js → entry.generated-Cbyseoex.js} +2 -2
  70. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-Cbyseoex.js.map +1 -0
  71. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-Cf2hKkwA.js +2 -0
  72. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-Cf2hKkwA.js.map +1 -0
  73. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-CfYgsDun.js.map +1 -1
  74. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-CqtsPVJy.js → entry.generated-Cl8rInnJ.js} +2 -2
  75. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-CqtsPVJy.js.map → entry.generated-Cl8rInnJ.js.map} +1 -1
  76. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-dcqwycC7.js → entry.generated-Ct9H8Hlf.js} +2 -2
  77. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-Ct9H8Hlf.js.map +1 -0
  78. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-D2es_Wi2.js.map +1 -1
  79. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-DQtFqG0K.js.map +1 -1
  80. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-FCDgmA0s.js +2 -0
  81. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-FCDgmA0s.js.map +1 -0
  82. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-J0oGNBzS.js +2 -0
  83. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-J0oGNBzS.js.map +1 -0
  84. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{flip-crNQSZEa.js → flip-BKThFI4L.js} +2 -2
  85. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{flip-crNQSZEa.js.map → flip-BKThFI4L.js.map} +1 -1
  86. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{motion-B90yNOaV.js → motion-RwlK04Cy.js} +2 -2
  87. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{motion-B90yNOaV.js.map → motion-RwlK04Cy.js.map} +1 -1
  88. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/styles-CQDZhwd_.js.map +1 -1
  89. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{ui-CTQoglp3.js → ui-Bg44ZmC3.js} +4 -4
  90. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/ui-Bg44ZmC3.js.map +1 -0
  91. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/warn-BbGtqbh1.js +2 -0
  92. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/warn-BbGtqbh1.js.map +1 -0
  93. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/accordion-DpoqsP_I.js +1 -0
  94. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/accordion.js +2 -2
  95. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/data-grid-CCPYnOuT.js +1 -0
  96. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/data-grid.js +2 -2
  97. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/date-picker-BCkP5gtC.js +1 -0
  98. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/date-picker.js +2 -2
  99. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/dropdown-Cc84envj.js +1 -0
  100. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/dropdown.js +2 -2
  101. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/index-DRH3gncZ.js +2 -0
  102. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/index-DRH3gncZ.js.map +1 -0
  103. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/index.js +2 -2
  104. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/modal-MUHGUsup.js +1 -0
  105. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/modal.js +2 -2
  106. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/panels-DNAroAhk.js +1 -0
  107. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/panels.js +2 -2
  108. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/select-BjLF548F.js +1 -0
  109. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/select.js +2 -2
  110. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/sidebar-GpvEBW3K.js +1 -0
  111. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/sidebar.js +2 -2
  112. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/tabs-bq7j1uwx.js +1 -0
  113. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/tabs.js +2 -2
  114. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/toast-DkP0-rBO.js +1 -0
  115. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/toast.js +2 -2
  116. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/tooltip-OITEWczP.js +1 -0
  117. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/tooltip.js +2 -2
  118. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/{core-CRIj89v5.js → core-Z4zMCScs.js} +1 -1
  119. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/core.js +2 -2
  120. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/index-DAz_hKiB.js +2 -0
  121. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/index-DAz_hKiB.js.map +1 -0
  122. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/index.js +2 -2
  123. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/logical-entry-manifest.json +134 -111
  124. package/packages/server/trellis_ui/static/trellis_ui/assets/js/trellis-ecb43dfd3b7b.js +11 -0
  125. package/packages/server/trellis_ui/static/trellis_ui/assets/js/trellis.js +6 -6
  126. package/packages/server/trellis_ui/static/trellis_ui/assets/js/trellis.min-ecb43dfd3b7b.js +11 -0
  127. package/packages/server/trellis_ui/static/trellis_ui/assets/js/trellis.min.js +6 -6
  128. package/packages/theme-engine/README.md +221 -0
  129. package/packages/theme-engine/THEME_AUTHORING.md +44 -0
  130. package/packages/theme-engine/dist/trellis.js +16935 -0
  131. package/packages/theme-engine/generated/knobs/v1/color-alpha.json +2426 -0
  132. package/packages/theme-engine/generated/knobs/v1/color-foundations.json +1582 -0
  133. package/packages/theme-engine/generated/knobs/v1/color-ink.json +6541 -0
  134. package/packages/theme-engine/generated/knobs/v1/color-lighting.json +3056 -0
  135. package/packages/theme-engine/generated/knobs/v1/color-normalization.json +1685 -0
  136. package/packages/theme-engine/generated/knobs/v1/color-ramps.json +14304 -0
  137. package/packages/theme-engine/generated/knobs/v1/composition.json +881 -0
  138. package/packages/theme-engine/generated/knobs/v1/depth.json +1705 -0
  139. package/packages/theme-engine/generated/knobs/v1/edges.json +326 -0
  140. package/packages/theme-engine/generated/knobs/v1/index.json +20096 -0
  141. package/packages/theme-engine/generated/knobs/v1/manifest.json +719 -0
  142. package/packages/theme-engine/generated/knobs/v1/motion.json +128 -0
  143. package/packages/theme-engine/generated/knobs/v1/radii.json +331 -0
  144. package/packages/theme-engine/generated/knobs/v1/semantic-actions.json +1814 -0
  145. package/packages/theme-engine/generated/knobs/v1/semantic-disabled.json +759 -0
  146. package/packages/theme-engine/generated/knobs/v1/semantic-disclosure.json +59 -0
  147. package/packages/theme-engine/generated/knobs/v1/semantic-intents.json +4841 -0
  148. package/packages/theme-engine/generated/knobs/v1/semantic-scrim.json +308 -0
  149. package/packages/theme-engine/generated/knobs/v1/semantic-selection.json +940 -0
  150. package/packages/theme-engine/generated/knobs/v1/semantic-structure.json +365 -0
  151. package/packages/theme-engine/generated/knobs/v1/sizing-anatomy.json +3112 -0
  152. package/packages/theme-engine/generated/knobs/v1/sizing-controls.json +599 -0
  153. package/packages/theme-engine/generated/knobs/v1/sizing-measures.json +1089 -0
  154. package/packages/theme-engine/generated/knobs/v1/spacing.json +1246 -0
  155. package/packages/theme-engine/generated/knobs/v1/substrates.json +315 -0
  156. package/packages/theme-engine/generated/knobs/v1/surfaces.json +870 -0
  157. package/packages/theme-engine/generated/knobs/v1/typography-anatomy.json +1754 -0
  158. package/packages/theme-engine/generated/knobs/v1/typography-fonts.json +711 -0
  159. package/packages/theme-engine/generated/knobs/v1/typography-scale.json +329 -0
  160. package/packages/theme-engine/generated/schemas/theme-config-v1.json +3987 -0
  161. package/packages/theme-engine/generated/schemas/theme-manifest-v1.json +79 -0
  162. package/packages/theme-engine/skills/create-trellis-theme/SKILL.md +108 -0
  163. package/packages/client/types/components/runtime-docs.d.ts +0 -2
  164. package/packages/server/trellis_ui/static/trellis_ui/assets/css/trellis.min-d053936d467f.css +0 -2
  165. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/capabilities/motion-B0MINJTL.js +0 -2
  166. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/anchored-popover-BwQbt4V2.js +0 -2
  167. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/anchored-popover-BwQbt4V2.js.map +0 -1
  168. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/capability-motion-D_BJBnwB.js +0 -2
  169. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/capability-sortable-BDbURlVO.js +0 -5
  170. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/core-Ybm_WmKr.js +0 -2
  171. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-2YvnuzOD.js +0 -2
  172. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-2YvnuzOD.js.map +0 -1
  173. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-B986Ob4f.js +0 -2
  174. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-B986Ob4f.js.map +0 -1
  175. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-BITa8xFV.js +0 -2
  176. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-BITa8xFV.js.map +0 -1
  177. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-BSVJpGWu.js +0 -2
  178. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-BSVJpGWu.js.map +0 -1
  179. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-BgGSoQFS.js.map +0 -1
  180. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-ChoqPigj.js.map +0 -1
  181. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-OT_bt7F2.js.map +0 -1
  182. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-WRveW7p9.js +0 -2
  183. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-WRveW7p9.js.map +0 -1
  184. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-dcqwycC7.js.map +0 -1
  185. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/ui-CTQoglp3.js.map +0 -1
  186. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/accordion-CKh9jOQc.js +0 -1
  187. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/data-grid-DHqf4lhn.js +0 -1
  188. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/date-picker-DhNrvLv7.js +0 -1
  189. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/dropdown-CDPdgATy.js +0 -1
  190. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/index-DzOKmgfj.js +0 -2
  191. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/index-DzOKmgfj.js.map +0 -1
  192. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/modal-1D2WtmlK.js +0 -1
  193. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/panels-BXtMr9cv.js +0 -1
  194. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/select-B_b2uwfv.js +0 -1
  195. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/sidebar-D8y44c-J.js +0 -1
  196. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/tabs-CBjcV5_z.js +0 -1
  197. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/toast-DSduFsxK.js +0 -1
  198. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/tooltip-B3vA5YAi.js +0 -1
  199. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/index-CL7BWKcd.js +0 -2
  200. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/index-CL7BWKcd.js.map +0 -1
  201. package/packages/server/trellis_ui/static/trellis_ui/assets/js/trellis-acc1b62a38b1.js +0 -11
  202. package/packages/server/trellis_ui/static/trellis_ui/assets/js/trellis.min-acc1b62a38b1.js +0 -11
@@ -1 +1 @@
1
- {"version":3,"file":"capability-sortable-BDbURlVO.js","names":["ownKeys","_objectSpread","isWithin","bind","bindAll","_navigator","start","bindAll","ledger","ownKeys","_objectSpread","_createForOfIteratorHelper","_unsupportedIterableToArray","_arrayLikeToArray","_createForOfIteratorHelper","_unsupportedIterableToArray","_arrayLikeToArray","ownKeys","_objectSpread","bind","_state","ownKeys","_objectSpread","bindAll","getBindingsForBrokenDrags"],"sources":["../../../../../../../../client/src/runtime/drag-and-drop/sortable/contract.ts","../../../../../../../../client/src/runtime/drag-and-drop/sortable/placement.ts","../../../../../../../../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop@2.0.2/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/public-utils/reorder.js","../../../../../../../../client/src/runtime/drag-and-drop/sortable/feedback.ts","../../../../../../../../client/src/runtime/drag-and-drop/sortable/ghost.ts","../../../../../../../../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop-live-region@2.1.0/node_modules/@atlaskit/pragmatic-drag-and-drop-live-region/dist/esm/constants.js","../../../../../../../../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop-live-region@2.1.0/node_modules/@atlaskit/pragmatic-drag-and-drop-live-region/dist/esm/index.js","../../../../../../../../client/src/runtime/drag-and-drop/sortable/registry.ts","../../../../../../../../client/src/runtime/drag-and-drop/sortable/cursor.ts","../../../../../../../../client/src/runtime/drag-and-drop/sortable/source-machine.ts","../../../../../../../../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop@3.1.0/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/honey-pot-fix/honey-pot-data-attribute.js","../../../../../../../../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop@3.1.0/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/honey-pot-fix/is-honey-pot-element.js","../../../../../../../../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop@3.1.0/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/honey-pot-fix/get-element-from-point-without-honey-pot.js","../../../../../../../../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop@3.1.0/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/max-z-index.js","../../../../../../../../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop@3.1.0/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/popover-reset-styles.js","../../../../../../../../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop@3.1.0/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/public-utils/once.js","../../../../../../../../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop@3.1.0/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/supports-popover.js","../../../../../../../../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop@3.1.0/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/honey-pot-fix/make-honey-pot-fix.js","../../../../../../../../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop@3.1.0/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/is-firefox.js","../../../../../../../../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop@3.1.0/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/is-safari.js","../../../../../../../../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop@3.1.0/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/changing-window/is-from-another-window.js","../../../../../../../../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop@3.1.0/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/changing-window/count-events-for-safari.js","../../../../../../../../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop@3.1.0/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/changing-window/is-leaving-window-in-safari.js","../../../../../../../../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop@3.1.0/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/changing-window/is-leaving-window.js","../../../../../../../../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop@3.1.0/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/detect-broken-drag.js","../../../../../../../../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop@3.1.0/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/get-input.js","../../../../../../../../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop@3.1.0/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/ledger/dispatch-consumer-event.js","../../../../../../../../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop@3.1.0/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/ledger/lifecycle-manager.js","../../../../../../../../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop@3.1.0/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/ledger/usage-ledger.js","../../../../../../../../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop@3.1.0/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/public-utils/combine.js","../../../../../../../../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop@3.1.0/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/add-attribute.js","../../../../../../../../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop@3.1.0/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/make-adapter/make-drop-target.js","../../../../../../../../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop@3.1.0/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/make-adapter/make-monitor.js","../../../../../../../../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop@3.1.0/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/make-adapter/make-adapter.js","../../../../../../../../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop@3.1.0/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/android.js","../../../../../../../../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop@3.1.0/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/media-types/text-media-type.js","../../../../../../../../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop@3.1.0/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/media-types/url-media-type.js","../../../../../../../../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop@3.1.0/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/adapter/element-adapter-native-data-key.js","../../../../../../../../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop@3.1.0/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/adapter/element-adapter.js","../../../../../../../../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop-auto-scroll@3.2.0/node_modules/@atlaskit/pragmatic-drag-and-drop-auto-scroll/dist/esm/shared/engagement-history.js","../../../../../../../../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop-auto-scroll@3.2.0/node_modules/@atlaskit/pragmatic-drag-and-drop-auto-scroll/dist/esm/shared/scheduler.js","../../../../../../../../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop-auto-scroll@3.2.0/node_modules/@atlaskit/pragmatic-drag-and-drop-auto-scroll/dist/esm/over-element/data-attributes.js","../../../../../../../../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop-auto-scroll@3.2.0/node_modules/@atlaskit/pragmatic-drag-and-drop-auto-scroll/dist/esm/shared/configuration.js","../../../../../../../../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop-auto-scroll@3.2.0/node_modules/@atlaskit/pragmatic-drag-and-drop-auto-scroll/dist/esm/shared/can-scroll-on-edge.js","../../../../../../../../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop-auto-scroll@3.2.0/node_modules/@atlaskit/pragmatic-drag-and-drop-auto-scroll/dist/esm/shared/edges.js","../../../../../../../../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop-auto-scroll@3.2.0/node_modules/@atlaskit/pragmatic-drag-and-drop-auto-scroll/dist/esm/shared/axis.js","../../../../../../../../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop-auto-scroll@3.2.0/node_modules/@atlaskit/pragmatic-drag-and-drop-auto-scroll/dist/esm/shared/side.js","../../../../../../../../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop-auto-scroll@3.2.0/node_modules/@atlaskit/pragmatic-drag-and-drop-auto-scroll/dist/esm/shared/get-over-element-hitbox.js","../../../../../../../../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop-auto-scroll@3.2.0/node_modules/@atlaskit/pragmatic-drag-and-drop-auto-scroll/dist/esm/shared/get-percentage-in-range.js","../../../../../../../../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop-auto-scroll@3.2.0/node_modules/@atlaskit/pragmatic-drag-and-drop-auto-scroll/dist/esm/shared/get-scroll-change.js","../../../../../../../../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop-auto-scroll@3.2.0/node_modules/@atlaskit/pragmatic-drag-and-drop-auto-scroll/dist/esm/shared/is-axis-allowed.js","../../../../../../../../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop-auto-scroll@3.2.0/node_modules/@atlaskit/pragmatic-drag-and-drop-auto-scroll/dist/esm/shared/is-within.js","../../../../../../../../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop-auto-scroll@3.2.0/node_modules/@atlaskit/pragmatic-drag-and-drop-auto-scroll/dist/esm/over-element/get-scroll-by.js","../../../../../../../../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop-auto-scroll@3.2.0/node_modules/@atlaskit/pragmatic-drag-and-drop-auto-scroll/dist/esm/over-element/try-scroll.js","../../../../../../../../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop-auto-scroll@3.2.0/node_modules/@atlaskit/pragmatic-drag-and-drop-auto-scroll/dist/esm/over-element/make-api.js","../../../../../../../../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop-auto-scroll@3.2.0/node_modules/@atlaskit/pragmatic-drag-and-drop-auto-scroll/dist/esm/entry-point/element.js","../../../../../../../../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop@2.0.2/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/public-utils/prevent-unhandled.js","../../../../../../../../client/src/directives/sortable.ts","../../../../../../../../client/src/capabilities/sortable.ts"],"sourcesContent":["type SortableOperation = 'insert' | 'move';\ntype SortableCancelReason = 'escape' | 'outside' | 'disabled' | 'removed';\ntype SortableOrientation = 'vertical' | 'horizontal' | 'grid';\ntype SortableFeedback = 'indicator' | 'reorder';\ntype SortableColor = 'neutral' | 'accent';\ntype SortableInteraction = 'tonal' | 'edge' | 'combined';\ntype SortableEdge = 'before' | 'after';\ntype SortableDirection = 'ltr' | 'rtl';\n\ntype SortableFrame = Readonly<{\n left: number;\n top: number;\n right: number;\n bottom: number;\n width: number;\n height: number;\n}>;\n\ntype SortableInput = Readonly<{\n clientX: number;\n clientY: number;\n}>;\n\ntype SortableDragDetail = Readonly<{\n source: SortableSource;\n input: SortableInput;\n previousInput: SortableInput;\n delta: Readonly<{x: number; y: number}>;\n velocity: Readonly<{x: number; y: number}>;\n ghostFrame: Readonly<{x: number; y: number; width: number; height: number}>;\n}>;\n\ntype SortableSourceFields = Readonly<{\n scopeId: string;\n id: string;\n type: string;\n label?: string;\n data?: Readonly<Record<string, unknown>>;\n}>;\ntype SortableInsertSource = SortableSourceFields & Readonly<{\n operation: 'insert';\n groupId: null;\n}>;\ntype SortableMoveSource = SortableSourceFields & Readonly<{\n operation: 'move';\n groupId: string;\n}>;\ntype SortableSource = SortableInsertSource | SortableMoveSource;\n\ntype SortableAnchor = Readonly<{\n id: string;\n edge: SortableEdge;\n}>;\n\ntype SortableDropIntent = Readonly<{\n destination: Readonly<{groupId: string}>;\n anchor: SortableAnchor | null;\n index?: never;\n}>;\n\ntype SortableResolvedPlacement = Readonly<{\n destination: Readonly<{groupId: string}>;\n anchor: SortableAnchor | null;\n index: number;\n}>;\n\ntype SortableGroup = Readonly<{\n scopeId: string;\n id: string;\n orientation: SortableOrientation;\n columns: number | null;\n accepts: readonly string[];\n disabled: boolean;\n readOnly: boolean;\n feedback: SortableFeedback;\n sourceOpacity: number;\n ghostOpacity: number;\n dragCursor: string;\n previewPosition: string;\n color: SortableColor;\n interaction: SortableInteraction;\n data?: Readonly<Record<string, unknown>>;\n label?: string;\n}>;\n\ntype SortableCanDropContext = Readonly<{\n source: SortableSource;\n destination: SortableGroup;\n itemIds: readonly string[];\n input: SortableInput | null;\n}>;\n\ntype SortableDropDetail =\n | (SortableResolvedPlacement & Readonly<{operation: 'insert'; source: SortableInsertSource}>)\n | (SortableResolvedPlacement & Readonly<{operation: 'move'; source: SortableMoveSource}>);\n\ntype SortableMoveOptions = Readonly<{\n scope: string;\n sourceId: string;\n destinationGroupId?: string;\n}>;\n\ntype SortableMoveRelativeOptions = SortableMoveOptions & Readonly<{anchorId: string}>;\n\ninterface UiSortableService {\n moveBefore(options: SortableMoveRelativeOptions): boolean;\n moveAfter(options: SortableMoveRelativeOptions): boolean;\n moveToStart(options: SortableMoveOptions & {destinationGroupId: string}): boolean;\n moveToEnd(options: SortableMoveOptions & {destinationGroupId: string}): boolean;\n}\n\nconst isValidGridColumns = (columns: number | null): columns is number => (\n columns !== null && Number.isInteger(columns) && columns > 0\n);\n\ntype SortableItemGeometry = Readonly<{\n id: string;\n rect: SortableFrame;\n}>;\n\ntype ResolveSortablePlacementOptions = Readonly<{\n groupId: string;\n orientation: SortableOrientation;\n direction: SortableDirection;\n columns: number | null;\n groupRect: SortableFrame;\n items: readonly SortableItemGeometry[];\n input: SortableInput;\n}>;\n\nexport type {\n ResolveSortablePlacementOptions,\n SortableAnchor,\n SortableCancelReason,\n SortableColor,\n SortableCanDropContext,\n SortableDirection,\n SortableDragDetail,\n SortableEdge,\n SortableFeedback,\n SortableFrame,\n SortableGroup,\n SortableDropIntent,\n SortableDropDetail,\n SortableInput,\n SortableInteraction,\n SortableInsertSource,\n SortableItemGeometry,\n SortableOperation,\n SortableOrientation,\n SortableResolvedPlacement,\n SortableMoveSource,\n SortableSource,\n SortableMoveOptions,\n SortableMoveRelativeOptions,\n UiSortableService,\n};\n\nexport {isValidGridColumns};\n","import type {\n ResolveSortablePlacementOptions,\n SortableAnchor,\n SortableItemGeometry,\n SortableResolvedPlacement,\n} from './contract';\nimport {isValidGridColumns} from './contract';\n\ntype Boundary = Readonly<{\n anchor: SortableAnchor | null;\n index: number;\n distance(input: ResolveSortablePlacementOptions['input']): number;\n}>;\n\ntype SortableIndicatorFrame = Readonly<{\n x: number;\n y: number;\n width: number;\n height: number;\n kind: 'inline-boundary' | 'block-boundary';\n}>;\n\nconst OUTER_INDICATOR_OFFSET = 4;\n\nconst isSameSortablePlacement = (\n left: SortableResolvedPlacement | null,\n right: SortableResolvedPlacement | null,\n): boolean => left === right || Boolean(\n left && right\n && left.destination.groupId === right.destination.groupId\n && left.anchor?.id === right.anchor?.id\n && left.anchor?.edge === right.anchor?.edge\n && left.index === right.index,\n);\n\nconst distanceToSegment = ({\n point,\n start,\n end,\n}: {\n point: {x: number; y: number};\n start: {x: number; y: number};\n end: {x: number; y: number};\n}): number => {\n const dx = end.x - start.x;\n const dy = end.y - start.y;\n const lengthSquared = dx * dx + dy * dy;\n if (lengthSquared === 0) return Math.hypot(point.x - start.x, point.y - start.y);\n const progress = Math.max(0, Math.min(1, (\n (point.x - start.x) * dx + (point.y - start.y) * dy\n ) / lengthSquared));\n return Math.hypot(point.x - (start.x + progress * dx), point.y - (start.y + progress * dy));\n};\n\nconst verticalBoundaries = (items: readonly SortableItemGeometry[]): Boundary[] => items.length === 0 ? [] : [\n {\n anchor: {id: items[0]!.id, edge: 'before'},\n index: 0,\n distance: (input) => Math.abs(input.clientY - items[0]!.rect.top),\n },\n ...items.slice(1).map((item, index) => {\n const previous = items[index]!;\n const y = (previous.rect.bottom + item.rect.top) / 2;\n return {\n anchor: {id: item.id, edge: 'before'} as const,\n index: index + 1,\n distance: (input: ResolveSortablePlacementOptions['input']) => Math.abs(input.clientY - y),\n };\n }),\n {\n anchor: {id: items.at(-1)!.id, edge: 'after'},\n index: items.length,\n distance: (input) => Math.abs(input.clientY - items.at(-1)!.rect.bottom),\n },\n];\n\nconst horizontalBoundaries = (\n items: readonly SortableItemGeometry[],\n direction: ResolveSortablePlacementOptions['direction'],\n): Boundary[] => {\n if (items.length === 0) return [];\n const inlineStart = (item: SortableItemGeometry): number => (\n direction === 'rtl' ? item.rect.right : item.rect.left\n );\n const inlineEnd = (item: SortableItemGeometry): number => (\n direction === 'rtl' ? item.rect.left : item.rect.right\n );\n return [\n {\n anchor: {id: items[0]!.id, edge: 'before'},\n index: 0,\n distance: (input) => Math.abs(input.clientX - inlineStart(items[0]!)),\n },\n ...items.slice(1).map((item, index) => {\n const previous = items[index]!;\n const x = (inlineEnd(previous) + inlineStart(item)) / 2;\n return {\n anchor: {id: item.id, edge: 'before'} as const,\n index: index + 1,\n distance: (input: ResolveSortablePlacementOptions['input']) => Math.abs(input.clientX - x),\n };\n }),\n {\n anchor: {id: items.at(-1)!.id, edge: 'after'},\n index: items.length,\n distance: (input) => Math.abs(input.clientX - inlineEnd(items.at(-1)!)),\n },\n ];\n};\n\nconst gridBoundaries = ({\n columns,\n direction,\n groupRect,\n items,\n}: Pick<ResolveSortablePlacementOptions, 'columns' | 'direction' | 'groupRect' | 'items'>): Boundary[] => {\n if (!isValidGridColumns(columns)) {\n throw new TypeError('Grid sortable groups require a positive integer columns value.');\n }\n if (items.length === 0) return [];\n\n const inlineStart = (item: SortableItemGeometry): number => (\n direction === 'rtl' ? item.rect.right : item.rect.left\n );\n const inlineEnd = (item: SortableItemGeometry): number => (\n direction === 'rtl' ? item.rect.left : item.rect.right\n );\n const rowItems = (row: number): readonly SortableItemGeometry[] => (\n items.slice(row * columns, (row + 1) * columns)\n );\n const rowTop = (row: number): number => Math.min(...rowItems(row).map((item) => item.rect.top));\n const rowBottom = (row: number): number => Math.max(...rowItems(row).map((item) => item.rect.bottom));\n const verticalBoundary = (\n x: number,\n row: number,\n anchor: SortableAnchor | null,\n index: number,\n ): Boundary => ({\n anchor,\n index,\n distance: (input) => distanceToSegment({\n point: {x: input.clientX, y: input.clientY},\n start: {x, y: rowTop(row)},\n end: {x, y: rowBottom(row)},\n }),\n });\n const horizontalBoundary = (\n y: number,\n anchor: SortableAnchor | null,\n index: number,\n ): Boundary => ({\n anchor,\n index,\n distance: (input) => distanceToSegment({\n point: {x: input.clientX, y: input.clientY},\n start: {x: groupRect.left, y},\n end: {x: groupRect.right, y},\n }),\n });\n\n const boundaries: Boundary[] = [verticalBoundary(\n inlineStart(items[0]!),\n 0,\n {id: items[0]!.id, edge: 'before'},\n 0,\n )];\n\n for (let index = 1; index < items.length; index += 1) {\n const item = items[index]!;\n const previous = items[index - 1]!;\n if (index % columns === 0) {\n const row = index / columns;\n boundaries.push(horizontalBoundary(\n (rowBottom(row - 1) + rowTop(row)) / 2,\n {id: item.id, edge: 'before'},\n index,\n ));\n } else {\n const row = Math.floor(index / columns);\n boundaries.push(verticalBoundary(\n (inlineEnd(previous) + inlineStart(item)) / 2,\n row,\n {id: item.id, edge: 'before'},\n index,\n ));\n }\n }\n\n const lastIndex = items.length - 1;\n const last = items[lastIndex]!;\n const lastRow = Math.floor(lastIndex / columns);\n const finalRowCount = items.length % columns;\n if (finalRowCount === 0) {\n boundaries.push(horizontalBoundary(\n rowBottom(lastRow),\n {id: last.id, edge: 'after'},\n items.length,\n ));\n } else {\n const exemplar = items[finalRowCount];\n const x = exemplar === undefined\n ? inlineEnd(last)\n : (inlineEnd(last) + inlineStart(exemplar)) / 2;\n boundaries.push(verticalBoundary(\n x,\n lastRow,\n {id: last.id, edge: 'after'},\n items.length,\n ));\n }\n\n return boundaries;\n};\n\nconst nearestBoundary = (\n boundaries: readonly Boundary[],\n input: ResolveSortablePlacementOptions['input'],\n): Boundary => boundaries.reduce((nearest, boundary) => (\n boundary.distance(input) < nearest.distance(input) ? boundary : nearest\n));\n\nconst resolveSortablePlacement = (options: ResolveSortablePlacementOptions): SortableResolvedPlacement => {\n if (options.items.length === 0) {\n return {destination: {groupId: options.groupId}, anchor: null, index: 0};\n }\n\n const boundaries = options.orientation === 'horizontal'\n ? horizontalBoundaries(options.items, options.direction)\n : options.orientation === 'grid'\n ? gridBoundaries(options)\n : verticalBoundaries(options.items);\n const boundary = nearestBoundary(boundaries, options.input);\n return {\n destination: {groupId: options.groupId},\n anchor: boundary.anchor,\n index: boundary.index,\n };\n};\n\nconst resolveSortableReorderPlacement = (options: ResolveSortablePlacementOptions): SortableResolvedPlacement => {\n if (options.items.length === 0 || options.orientation === 'grid') {\n return resolveSortablePlacement(options);\n }\n const coordinate = options.orientation === 'vertical'\n ? options.input.clientY\n : options.input.clientX * (options.direction === 'rtl' ? -1 : 1);\n const index = options.items.findIndex(({rect}) => {\n const midpoint = options.orientation === 'vertical'\n ? rect.top + rect.height / 2\n : (rect.left + rect.width / 2) * (options.direction === 'rtl' ? -1 : 1);\n return coordinate < midpoint;\n });\n const insertionIndex = index < 0 ? options.items.length : index;\n const anchor = insertionIndex === options.items.length\n ? {id: options.items.at(-1)!.id, edge: 'after' as const}\n : {id: options.items[insertionIndex]!.id, edge: 'before' as const};\n return {destination: {groupId: options.groupId}, anchor, index: insertionIndex};\n};\n\nconst projectSortablePlacement = ({\n placement,\n sourceId,\n sourceGroupId,\n itemIds,\n}: {\n placement: SortableResolvedPlacement;\n sourceId: string;\n sourceGroupId: string | null;\n itemIds: readonly string[];\n}): SortableResolvedPlacement => {\n if (sourceGroupId !== placement.destination.groupId) return placement;\n const sourceIndex = itemIds.indexOf(sourceId);\n if (sourceIndex < 0) return placement;\n const projectedIds = itemIds.filter((id) => id !== sourceId);\n const index = Math.max(0, Math.min(\n projectedIds.length,\n placement.index > sourceIndex ? placement.index - 1 : placement.index,\n ));\n const anchor = projectedIds.length === 0\n ? null\n : index === projectedIds.length\n ? {id: projectedIds.at(-1)!, edge: 'after' as const}\n : {id: projectedIds[index]!, edge: 'before' as const};\n return {destination: placement.destination, anchor, index};\n};\n\nconst resolveSortableIndicatorFrame = (\n options: Omit<ResolveSortablePlacementOptions, 'input'>,\n placement: SortableResolvedPlacement,\n): SortableIndicatorFrame => {\n const {groupRect, items, orientation, direction} = options;\n if (items.length === 0 || placement.anchor === null) {\n if (orientation === 'horizontal') {\n const x = direction === 'rtl'\n ? groupRect.right - OUTER_INDICATOR_OFFSET\n : groupRect.left + OUTER_INDICATOR_OFFSET;\n return {x, y: groupRect.top, width: 0, height: groupRect.height, kind: 'inline-boundary'};\n }\n return {\n x: groupRect.left,\n y: groupRect.top + OUTER_INDICATOR_OFFSET,\n width: groupRect.width,\n height: 0,\n kind: 'block-boundary',\n };\n }\n const index = placement.index;\n const previous = index > 0 ? items[index - 1] : undefined;\n const next = index < items.length ? items[index] : undefined;\n if (orientation === 'vertical') {\n const y = previous && next ? (previous.rect.bottom + next.rect.top) / 2\n : next ? next.rect.top - OUTER_INDICATOR_OFFSET : previous!.rect.bottom + OUTER_INDICATOR_OFFSET;\n return {x: groupRect.left, y, width: groupRect.width, height: 0, kind: 'block-boundary'};\n }\n const inlineStart = (item: SortableItemGeometry): number => direction === 'rtl' ? item.rect.right : item.rect.left;\n const inlineEnd = (item: SortableItemGeometry): number => direction === 'rtl' ? item.rect.left : item.rect.right;\n if (orientation === 'horizontal') {\n const x = previous && next ? (inlineEnd(previous) + inlineStart(next)) / 2\n : next ? inlineStart(next) + (direction === 'rtl' ? OUTER_INDICATOR_OFFSET : -OUTER_INDICATOR_OFFSET)\n : inlineEnd(previous!) + (direction === 'rtl' ? -OUTER_INDICATOR_OFFSET : OUTER_INDICATOR_OFFSET);\n return {x, y: groupRect.top, width: 0, height: groupRect.height, kind: 'inline-boundary'};\n }\n const columns = options.columns;\n if (!isValidGridColumns(columns)) {\n throw new TypeError('Grid sortable groups require a positive integer columns value.');\n }\n const isRowBoundary = index > 0 && index % columns === 0;\n if (isRowBoundary) {\n const y = next ? (previous!.rect.bottom + next.rect.top) / 2 : previous!.rect.bottom + OUTER_INDICATOR_OFFSET;\n return {x: groupRect.left, y, width: groupRect.width, height: 0, kind: 'block-boundary'};\n }\n let x: number;\n if (previous && next) x = (inlineEnd(previous) + inlineStart(next)) / 2;\n else if (next) x = inlineStart(next) + (direction === 'rtl' ? OUTER_INDICATOR_OFFSET : -OUTER_INDICATOR_OFFSET);\n else {\n const finalRowCount = items.length % columns;\n const exemplar = finalRowCount === 0 ? undefined : items[finalRowCount];\n x = exemplar ? (inlineEnd(previous!) + inlineStart(exemplar)) / 2\n : inlineEnd(previous!) + (direction === 'rtl' ? -OUTER_INDICATOR_OFFSET : OUTER_INDICATOR_OFFSET);\n }\n const rowStart = Math.floor(Math.min(index, items.length - 1) / columns) * columns;\n const row = items.slice(rowStart, rowStart + columns);\n return {\n x,\n y: Math.min(...row.map((item) => item.rect.top)),\n width: 0,\n height: Math.max(...row.map((item) => item.rect.bottom)) - Math.min(...row.map((item) => item.rect.top)),\n kind: 'inline-boundary',\n };\n};\n\nexport {\n distanceToSegment,\n isSameSortablePlacement,\n projectSortablePlacement,\n resolveSortableIndicatorFrame,\n resolveSortablePlacement,\n resolveSortableReorderPlacement,\n};\nexport type {SortableIndicatorFrame};\n","import _slicedToArray from \"@babel/runtime/helpers/slicedToArray\";\n/**\n * A function that will reorder an array (`list`).\n * `reorder` returns a new array with reordered items and does not\n * modify the original array. The items in the array are also not modified.\n */\nexport function reorder(_ref) {\n var list = _ref.list,\n startIndex = _ref.startIndex,\n finishIndex = _ref.finishIndex;\n if (startIndex === -1 || finishIndex === -1) {\n // Making this function consistently return a new array reference.\n // This is consistent with .toSorted() which always returns a new array\n // even when it does not do anything\n return Array.from(list);\n }\n var result = Array.from(list);\n var _result$splice = result.splice(startIndex, 1),\n _result$splice2 = _slicedToArray(_result$splice, 1),\n removed = _result$splice2[0];\n result.splice(finishIndex, 0, removed);\n return result;\n}","import {reorder} from '@atlaskit/pragmatic-drag-and-drop/reorder';\n\nimport type {\n SortableDirection,\n SortableFrame,\n SortableItemGeometry,\n SortableOrientation,\n SortableResolvedPlacement,\n} from './contract';\n\ntype SortableReorderLayout = Readonly<{\n groupId: string;\n orientation: SortableOrientation;\n direction: SortableDirection;\n columns: number | null;\n groupRect: SortableFrame;\n items: readonly SortableItemGeometry[];\n}>;\n\ntype SortableReorderOffset = Readonly<{\n groupId: string;\n id: string;\n x: number;\n y: number;\n}>;\n\nconst translate = (\n groupId: string,\n item: SortableItemGeometry,\n slot: SortableFrame,\n): SortableReorderOffset => ({\n groupId,\n id: item.id,\n x: slot.left - item.rect.left,\n y: slot.top - item.rect.top,\n});\nconst moved = ({x, y}: SortableReorderOffset): boolean => x !== 0 || y !== 0;\n\nconst moveFrame = (frame: SortableFrame, x: number, y: number): SortableFrame => ({\n left: frame.left + x,\n top: frame.top + y,\n right: frame.right + x,\n bottom: frame.bottom + y,\n width: frame.width,\n height: frame.height,\n});\n\nconst nextSlot = (layout: SortableReorderLayout): SortableFrame | null => {\n const {items, orientation, direction, columns} = layout;\n const last = items.at(-1);\n if (!last) return null;\n const previous = items.at(-2);\n if (orientation === 'vertical') {\n const step = previous ? last.rect.top - previous.rect.top : last.rect.height + 8;\n return moveFrame(last.rect, 0, step);\n }\n if (orientation === 'horizontal') {\n const step = previous\n ? last.rect.left - previous.rect.left\n : (last.rect.width + 8) * (direction === 'rtl' ? -1 : 1);\n return moveFrame(last.rect, step, 0);\n }\n if (columns && items.length >= columns) {\n const previousRow = items[items.length - columns]!;\n return moveFrame(previousRow.rect, 0, last.rect.top - previousRow.rect.top || last.rect.height + 8);\n }\n const step = previous\n ? last.rect.left - previous.rect.left\n : (last.rect.width + 8) * (direction === 'rtl' ? -1 : 1);\n return moveFrame(last.rect, step, 0);\n};\n\nconst slotsWithEnd = (layout: SortableReorderLayout): readonly SortableFrame[] => {\n const end = nextSlot(layout);\n return end ? [...layout.items.map(({rect}) => rect), end] : [];\n};\n\nconst projectSortableReorderLayout = (\n layout: SortableReorderLayout,\n offsets: readonly SortableReorderOffset[],\n): SortableReorderLayout => {\n const byItem = new Map(offsets\n .filter(({groupId}) => groupId === layout.groupId)\n .map((offset) => [offset.id, offset]));\n return {\n ...layout,\n items: layout.items.map((item) => {\n const offset = byItem.get(item.id);\n return offset ? {...item, rect: moveFrame(item.rect, offset.x, offset.y)} : item;\n }),\n };\n};\n\nconst resolveSortableDropFrame = ({\n source,\n placement,\n sourceLayout,\n destinationLayout = sourceLayout,\n}: {\n source: Readonly<{id: string; groupId: string | null}>;\n placement: SortableResolvedPlacement;\n sourceLayout: SortableReorderLayout | null;\n destinationLayout?: SortableReorderLayout | null;\n}): SortableFrame | null => {\n if (!destinationLayout) return null;\n const destinationIndex = Math.max(0, Math.min(\n destinationLayout.items.length,\n placement.index,\n ));\n if (source.groupId === destinationLayout.groupId && sourceLayout) {\n return sourceLayout.items[Math.min(destinationIndex, sourceLayout.items.length - 1)]?.rect\n ?? destinationLayout.groupRect;\n }\n return slotsWithEnd(destinationLayout)[destinationIndex] ?? destinationLayout.groupRect;\n};\n\nconst resolveSortableReorderOffsets = ({\n source,\n placement,\n sourceLayout,\n destinationLayout = sourceLayout,\n}: {\n source: Readonly<{id: string; groupId: string | null}>;\n placement: SortableResolvedPlacement;\n sourceLayout: SortableReorderLayout | null;\n destinationLayout?: SortableReorderLayout | null;\n}): readonly SortableReorderOffset[] => {\n if (!destinationLayout) return [];\n const destinationIndex = Math.max(0, Math.min(\n destinationLayout.items.length,\n placement.index,\n ));\n\n if (source.groupId === destinationLayout.groupId && sourceLayout) {\n const sourceIndex = sourceLayout.items.findIndex(({id}) => id === source.id);\n if (sourceIndex < 0) return [];\n const reordered = reorder({list: [...sourceLayout.items], startIndex: sourceIndex, finishIndex: destinationIndex});\n const projectedFramesByItemId = new Map<string, SortableFrame>();\n reordered.forEach((item, index) => {\n const itemId = item.id;\n const projectedFrame = sourceLayout.items[index]?.rect;\n if (projectedFrame && !projectedFramesByItemId.has(itemId)) {\n projectedFramesByItemId.set(itemId, projectedFrame);\n }\n });\n return sourceLayout.items\n .map((item) => {\n const projectedFrame = projectedFramesByItemId.get(item.id);\n return projectedFrame ? translate(sourceLayout.groupId, item, projectedFrame) : null;\n })\n .filter((offset): offset is SortableReorderOffset => offset !== null)\n .filter(moved);\n }\n\n const destinationSlots = slotsWithEnd(destinationLayout);\n const offsets: SortableReorderOffset[] = destinationLayout.items\n .map((item, index) => translate(\n destinationLayout.groupId,\n item,\n destinationSlots[index < destinationIndex ? index : index + 1]!,\n ))\n .filter(moved);\n\n if (!sourceLayout || source.groupId === null) return offsets;\n const sourceIndex = sourceLayout.items.findIndex(({id}) => id === source.id);\n if (sourceIndex < 0) return offsets;\n const sourceItem = sourceLayout.items[sourceIndex]!;\n const sourceOffset = translate(\n sourceLayout.groupId,\n sourceItem,\n destinationSlots[destinationIndex] ?? destinationLayout.groupRect,\n );\n if (moved(sourceOffset)) offsets.push(sourceOffset);\n sourceLayout.items.slice(sourceIndex + 1).forEach((item, index) => {\n offsets.push(translate(sourceLayout.groupId, item, sourceLayout.items[sourceIndex + index]!.rect));\n });\n return offsets;\n};\n\nexport {projectSortableReorderLayout, resolveSortableDropFrame, resolveSortableReorderOffsets};\nexport type {SortableReorderLayout, SortableReorderOffset};\n","import type {SortableColor, SortableInput, SortableInteraction} from './contract';\nimport {motion} from '../../../motion';\n\ntype ManagedGhostFrame = Readonly<{x: number; y: number; width: number; height: number}>;\n\ntype SortablePreviewPositionOptions = Readonly<{\n value: string;\n input: SortableInput;\n initialInput: SortableInput;\n sourceRect: Readonly<{left: number; top: number}>;\n previewSize: Readonly<{width: number; height: number}>;\n}>;\n\nconst PIXEL_OFFSET = /^-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)(?:px)?$/;\n\nconst resolvePreviewAxis = (\n value: string,\n pointer: number,\n size: number,\n start: string,\n end: string,\n): number | null => {\n if (value === start) return pointer;\n if (value === 'center') return pointer - size / 2;\n if (value === end) return pointer - size;\n return PIXEL_OFFSET.test(value) ? pointer + Number.parseFloat(value) : null;\n};\n\nconst resolveSortablePreviewPosition = ({\n value,\n input,\n initialInput,\n sourceRect,\n previewSize,\n}: SortablePreviewPositionOptions): Readonly<{x: number; y: number}> => {\n const preserve = {\n x: input.clientX - (initialInput.clientX - sourceRect.left),\n y: input.clientY - (initialInput.clientY - sourceRect.top),\n };\n const tokens = value.trim().toLowerCase().split(/\\s+/).filter(Boolean);\n if (tokens.length === 0 || (tokens.length === 1 && tokens[0] === 'preserve')) return preserve;\n if (tokens.length !== 2) return preserve;\n const x = resolvePreviewAxis(tokens[0]!, input.clientX, previewSize.width, 'left', 'right');\n const y = resolvePreviewAxis(tokens[1]!, input.clientY, previewSize.height, 'top', 'bottom');\n return x === null || y === null ? preserve : {x, y};\n};\n\ntype SortableGhost = Readonly<{\n positioner: HTMLElement;\n visual: HTMLElement;\n frame(): ManagedGhostFrame;\n projectedFrame(input: SortableInput): ManagedGhostFrame;\n projectedSourceFrame(input: SortableInput): ManagedGhostFrame;\n move(input: SortableInput): void;\n finish(to: ManagedGhostFrame | null): Promise<void>;\n remove(): void;\n}>;\n\nconst sanitizeClone = (root: HTMLElement): void => {\n root.setAttribute('x-ignore', '');\n [root, ...root.querySelectorAll<HTMLElement>('*')].forEach((element) => {\n element.removeAttribute('id');\n element.removeAttribute('data-ui-motion-key');\n element.removeAttribute('data-ui-motion-layout');\n if (element instanceof HTMLInputElement || element instanceof HTMLButtonElement) element.disabled = true;\n if (element instanceof HTMLSelectElement || element instanceof HTMLTextAreaElement) element.disabled = true;\n });\n};\n\nconst copyControlValues = (source: HTMLElement, clone: HTMLElement): void => {\n const sourceControls = [source, ...source.querySelectorAll<HTMLElement>('input, textarea, select')];\n const cloneControls = [clone, ...clone.querySelectorAll<HTMLElement>('input, textarea, select')];\n sourceControls.forEach((control, index) => {\n const cloned = cloneControls[index];\n if (control instanceof HTMLInputElement && cloned instanceof HTMLInputElement) {\n cloned.value = control.value;\n cloned.checked = control.checked;\n } else if (control instanceof HTMLTextAreaElement && cloned instanceof HTMLTextAreaElement) {\n cloned.value = control.value;\n } else if (control instanceof HTMLSelectElement && cloned instanceof HTMLSelectElement) {\n cloned.selectedIndex = control.selectedIndex;\n }\n });\n};\n\nconst frameFromRect = (rect: DOMRect | DOMRectReadOnly): ManagedGhostFrame => ({\n x: rect.left,\n y: rect.top,\n width: rect.width,\n height: rect.height,\n});\n\nconst createSortableGhost = ({\n source,\n input,\n preview,\n previewPosition = 'preserve',\n opacity = 0.92,\n color = 'neutral',\n interaction = 'edge',\n}: {\n source: HTMLElement;\n input: SortableInput;\n preview?: HTMLTemplateElement | null;\n previewPosition?: string;\n opacity?: number;\n color?: SortableColor;\n interaction?: SortableInteraction;\n}): SortableGhost => {\n const sourceRect = source.getBoundingClientRect();\n const overlay = document.createElement('div');\n const positioner = document.createElement('div');\n const visual = document.createElement('div');\n const previewNode = preview?.content.firstElementChild?.cloneNode(true);\n const hasCustomPreview = previewNode instanceof HTMLElement;\n const content = hasCustomPreview ? previewNode : source.cloneNode(true) as HTMLElement;\n if (!hasCustomPreview) copyControlValues(source, content);\n sanitizeClone(content);\n\n overlay.setAttribute('data-ui-sortable-overlay', '');\n overlay.setAttribute('popover', 'manual');\n positioner.setAttribute('data-ui-sortable-ghost-positioner', '');\n visual.setAttribute('data-ui-sortable-ghost', '');\n visual.setAttribute('aria-hidden', 'true');\n visual.setAttribute('inert', '');\n if (!hasCustomPreview) {\n visual.setAttribute('data-ui-sortable-default-preview', '');\n visual.setAttribute('data-ui-selection-color', '');\n visual.dataset.color = color;\n visual.dataset.uiInteraction = interaction;\n visual.dataset.selected = 'true';\n visual.dataset.uiSurface = '+1';\n visual.dataset.uiElevation = '2';\n }\n const themeOwner = source.closest<HTMLElement>('[data-theme], .dark, .light');\n if (themeOwner?.classList.contains('dark')) overlay.classList.add('dark');\n if (themeOwner?.classList.contains('light')) overlay.classList.add('light');\n if (themeOwner?.dataset.theme) overlay.dataset.theme = themeOwner.dataset.theme;\n Object.assign(overlay.style, {\n position: 'fixed', inset: '0', width: '100vw', height: '100vh', maxWidth: 'none', maxHeight: 'none',\n margin: '0', padding: '0', border: '0', background: 'transparent', overflow: 'clip', contain: 'strict',\n zIndex: '2147483647', pointerEvents: 'none',\n });\n Object.assign(positioner.style, {\n position: 'absolute', left: '0', top: '0',\n width: hasCustomPreview ? 'max-content' : `${sourceRect.width}px`,\n height: hasCustomPreview ? 'max-content' : `${sourceRect.height}px`,\n pointerEvents: 'none',\n });\n Object.assign(visual.style, {\n width: hasCustomPreview ? 'max-content' : '100%',\n height: hasCustomPreview ? 'max-content' : '100%',\n opacity: `${opacity}`, pointerEvents: 'none',\n ...(hasCustomPreview ? {} : {\n overflow: 'hidden',\n borderRadius: 'var(--radius-overlay-sm)',\n }),\n });\n visual.append(content);\n positioner.append(visual);\n overlay.append(positioner);\n document.body.append(overlay);\n overlay.showPopover?.();\n\n const previewRect = positioner.getBoundingClientRect();\n const size = hasCustomPreview\n ? {width: previewRect.width, height: previewRect.height}\n : {width: sourceRect.width, height: sourceRect.height};\n const position = (nextInput: SortableInput): Readonly<{x: number; y: number}> => (\n resolveSortablePreviewPosition({\n value: previewPosition,\n input: nextInput,\n initialInput: input,\n sourceRect,\n previewSize: size,\n })\n );\n const sourcePosition = (nextInput: SortableInput): Readonly<{x: number; y: number}> => (\n resolveSortablePreviewPosition({\n value: 'preserve',\n input: nextInput,\n initialInput: input,\n sourceRect,\n previewSize: {width: sourceRect.width, height: sourceRect.height},\n })\n );\n const initialPosition = position(input);\n const movement = motion.createController({\n values: {\n x: {initial: initialPosition.x, transition: motion.roles.layout},\n y: {initial: initialPosition.y, transition: motion.roles.layout},\n },\n style: ({x, y}) => ({transform: `translate3d(${x}px, ${y}px, 0)`}),\n });\n movement.mount(positioner);\n\n return {\n positioner,\n visual,\n frame: () => ({...movement.current(), ...size}),\n projectedFrame: (nextInput) => ({...position(nextInput), ...size}),\n projectedSourceFrame: (nextInput) => ({\n ...sourcePosition(nextInput), width: sourceRect.width, height: sourceRect.height,\n }),\n move(nextInput) {\n movement.set(position(nextInput));\n },\n async finish(to) {\n if (to) await movement.animate({x: to.x, y: to.y}).finished;\n },\n remove: () => {\n movement.destroy();\n overlay.remove();\n },\n };\n};\n\nexport {createSortableGhost, frameFromRect, resolveSortablePreviewPosition, sanitizeClone};\nexport type {ManagedGhostFrame, SortableGhost, SortablePreviewPositionOptions};\n","/**\n * Delay until the text content of the live region is updated.\n *\n * This value was reached through some experimentation, and may need tweaking in the future.\n */\nexport var announceDelay = 1000;","import { announceDelay } from './constants';\nvar node = null;\nvar size = '1px';\nvar visuallyHiddenStyles = {\n // Standard visually hidden styles.\n // Copied from our VisuallyHidden (react) package.\n width: size,\n height: size,\n padding: '0',\n position: 'absolute',\n border: '0',\n clip: \"rect(\".concat(size, \", \").concat(size, \", \").concat(size, \", \").concat(size, \")\"),\n overflow: 'hidden',\n whiteSpace: 'nowrap',\n // Pulling upwards slightly to prevent the page\n // from growing when appended to a body that contains\n // an element with height:100%\n marginTop: \"-\".concat(size),\n // Just being safe and letting this element not interfere with hitboxes\n pointerEvents: 'none'\n};\n\n/**\n * Creates a live region node, appends it to the body, and returns it.\n */\nfunction createNode() {\n var node = document.createElement('div');\n /**\n * Using `role=\"status\"` instead of `role=\"alert\"` so that the message\n * can be queued and read when able.\n *\n * We found with `role=\"alert\"` the message was not reliably read when\n * focus changed.\n */\n node.setAttribute('role', 'status');\n Object.assign(node.style, visuallyHiddenStyles);\n document.body.append(node);\n return node;\n}\n\n/**\n * Returns the live region node, creating one if necessary.\n */\nfunction getNode() {\n if (node === null) {\n node = createNode();\n }\n return node;\n}\nvar timerId = null;\nfunction tryClearTimer() {\n if (timerId !== null) {\n clearTimeout(timerId);\n }\n timerId = null;\n}\n\n/**\n * Announces the provided message to assistive technology.\n */\nexport function announce(message) {\n /**\n * Calling this immediately to ensure a node exists and has time to be parsed\n * and exposed in the accessibility tree.\n */\n getNode();\n\n /**\n * Updating the message in a timeout so that it's less likely to be interrupted.\n *\n * This function is often called right before focus changes,\n * because the user has just taken an action.\n * This focus change would often cause the message to be skipped / interrupted.\n */\n tryClearTimer();\n timerId = setTimeout(function () {\n timerId = null;\n var node = getNode();\n node.textContent = message;\n }, announceDelay);\n return;\n}\n\n/**\n * Removes the created live region. If there is no live region this is a no-op.\n */\n// eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports\nexport function cleanup() {\n var _node;\n tryClearTimer();\n (_node = node) === null || _node === void 0 || _node.remove();\n node = null;\n}","import {announce} from '@atlaskit/pragmatic-drag-and-drop-live-region';\nimport {dispatch} from '../../../utils';\n\nimport type {\n SortableCanDropContext,\n SortableDropIntent,\n SortableDropDetail,\n SortableGroup,\n SortableResolvedPlacement,\n SortableSource,\n SortableInput,\n UiSortableService,\n} from './contract';\nimport {isValidGridColumns} from './contract';\n\ntype GroupRecord = Readonly<{\n element: HTMLElement;\n getGroup(): SortableGroup;\n getItemIds(): readonly string[];\n canDrop?(context: SortableCanDropContext): boolean;\n}>;\n\ntype SourceRecord = Readonly<{\n element: HTMLElement;\n getSource(): SortableSource;\n isDisabled(): boolean;\n}>;\n\ntype SortableRegistration = (() => void) & Readonly<{\n refresh(): void;\n}>;\n\ntype SortableRegistry = UiSortableService & Readonly<{\n registerGroup(record: GroupRecord): SortableRegistration;\n registerSource(record: SourceRecord): SortableRegistration;\n group(scopeId: string, groupId: string): GroupRecord | null;\n source(scopeId: string, sourceId: string): SourceRecord | null;\n canDrop(source: SortableSource, destinationGroupId: string, input?: SortableInput | null): boolean;\n isNoop(source: SortableSource, intent: SortableDropIntent): boolean;\n emitDrop(source: SortableSource, intent: SortableDropIntent, input?: SortableInput | null): boolean;\n}>;\ntype PreparedSortableDrop = Readonly<{\n placement: SortableResolvedPlacement;\n commit(): void;\n}>;\ntype SortableDropPreparer = (\n source: SortableSource,\n intent: SortableDropIntent,\n input?: SortableInput | null,\n) => PreparedSortableDrop | null;\n\nconst dropPreparers = new WeakMap<SortableRegistry, SortableDropPreparer>();\n\nconst keyFor = (scope: string, id: string): string => `${scope}\\u0000${id}`;\n\nconst frozenDropDetail = (source: SortableSource, placement: SortableResolvedPlacement): SortableDropDetail => {\n const placementDetail = {\n destination: Object.freeze({...placement.destination}),\n anchor: placement.anchor === null ? null : Object.freeze({...placement.anchor}),\n index: placement.index,\n };\n return source.operation === 'insert'\n ? Object.freeze({operation: 'insert', source: Object.freeze({...source}), ...placementDetail})\n : Object.freeze({operation: 'move', source: Object.freeze({...source}), ...placementDetail});\n};\n\nconst createSortableRegistry = (): SortableRegistry => {\n const groups = new Map<string, GroupRecord>();\n const sources = new Map<string, SourceRecord>();\n\n const register = <T extends {element: HTMLElement}>(\n records: Map<string, T>,\n initialKey: string,\n currentKey: () => string,\n value: T,\n kind: string,\n ): SortableRegistration => {\n let key = initialKey;\n let active = true;\n const initialExisting = records.get(key);\n if (initialExisting && (initialExisting.element.isConnected || !value.element.isConnected)) {\n throw new Error(`Duplicate sortable ${kind} identity: ${key.replace('\\u0000', '/')}`);\n }\n records.set(key, value);\n const unregister = (): void => {\n if (!active) return;\n active = false;\n if (records.get(key) === value) records.delete(key);\n };\n const refresh = (): void => {\n if (!active) return;\n const nextKey = currentKey();\n if (nextKey === key) return;\n const existing = records.get(nextKey);\n if (\n existing\n && existing !== value\n && (existing.element.isConnected || !value.element.isConnected)\n ) {\n throw new Error(`Duplicate sortable ${kind} identity: ${nextKey.replace('\\u0000', '/')}`);\n }\n if (records.get(key) === value) records.delete(key);\n records.set(nextKey, value);\n key = nextKey;\n };\n return Object.assign(unregister, {refresh});\n };\n\n const group = (scopeId: string, groupId: string): GroupRecord | null => (\n groups.get(keyFor(scopeId, groupId)) ?? null\n );\n const source = (scopeId: string, sourceId: string): SourceRecord | null => (\n sources.get(keyFor(scopeId, sourceId)) ?? null\n );\n\n const canDrop = (\n sortableSource: SortableSource,\n destinationGroupId: string,\n input: SortableInput | null = null,\n ): boolean => {\n const destination = group(sortableSource.scopeId, destinationGroupId);\n const sourceRecord = source(sortableSource.scopeId, sortableSource.id);\n if (!destination || !sourceRecord || sourceRecord.isDisabled()) return false;\n const destinationGroup = destination.getGroup();\n if (destinationGroup.disabled || destinationGroup.readOnly) return false;\n if (destinationGroup.orientation === 'grid' && !isValidGridColumns(destinationGroup.columns)) return false;\n if (!destinationGroup.accepts.includes(sortableSource.type)) return false;\n const itemIds = destination.getItemIds().filter((id) => (\n sortableSource.operation !== 'move'\n || sortableSource.groupId !== destinationGroupId\n || id !== sortableSource.id\n ));\n const context: SortableCanDropContext = Object.freeze({\n source: sortableSource,\n destination: destinationGroup,\n itemIds: Object.freeze(itemIds),\n input: input === null ? null : Object.freeze({...input}),\n });\n return destination.canDrop?.(context) !== false;\n };\n\n const resolveDropIntent = (sortableSource: SortableSource, intent: SortableDropIntent): {\n originalIds: readonly string[];\n placement: SortableResolvedPlacement;\n } | null => {\n const destination = group(sortableSource.scopeId, intent.destination.groupId);\n if (!destination) return null;\n const originalIds = destination.getItemIds();\n const projectedIds = sortableSource.operation === 'move' && sortableSource.groupId === intent.destination.groupId\n ? originalIds.filter((id) => id !== sortableSource.id)\n : [...originalIds];\n if (intent.anchor !== null && !projectedIds.includes(intent.anchor.id)) return null;\n const index = intent.anchor === null\n ? 0\n : projectedIds.indexOf(intent.anchor.id) + (intent.anchor.edge === 'after' ? 1 : 0);\n return {\n originalIds,\n placement: {destination: intent.destination, anchor: intent.anchor, index},\n };\n };\n\n const isResolvedNoop = (\n sortableSource: SortableSource,\n originalIds: readonly string[],\n placement: SortableResolvedPlacement,\n ): boolean => (\n sortableSource.operation === 'move'\n && sortableSource.groupId === placement.destination.groupId\n && originalIds.indexOf(sortableSource.id) === placement.index\n );\n\n const isNoop = (sortableSource: SortableSource, intent: SortableDropIntent): boolean => {\n const resolved = resolveDropIntent(sortableSource, intent);\n return resolved !== null && isResolvedNoop(sortableSource, resolved.originalIds, resolved.placement);\n };\n\n const prepareDrop: SortableDropPreparer = (\n sortableSource: SortableSource,\n intent: SortableDropIntent,\n input: SortableInput | null = null,\n ) => {\n const destination = group(sortableSource.scopeId, intent.destination.groupId);\n if (!destination || !canDrop(sortableSource, intent.destination.groupId, input)) return null;\n const destinationGroup = destination.getGroup();\n\n const resolved = resolveDropIntent(sortableSource, intent);\n if (!resolved || isResolvedNoop(sortableSource, resolved.originalIds, resolved.placement)) return null;\n\n const detail = frozenDropDetail(sortableSource, resolved.placement);\n let committed = false;\n return Object.freeze({\n placement: resolved.placement,\n commit: () => {\n if (committed) return;\n committed = true;\n dispatch({\n el: destination.element,\n name: 'ui:sortable-drop',\n composed: true,\n detail,\n });\n if (sortableSource.label && destinationGroup.label) {\n announce(`${sortableSource.label} moved to ${destinationGroup.label}.`);\n }\n },\n });\n };\n\n const emitDrop = (\n sortableSource: SortableSource,\n intent: SortableDropIntent,\n input: SortableInput | null = null,\n ): boolean => {\n const prepared = prepareDrop(sortableSource, intent, input);\n if (!prepared) return false;\n prepared.commit();\n return true;\n };\n\n const moveRelative = (edge: 'before' | 'after', options: {\n scope: string;\n sourceId: string;\n anchorId: string;\n destinationGroupId?: string;\n }): boolean => {\n const sourceRecord = source(options.scope, options.sourceId);\n if (!sourceRecord) return false;\n const sortableSource = sourceRecord.getSource();\n const destinationGroupId = options.destinationGroupId ?? sortableSource.groupId;\n if (!destinationGroupId || options.anchorId === options.sourceId) return false;\n return emitDrop(sortableSource, {\n destination: {groupId: destinationGroupId},\n anchor: {id: options.anchorId, edge},\n });\n };\n\n const moveToEdge = (edge: 'start' | 'end', options: {\n scope: string;\n sourceId: string;\n destinationGroupId: string;\n }): boolean => {\n const sourceRecord = source(options.scope, options.sourceId);\n const destination = group(options.scope, options.destinationGroupId);\n if (!sourceRecord || !destination) return false;\n const sortableSource = sourceRecord.getSource();\n const ids = destination.getItemIds().filter((id) => (\n sortableSource.groupId !== options.destinationGroupId || id !== sortableSource.id\n ));\n const anchor = ids.length === 0\n ? null\n : edge === 'start'\n ? {id: ids[0]!, edge: 'before' as const}\n : {id: ids.at(-1)!, edge: 'after' as const};\n return emitDrop(sortableSource, {destination: {groupId: options.destinationGroupId}, anchor});\n };\n\n const registry: SortableRegistry = {\n registerGroup: (record) => {\n const value = record.getGroup();\n return register(\n groups,\n keyFor(value.scopeId, value.id),\n () => {\n const current = record.getGroup();\n return keyFor(current.scopeId, current.id);\n },\n record,\n 'group',\n );\n },\n registerSource: (record) => {\n const value = record.getSource();\n return register(\n sources,\n keyFor(value.scopeId, value.id),\n () => {\n const current = record.getSource();\n return keyFor(current.scopeId, current.id);\n },\n record,\n 'source',\n );\n },\n group,\n source,\n canDrop,\n isNoop,\n emitDrop,\n moveBefore: (options) => moveRelative('before', options),\n moveAfter: (options) => moveRelative('after', options),\n moveToStart: (options) => moveToEdge('start', options),\n moveToEnd: (options) => moveToEdge('end', options),\n };\n dropPreparers.set(registry, prepareDrop);\n return registry;\n};\n\nconst prepareSortableDrop = (\n registry: SortableRegistry,\n source: SortableSource,\n intent: SortableDropIntent,\n input: SortableInput | null = null,\n): PreparedSortableDrop | null => dropPreparers.get(registry)?.(source, intent, input) ?? null;\n\nexport {createSortableRegistry, prepareSortableDrop};\nexport type {GroupRecord, SortableRegistration, SortableRegistry, SourceRecord};\n","const CURSOR_PROPERTY = '--ui-sortable-drag-cursor';\nconst DRAGGING_ATTRIBUTE = 'data-ui-sortable-dragging';\n\nconst activateSortableCursor = (cursor: string): (() => void) => {\n const root = document.documentElement;\n const previousAttribute = root.getAttribute(DRAGGING_ATTRIBUTE);\n const previousCursor = root.style.getPropertyValue(CURSOR_PROPERTY);\n root.setAttribute(DRAGGING_ATTRIBUTE, '');\n root.style.setProperty(CURSOR_PROPERTY, cursor.trim() || 'default');\n\n return () => {\n if (previousAttribute === null) root.removeAttribute(DRAGGING_ATTRIBUTE);\n else root.setAttribute(DRAGGING_ATTRIBUTE, previousAttribute);\n if (previousCursor) root.style.setProperty(CURSOR_PROPERTY, previousCursor);\n else root.style.removeProperty(CURSOR_PROPERTY);\n };\n};\n\nexport {activateSortableCursor};\n","import {createMachine, type Machine, type MachineScope} from '../../state-machine';\n\ntype SortablePointerSnapshot = Readonly<{\n destinationId: string | null;\n input: Readonly<{clientX: number; clientY: number}>;\n}>;\ntype SortableSourceMachineContext = {\n data: Record<string, unknown>;\n pointer: SortablePointerSnapshot | null;\n};\ntype SortableSourceMachineEffects<TProps> = Readonly<{\n resolvePlacement(scope: MachineScope<SortableSourceMachineContext, TProps>): void;\n synced(scope: MachineScope<SortableSourceMachineContext, TProps>): void;\n complete(scope: MachineScope<SortableSourceMachineContext, TProps>): void;\n reconcile(scope: MachineScope<SortableSourceMachineContext, TProps>): void;\n}>;\n\nconst createSortableSourceMachine = <TProps>({props, effects}: {\n props: TProps;\n effects: SortableSourceMachineEffects<TProps>;\n}): Machine<SortableSourceMachineContext, TProps> => createMachine<SortableSourceMachineContext, TProps>({\n type: 'parallel',\n on: {\n PROPS_CHANGED: {reduce: 'props', effects: 'reconcile'},\n DOM_INVALIDATED: {effects: 'reconcile'},\n POINTER_MOVED: {reduce: 'pointer', effects: 'resolvePlacement'},\n },\n states: {\n interaction: {\n initial: 'idle',\n states: {\n idle: {on: {START: {target: 'starting', reduce: 'start'}}},\n starting: {on: {\n STARTING_DONE: {target: 'dragging'},\n END: {target: 'ending', reduce: 'data'},\n }},\n dragging: {on: {END: {target: 'ending', reduce: 'data'}}},\n ending: {on: {ENDING_DONE: {target: 'idle', effects: 'complete'}}},\n },\n },\n layout: {\n initial: 'inactive',\n states: {\n inactive: {on: {START: {target: 'ready'}}},\n ready: {on: {\n LAYOUT_PROPOSED: {target: 'placing', reduce: 'data'},\n END: {target: 'inactive'},\n }},\n placing: {on: {\n LAYOUT_PROPOSED: {target: 'placing', reduce: 'data'},\n PLACING_DONE: {target: 'ready', effects: 'synced'},\n END: {target: 'inactive', effects: 'synced'},\n }},\n },\n },\n },\n}, {\n props,\n context: {data: {}, pointer: null},\n reducers: {\n start: ({event}) => ({context: {\n data: event.data as Record<string, unknown>,\n pointer: null,\n }}),\n data: ({context, event}) => ({context: {...context, data: event.data as Record<string, unknown>}}),\n pointer: ({context, event}) => ({context: {\n ...context,\n pointer: event.pointer as SortablePointerSnapshot,\n }}),\n props: ({context, event}) => ({context, props: event.props as TProps}),\n },\n effects,\n});\n\nexport {createSortableSourceMachine};\nexport type {SortablePointerSnapshot, SortableSourceMachineContext, SortableSourceMachineEffects};\n","// pulling this into a separate file so adapter(s) that don't\n// need the honey pot can pay as little as possible for it.\nexport var honeyPotDataAttribute = 'data-pdnd-honey-pot';","import { honeyPotDataAttribute } from './honey-pot-data-attribute';\nexport function isHoneyPotElement(target) {\n return target instanceof Element && target.hasAttribute(honeyPotDataAttribute);\n}","import _slicedToArray from \"@babel/runtime/helpers/slicedToArray\";\nimport { isHoneyPotElement } from './is-honey-pot-element';\nexport function getElementFromPointWithoutHoneypot(client) {\n // eslint-disable-next-line no-restricted-syntax\n var _document$elementsFro = document.elementsFromPoint(client.x, client.y),\n _document$elementsFro2 = _slicedToArray(_document$elementsFro, 2),\n top = _document$elementsFro2[0],\n second = _document$elementsFro2[1];\n if (!top) {\n return null;\n }\n if (isHoneyPotElement(top)) {\n return second !== null && second !== void 0 ? second : null;\n }\n return top;\n}","// Maximum possible z-index\n// https://stackoverflow.com/questions/491052/minimum-and-maximum-value-of-z-index\nexport var maxZIndex = 2147483647;","/**\n * Resets user agent styles for `[popover]` elements.\n *\n * Browsers apply these defaults to popovers (per the WHATWG HTML spec rendering section):\n * - `inset: 0` + `margin: auto` → centers the popover in the viewport\n * - `border: solid` → visible border\n * - `padding: 0.25em` → internal spacing\n * - `overflow: auto` → scrollbars when content overflows\n * - `color: CanvasText` + `background-color: Canvas` → system theme colors\n *\n * This object neutralizes those defaults so the popover behaves like a plain\n * positioned `<div>`, matching the sizing of the legacy (non-popover)\n * fallback container exactly.\n *\n * **Width and height (`auto`)**\n *\n * `width` and `height` override the spec user agent value of `fit-content`\n * with `auto`.\n *\n * _Why?_\n *\n * - When a `[popover]` is sized with `fit-content` and contains a flex\n * container, Safari collapses any flex item that uses `overflow: auto`\n * to `0px`.\n * - Setting the popover's `width` and `height` to `auto` skips the `fit-content`\n * pass and avoids the bug in Safari\n * - Chromium and Firefox tolerate `fit-content` here, but `auto` is safe\n * everywhere and matches our non-popover path\n */\nexport var popoverResetUserAgentStyles = {\n inset: 'unset',\n border: 'none',\n padding: 0,\n margin: 0,\n overflow: 'visible',\n color: 'inherit',\n background: 'transparent',\n width: 'auto',\n height: 'auto'\n};","/** Provide a function that you only ever want to be called a single time */\nexport function once(fn) {\n var cache = null;\n return function wrapped() {\n if (!cache) {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n var result = fn.apply(this, args);\n cache = {\n result: result\n };\n }\n return cache.result;\n };\n}","import { once } from '../public-utils/once';\n\n// Using `once` as the value won't change in a browser\n\n/**\n * Returns `true` if the browser supports the Popover API (top-layer).\n *\n * When supported, elements with `popover=\"manual\"` can be promoted to the\n * browser's top layer via `element.showPopover()`, which is more reliable\n * than `z-index` for ensuring an element renders above everything else.\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/API/Popover_API\n */\nexport var supportsPopover = once(function supportsPopover() {\n return typeof HTMLElement !== 'undefined' && typeof HTMLElement.prototype.showPopover === 'function';\n});","import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nimport { bind, bindAll } from 'bind-event-listener';\nimport { maxZIndex } from '../util/max-z-index';\nimport { popoverResetUserAgentStyles } from '../util/popover-reset-styles';\nimport { supportsPopover } from '../util/supports-popover';\nimport { honeyPotDataAttribute } from './honey-pot-data-attribute';\nvar honeyPotSize = 2;\nvar halfHoneyPotSize = honeyPotSize / 2;\n\n/**\n * `clientX` and `clientY` can be in sub pixels (eg `2.332`)\n * However, browser hitbox testing is commonly do to the closest pixel.\n *\n * → https://issues.chromium.org/issues/40940531\n *\n * To be sure that the honey pot will be over the `client` position,\n * we `.floor()` `clientX` and`clientY` and then make it `2px` in size.\n **/\nfunction floorToClosestPixel(point) {\n return {\n x: Math.floor(point.x),\n y: Math.floor(point.y)\n };\n}\n\n/**\n * We want to make sure the honey pot sits around the users position.\n * This seemed to be the most resilient while testing.\n */\nfunction pullBackByHalfHoneyPotSize(point) {\n return {\n x: point.x - halfHoneyPotSize,\n y: point.y - halfHoneyPotSize\n };\n}\n\n/**\n * Prevent the honey pot from changing the window size.\n * This is super unlikely to occur, but just being safe.\n */\nfunction preventGoingBackwardsOffScreen(point) {\n return {\n x: Math.max(point.x, 0),\n y: Math.max(point.y, 0)\n };\n}\n\n/**\n * Prevent the honey pot from changing the window size.\n * This is super unlikely to occur, but just being safe.\n */\nfunction preventGoingForwardsOffScreen(point) {\n return {\n x: Math.min(point.x, window.innerWidth - honeyPotSize),\n y: Math.min(point.y, window.innerHeight - honeyPotSize)\n };\n}\n\n/**\n * Create a `2x2` `DOMRect` around the `client` position\n */\nfunction getHoneyPotRectFor(_ref) {\n var client = _ref.client;\n var point = preventGoingForwardsOffScreen(preventGoingBackwardsOffScreen(pullBackByHalfHoneyPotSize(floorToClosestPixel(client))));\n\n // When debugging, it is helpful to\n // make this element a bit bigger\n return DOMRect.fromRect({\n x: point.x,\n y: point.y,\n width: honeyPotSize,\n height: honeyPotSize\n });\n}\nfunction getRectStyles(_ref2) {\n var clientRect = _ref2.clientRect;\n return {\n left: \"\".concat(clientRect.left, \"px\"),\n top: \"\".concat(clientRect.top, \"px\"),\n width: \"\".concat(clientRect.width, \"px\"),\n height: \"\".concat(clientRect.height, \"px\")\n };\n}\nfunction isWithin(_ref3) {\n var client = _ref3.client,\n clientRect = _ref3.clientRect;\n return (\n // is within horizontal bounds\n client.x >= clientRect.x && client.x <= clientRect.x + clientRect.width &&\n // is within vertical bounds\n client.y >= clientRect.y && client.y <= clientRect.y + clientRect.height\n );\n}\n/**\n * The honey pot fix is designed to get around a painful bug in all browsers.\n *\n * [Overview](https://www.youtube.com/watch?v=udE9qbFTeQg)\n *\n * **Background**\n *\n * When a drag starts, browsers incorrectly think that the users pointer is\n * still depressed where the drag started. Any element that goes under this position\n * will be entered into, causing `\"mouseenter\"` events and `\":hover\"` styles to be applied.\n *\n * _This is a violation of the spec_\n *\n * > \"From the moment that the user agent is to initiate the drag-and-drop operation,\n * > until the end \tof the drag-and-drop operation, device input events\n * > (e.g. mouse and keyboard events) must be suppressed.\"\n * >\n * > - https://html.spec.whatwg.org/multipage/dnd.html#drag-and-drop-processing-model\n *\n * _Some impacts_\n *\n * - `\":hover\"` styles being applied where they shouldn't (looks messy)\n * - components such as tooltips responding to `\"mouseenter\"` can show during a drag,\n * and on an element the user isn't even over\n *\n * Bug: https://issues.chromium.org/issues/41129937\n *\n * **Honey pot fix**\n *\n * 1. Create an element where the browser thinks the depressed pointer is\n * to absorb the incorrect pointer events\n * 2. Remove that element when it is no longer needed\n */\nfunction mountHoneyPot(_ref4) {\n var initial = _ref4.initial;\n var element = document.createElement('div');\n element.setAttribute(honeyPotDataAttribute, 'true');\n\n // Using popover=\"manual\" to place the element in the browser's top layer.\n // This ensures the honey pot is visually on top of everything else,\n // including elements using z-index and other stacking contexts.\n // \"manual\" means no light dismiss — we manage the lifecycle ourselves.\n // Falls back to position:fixed + maxZIndex when the popover API is not available.\n if (supportsPopover()) {\n element.setAttribute('popover', 'manual');\n }\n\n // can shift during the drag thanks to Firefox\n var clientRect = getHoneyPotRectFor({\n client: initial\n });\n Object.assign(element.style, _objectSpread(_objectSpread({\n position: 'fixed'\n }, supportsPopover() ?\n // needs to come first as it has 'inset: unset' which\n // needs to be overridden by our top / left values\n popoverResetUserAgentStyles : {\n // Fallback: using maximum possible z-index so that this element\n // will always be on top of other positioned content.\n zIndex: maxZIndex\n }), {}, {\n // Setting a background color explicitly to avoid any inherited styles.\n // Looks like this could be `opacity: 0`, but worried that _might_\n // cause the element to be ignored on some platforms.\n // When debugging, set backgroundColor to something like \"red\".\n backgroundColor: 'transparent',\n // Being explicit to avoid inheriting styles\n padding: 0,\n margin: 0,\n boxSizing: 'border-box',\n // We want this element to absorb pointer events,\n // it's kind of the whole point 😉\n pointerEvents: 'auto'\n }, getRectStyles({\n clientRect: clientRect\n })));\n document.body.appendChild(element);\n if (supportsPopover()) {\n element.showPopover();\n }\n\n /**\n * 🦊 In firefox we can get `\"pointermove\"` events after the drag\n * has started, which is a spec violation.\n * The final `\"pointermove\"` will reveal where the \"depressed\" position\n * is for our honey pot fix.\n */\n var unbindPointerMove = bind(window, {\n type: 'pointermove',\n listener: function listener(event) {\n var client = {\n x: event.clientX,\n y: event.clientY\n };\n clientRect = getHoneyPotRectFor({\n client: client\n });\n Object.assign(element.style, getRectStyles({\n clientRect: clientRect\n }));\n },\n // using capture so we are less likely to be impacted by event stopping\n options: {\n capture: true\n }\n });\n return function finish(_ref5) {\n var current = _ref5.current;\n // Don't need this any more\n unbindPointerMove();\n\n // If the user is hover the honey pot, we remove it\n // so that the user can continue to interact with the page normally.\n if (isWithin({\n client: current,\n clientRect: clientRect\n })) {\n element.remove();\n return;\n }\n function cleanup() {\n unbindPostDragEvents();\n element.remove();\n }\n var unbindPostDragEvents = bindAll(window, [{\n type: 'pointerdown',\n listener: cleanup\n }, {\n type: 'pointermove',\n listener: cleanup\n }, {\n type: 'focusin',\n listener: cleanup\n }, {\n type: 'focusout',\n listener: cleanup\n },\n // a 'pointerdown' should happen before 'dragstart', but just being super safe\n {\n type: 'dragstart',\n listener: cleanup\n },\n // if the user has dragged something out of the window\n // and then is dragging something back into the window\n // the first events we will see are \"dragenter\" (and then \"dragover\").\n // So if we see any of these we need to clear the post drag fix.\n {\n type: 'dragenter',\n listener: cleanup\n }, {\n type: 'dragover',\n listener: cleanup\n }\n\n // Not adding a \"wheel\" event listener, as \"wheel\" by itself does not\n // resolve the bug.\n ], {\n // Using `capture` so less likely to be impacted by other code stopping events\n capture: true\n });\n };\n}\nexport function makeHoneyPotFix() {\n var latestPointerMove = null;\n function bindEvents() {\n // For sanity, only collecting this value from when events are first bound.\n // This prevents the case where a super old \"pointermove\" could be used\n // from a prior interaction.\n latestPointerMove = null;\n return bind(window, {\n type: 'pointermove',\n listener: function listener(event) {\n latestPointerMove = {\n x: event.clientX,\n y: event.clientY\n };\n },\n // listening for pointer move in capture phase\n // so we are less likely to be impacted by events being stopped.\n options: {\n capture: true\n }\n });\n }\n function getOnPostDispatch() {\n var finish = null;\n return function onPostEvent(_ref6) {\n var eventName = _ref6.eventName,\n payload = _ref6.payload;\n // We are adding the honey pot `onDragStart` so we don't\n // impact the creation of the native drag preview.\n if (eventName === 'onDragStart') {\n var input = payload.location.initial.input;\n\n // Sometimes there will be no latest \"pointermove\" (eg iOS).\n // In which case, we use the start position of the drag.\n var initial = latestPointerMove !== null && latestPointerMove !== void 0 ? latestPointerMove : {\n x: input.clientX,\n y: input.clientY\n };\n\n // Don't need to defensively call `finish()` as `onDrop` from\n // one interaction is guaranteed to be called before `onDragStart`\n // of the next.\n finish = mountHoneyPot({\n initial: initial\n });\n }\n if (eventName === 'onDrop') {\n var _finish;\n var _input = payload.location.current.input;\n (_finish = finish) === null || _finish === void 0 || _finish({\n current: {\n x: _input.clientX,\n y: _input.clientY\n }\n });\n finish = null;\n // this interaction is finished, we want to use\n // the latest \"pointermove\" for each interaction\n latestPointerMove = null;\n }\n };\n }\n return {\n bindEvents: bindEvents,\n getOnPostDispatch: getOnPostDispatch\n };\n}","import { once } from '../public-utils/once';\n\n// using `cache` as our `isFirefox()` result will not change in a browser\n\n/**\n * Returns `true` if a `Firefox` browser\n * */\nexport var isFirefox = once(function isFirefox() {\n if (process.env.NODE_ENV === 'test') {\n return false;\n }\n return navigator.userAgent.includes('Firefox');\n});","import { once } from '../public-utils/once';\n\n// using `cache` as our `isSafari()` result will not change in a browser\n\n/**\n * Returns `true` if a `Safari` browser.\n * Returns `true` if the browser is running on iOS (they are all Safari).\n *\n * Use `isSafariOnIOS` if you want to check if something is Safari + iOS\n * */\nexport var isSafari = once(function isSafari() {\n if (process.env.NODE_ENV === 'test') {\n return false;\n }\n var _navigator = navigator,\n userAgent = _navigator.userAgent;\n return userAgent.includes('AppleWebKit') && !userAgent.includes('Chrome');\n});","/**\n * Does the `EventTarget` look like a `Node` based on \"duck typing\".\n *\n * Helpful when the `Node` might be outside of the current document\n * so we cannot to an `target instanceof Node` check.\n */\nfunction isNodeLike(target) {\n return 'nodeName' in target;\n}\n\n/**\n * Is an `EventTarget` a `Node` from another `window`?\n */\nexport function isFromAnotherWindow(eventTarget) {\n return isNodeLike(eventTarget) && eventTarget.ownerDocument !== document;\n}","import { bindAll } from 'bind-event-listener';\nimport { isSafari } from '../is-safari';\n\n/* For \"dragenter\" events, the browser should set `relatedTarget` to the previous element.\n * For external drag operations, our first \"dragenter\" event should have a `event.relatedTarget` of `null`.\n *\n * Unfortunately in Safari `event.relatedTarget` is *always* set to `null`\n * Safari bug: https://bugs.webkit.org/show_bug.cgi?id=242627\n * To work around this we count \"dragenter\" and \"dragleave\" events */\n// Using symbols for event properties so we don't clash with\n// anything on the `event` object\nexport var symbols = {\n isLeavingWindow: Symbol('leaving'),\n isEnteringWindow: Symbol('entering')\n};\n(function fixSafari() {\n // Don't do anything when server side rendering\n if (typeof window === 'undefined') {\n return;\n }\n\n // rather than checking the userAgent for \"jsdom\" we can do this check\n // so that the check will be removed completely in production code\n if (process.env.NODE_ENV === 'test') {\n return;\n }\n if (!isSafari()) {\n return;\n }\n function getInitialState() {\n return {\n enterCount: 0,\n isOverWindow: false\n };\n }\n var state = getInitialState();\n function resetState() {\n state = getInitialState();\n }\n\n // These event listeners are bound _forever_ and _never_ removed\n // We don't bother cleaning up these event listeners (for now)\n // as this workaround is only for Safari\n\n // This is how the event count works:\n //\n // lift (+1 enterCount)\n // - dragstart(draggable) [enterCount: 0]\n // - dragenter(draggable) [enterCount: 1]\n // leaving draggable (+0 enterCount)\n // - dragenter(document.body) [enterCount: 2]\n // - dragleave(draggable) [enterCount: 1]\n // leaving window (-1 enterCount)\n // - dragleave(document.body) [enterCount: 0] {leaving the window}\n\n // Things to note:\n // - dragenter and dragleave bubble\n // - the first dragenter when entering a window might not be on `window`\n // - it could be on an element that is pressed up against the window\n // - (so we cannot rely on `event.target` values)\n\n bindAll(window, [{\n type: 'dragstart',\n listener: function listener() {\n state.enterCount = 0;\n // drag start occurs in the source window\n state.isOverWindow = true;\n // When a drag first starts it will also trigger a \"dragenter\" on the draggable element\n }\n }, {\n type: 'drop',\n listener: resetState\n }, {\n type: 'dragend',\n listener: resetState\n }, {\n type: 'dragenter',\n listener: function listener(event) {\n if (!state.isOverWindow && state.enterCount === 0) {\n // Patching the `event` object\n // The `event` object is shared with all event listeners for the event\n event[symbols.isEnteringWindow] = true;\n }\n state.isOverWindow = true;\n state.enterCount++;\n }\n }, {\n type: 'dragleave',\n listener: function listener(event) {\n state.enterCount--;\n if (state.isOverWindow && state.enterCount === 0) {\n // Patching the `event` object as it is shared with all event listeners\n // The `event` object is shared with all event listeners for the event\n event[symbols.isLeavingWindow] = true;\n state.isOverWindow = false;\n }\n }\n }],\n // using `capture: true` so that adding event listeners\n // in bubble phase will have the correct symbols\n {\n capture: true\n });\n})();","import { isSafari } from '../is-safari';\nimport { symbols } from './count-events-for-safari';\n\n// eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports\nexport function isLeavingWindowInSafari(_ref) {\n var dragLeave = _ref.dragLeave;\n if (!isSafari()) {\n return false;\n }\n return dragLeave.hasOwnProperty(symbols.isLeavingWindow);\n}","import { isFirefox } from '../is-firefox';\nimport { isSafari } from '../is-safari';\nimport { isFromAnotherWindow } from './is-from-another-window';\nimport { isLeavingWindowInSafari } from './is-leaving-window-in-safari';\nexport function isLeavingWindow(_ref) {\n var dragLeave = _ref.dragLeave;\n var type = dragLeave.type,\n relatedTarget = dragLeave.relatedTarget;\n if (type !== 'dragleave') {\n return false;\n }\n if (isSafari()) {\n return isLeavingWindowInSafari({\n dragLeave: dragLeave\n });\n }\n\n // Standard check: if going to `null` we are leaving the `window`\n if (relatedTarget == null) {\n return true;\n }\n\n /**\n * 🦊 Exception: `iframe` in Firefox (`125.0`)\n *\n * Case 1: parent `window` → child `iframe`\n * `dragLeave.relatedTarget` is element _inside_ the child `iframe`\n * (foreign element)\n *\n * Case 2: child `iframe` → parent `window`\n * `dragLeave.relatedTarget` is the `iframe` in the parent `window`\n * (foreign element)\n */\n\n if (isFirefox()) {\n return isFromAnotherWindow(relatedTarget);\n }\n\n /**\n * 🌏 Exception: `iframe` in Chrome (`124.0`)\n *\n * Case 1: parent `window` → child `iframe`\n * `dragLeave.relatedTarget` is the `iframe` in the parent `window`\n *\n * Case 2: child `iframe` → parent `window`\n * `dragLeave.relatedTarget` is `null` *(standard check)*\n */\n\n // Case 2\n // Using `instanceof` check as the element will be in the same `window`\n return relatedTarget instanceof HTMLIFrameElement;\n}","export function getBindingsForBrokenDrags(_ref) {\n var onDragEnd = _ref.onDragEnd;\n return [\n // ## Detecting drag ending for removed draggables\n //\n // If a draggable element is removed during a drag and the user drops:\n // 1. if over a valid drop target: we get a \"drop\" event to know the drag is finished\n // 2. if not over a valid drop target (or cancelled): we get nothing\n // The \"dragend\" event will not fire on the source draggable if it has been\n // removed from the DOM.\n // So we need to figure out if a drag operation has finished by looking at other events\n // We can do this by looking at other events\n\n // ### First detection: \"pointermove\" events\n\n // 1. \"pointermove\" events cannot fire during a drag and drop operation\n // according to the spec. So if we get a \"pointermove\" it means that\n // the drag and drop operations has finished. So if we get a \"pointermove\"\n // we know that the drag is over\n // 2. 🦊😤 Drag and drop operations are _supposed_ to suppress\n // other pointer events. However, firefox will allow a few\n // pointer event to get through after a drag starts.\n // The most I've seen is 3\n {\n type: 'pointermove',\n listener: function () {\n var callCount = 0;\n return function listener() {\n // Using 20 as it is far bigger than the most observed (3)\n if (callCount < 20) {\n callCount++;\n return;\n }\n onDragEnd();\n };\n }()\n },\n // ### Second detection: \"pointerdown\" events\n\n // If we receive this event then we know that a drag operation has finished\n // and potentially another one is about to start.\n // Note: `pointerdown` fires on all browsers / platforms before \"dragstart\"\n {\n type: 'pointerdown',\n listener: onDragEnd\n }];\n}","export function getInput(event) {\n return {\n altKey: event.altKey,\n button: event.button,\n buttons: event.buttons,\n ctrlKey: event.ctrlKey,\n metaKey: event.metaKey,\n shiftKey: event.shiftKey,\n clientX: event.clientX,\n clientY: event.clientY,\n pageX: event.pageX,\n pageY: event.pageY\n };\n}","import rafSchd from 'raf-schd';\nvar scheduleOnDrag = rafSchd(function (fn) {\n return fn();\n});\nvar dragStart = function () {\n var scheduled = null;\n function schedule(fn) {\n var frameId = requestAnimationFrame(function () {\n scheduled = null;\n fn();\n });\n scheduled = {\n frameId: frameId,\n fn: fn\n };\n }\n function flush() {\n if (scheduled) {\n cancelAnimationFrame(scheduled.frameId);\n scheduled.fn();\n scheduled = null;\n }\n }\n return {\n schedule: schedule,\n flush: flush\n };\n}();\nexport function makeDispatch(_ref) {\n var source = _ref.source,\n initial = _ref.initial,\n dispatchEvent = _ref.dispatchEvent;\n var previous = {\n dropTargets: []\n };\n function safeDispatch(args) {\n dispatchEvent(args);\n previous = {\n dropTargets: args.payload.location.current.dropTargets\n };\n }\n var dispatch = {\n start: function start(_ref2) {\n var nativeSetDragImage = _ref2.nativeSetDragImage;\n // Ensuring that both `onGenerateDragPreview` and `onDragStart` get the same location.\n // We do this so that `previous` is`[]` in `onDragStart` (which is logical)\n var location = {\n current: initial,\n previous: previous,\n initial: initial\n };\n // a `onGenerateDragPreview` does _not_ add another entry for `previous`\n // onDragPreview\n safeDispatch({\n eventName: 'onGenerateDragPreview',\n payload: {\n source: source,\n location: location,\n nativeSetDragImage: nativeSetDragImage\n }\n });\n dragStart.schedule(function () {\n safeDispatch({\n eventName: 'onDragStart',\n payload: {\n source: source,\n location: location\n }\n });\n });\n },\n dragUpdate: function dragUpdate(_ref3) {\n var current = _ref3.current;\n dragStart.flush();\n scheduleOnDrag.cancel();\n safeDispatch({\n eventName: 'onDropTargetChange',\n payload: {\n source: source,\n location: {\n initial: initial,\n previous: previous,\n current: current\n }\n }\n });\n },\n drag: function drag(_ref4) {\n var current = _ref4.current;\n scheduleOnDrag(function () {\n dragStart.flush();\n var location = {\n initial: initial,\n previous: previous,\n current: current\n };\n safeDispatch({\n eventName: 'onDrag',\n payload: {\n source: source,\n location: location\n }\n });\n });\n },\n drop: function drop(_ref5) {\n var current = _ref5.current,\n updatedSourcePayload = _ref5.updatedSourcePayload;\n dragStart.flush();\n scheduleOnDrag.cancel();\n safeDispatch({\n eventName: 'onDrop',\n payload: {\n source: updatedSourcePayload !== null && updatedSourcePayload !== void 0 ? updatedSourcePayload : source,\n location: {\n current: current,\n previous: previous,\n initial: initial\n }\n }\n });\n }\n };\n return dispatch;\n}","import _toConsumableArray from \"@babel/runtime/helpers/toConsumableArray\";\nimport { bindAll } from 'bind-event-listener';\nimport { getElementFromPointWithoutHoneypot } from '../honey-pot-fix/get-element-from-point-without-honey-pot';\nimport { isHoneyPotElement } from '../honey-pot-fix/is-honey-pot-element';\nimport { isLeavingWindow } from '../util/changing-window/is-leaving-window';\nimport { getBindingsForBrokenDrags } from '../util/detect-broken-drag';\nimport { getInput } from '../util/get-input';\nimport { makeDispatch } from './dispatch-consumer-event';\nvar globalState = {\n isActive: false\n};\nfunction canStart() {\n return !globalState.isActive;\n}\nfunction getNativeSetDragImage(event) {\n if (event.dataTransfer) {\n // need to use `.bind` as `setDragImage` is required\n // to be run with `event.dataTransfer` as the \"this\" context\n return event.dataTransfer.setDragImage.bind(event.dataTransfer);\n }\n return null;\n}\nfunction hasHierarchyChanged(_ref) {\n var current = _ref.current,\n next = _ref.next;\n if (current.length !== next.length) {\n return true;\n }\n // not checking stickiness, data or dropEffect,\n // just whether the hierarchy has changed\n for (var i = 0; i < current.length; i++) {\n if (current[i].element !== next[i].element) {\n return true;\n }\n }\n return false;\n}\nfunction start(_ref2) {\n var event = _ref2.event,\n dragType = _ref2.dragType,\n getDropTargetsOver = _ref2.getDropTargetsOver,\n dispatchEvent = _ref2.dispatchEvent;\n if (!canStart()) {\n return;\n }\n var initial = getStartLocation({\n event: event,\n dragType: dragType,\n getDropTargetsOver: getDropTargetsOver\n });\n globalState.isActive = true;\n var state = {\n current: initial\n };\n\n // Setting initial drop effect for the drag\n setDropEffectOnEvent({\n event: event,\n current: initial.dropTargets\n });\n var dispatch = makeDispatch({\n source: dragType.payload,\n dispatchEvent: dispatchEvent,\n initial: initial\n });\n function updateState(next) {\n // only looking at whether hierarchy has changed to determine whether something as 'changed'\n var hasChanged = hasHierarchyChanged({\n current: state.current.dropTargets,\n next: next.dropTargets\n });\n\n // Always updating the state to include latest data, dropEffect and stickiness\n // Only updating consumers if the hierarchy has changed in some way\n // Consumers can get the latest data by using `onDrag`\n state.current = next;\n if (hasChanged) {\n dispatch.dragUpdate({\n current: state.current\n });\n }\n }\n function onUpdateEvent(event) {\n var input = getInput(event);\n\n // If we are over the honey pot, we need to get the element\n // that the user would have been over if not for the honey pot\n var target = isHoneyPotElement(event.target) ? getElementFromPointWithoutHoneypot({\n x: input.clientX,\n y: input.clientY\n }) : event.target;\n var nextDropTargets = getDropTargetsOver({\n target: target,\n input: input,\n source: dragType.payload,\n current: state.current.dropTargets\n });\n if (nextDropTargets.length) {\n // 🩸 must call `event.preventDefault()` to allow a browser drop to occur\n event.preventDefault();\n setDropEffectOnEvent({\n event: event,\n current: nextDropTargets\n });\n }\n updateState({\n dropTargets: nextDropTargets,\n input: input\n });\n }\n function cancel() {\n // The spec behaviour is that when a drag is cancelled, or when dropping on no drop targets,\n // a \"dragleave\" event is fired on the active drop target before a \"dragend\" event.\n // We are replicating that behaviour in `cancel` if there are any active drop targets to\n // ensure consistent behaviour.\n //\n // Note: When cancelling, or dropping on no drop targets, a \"dragleave\" event\n // will have already cleared the dropTargets to `[]` (as that particular \"dragleave\" has a `relatedTarget` of `null`)\n\n if (state.current.dropTargets.length) {\n updateState({\n dropTargets: [],\n input: state.current.input\n });\n }\n dispatch.drop({\n current: state.current,\n updatedSourcePayload: null\n });\n finish();\n }\n function finish() {\n globalState.isActive = false;\n unbindEvents();\n }\n var unbindEvents = bindAll(window, [{\n // 👋 Note: we are repurposing the `dragover` event as our `drag` event\n // this is because firefox does not publish pointer coordinates during\n // a `drag` event, but does for every other type of drag event\n // `dragover` fires on all elements that are being dragged over\n // Because we are binding to `window` - our `dragover` is effectively the same as a `drag`\n // 🦊😤\n type: 'dragover',\n listener: function listener(event) {\n // We need to regularly calculate the drop targets in order to allow:\n // - dynamic `canDrop()` checks\n // - rapid updating `getData()` calls to attach data in response to user input (eg for edge detection)\n // Sadly we cannot schedule inspecting changes resulting from this event\n // we need to be able to conditionally cancel the event with `event.preventDefault()`\n // to enable the correct native drop experience.\n\n // 1. check to see if anything has changed\n onUpdateEvent(event);\n\n // 2. let consumers know a move has occurred\n // This will include the latest 'input' values\n dispatch.drag({\n current: state.current\n });\n }\n }, {\n type: 'dragenter',\n listener: onUpdateEvent\n }, {\n type: 'dragleave',\n listener: function listener(event) {\n if (!isLeavingWindow({\n dragLeave: event\n })) {\n return;\n }\n\n /**\n * At this point we don't know if a drag is being cancelled,\n * or if a drag is leaving the `window`.\n *\n * Both have:\n * 1. \"dragleave\" (with `relatedTarget: null`)\n * 2. \"dragend\" (a \"dragend\" can occur when outside the `window`)\n *\n * **Clearing drop targets**\n *\n * For either case we are clearing the the drop targets\n *\n * - cancelling: we clear drop targets in `\"dragend\"` anyway\n * - leaving the `window`: we clear the drop targets (to clear stickiness)\n *\n * **Leaving the window and finishing the drag**\n *\n * _internal drags_\n *\n * - The drag continues when the user is outside the `window`\n * and can resume if the user drags back over the `window`,\n * or end when the user drops in an external `window`.\n * - We will get a `\"dragend\"`, or we can listen for other\n * events to determine the drag is finished when the user re-enters the `window`).\n *\n * _external drags_\n *\n * - We conclude the drag operation.\n * - We have no idea if the user will drag back over the `window`,\n * or if the drag ends elsewhere.\n * - We will create a new drag if the user re-enters the `window`.\n *\n * **Not updating `input`**\n *\n * 🐛 Bug[Chrome] the final `\"dragleave\"` has default input values (eg `clientX == 0`)\n * Workaround: intentionally not updating `input` in \"dragleave\"\n * rather than the users current input values\n * - [Conversation](https://twitter.com/alexandereardon/status/1642697633864241152)\n * - [Bug](https://bugs.chromium.org/p/chromium/issues/detail?id=1429937)\n **/\n\n updateState({\n input: state.current.input,\n dropTargets: []\n });\n if (dragType.startedFrom === 'external') {\n cancel();\n }\n }\n }, {\n // A \"drop\" can only happen if the browser allowed the drop\n type: 'drop',\n listener: function listener(event) {\n // Capture the final input.\n // We are capturing the final `input` for the\n // most accurate honey pot experience\n state.current = {\n dropTargets: state.current.dropTargets,\n input: getInput(event)\n };\n\n /** If there are no drop targets, then we will get\n * a \"drop\" event if:\n * - `preventUnhandled()` is being used\n * - there is an unmanaged drop target (eg another library)\n * In these cases, it's up to the consumer\n * to handle the drop if it's not over one of our drop targets\n * - `preventUnhandled()` will cancel the \"drop\"\n * - unmanaged drop targets can handle the \"drop\" how they want to\n * We won't call `event.preventDefault()` in this call path */\n\n if (!state.current.dropTargets.length) {\n cancel();\n return;\n }\n event.preventDefault();\n\n // applying the latest drop effect to the event\n setDropEffectOnEvent({\n event: event,\n current: state.current.dropTargets\n });\n dispatch.drop({\n current: state.current,\n // When dropping something native, we need to extract the latest\n // `.items` from the \"drop\" event as it is now accessible\n updatedSourcePayload: dragType.type === 'external' ? dragType.getDropPayload(event) : null\n });\n finish();\n }\n }, {\n // \"dragend\" fires when on the drag source (eg a draggable element)\n // when the drag is finished.\n // \"dragend\" will fire after \"drop\" (if there was a successful drop)\n // \"dragend\" does not fire if the draggable source has been removed during the drag\n // or for external drag sources (eg files)\n\n // This \"dragend\" listener will not fire if there was a successful drop\n // as we will have already removed the event listener\n\n type: 'dragend',\n listener: function listener(event) {\n // In firefox, the position of the \"dragend\" event can\n // be a bit different to the last \"dragover\" event.\n // Updating the input so we can get the best possible\n // information for the honey pot.\n state.current = {\n dropTargets: state.current.dropTargets,\n input: getInput(event)\n };\n cancel();\n }\n }].concat(_toConsumableArray(getBindingsForBrokenDrags({\n onDragEnd: cancel\n }))),\n // Once we have started a managed drag operation it is important that we see / own all drag events\n // We got one adoption bug pop up where some code was stopping (`event.stopPropagation()`)\n // all \"drop\" events in the bubble phase on the `document.body`.\n // This meant that we never saw the \"drop\" event.\n {\n capture: true\n });\n dispatch.start({\n nativeSetDragImage: getNativeSetDragImage(event)\n });\n}\nfunction setDropEffectOnEvent(_ref3) {\n var _current$;\n var event = _ref3.event,\n current = _ref3.current;\n // setting the `dropEffect` to be the innerMost drop targets dropEffect\n var innerMost = (_current$ = current[0]) === null || _current$ === void 0 ? void 0 : _current$.dropEffect;\n if (innerMost != null && event.dataTransfer) {\n event.dataTransfer.dropEffect = innerMost;\n }\n}\nfunction getStartLocation(_ref4) {\n var event = _ref4.event,\n dragType = _ref4.dragType,\n getDropTargetsOver = _ref4.getDropTargetsOver;\n var input = getInput(event);\n\n // When dragging from outside of the browser,\n // the drag is not being sourced from any local drop targets\n if (dragType.startedFrom === 'external') {\n return {\n input: input,\n dropTargets: []\n };\n }\n var dropTargets = getDropTargetsOver({\n input: input,\n source: dragType.payload,\n target: event.target,\n current: []\n });\n return {\n input: input,\n dropTargets: dropTargets\n };\n}\nexport var lifecycle = {\n canStart: canStart,\n start: start\n};","// Extending `Map` to allow us to link Key and Values together\n\nvar ledger = new Map();\nfunction registerUsage(_ref) {\n var typeKey = _ref.typeKey,\n mount = _ref.mount;\n var entry = ledger.get(typeKey);\n if (entry) {\n entry.usageCount++;\n return entry;\n }\n var initial = {\n typeKey: typeKey,\n unmount: mount(),\n usageCount: 1\n };\n ledger.set(typeKey, initial);\n return initial;\n}\nexport function register(args) {\n var entry = registerUsage(args);\n return function unregister() {\n entry.usageCount--;\n if (entry.usageCount > 0) {\n return;\n }\n // Only a single usage left, remove it\n entry.unmount();\n ledger.delete(args.typeKey);\n };\n}","/** Create a new combined function that will call all the provided functions */\nexport function combine() {\n for (var _len = arguments.length, fns = new Array(_len), _key = 0; _key < _len; _key++) {\n fns[_key] = arguments[_key];\n }\n return function cleanup() {\n fns.forEach(function (fn) {\n return fn();\n });\n };\n}","export function addAttribute(element, _ref) {\n var attribute = _ref.attribute,\n value = _ref.value;\n element.setAttribute(attribute, value);\n return function () {\n return element.removeAttribute(attribute);\n };\n}","import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport _toConsumableArray from \"@babel/runtime/helpers/toConsumableArray\";\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _createForOfIteratorHelper(r, e) { var t = \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && \"number\" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nimport { combine } from '../public-utils/combine';\nimport { once } from '../public-utils/once';\nimport { addAttribute } from '../util/add-attribute';\nfunction copyReverse(array) {\n return array.slice(0).reverse();\n}\nexport function makeDropTarget(_ref) {\n var typeKey = _ref.typeKey,\n defaultDropEffect = _ref.defaultDropEffect;\n var registry = new WeakMap();\n var dropTargetDataAtt = \"data-drop-target-for-\".concat(typeKey);\n var dropTargetSelector = \"[\".concat(dropTargetDataAtt, \"]\");\n function addToRegistry(args) {\n registry.set(args.element, args);\n return function () {\n return registry.delete(args.element);\n };\n }\n function dropTargetForConsumers(args) {\n // Guardrail: warn if the draggable element is already registered\n if (process.env.NODE_ENV !== 'production') {\n var existing = registry.get(args.element);\n if (existing) {\n // eslint-disable-next-line no-console\n console.warn(\"You have already registered a [\".concat(typeKey, \"] dropTarget on the same element\"), {\n existing: existing,\n proposed: args\n });\n }\n if (args.element instanceof HTMLIFrameElement) {\n // eslint-disable-next-line no-console\n console.warn(\"\\n We recommend not registering <iframe> elements as drop targets\\n as it can result in some strange browser event ordering.\\n \" // Removing newlines and excessive whitespace\n .replace(/\\s{2,}/g, ' ').trim());\n }\n }\n var cleanup = combine(addAttribute(args.element, {\n attribute: dropTargetDataAtt,\n value: 'true'\n }), addToRegistry(args));\n\n // Wrapping in `once` to prevent unexpected side effects if consumers call\n // the clean up function multiple times.\n return once(cleanup);\n }\n function getActualDropTargets(_ref2) {\n var _args$getData, _args$getData2, _args$getDropEffect, _args$getDropEffect2;\n var source = _ref2.source,\n target = _ref2.target,\n input = _ref2.input,\n _ref2$result = _ref2.result,\n result = _ref2$result === void 0 ? [] : _ref2$result;\n if (target == null) {\n return result;\n }\n if (!(target instanceof Element)) {\n // For \"text-selection\" drags, the original `target`\n // is not an `Element`, so we need to start looking from\n // the parent element\n if (target instanceof Node) {\n return getActualDropTargets({\n source: source,\n target: target.parentElement,\n input: input,\n result: result\n });\n }\n\n // not sure what we are working with,\n // so we can exit.\n return result;\n }\n var closest = target.closest(dropTargetSelector);\n\n // Cannot find anything else\n if (closest == null) {\n return result;\n }\n var args = registry.get(closest);\n\n // error: something had a dropTargetSelector but we could not\n // find a match. For now, failing silently\n if (args == null) {\n return result;\n }\n var feedback = {\n input: input,\n source: source,\n element: args.element\n };\n\n // if dropping is not allowed, skip this drop target\n // and continue looking up the DOM tree\n if (args.canDrop && !args.canDrop(feedback)) {\n return getActualDropTargets({\n source: source,\n target: args.element.parentElement,\n input: input,\n result: result\n });\n }\n\n // calculate our new record\n var data = (_args$getData = (_args$getData2 = args.getData) === null || _args$getData2 === void 0 ? void 0 : _args$getData2.call(args, feedback)) !== null && _args$getData !== void 0 ? _args$getData : {};\n var dropEffect = (_args$getDropEffect = (_args$getDropEffect2 = args.getDropEffect) === null || _args$getDropEffect2 === void 0 ? void 0 : _args$getDropEffect2.call(args, feedback)) !== null && _args$getDropEffect !== void 0 ? _args$getDropEffect : defaultDropEffect;\n var record = {\n data: data,\n element: args.element,\n dropEffect: dropEffect,\n // we are collecting _actual_ drop targets, so these are\n // being applied _not_ due to stickiness\n isActiveDueToStickiness: false\n };\n return getActualDropTargets({\n source: source,\n target: args.element.parentElement,\n input: input,\n // Using bubble ordering. Same ordering as `event.getPath()`\n result: [].concat(_toConsumableArray(result), [record])\n });\n }\n function notifyCurrent(_ref3) {\n var eventName = _ref3.eventName,\n payload = _ref3.payload;\n var _iterator = _createForOfIteratorHelper(payload.location.current.dropTargets),\n _step;\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var _entry$eventName;\n var record = _step.value;\n var entry = registry.get(record.element);\n var args = _objectSpread(_objectSpread({}, payload), {}, {\n self: record\n });\n entry === null || entry === void 0 || (_entry$eventName = entry[eventName]) === null || _entry$eventName === void 0 || _entry$eventName.call(entry,\n // I cannot seem to get the types right here.\n // TS doesn't seem to like that one event can need `nativeSetDragImage`\n // @ts-expect-error\n args);\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n }\n var actions = {\n onGenerateDragPreview: notifyCurrent,\n onDrag: notifyCurrent,\n onDragStart: notifyCurrent,\n onDrop: notifyCurrent,\n onDropTargetChange: function onDropTargetChange(_ref4) {\n var payload = _ref4.payload;\n var isCurrent = new Set(payload.location.current.dropTargets.map(function (record) {\n return record.element;\n }));\n var visited = new Set();\n var _iterator2 = _createForOfIteratorHelper(payload.location.previous.dropTargets),\n _step2;\n try {\n for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {\n var _entry$onDropTargetCh;\n var record = _step2.value;\n visited.add(record.element);\n var entry = registry.get(record.element);\n var isOver = isCurrent.has(record.element);\n var args = _objectSpread(_objectSpread({}, payload), {}, {\n self: record\n });\n entry === null || entry === void 0 || (_entry$onDropTargetCh = entry.onDropTargetChange) === null || _entry$onDropTargetCh === void 0 || _entry$onDropTargetCh.call(entry, args);\n\n // if we cannot find the drop target in the current array, then it has been left\n if (!isOver) {\n var _entry$onDragLeave;\n entry === null || entry === void 0 || (_entry$onDragLeave = entry.onDragLeave) === null || _entry$onDragLeave === void 0 || _entry$onDragLeave.call(entry, args);\n }\n }\n } catch (err) {\n _iterator2.e(err);\n } finally {\n _iterator2.f();\n }\n var _iterator3 = _createForOfIteratorHelper(payload.location.current.dropTargets),\n _step3;\n try {\n for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {\n var _entry$onDropTargetCh2, _entry$onDragEnter;\n var _record = _step3.value;\n // already published an update to this drop target\n if (visited.has(_record.element)) {\n continue;\n }\n // at this point we have a new drop target that is being entered into\n var _args = _objectSpread(_objectSpread({}, payload), {}, {\n self: _record\n });\n var _entry = registry.get(_record.element);\n _entry === null || _entry === void 0 || (_entry$onDropTargetCh2 = _entry.onDropTargetChange) === null || _entry$onDropTargetCh2 === void 0 || _entry$onDropTargetCh2.call(_entry, _args);\n _entry === null || _entry === void 0 || (_entry$onDragEnter = _entry.onDragEnter) === null || _entry$onDragEnter === void 0 || _entry$onDragEnter.call(_entry, _args);\n }\n } catch (err) {\n _iterator3.e(err);\n } finally {\n _iterator3.f();\n }\n }\n };\n function dispatchEvent(args) {\n actions[args.eventName](args);\n }\n function getIsOver(_ref5) {\n var source = _ref5.source,\n target = _ref5.target,\n input = _ref5.input,\n current = _ref5.current;\n var actual = getActualDropTargets({\n source: source,\n target: target,\n input: input\n });\n\n // stickiness is only relevant when we have less\n // drop targets than we did before\n if (actual.length >= current.length) {\n return actual;\n }\n\n // less 'actual' drop targets than before,\n // we need to see if 'stickiness' applies\n\n // An old drop target will continue to be dropped on if:\n // 1. it has the same parent\n // 2. nothing exists in it's previous index\n\n var lastCaptureOrdered = copyReverse(current);\n var actualCaptureOrdered = copyReverse(actual);\n var resultCaptureOrdered = [];\n for (var index = 0; index < lastCaptureOrdered.length; index++) {\n var _argsForLast$getIsSti;\n var last = lastCaptureOrdered[index];\n var fresh = actualCaptureOrdered[index];\n\n // if a record is in the new index -> use that\n // it will have the latest data + dropEffect\n if (fresh != null) {\n resultCaptureOrdered.push(fresh);\n continue;\n }\n\n // At this point we have no drop target in the old spot\n // Check to see if we can use a previous sticky drop target\n\n // The \"parent\" is the one inside of `resultCaptureOrdered`\n // (the parent might be a drop target that was sticky)\n var parent = resultCaptureOrdered[index - 1];\n var lastParent = lastCaptureOrdered[index - 1];\n\n // Stickiness is based on parent relationships, so if the parent relationship has change\n // then we can stop our search\n if ((parent === null || parent === void 0 ? void 0 : parent.element) !== (lastParent === null || lastParent === void 0 ? void 0 : lastParent.element)) {\n break;\n }\n\n // We need to check whether the old drop target can still be dropped on\n\n var argsForLast = registry.get(last.element);\n\n // We cannot drop on a drop target that is no longer mounted\n if (!argsForLast) {\n break;\n }\n var feedback = {\n input: input,\n source: source,\n element: argsForLast.element\n };\n\n // We cannot drop on a drop target that no longer allows being dropped on\n if (argsForLast.canDrop && !argsForLast.canDrop(feedback)) {\n break;\n }\n\n // We cannot drop on a drop target that is no longer sticky\n if (!((_argsForLast$getIsSti = argsForLast.getIsSticky) !== null && _argsForLast$getIsSti !== void 0 && _argsForLast$getIsSti.call(argsForLast, feedback))) {\n break;\n }\n\n // Note: intentionally not recollecting `getData()` or `getDropEffect()`\n // Previous values for `data` and `dropEffect` will be borrowed\n // This is to prevent things like the 'closest edge' changing when\n // no longer over a drop target.\n // We could change our mind on this behaviour in the future\n\n resultCaptureOrdered.push(_objectSpread(_objectSpread({}, last), {}, {\n // making it clear to consumers this drop target is active due to stickiness\n isActiveDueToStickiness: true\n }));\n }\n\n // return bubble ordered result\n return copyReverse(resultCaptureOrdered);\n }\n return {\n dropTargetForConsumers: dropTargetForConsumers,\n getIsOver: getIsOver,\n dispatchEvent: dispatchEvent\n };\n}","import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nfunction _createForOfIteratorHelper(r, e) { var t = \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && \"number\" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nimport { once } from '../public-utils/once';\nexport function makeMonitor() {\n var registry = new Set();\n var dragging = null;\n function tryAddToActive(monitor) {\n if (!dragging) {\n return;\n }\n // Monitor is allowed to monitor events if:\n // 1. It has no `canMonitor` function (default is that a monitor can listen to everything)\n // 2. `canMonitor` returns true\n if (!monitor.canMonitor || monitor.canMonitor(dragging.canMonitorArgs)) {\n dragging.active.add(monitor);\n }\n }\n function monitorForConsumers(args) {\n // We are giving each `args` a new reference so that you\n // can create multiple monitors with the same `args`.\n var entry = _objectSpread({}, args);\n registry.add(entry);\n\n // if there is an active drag we need to see if this new monitor is relevant\n tryAddToActive(entry);\n function cleanup() {\n registry.delete(entry);\n\n // We need to stop publishing events during a drag to this monitor!\n if (dragging) {\n dragging.active.delete(entry);\n }\n }\n\n // Wrapping in `once` to prevent unexpected side effects if consumers call\n // the clean up function multiple times.\n return once(cleanup);\n }\n function dispatchEvent(_ref) {\n var eventName = _ref.eventName,\n payload = _ref.payload;\n if (eventName === 'onGenerateDragPreview') {\n dragging = {\n canMonitorArgs: {\n initial: payload.location.initial,\n source: payload.source\n },\n active: new Set()\n };\n var _iterator = _createForOfIteratorHelper(registry),\n _step;\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var monitor = _step.value;\n tryAddToActive(monitor);\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n }\n\n // This should never happen.\n if (!dragging) {\n return;\n }\n\n // Creating an array from the set _before_ iterating\n // This is so that monitors added during the current event will not be called.\n // This behaviour matches native EventTargets where an event listener\n // cannot add another event listener during an active event to the same\n // event target in the same event (for us we have a single global event target)\n var active = Array.from(dragging.active);\n for (var _i = 0, _active = active; _i < _active.length; _i++) {\n var _monitor = _active[_i];\n // A monitor can be removed by another monitor during an event.\n // We need to check that the monitor is still registered before calling it\n if (dragging.active.has(_monitor)) {\n var _monitor$eventName;\n // @ts-expect-error: I cannot get this type working!\n (_monitor$eventName = _monitor[eventName]) === null || _monitor$eventName === void 0 || _monitor$eventName.call(_monitor, payload);\n }\n }\n if (eventName === 'onDrop') {\n dragging.active.clear();\n dragging = null;\n }\n }\n return {\n dispatchEvent: dispatchEvent,\n monitorForConsumers: monitorForConsumers\n };\n}","import { lifecycle } from '../ledger/lifecycle-manager';\nimport { register } from '../ledger/usage-ledger';\nimport { makeDropTarget } from './make-drop-target';\nimport { makeMonitor } from './make-monitor';\nexport function makeAdapter(_ref) {\n var typeKey = _ref.typeKey,\n mount = _ref.mount,\n dispatchEventToSource = _ref.dispatchEventToSource,\n onPostDispatch = _ref.onPostDispatch,\n defaultDropEffect = _ref.defaultDropEffect;\n var monitorAPI = makeMonitor();\n var dropTargetAPI = makeDropTarget({\n typeKey: typeKey,\n defaultDropEffect: defaultDropEffect\n });\n function dispatchEvent(args) {\n // 1. forward the event to source\n dispatchEventToSource === null || dispatchEventToSource === void 0 || dispatchEventToSource(args);\n\n // 2. forward the event to relevant dropTargets\n dropTargetAPI.dispatchEvent(args);\n\n // 3. forward event to monitors\n monitorAPI.dispatchEvent(args);\n\n // 4. post consumer dispatch (used for honey pot fix)\n onPostDispatch === null || onPostDispatch === void 0 || onPostDispatch(args);\n }\n function start(_ref2) {\n var event = _ref2.event,\n dragType = _ref2.dragType;\n lifecycle.start({\n event: event,\n dragType: dragType,\n getDropTargetsOver: dropTargetAPI.getIsOver,\n dispatchEvent: dispatchEvent\n });\n }\n function registerUsage() {\n function mountAdapter() {\n var api = {\n canStart: lifecycle.canStart,\n start: start\n };\n return mount(api);\n }\n return register({\n typeKey: typeKey,\n mount: mountAdapter\n });\n }\n return {\n registerUsage: registerUsage,\n dropTarget: dropTargetAPI.dropTargetForConsumers,\n monitor: monitorAPI.monitorForConsumers\n };\n}","import { once } from '../public-utils/once';\n\n// Using `once` as the value won't change in a browser\n\nexport var isAndroid = once(function isAndroid() {\n return navigator.userAgent.toLocaleLowerCase().includes('android');\n});\n\n// eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports\nexport var androidFallbackText = 'pdnd:android-fallback';","// Why we put the media types in their own files:\n//\n// - we are not putting them all in one file as not all adapters need all types\n// - we are not putting them in the external helpers as some things just need the\n// types and not the external functions code\nexport var textMediaType = 'text/plain';","// Why we put the media types in their own files:\n//\n// - we are not putting them all in one file as not all adapters need all types\n// - we are not putting them in the external helpers as some things just need the\n// types and not the external functions code\nexport var URLMediaType = 'text/uri-list';","/**\n * This key has been pulled into a separate module\n * so that the external adapter does not need to import\n * the element adapter\n */\nexport var elementAdapterNativeDataKey = 'application/vnd.pdnd';","import _slicedToArray from \"@babel/runtime/helpers/slicedToArray\";\nimport { bind } from 'bind-event-listener';\nimport { getElementFromPointWithoutHoneypot } from '../honey-pot-fix/get-element-from-point-without-honey-pot';\nimport { makeHoneyPotFix } from '../honey-pot-fix/make-honey-pot-fix';\nimport { makeAdapter } from '../make-adapter/make-adapter';\nimport { combine } from '../public-utils/combine';\nimport { once } from '../public-utils/once';\nimport { addAttribute } from '../util/add-attribute';\nimport { androidFallbackText, isAndroid } from '../util/android';\nimport { getInput } from '../util/get-input';\nimport { textMediaType } from '../util/media-types/text-media-type';\nimport { URLMediaType } from '../util/media-types/url-media-type';\nimport { elementAdapterNativeDataKey } from './element-adapter-native-data-key';\n\n// Payload for the draggable being dragged\n// eslint-disable-next-line @atlaskit/volt-strict-mode/no-re-exports\n\nvar draggableRegistry = new WeakMap();\nfunction addToRegistry(args) {\n draggableRegistry.set(args.element, args);\n return function cleanup() {\n draggableRegistry.delete(args.element);\n };\n}\nvar honeyPotFix = makeHoneyPotFix();\nvar adapter = makeAdapter({\n typeKey: 'element',\n defaultDropEffect: 'move',\n mount: function mount(api) {\n /** Binding event listeners the `document` rather than `window` so that\n * this adapter always gets preference over the text adapter.\n * `document` is the first `EventTarget` under `window`\n * https://twitter.com/alexandereardon/status/1604658588311465985\n */\n return combine(honeyPotFix.bindEvents(), bind(document, {\n type: 'dragstart',\n listener: function listener(event) {\n var _entry$dragHandle, _entry$getInitialData, _entry$getInitialData2, _entry$dragHandle2, _entry$getInitialData3, _entry$getInitialData4;\n if (!api.canStart(event)) {\n return;\n }\n\n // If the \"dragstart\" event is cancelled, then a drag won't start\n // There will be no further drag operation events (eg no \"dragend\" event)\n if (event.defaultPrevented) {\n return;\n }\n\n // Technically `dataTransfer` can be `null` according to the types\n // But that behaviour does not seem to appear in the spec.\n // If there is not `dataTransfer`, we can assume something is wrong and not\n // start a drag\n if (!event.dataTransfer) {\n // Including this code on \"test\" and \"development\" environments:\n // - Browser tests commonly run against \"development\" builds\n // - Unit tests commonly run in \"test\"\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line no-console\n console.warn(\"\\n It appears as though you have are not testing DragEvents correctly.\\n\\n - If you are unit testing, ensure you have polyfilled DragEvent.\\n - If you are browser testing, ensure you are dispatching drag events correctly.\\n\\n Please see our testing guides for more information:\\n https://atlassian.design/components/pragmatic-drag-and-drop/core-package/testing\\n \".replace(/ {2}/g, ''));\n }\n return;\n }\n\n // the closest parent that is a draggable element will be marked as\n // the `event.target` for the event\n var target = event.target;\n\n // this source is only for elements\n // Note: only HTMLElements can have the \"draggable\" attribute\n if (!(target instanceof HTMLElement)) {\n return;\n }\n\n // see if the thing being dragged is owned by us\n var entry = draggableRegistry.get(target);\n\n // no matching element found\n // → dragging an element with `draggable=\"true\"` that is not controlled by us\n if (!entry) {\n return;\n }\n\n /**\n * A text selection drag _can_ have the `draggable` element be\n * the `event.target` if the user is dragging the text selection\n * from the `draggable`.\n *\n * To know if the `draggable` is being dragged, we look at whether any\n * `\"text/plain\"` data is being dragged. If it is, then a text selection\n * drag is occurring.\n *\n * This behaviour has been validated on:\n *\n * - Chrome@128 on Android@14\n * - Chrome@128 on iOS@17.6.1\n * - Chrome@128 on Windows@11\n * - Chrome@128 on MacOS@14.6.1\n * - Firefox@129 on Windows@11 (not possible for user to select text in a draggable)\n * - Firefox@129 on MacOS@14.6.1 (not possible for user to select text in a draggable)\n *\n * Note: Could usually just use: `event.dataTransfer.types.includes(textMediaType)`\n * but unfortunately ProseMirror is always setting `\"\"` as the dragged text\n *\n * Note: Unfortunately editor is (heavily) leaning on the current functionality today\n * and unwinding it will be a decent amount of effort. So for now, a text selection\n * where the `event.target` is a `draggable` element will still trigger the\n * element adapter.\n *\n * // Future state:\n * if(event.dataTransfer.getData(textMediaType)) {\n * \treturn;\n * }\n *\n */\n\n var input = getInput(event);\n var feedback = {\n element: entry.element,\n dragHandle: (_entry$dragHandle = entry.dragHandle) !== null && _entry$dragHandle !== void 0 ? _entry$dragHandle : null,\n input: input\n };\n\n // Check: does the draggable want to allow dragging?\n if (entry.canDrag && !entry.canDrag(feedback)) {\n // cancel drag operation if we cannot drag\n event.preventDefault();\n return;\n }\n\n // Check: is there a drag handle and is the user using it?\n if (entry.dragHandle) {\n // technically don't need this util, but just being\n // consistent with how we look up what is under the users\n // cursor.\n var over = getElementFromPointWithoutHoneypot({\n x: input.clientX,\n y: input.clientY\n });\n\n // if we are not dragging from the drag handle (or something inside the drag handle)\n // then we will cancel the active drag\n if (!entry.dragHandle.contains(over)) {\n event.preventDefault();\n return;\n }\n }\n\n /**\n * **Goal**\n * Pass information to other applications\n *\n * **Approach**\n * Put data into the native data store\n *\n * **What about the native adapter?**\n * When the element adapter puts native data into the native data store\n * the native adapter is not triggered in the current window,\n * but a native adapter in an external window _can_ be triggered\n *\n * **Why bake this into core?**\n * This functionality could be pulled out and exposed inside of\n * `onGenerateDragPreview`. But decided to make it a part of the\n * base API as it felt like a common enough use case and ended\n * up being a similar amount of code to include this function as\n * it was to expose the hook for it\n */\n var nativeData = (_entry$getInitialData = (_entry$getInitialData2 = entry.getInitialDataForExternal) === null || _entry$getInitialData2 === void 0 ? void 0 : _entry$getInitialData2.call(entry, feedback)) !== null && _entry$getInitialData !== void 0 ? _entry$getInitialData : null;\n if (nativeData) {\n for (var _i = 0, _Object$entries = Object.entries(nativeData); _i < _Object$entries.length; _i++) {\n var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),\n key = _Object$entries$_i[0],\n data = _Object$entries$_i[1];\n event.dataTransfer.setData(key, data !== null && data !== void 0 ? data : '');\n }\n }\n\n /**\n * 📱 For Android devices, a drag operation will not start unless\n * \"text/plain\" or \"text/uri-list\" data exists in the native data store\n * https://twitter.com/alexandereardon/status/1732189803754713424\n *\n * Tested on:\n * Device: Google Pixel 5\n * Android version: 14 (November 5, 2023)\n * Chrome version: 120.0\n */\n if (isAndroid() && !event.dataTransfer.types.includes(textMediaType) && !event.dataTransfer.types.includes(URLMediaType)) {\n event.dataTransfer.setData(textMediaType, androidFallbackText);\n }\n\n /**\n * 1. Must set any media type for `iOS15` to work\n * 2. We are also doing adding data so that the native adapter\n * can know that the element adapter has handled this drag\n *\n * We used to wrap this `setData()` in a `try/catch` for Firefox,\n * but it looks like that was not needed.\n *\n * Tested using: https://codesandbox.io/s/checking-firefox-throw-behaviour-on-dragstart-qt8h4f\n *\n * - ✅ Firefox@70.0 (Oct 2019) on macOS Sonoma\n * - ✅ Firefox@70.0 (Oct 2019) on macOS Big Sur\n * - ✅ Firefox@70.0 (Oct 2019) on Windows 10\n *\n * // just checking a few more combinations to be super safe\n *\n * - ✅ Chrome@78 (Oct 2019) on macOS Big Sur\n * - ✅ Chrome@78 (Oct 2019) on Windows 10\n * - ✅ Safari@14.1 on macOS Big Sur\n */\n event.dataTransfer.setData(elementAdapterNativeDataKey, '');\n var payload = {\n element: entry.element,\n dragHandle: (_entry$dragHandle2 = entry.dragHandle) !== null && _entry$dragHandle2 !== void 0 ? _entry$dragHandle2 : null,\n data: (_entry$getInitialData3 = (_entry$getInitialData4 = entry.getInitialData) === null || _entry$getInitialData4 === void 0 ? void 0 : _entry$getInitialData4.call(entry, feedback)) !== null && _entry$getInitialData3 !== void 0 ? _entry$getInitialData3 : {}\n };\n var dragType = {\n type: 'element',\n payload: payload,\n startedFrom: 'internal'\n };\n api.start({\n event: event,\n dragType: dragType\n });\n }\n }));\n },\n dispatchEventToSource: function dispatchEventToSource(_ref) {\n var _draggableRegistry$ge, _draggableRegistry$ge2;\n var eventName = _ref.eventName,\n payload = _ref.payload;\n // During a drag operation, a draggable can be:\n // - remounted with different functions\n // - removed completely\n // So we need to get the latest entry from the registry in order\n // to call the latest event functions\n\n (_draggableRegistry$ge = draggableRegistry.get(payload.source.element)) === null || _draggableRegistry$ge === void 0 || (_draggableRegistry$ge2 = _draggableRegistry$ge[eventName]) === null || _draggableRegistry$ge2 === void 0 || _draggableRegistry$ge2.call(_draggableRegistry$ge,\n // I cannot seem to get the types right here.\n // TS doesn't seem to like that one event can need `nativeSetDragImage`\n // @ts-expect-error\n payload);\n },\n onPostDispatch: honeyPotFix.getOnPostDispatch()\n});\nexport var dropTargetForElements = adapter.dropTarget;\n// eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports\nexport var monitorForElements = adapter.monitor;\n\n// eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports\nexport function draggable(args) {\n // Guardrail: warn if the drag handle is not contained in draggable element\n if (process.env.NODE_ENV !== 'production') {\n if (args.dragHandle && !args.element.contains(args.dragHandle)) {\n // eslint-disable-next-line no-console\n console.warn('Drag handle element must be contained in draggable element', {\n element: args.element,\n dragHandle: args.dragHandle\n });\n }\n }\n // Guardrail: warn if the draggable element is already registered\n if (process.env.NODE_ENV !== 'production') {\n var existing = draggableRegistry.get(args.element);\n if (existing) {\n // eslint-disable-next-line no-console\n console.warn('You have already registered a `draggable` on the same element', {\n existing: existing,\n proposed: args\n });\n }\n }\n var cleanup = combine(\n // making the draggable register the adapter rather than drop targets\n // this is because you *must* have a draggable element to start a drag\n // but you _might_ not have any drop targets immediately\n // (You might create drop targets async)\n adapter.registerUsage(), addToRegistry(args), addAttribute(args.element, {\n attribute: 'draggable',\n value: 'true'\n }));\n\n // Wrapping in `once` to prevent unexpected side effects if consumers call\n // the clean up function multiple times.\n return once(cleanup);\n}\n\n/** Common event payload for all events */\n\n/** A map containing payloads for all events */\n\n/** Common event payload for all drop target events */\n\n/** A map containing payloads for all events on drop targets */\n\n/** Arguments given to all feedback functions (eg `canDrag()`) on for a `draggable()` */\n\n/** Arguments given to all feedback functions (eg `canDrop()`) on a `dropTargetForElements()` */\n\n/** Arguments given to all monitor feedback functions (eg `canMonitor()`) for a `monitorForElements` */","var ledger = new Map();\nvar requested = new Set();\nexport function markAndGetEngagement(element) {\n markEngagement(element);\n var entry = ledger.get(element);\n if (entry) {\n return entry;\n }\n var fresh = {\n timeOfEngagementStart: Date.now()\n };\n ledger.set(element, fresh);\n return fresh;\n}\n\n// eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports\nexport function markEngagement(element) {\n requested.add(element);\n}\n\n// eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports\nexport function clearUnusedEngagements(fn) {\n // make sure previous engagement requests don't linger\n requested.clear();\n\n // perform the required work\n fn();\n\n // if engagements where not requested, purge it\n ledger.forEach(function (_, element) {\n if (!requested.has(element)) {\n ledger.delete(element);\n }\n });\n\n // cleaning up after ourselves\n requested.clear();\n}\n\n// eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports\nexport function clearEngagementHistory() {\n ledger.clear();\n}","import { getElementFromPointWithoutHoneypot } from '@atlaskit/pragmatic-drag-and-drop/get-element-from-point-without-honey-pot';\nimport { clearEngagementHistory, clearUnusedEngagements } from './engagement-history';\n// We keep this map so that \"over element\" scrolling and \"overflow\" scrolling\n// can leverage the same scheduler.\n// The 'monitor' is the key for looking up schedulers\nvar schedulers = new Map();\nexport function getScheduler(monitor) {\n var scheduler = schedulers.get(monitor);\n if (scheduler) {\n // @ts-expect-error: I don't know how to link the DragType generic between the key and the value when the\n // monitor itself is the key\n return scheduler;\n }\n var created = makeScheduler(monitor);\n schedulers.set(monitor, created);\n return created;\n}\nfunction makeScheduler(monitor) {\n var state = {\n type: 'idle'\n };\n var callbacks = [];\n function loop(timeLastFrameFinished) {\n if (state.type !== 'running') {\n return;\n }\n var timeSinceLastFrame = timeLastFrameFinished - state.timeLastFrameFinished;\n var _state = state,\n latestArgs = _state.latestArgs;\n\n // A common starting lookup point for determining\n // which auto scroller should be used, and what should be scrolled.\n var underUsersPointer = getElementFromPointWithoutHoneypot({\n x: latestArgs.location.current.input.clientX,\n y: latestArgs.location.current.input.clientY\n });\n clearUnusedEngagements(function () {\n callbacks.forEach(function (onFrame) {\n return onFrame({\n underUsersPointer: underUsersPointer,\n latestArgs: latestArgs,\n timeSinceLastFrame: timeSinceLastFrame\n });\n });\n });\n state.timeLastFrameFinished = timeLastFrameFinished;\n state.frameId = requestAnimationFrame(loop);\n }\n function reset() {\n if (state.type === 'idle') {\n return;\n }\n cancelAnimationFrame(state.frameId);\n clearEngagementHistory();\n state = {\n type: 'idle'\n };\n }\n function start(args) {\n if (state.type !== 'idle') {\n return;\n }\n state = {\n // Waiting a frame so we can accurately determine `timeSinceLastFrame`.\n type: 'initializing',\n latestArgs: args,\n frameId: requestAnimationFrame(function (timeLastFrameFinished) {\n if (state.type !== 'initializing') {\n return;\n }\n state = {\n type: 'running',\n timeLastFrameFinished: timeLastFrameFinished,\n latestArgs: state.latestArgs,\n frameId: requestAnimationFrame(loop)\n };\n })\n };\n }\n\n // this module might have been imported after a drag has started\n // We are starting the auto scroller if we get an update event and\n // the auto scroller has not started yet\n function update(args) {\n if (state.type === 'idle') {\n start(args);\n return;\n }\n state.latestArgs = args;\n }\n\n // Not exposing a way to stop listening\n monitor({\n onDragStart: start,\n onDropTargetChange: update,\n onDrag: update,\n onDrop: reset\n });\n var api = {\n onFrame: function onFrame(fn) {\n callbacks.push(fn);\n }\n };\n return api;\n}","export var dataAttribute = 'data-auto-scrollable';\n// eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports\nexport var selector = \"[\".concat(dataAttribute, \"=\\\"true\\\"]\");\n\n// eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports\nexport function addScrollableAttribute(element) {\n element.setAttribute(dataAttribute, 'true');\n return function () {\n return element.removeAttribute(dataAttribute);\n };\n}","import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nvar baseConfig = {\n startHitboxAtPercentageRemainingOfElement: {\n top: 0.25,\n right: 0.25,\n bottom: 0.25,\n left: 0.25\n },\n maxScrollAtPercentageRemainingOfHitbox: {\n top: 0.5,\n right: 0.5,\n bottom: 0.5,\n left: 0.5\n },\n timeDampeningDurationMs: 400,\n // Too big and it's too easy to trigger auto scrolling\n // Too small and it's too hard 😅\n maxMainAxisHitboxSize: 180\n};\n\n/** What the max scroll should be per second. Using \"per second\" rather than \"per frame\"\n * as we want a consistent scroll speed regardless of frame rate.\n *\n *\n * I explored trying to make the max scroll speed dynamic based on particular factors.\n * However, it ended up being difficult to find a _perfect_ formula.\n *\n * Likely the perfect answer would involve:\n * - the size of the scrollable element\n * - the size of the scrollable element relative to the screen size\n * - the size of the drag preview\n * - the size of elements being scrolled in scrollable elements (expensive and difficult to compute)\n */\nvar maxPixelScrollPerSecond = {\n // What the value would be if we were scrolling at 15px per frame at 60fps.\n // This is the default as it works well for most experiences.\n // In certain scenarios though it can feel a bit slow.\n standard: 15 * 60,\n // What the value would be if we were scrolling at 25px per frame at 60fps.\n // This is not the default as it feels too fast for a lot of experiences.\n fast: 25 * 60\n};\nexport function getInternalConfig(provided) {\n var _provided$maxScrollSp;\n return _objectSpread(_objectSpread({}, baseConfig), {}, {\n // only allowing limited control over the config at this stage\n maxPixelScrollPerSecond: maxPixelScrollPerSecond[(_provided$maxScrollSp = provided === null || provided === void 0 ? void 0 : provided.maxScrollSpeed) !== null && _provided$maxScrollSp !== void 0 ? _provided$maxScrollSp : 'standard']\n });\n}","export var canScrollOnEdge = {\n // Notes:\n //\n // 🌏 Chrome 115.0: uses fractional units for `scrollLeft` and `scrollTop`\n // (and fractional units don't reach true integer maximum when zoomed in / out)\n // 🍎 Safari 16.5.2: no fractional units\n // 🦊 Firefox 115.0: no fractional units\n\n // we have some scroll we can move backwards into\n top: function top(element) {\n return element.scrollTop > 0;\n },\n // We have some scroll we can move forward into\n right: function right(element) {\n return Math.ceil(element.scrollLeft) + element.clientWidth < element.scrollWidth;\n },\n // We have some scroll we can move forwards into\n bottom: function bottom(element) {\n return Math.ceil(element.scrollTop) + element.clientHeight < element.scrollHeight;\n },\n // we have some scroll we can move back into.\n left: function left(element) {\n return element.scrollLeft > 0;\n }\n};","export var edges = ['top', 'right', 'bottom', 'left'];\n\n// eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports\nexport var edgeAxisLookup = {\n top: 'vertical',\n right: 'horizontal',\n bottom: 'vertical',\n left: 'horizontal'\n};","var vertical = {\n start: 'top',\n end: 'bottom',\n point: 'y',\n size: 'height'\n};\nvar horizontal = {\n start: 'left',\n end: 'right',\n point: 'x',\n size: 'width'\n};\nexport var axisLookup = {\n vertical: {\n mainAxis: vertical,\n crossAxis: horizontal\n },\n horizontal: {\n mainAxis: horizontal,\n crossAxis: vertical\n }\n};","export var mainAxisSideLookup = {\n top: 'start',\n right: 'end',\n bottom: 'end',\n left: 'start'\n};","import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport { axisLookup } from './axis';\nimport { mainAxisSideLookup } from './side';\nfunction makeGetHitbox(_ref) {\n var edge = _ref.edge,\n axis = _ref.axis;\n return function hitbox(_ref2) {\n var clientRect = _ref2.clientRect,\n config = _ref2.config;\n var _axisLookup$axis = axisLookup[axis],\n mainAxis = _axisLookup$axis.mainAxis,\n crossAxis = _axisLookup$axis.crossAxis;\n var side = mainAxisSideLookup[edge];\n var mainAxisHitboxSize = Math.min(\n // scale the size of the hitbox down for smaller elements\n config.startHitboxAtPercentageRemainingOfElement[edge] * clientRect[mainAxis.size],\n // Don't let the hitbox grow too big for big elements\n config.maxMainAxisHitboxSize);\n return DOMRect.fromRect(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, mainAxis.point, side === 'start' ?\n // begin from the start edge and grow inwards\n clientRect[mainAxis.point] :\n // begin from inside the end edge and grow towards the end edge\n clientRect[mainAxis.point] + clientRect[mainAxis.size] - mainAxisHitboxSize), crossAxis.point, clientRect[crossAxis.point]), mainAxis.size, mainAxisHitboxSize), crossAxis.size, clientRect[crossAxis.size]));\n };\n}\nexport var getOverElementHitbox = {\n top: makeGetHitbox({\n axis: 'vertical',\n edge: 'top'\n }),\n right: makeGetHitbox({\n axis: 'horizontal',\n edge: 'right'\n }),\n bottom: makeGetHitbox({\n axis: 'vertical',\n edge: 'bottom'\n }),\n left: makeGetHitbox({\n axis: 'horizontal',\n edge: 'left'\n })\n};","export function getPercentageInRange(_ref) {\n var startOfRange = _ref.startOfRange,\n endOfRange = _ref.endOfRange,\n value = _ref.value;\n // checking inputs\n var isValid = startOfRange < endOfRange;\n if (!isValid) {\n return 0;\n }\n if (value < startOfRange) {\n return 0;\n }\n if (value > endOfRange) {\n return 1;\n }\n var range = endOfRange - startOfRange;\n return (value - startOfRange) / range;\n}","import { axisLookup } from './axis';\nimport { getPercentageInRange } from './get-percentage-in-range';\nimport { mainAxisSideLookup } from './side';\n\n// We want a consistent scroll speed across devices, regardless of framerate\nfunction getMaxScrollChange(_ref) {\n var timeSinceLastFrame = _ref.timeSinceLastFrame,\n config = _ref.config;\n var targetScrollPerMs = config.maxPixelScrollPerSecond / 1000;\n\n // Adjusting out target scroll rate to match the frame rate of the target device\n // This will pull the scroll speed down on high frame rate devices\n // so we get a consistent visual scroll speed regardless of device.\n var proposed = Math.ceil(targetScrollPerMs * timeSinceLastFrame);\n\n // If lots of time as passed since that last frame (such on lower frame rate devices)\n // we don't want the scroll speed to be too fast, otherwise it can feel jumpy\n // We are capping the scroll speed at what it would be if we were hitting 60fps\n var maximum = config.maxPixelScrollPerSecond / 60;\n return Math.min(proposed, maximum);\n}\nfunction getDistanceDampening(_ref2) {\n var client = _ref2.client,\n axis = _ref2.axis,\n edge = _ref2.edge,\n hitbox = _ref2.hitbox,\n config = _ref2.config;\n var mainAxis = axisLookup[axis].mainAxis;\n var side = mainAxisSideLookup[edge];\n\n // We want to hit the max speed before the edge of the hitbox\n var maxSpeedBuffer = hitbox[mainAxis.size] * config.maxScrollAtPercentageRemainingOfHitbox[edge];\n if (side === 'end') {\n return getPercentageInRange({\n startOfRange: hitbox[mainAxis.start],\n endOfRange: hitbox[mainAxis.end] - maxSpeedBuffer,\n value: client[mainAxis.point]\n });\n }\n\n // Moving towards start edge\n\n var raw = getPercentageInRange({\n startOfRange: hitbox[mainAxis.start] + maxSpeedBuffer,\n endOfRange: hitbox[mainAxis.end],\n value: client[mainAxis.point]\n });\n // When moving near start edge\n // - the 'end' edge is where we start scrolling\n // - the 'start' edge is where we reach max speed\n // So we need to invert the percentage when moving backwards\n return 1 - raw;\n}\nexport function getScrollChange(_ref3) {\n var client = _ref3.client,\n timeSinceLastFrame = _ref3.timeSinceLastFrame,\n engagement = _ref3.engagement,\n axis = _ref3.axis,\n hitbox = _ref3.hitbox,\n edge = _ref3.edge,\n isDistanceDampeningEnabled = _ref3.isDistanceDampeningEnabled,\n config = _ref3.config;\n // We have two forms of speed dampening:\n // 1. 🗺️ Distance\n // The closer you are to a hitbox edge, the faster the scroll speed will be\n // 2. ⏱️ Time\n // When first entering a scroll container we want to dampening all scrolling\n // This is to prevent super fast auto scrolling when first entering into\n // a scroll container, or when lifting in a scroll container\n\n var maxScroll = getMaxScrollChange({\n timeSinceLastFrame: timeSinceLastFrame,\n config: config\n });\n var percentageDistanceDampening = isDistanceDampeningEnabled ? getDistanceDampening({\n client: client,\n edge: edge,\n hitbox: hitbox,\n axis: axis,\n config: config\n }) : 1;\n\n // Dampen speed by time\n var percentageThroughTimeDampening = getPercentageInRange({\n startOfRange: engagement.timeOfEngagementStart,\n endOfRange: engagement.timeOfEngagementStart + config.timeDampeningDurationMs,\n value: Date.now()\n });\n\n // Calculate how much of the max scroll we should apply based on dampening\n var percentageOfMaxScroll = percentageDistanceDampening * percentageThroughTimeDampening;\n\n // We _could_ ease this update (`Math.pow(percentageOfMaxSpeed, 2)`)\n // But linear is feeling really good\n // Always scrolling by at least one pixel, otherwise the scroll does nothing\n var scroll = Math.max(maxScroll * percentageOfMaxScroll, 1);\n var side = mainAxisSideLookup[edge];\n\n // When moving backwards, we will be scrolling backwards\n return side === 'end' ? scroll : -1 * scroll;\n}","export function isAxisAllowed(axis, allowedAxis) {\n return allowedAxis === 'all' || axis === allowedAxis;\n}","export function isWithin(_ref) {\n var client = _ref.client,\n clientRect = _ref.clientRect;\n return (\n // is within horizontal bounds\n client.x >= clientRect.x && client.x <= clientRect.x + clientRect.width &&\n // is within vertical bounds\n client.y >= clientRect.y && client.y <= clientRect.y + clientRect.height\n );\n}","import { canScrollOnEdge } from '../shared/can-scroll-on-edge';\nimport { edgeAxisLookup, edges } from '../shared/edges';\nimport { getOverElementHitbox } from '../shared/get-over-element-hitbox';\nimport { getScrollChange } from '../shared/get-scroll-change';\nimport { isAxisAllowed } from '../shared/is-axis-allowed';\nimport { isWithin } from '../shared/is-within';\nfunction getRectDefault(element) {\n return element.getBoundingClientRect();\n}\nexport function getScrollBy(_ref) {\n var element = _ref.element,\n input = _ref.input,\n timeSinceLastFrame = _ref.timeSinceLastFrame,\n engagement = _ref.engagement,\n config = _ref.config,\n allowedAxis = _ref.allowedAxis,\n _ref$getRect = _ref.getRect,\n getRect = _ref$getRect === void 0 ? getRectDefault : _ref$getRect;\n var client = {\n x: input.clientX,\n y: input.clientY\n };\n var clientRect = getRect(element);\n var scrollableEdges = edges.reduce(function (map, edge) {\n var hitbox = getOverElementHitbox[edge]({\n clientRect: clientRect,\n config: config\n });\n var axis = edgeAxisLookup[edge];\n\n // Note: changing the allowed axis during a drag will not\n // reset time dampening. It was decided it would be too\n // complex to implement initially, and we can add it\n // later if needed.\n if (!isAxisAllowed(axis, allowedAxis)) {\n return map;\n }\n if (!isWithin({\n client: client,\n clientRect: hitbox\n })) {\n return map;\n }\n if (!canScrollOnEdge[edge](element)) {\n return map;\n }\n map.set(edge, {\n edge: edge,\n hitbox: hitbox\n });\n return map;\n }, new Map());\n var left = function () {\n var axis = 'horizontal';\n var leftEdge = scrollableEdges.get('left');\n if (leftEdge) {\n return getScrollChange({\n client: client,\n edge: leftEdge.edge,\n hitbox: leftEdge.hitbox,\n axis: axis,\n timeSinceLastFrame: timeSinceLastFrame,\n engagement: engagement,\n isDistanceDampeningEnabled: true,\n config: config\n });\n }\n var rightEdge = scrollableEdges.get('right');\n if (rightEdge) {\n return getScrollChange({\n client: client,\n edge: rightEdge.edge,\n hitbox: rightEdge.hitbox,\n axis: axis,\n timeSinceLastFrame: timeSinceLastFrame,\n engagement: engagement,\n isDistanceDampeningEnabled: true,\n config: config\n });\n }\n return 0;\n }();\n var top = function () {\n var axis = 'vertical';\n var bottomEdge = scrollableEdges.get('bottom');\n if (bottomEdge) {\n return getScrollChange({\n client: client,\n edge: bottomEdge.edge,\n hitbox: bottomEdge.hitbox,\n axis: axis,\n timeSinceLastFrame: timeSinceLastFrame,\n engagement: engagement,\n isDistanceDampeningEnabled: true,\n config: config\n });\n }\n var topEdge = scrollableEdges.get('top');\n if (topEdge) {\n return getScrollChange({\n client: client,\n edge: topEdge.edge,\n hitbox: topEdge.hitbox,\n axis: axis,\n timeSinceLastFrame: timeSinceLastFrame,\n engagement: engagement,\n isDistanceDampeningEnabled: true,\n config: config\n });\n }\n return 0;\n }();\n return {\n left: left,\n top: top\n };\n}","function _createForOfIteratorHelper(r, e) { var t = \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && \"number\" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nimport { getInternalConfig } from '../shared/configuration';\nimport { markAndGetEngagement } from '../shared/engagement-history';\nimport { selector } from './data-attributes';\nimport { getScrollBy } from './get-scroll-by';\nfunction isScrollingAvailable(value) {\n return Boolean(value.top || value.left);\n}\nfunction tryScrollElements(_ref) {\n var _container$getConfigu, _container$getAllowed, _container$getAllowed2;\n var target = _ref.target,\n input = _ref.input,\n source = _ref.source,\n findEntry = _ref.findEntry,\n timeSinceLastFrame = _ref.timeSinceLastFrame,\n _ref$available = _ref.available,\n available = _ref$available === void 0 ? {\n top: true,\n left: true\n } : _ref$available;\n // we cannot do any more scrolling\n if (!isScrollingAvailable(available)) {\n return available;\n }\n\n // run out of parents to search\n if (!target) {\n return available;\n }\n var element = target.closest(selector);\n\n // cannot find any more scroll containers\n if (!element) {\n return available;\n }\n var container = findEntry(element);\n\n // cannot find registration, this is bad.\n // fail and just exit\n if (!container) {\n return available;\n }\n function continueSearchUp() {\n var _element$parentElemen;\n return tryScrollElements({\n target: (_element$parentElemen = element === null || element === void 0 ? void 0 : element.parentElement) !== null && _element$parentElemen !== void 0 ? _element$parentElemen : null,\n findEntry: findEntry,\n source: source,\n timeSinceLastFrame: timeSinceLastFrame,\n input: input,\n available: available\n });\n }\n var feedback = {\n input: input,\n source: source,\n element: element\n };\n\n // Engagement is not marked if scrolling is explicitly not allowed\n if (container.canScroll && !container.canScroll(feedback)) {\n return continueSearchUp();\n }\n\n // Marking engagement even if no edges are scrollable.\n // We are marking engagement as soon as the element is scrolled over\n var engagement = markAndGetEngagement(element);\n var config = getInternalConfig((_container$getConfigu = container.getConfiguration) === null || _container$getConfigu === void 0 ? void 0 : _container$getConfigu.call(container, feedback));\n var allowedAxis = (_container$getAllowed = (_container$getAllowed2 = container.getAllowedAxis) === null || _container$getAllowed2 === void 0 ? void 0 : _container$getAllowed2.call(container, feedback)) !== null && _container$getAllowed !== void 0 ? _container$getAllowed : 'all';\n var scrollBy = getScrollBy({\n element: element,\n engagement: engagement,\n input: input,\n timeSinceLastFrame: timeSinceLastFrame,\n allowedAxis: allowedAxis,\n config: config\n });\n\n // Only allow scrolling in directions that have not already been used\n var scroll = {\n top: 0,\n left: 0\n };\n if (available.top && scrollBy.top !== 0) {\n scroll.top = scrollBy.top;\n // can no longer scroll on the top after this\n available.top = false;\n }\n if (available.left && scrollBy.left !== 0) {\n scroll.left = scrollBy.left;\n // can no longer scroll on the left after this\n available.left = false;\n }\n\n // Only scroll if there is something to scroll\n if (scroll.top !== 0 || scroll.left !== 0) {\n element.scrollBy(scroll);\n }\n return continueSearchUp();\n}\nfunction tryScrollWindow(_ref2) {\n var input = _ref2.input,\n timeSinceLastFrame = _ref2.timeSinceLastFrame,\n available = _ref2.available,\n source = _ref2.source,\n entries = _ref2.entries;\n var element = document.documentElement;\n var feedback = {\n input: input,\n source: source,\n element: element\n };\n var _iterator = _createForOfIteratorHelper(entries),\n _step;\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var _entry$getConfigurati, _entry$getAllowedAxis, _entry$getAllowedAxis2;\n var entry = _step.value;\n // this entry is not allowing scrolling, we need to look for another\n if (entry.canScroll && !entry.canScroll(feedback)) {\n continue;\n }\n\n // Note: if we had an event for when the user is leaving a tab\n // we _could_ conceptually reset the engagement\n var engagement = markAndGetEngagement(element);\n var config = getInternalConfig((_entry$getConfigurati = entry.getConfiguration) === null || _entry$getConfigurati === void 0 ? void 0 : _entry$getConfigurati.call(entry, feedback));\n var allowedAxis = (_entry$getAllowedAxis = (_entry$getAllowedAxis2 = entry.getAllowedAxis) === null || _entry$getAllowedAxis2 === void 0 ? void 0 : _entry$getAllowedAxis2.call(entry, feedback)) !== null && _entry$getAllowedAxis !== void 0 ? _entry$getAllowedAxis : 'all';\n var scrollBy = getScrollBy({\n element: element,\n engagement: engagement,\n input: input,\n config: config,\n allowedAxis: allowedAxis,\n getRect: function getRect(element) {\n return DOMRect.fromRect({\n y: 0,\n x: 0,\n width: element.clientWidth,\n height: element.clientHeight\n });\n },\n timeSinceLastFrame: timeSinceLastFrame\n });\n var scroll = {\n top: available.top ? scrollBy.top : 0,\n left: available.left ? scrollBy.left : 0\n };\n\n // only trigger a scroll if we are actually scrolling\n if (scroll.top !== 0 || scroll.left !== 0) {\n element.scrollBy(scroll);\n }\n\n // We only want the window to scroll once\n break;\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n}\nexport function tryScroll(_ref3) {\n var input = _ref3.input,\n findEntry = _ref3.findEntry,\n timeSinceLastFrame = _ref3.timeSinceLastFrame,\n source = _ref3.source,\n getWindowScrollEntries = _ref3.getWindowScrollEntries,\n underUsersPointer = _ref3.underUsersPointer;\n // We are matching browser behaviour and scrolling inner elements\n // before outer ones. So we try to scroll scroller containers before\n // the window.\n var remainder = tryScrollElements({\n target: underUsersPointer,\n timeSinceLastFrame: timeSinceLastFrame,\n input: input,\n source: source,\n findEntry: findEntry\n });\n\n // Check if we can do any window scrolling\n if (!isScrollingAvailable(remainder)) {\n return;\n }\n tryScrollWindow({\n input: input,\n source: source,\n entries: getWindowScrollEntries(),\n timeSinceLastFrame: timeSinceLastFrame,\n available: remainder\n });\n}","import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nimport { combine } from '@atlaskit/pragmatic-drag-and-drop/utils/combine';\nimport { once } from '@atlaskit/pragmatic-drag-and-drop/utils/once';\nimport { getScheduler } from '../shared/scheduler';\nimport { addScrollableAttribute } from './data-attributes';\nimport { tryScroll } from './try-scroll';\nexport function makeApi(_ref) {\n var monitor = _ref.monitor;\n var elementRegistry = new Map();\n var windowRegistry = new Set();\n function autoScroll(args) {\n // Warn during development if trying to add auto scroll to an element\n // that is not scrollable.\n // Note: this can produce a false positive when a scroll container is not\n // scrollable initially, but becomes scrollable during a drag.\n // I thought of adding the warning as I think it would be a more common pitfall\n // to accidentally register auto scrolling on the wrong element\n // If requested, we could provide a mechanism to opt out of this warning\n if (process.env.NODE_ENV !== 'production') {\n var _window$getComputedSt = window.getComputedStyle(args.element),\n overflowX = _window$getComputedSt.overflowX,\n overflowY = _window$getComputedSt.overflowY;\n var isScrollable = overflowX === 'auto' || overflowX === 'scroll' || overflowY === 'auto' || overflowY === 'scroll';\n if (!isScrollable) {\n // eslint-disable-next-line no-console\n console.warn('Auto scrolling has been attached to an element that appears not to be scrollable', {\n element: args.element,\n overflowX: overflowX,\n overflowY: overflowY\n });\n }\n }\n\n // Warn if there is an existing registration\n if (process.env.NODE_ENV !== 'production') {\n var existing = elementRegistry.get(args.element);\n if (existing) {\n // eslint-disable-next-line no-console\n console.warn('You have already registered autoScrolling on the same element', {\n existing: existing,\n proposed: args\n });\n }\n }\n elementRegistry.set(args.element, args);\n var cleanup = combine(addScrollableAttribute(args.element), function () {\n return elementRegistry.delete(args.element);\n });\n return once(cleanup);\n }\n function autoScrollWindow() {\n var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n // Putting `args` in a unique object so that\n // each call will create a unique entry, even if a consumer\n // shares the `args` object between calls.\n // Just being safe here.\n var unique = _objectSpread({}, args);\n windowRegistry.add(unique);\n function cleanup() {\n windowRegistry.delete(unique);\n }\n return once(cleanup);\n }\n function findEntry(element) {\n var _elementRegistry$get;\n return (_elementRegistry$get = elementRegistry.get(element)) !== null && _elementRegistry$get !== void 0 ? _elementRegistry$get : null;\n }\n function getWindowScrollEntries() {\n return Array.from(windowRegistry);\n }\n function onFrame(_ref2) {\n var latestArgs = _ref2.latestArgs,\n underUsersPointer = _ref2.underUsersPointer,\n timeSinceLastFrame = _ref2.timeSinceLastFrame;\n tryScroll({\n input: latestArgs.location.current.input,\n source: latestArgs.source,\n findEntry: findEntry,\n underUsersPointer: underUsersPointer,\n timeSinceLastFrame: timeSinceLastFrame,\n getWindowScrollEntries: getWindowScrollEntries\n });\n }\n getScheduler(monitor).onFrame(onFrame);\n return {\n autoScroll: autoScroll,\n autoScrollWindow: autoScrollWindow\n };\n}","import { monitorForElements } from '@atlaskit/pragmatic-drag-and-drop/adapter/element-adapter';\nimport { makeApi } from '../over-element/make-api';\nvar api = makeApi({\n monitor: monitorForElements\n});\nexport var autoScrollForElements = api.autoScroll;\n// eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports\nexport var autoScrollWindowForElements = api.autoScrollWindow;","import _toConsumableArray from \"@babel/runtime/helpers/toConsumableArray\";\nimport { bindAll } from 'bind-event-listener';\nimport { getBindingsForBrokenDrags } from '../util/detect-broken-drag';\nfunction acceptDrop(event) {\n // if the event is already prevented the event we don't need to do anything\n if (event.defaultPrevented) {\n return;\n }\n // Using \"move\" as the drop effect as that uses the standard\n // cursor. Doing this so the user doesn't think they are dropping\n // on the page\n // Note: using \"none\" will not allow a \"drop\" to occur, so we are using \"move\"\n if (event.dataTransfer) {\n event.dataTransfer.dropEffect = 'move';\n }\n // cancel the default browser behaviour\n // doing this will tell the browser that we have handled the drop\n event.preventDefault();\n}\nvar unbindEvents = null;\n\n/**\n * Block drag operations outside of `@atlaskit/pragmatic-drag-and-drop`\n */\nfunction start() {\n cleanup();\n unbindEvents = bindAll(window, [{\n type: 'dragover',\n listener: acceptDrop\n }, {\n type: 'dragenter',\n listener: acceptDrop\n }, {\n type: 'drop',\n listener: function listener(event) {\n // our lifecycle manager already prevents events, but just being super safe\n event.preventDefault();\n\n // not setting dropEffect, as `drop.dropEffect` has already been published to the user\n // (lifecycle-manager binds events in the capture phase)\n\n // we don't need to wait for \"dragend\", and \"dragend\" might not even happen,\n // such as when the draggable has been removed during a drag.\n cleanup();\n }\n }, {\n type: 'dragend',\n listener: cleanup\n }].concat(_toConsumableArray(getBindingsForBrokenDrags({\n onDragEnd: cleanup\n }))),\n // being clear that these are added in the bubble phase\n {\n capture: false\n });\n}\nfunction cleanup() {\n var _unbindEvents;\n (_unbindEvents = unbindEvents) === null || _unbindEvents === void 0 || _unbindEvents();\n unbindEvents = null;\n}\n\n/**\n * TODO: for next major, we could look at do the following:\n *\n * ```diff\n * - preventUnhandled.start();\n * - preventUnhandled.stop();\n * + const stop = preventUnhandled();\n * ```\n */\n\nfunction stop() {\n var _window$event;\n /**\n * if `stop()` is called in a `\"drop\"` event, then `event.preventDefault()` won't be called.\n * Our `\"drop\"` listener calls `event.preventDefault()` for handled drop events\n * (\"drop\" events caused by dropping over a drop target)\n * `preventUnhandled()` causes every element to become a drop target (according to the browser)\n *\n * To opt out of the default behaviour for a `\"drop\"` event, we need to make sure\n * that we cancel it.\n *\n * The `\"drop\"` event listener in core is in the `capture` phase, so people calling\n * `preventUnhandled.stop()` in `onDrop()` will remove the `\"drop\"` event listener in this\n * file before it has the chance to cancel the event.\n *\n * Being sneaky and using the `window.event` global to sniff out the current event\n */\n if (((_window$event = window.event) === null || _window$event === void 0 ? void 0 : _window$event.type) === 'drop') {\n var _window$event2;\n (_window$event2 = window.event) === null || _window$event2 === void 0 || _window$event2.preventDefault();\n }\n cleanup();\n}\nexport var preventUnhandled = {\n start: start,\n stop: stop\n};","import {autoScrollForElements, autoScrollWindowForElements} from '@atlaskit/pragmatic-drag-and-drop-auto-scroll/element';\nimport {\n draggable,\n dropTargetForElements,\n} from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\nimport {disableNativeDragPreview} from '@atlaskit/pragmatic-drag-and-drop/element/disable-native-drag-preview';\nimport {preventUnhandled} from '@atlaskit/pragmatic-drag-and-drop/prevent-unhandled';\nimport type Alpine from 'alpinejs';\n\nimport {INTERACTION_TREATMENTS, SELECTION_COLORS} from '@client/components/common';\nimport {motion, resolveMotionRole, type Controller} from '@client/motion';\nimport {createAlpineMachine} from '@client/runtime/alpine-machine';\nimport {bool, defineProps, json, number, oneOf, string, type SchemaToProps} from '@client/runtime/codecs';\nimport {registerDomInvalidationOwner} from '@client/runtime/dom-invalidation';\nimport {stableIdentity} from '@client/runtime/identity';\nimport {focusElement} from '@client/runtime/focus';\nimport {declareMorphAttributes} from '@client/runtime/morph';\nimport {defineHook} from '@client/runtime/transition-coordinator';\nimport {bindDragEffectAllowed, currentDragInput, initialDragInput, type ElementDragEvent} from '@client/runtime/drag-and-drop/pdd';\nimport {prepareSortableDrop} from '@client/runtime/drag-and-drop/sortable/registry';\nimport {\n createSortableGhost,\n createSortableSourceMachine,\n activateSortableCursor,\n frameFromRect,\n isSameSortablePlacement,\n isValidGridColumns,\n projectSortablePlacement,\n projectSortableReorderLayout,\n resolveSortableDropFrame,\n resolveSortableReorderOffsets,\n resolveSortableIndicatorFrame,\n resolveSortablePlacement,\n resolveSortableReorderPlacement,\n createSortableRegistry,\n type SortableRegistry,\n type SortableGroup,\n type SortableIndicatorFrame,\n type SortableResolvedPlacement,\n type SortableReorderLayout,\n type SortableReorderOffset,\n type SortableCancelReason,\n type SortableCanDropContext,\n type SortableSource,\n} from '@client/runtime/drag-and-drop/sortable';\nimport {dispatch, warn} from '@client/utils';\n\nconst GROUP_SELECTOR = '[data-ui-sortable]';\nconst ITEM_SELECTOR = '[data-ui-sortable-item]';\nconst SOURCE_SELECTOR = '[data-ui-sortable-source]';\nconst HANDLE_SELECTOR = '[x-ui-sortable\\\\:handle], [data-ui-sortable-handle]';\nconst PREVIEW_SELECTOR = '[x-ui-sortable\\\\:preview], [data-ui-sortable-preview]';\nconst INDICATOR_SELECTOR = '[x-ui-sortable\\\\:indicator], [data-ui-sortable-indicator]';\nconst MARKER = 'ui-sortable';\nconst INDICATOR_THICKNESS = 2;\nconst INTERACTIVE_SELECTOR = 'a, button, input, select, textarea, summary, [contenteditable], [role=\"button\"], [role=\"link\"]';\n\nconst groupSchema = {\n sortableScope: string.trim,\n sortableId: string.trim,\n orientation: oneOf(['vertical', 'horizontal', 'grid'] as const, 'vertical'),\n columns: number.default(0),\n accepts: json.array<string>([]),\n disabled: bool,\n readonly: bool,\n feedback: oneOf(['indicator', 'reorder'] as const, 'indicator'),\n sourceOpacity: number.clamp(0, 1).default(0.4),\n ghostOpacity: number.clamp(0, 1).default(0.92),\n dragCursor: string.trim.default('default'),\n previewPosition: string.trim.default('preserve'),\n color: oneOf(SELECTION_COLORS, 'neutral'),\n interaction: oneOf(INTERACTION_TREATMENTS, 'edge'),\n label: string.trim,\n sortableData: json.object<Record<string, unknown>>({}),\n};\nconst sourceSchema = {\n sortableScope: string.trim,\n sortableId: string.trim,\n sortableType: string.trim,\n label: string.trim,\n disabled: bool,\n sortableData: json.object<Record<string, unknown>>({}),\n sourceOpacity: number.clamp(0, 1).default(0.4),\n ghostOpacity: number.clamp(0, 1).default(0.92),\n dragCursor: string.trim.default('default'),\n previewPosition: string.trim.default('12px 12px'),\n color: oneOf(SELECTION_COLORS, 'neutral'),\n interaction: oneOf(INTERACTION_TREATMENTS, 'edge'),\n};\ntype SourceProps = SchemaToProps<typeof sourceSchema>;\ntype SourceTransitionContext = {data: Record<string, unknown>};\ntype PlacingTransitionData = Readonly<{\n operationId: number;\n source: SortableSource;\n previous: SortableResolvedPlacement | null;\n placement: SortableResolvedPlacement;\n feedback: 'indicator' | 'reorder';\n offsets: readonly SortableReorderOffset[];\n indicatorFrame: SortableIndicatorFrame | null;\n noop: boolean;\n}>;\ntype CanDropPolicy = (context: SortableCanDropContext) => boolean;\nconst startingHook = defineHook<SourceTransitionContext, SourceProps, Record<string, unknown>, 'starting'>({\n name: 'starting', state: 'interaction.starting', project: ({context}) => context.data,\n onDone: 'STARTING_DONE', onError: 'STARTING_DONE',\n});\nconst placingHook = defineHook<SourceTransitionContext, SourceProps, PlacingTransitionData, 'placing'>({\n name: 'placing', state: 'layout.placing', project: ({context}) => context.data as PlacingTransitionData,\n onDone: 'PLACING_DONE', onError: 'PLACING_DONE',\n});\nconst endingHook = defineHook<SourceTransitionContext, SourceProps, Record<string, unknown>, 'ending'>({\n name: 'ending', state: 'interaction.ending', project: ({context}) => context.data,\n onDone: 'ENDING_DONE', onError: 'ENDING_DONE',\n});\nconst sourceHooks = [startingHook, placingHook, endingHook] as const;\n\ntype GroupController = {\n el: HTMLElement;\n group(): SortableGroup;\n itemIds(): readonly string[];\n indicator(): HTMLElement | null;\n refresh(): void;\n};\ntype GroupLayoutSnapshot = Readonly<{\n controller: GroupController;\n layout: SortableReorderLayout;\n}>;\ntype ReorderProjection = {\n baseline: string;\n target: string;\n motion: Controller<{translate: string}>;\n};\ntype SourceController = {\n el: HTMLElement;\n owner(): HTMLElement | null;\n source(): SortableSource;\n disabled(): boolean;\n appearance(): Readonly<{\n sourceOpacity: number;\n ghostOpacity: number;\n dragCursor: string;\n previewPosition: string;\n color: typeof SELECTION_COLORS[number];\n interaction: typeof INTERACTION_TREATMENTS[number];\n }>;\n refresh(): void;\n machine: ReturnType<typeof createAlpineMachine<SourceTransitionContext, typeof sourceSchema, typeof sourceHooks>>;\n};\n\ntype SortableDragOperation = {\n readonly id: number;\n phase: 'dragging' | 'ending';\n controller: SourceController;\n source: SortableSource;\n ghost: ReturnType<typeof createSortableGhost>;\n placement: SortableResolvedPlacement | null;\n group: GroupController | null;\n layouts: ReadonlyMap<string, GroupLayoutSnapshot>;\n projections: Map<HTMLElement, ReorderProjection>;\n input: Readonly<{clientX: number; clientY: number}>;\n timestamp: number;\n restoreCursor: () => void;\n previousOpacity: string;\n settled: boolean;\n endSent: boolean;\n terminalData: Record<string, unknown> | null;\n};\n\nconst createSortableSession = (\n registry: SortableRegistry,\n mutateSortableDom: (callback: () => void) => void,\n) => {\n// Session state is isolated per Alpine registration. PDD prevention, cursor, ghost, and window scrolling remain\n// primitives of the current document realm, matching the supported one-runtime-owner-per-document path.\nlet operationSequence = 0;\nconst groups = new WeakMap<HTMLElement, GroupController>();\nconst groupControllers = new Set<GroupController>();\nconst canDropPolicies = new WeakMap<HTMLElement, CanDropPolicy>();\nlet active: SortableDragOperation | null = null;\nlet registrationCount = 0;\nlet windowAutoScrollCleanup: (() => void) | null = null;\n\nconst retainWindowAutoScroll = (): (() => void) => {\n registrationCount += 1;\n windowAutoScrollCleanup ??= autoScrollWindowForElements();\n return () => {\n registrationCount -= 1;\n if (registrationCount !== 0) return;\n windowAutoScrollCleanup?.();\n windowAutoScrollCleanup = null;\n };\n};\n\nconst directOwner = (element: Element, selector: string): HTMLElement | null => element.closest<HTMLElement>(selector);\nconst directItems = (group: HTMLElement): HTMLElement[] => [...group.querySelectorAll<HTMLElement>(ITEM_SELECTOR)]\n .filter((item) => directOwner(item.parentElement ?? item, GROUP_SELECTOR) === group);\nconst sortableIdentity = (element: HTMLElement, explicit = element.dataset.sortableId): string => (\n stableIdentity(element, explicit) ?? ''\n);\n\nconst captureLayout = (controller: GroupController): GroupLayoutSnapshot => {\n const group = controller.group();\n const items = directItems(controller.el);\n return {\n controller,\n layout: {\n groupId: group.id,\n orientation: group.orientation,\n direction: getComputedStyle(controller.el).direction === 'rtl' ? 'rtl' : 'ltr',\n columns: group.columns,\n groupRect: controller.el.getBoundingClientRect(),\n items: items.map((item) => ({\n id: sortableIdentity(item),\n rect: item.getBoundingClientRect(),\n })),\n },\n };\n};\n\nconst currentLayout = (snapshot: GroupLayoutSnapshot): SortableReorderLayout => {\n const group = snapshot.controller.group();\n const groupRect = snapshot.controller.el.getBoundingClientRect();\n const x = groupRect.left - snapshot.layout.groupRect.left;\n const y = groupRect.top - snapshot.layout.groupRect.top;\n const move = (rect: SortableReorderLayout['groupRect']) => ({\n left: rect.left + x, right: rect.right + x,\n top: rect.top + y, bottom: rect.bottom + y,\n width: rect.width, height: rect.height,\n });\n return {\n ...snapshot.layout,\n orientation: group.orientation,\n columns: group.columns,\n groupRect,\n items: snapshot.layout.items.map((item) => ({...item, rect: move(item.rect)})),\n };\n};\n\nconst animateProjection = (element: HTMLElement, state: ReorderProjection, target: string): void => {\n if (state.target === target) return;\n state.target = target;\n state.motion.animate({translate: target}, resolveMotionRole(element, 'layout'));\n};\n\nconst clearRejectedTargets = (hovered: HTMLElement | null = null): void => {\n groupControllers.forEach(({el}) => {\n if (el !== hovered) el.removeAttribute('data-drag-rejected');\n });\n};\n\nconst applyReorderProjection = (offsets: readonly SortableReorderOffset[]): void => {\n const current = active;\n if (!current) return;\n const projected = new Map<HTMLElement, Readonly<{x: number; y: number; group: GroupController}>>();\n offsets.forEach(({groupId, id, x, y}) => {\n const snapshot = current.layouts.get(groupId);\n const element = snapshot && directItems(snapshot.controller.el)\n .find((item) => sortableIdentity(item) === id);\n if (!element) return;\n projected.set(element, {x, y, group: snapshot.controller});\n });\n current.projections.forEach((state, element) => {\n if (projected.has(element)) return;\n animateProjection(element, state, state.baseline);\n element.removeAttribute('data-reordering');\n });\n const activeGroups = new Set<GroupController>();\n projected.forEach(({x, y, group}, element) => {\n let state = current.projections.get(element);\n if (!state) {\n const baseline = element.style.translate && element.style.translate !== 'none'\n ? element.style.translate : '0px 0px';\n const controller = motion.createController({\n values: {translate: baseline},\n style: ({translate}) => ({translate}),\n });\n controller.mount(element);\n element.setAttribute('data-ui-sortable-projection', '');\n state = {baseline, target: baseline, motion: controller};\n current.projections.set(element, state);\n }\n const translate = `${x}px ${y}px`;\n animateProjection(element, state, translate);\n element.setAttribute('data-reordering', '');\n activeGroups.add(group);\n });\n groupControllers.forEach((controller) => controller.el.toggleAttribute('data-reordering', activeGroups.has(controller)));\n};\n\nconst setIndicator = (\n controller: GroupController,\n placement: SortableResolvedPlacement | null,\n operation?: string,\n frame: SortableIndicatorFrame | null = null,\n): void => {\n const indicator = controller.indicator();\n if (!indicator) return;\n if (!placement || !frame) {\n indicator.hidden = true;\n return;\n }\n Object.assign(indicator.style, {position: 'absolute', left: '0', top: '0'});\n indicator.hidden = false;\n const edge = placement.anchor?.edge ?? 'empty';\n const offsetParent = indicator.offsetParent;\n const offsetRect = offsetParent instanceof Element\n ? offsetParent.getBoundingClientRect()\n : {left: -window.scrollX, top: -window.scrollY};\n const scrollLeft = offsetParent instanceof HTMLElement ? offsetParent.scrollLeft : 0;\n const scrollTop = offsetParent instanceof HTMLElement ? offsetParent.scrollTop : 0;\n const inlineBoundary = frame.kind === 'inline-boundary';\n const blockBoundary = frame.kind === 'block-boundary';\n const x = frame.x - offsetRect.left + scrollLeft - (inlineBoundary ? INDICATOR_THICKNESS / 2 : 0);\n const y = frame.y - offsetRect.top + scrollTop - (blockBoundary ? INDICATOR_THICKNESS / 2 : 0);\n Object.assign(indicator.style, {\n transform: `translate3d(${x}px, ${y}px, 0)`,\n width: `${inlineBoundary ? INDICATOR_THICKNESS : frame.width}px`,\n height: `${blockBoundary ? INDICATOR_THICKNESS : frame.height}px`,\n pointerEvents: 'none',\n zIndex: '2147483646',\n });\n indicator.dataset.orientation = controller.group().orientation;\n indicator.dataset.edge = edge;\n indicator.dataset.index = String(placement.index);\n indicator.dataset.operation = operation ?? '';\n indicator.dataset.indicatorKind = frame.kind;\n};\n\nconst clearActiveGroupSurface = (): void => {\n if (!active?.group) return;\n active.group.el.removeAttribute('data-drag-over');\n active.group.el.removeAttribute('data-drop-edge');\n active.group.el.removeAttribute('data-drop-effect');\n active.group.el.removeAttribute('data-drop-noop');\n active.group.el.removeAttribute('data-placing');\n setIndicator(active.group, null);\n active.group = null;\n};\n\nconst clearActiveGroup = (): void => {\n if (!active) return;\n active.projections.forEach((state, element) => {\n state.motion.destroy();\n element.removeAttribute('data-ui-sortable-projection');\n element.removeAttribute('data-reordering');\n });\n active.projections.clear();\n groupControllers.forEach(({el}) => el.removeAttribute('data-reordering'));\n clearActiveGroupSurface();\n active.placement = null;\n};\n\nconst sameOrder = (left: readonly string[], right: readonly string[]): boolean => (\n left.length === right.length && left.every((id, index) => id === right[index])\n);\n\nconst scheduleAcceptedReorderPromotion = (): void => {\n const current = active;\n const placement = current?.placement;\n const destination = current?.group;\n const source = current?.controller.el;\n const sourceSnapshot = current?.source.groupId === null\n ? null\n : current?.layouts.get(current.source.groupId) ?? null;\n const destinationSnapshot = placement\n ? current?.layouts.get(placement.destination.groupId) ?? null\n : null;\n if (\n !current\n || !placement\n || !destination\n || !source?.isConnected\n || !destinationSnapshot\n || current.source.operation !== 'move'\n || destination.group().feedback !== 'reorder'\n ) return;\n\n const activeItemIds = new Set(\n [...current.layouts.values()].flatMap(({controller}) => (\n directItems(controller.el)\n .filter((item) => item.getAttribute('data-active') === 'true')\n .map((item) => sortableIdentity(item))\n )),\n );\n const focusedItemId = [...current.layouts.values()].flatMap(({controller}) => directItems(controller.el))\n .find((item) => item === document.activeElement || item.contains(document.activeElement))\n ?.dataset.sortableId;\n const restoreInteractionState = (): void => {\n current.layouts.forEach(({controller}) => {\n directItems(controller.el).forEach((item) => {\n if (activeItemIds.has(sortableIdentity(item))) item.setAttribute('data-active', 'true');\n else item.removeAttribute('data-active');\n });\n });\n if (!focusedItemId) return;\n const focusedItem = [...current.layouts.values()]\n .flatMap(({controller}) => directItems(controller.el))\n .find((item) => sortableIdentity(item) === focusedItemId);\n focusElement(focusedItem ?? null);\n };\n const sourceOrder = sourceSnapshot?.layout.items.map(({id}) => id) ?? [];\n const destinationOrder = destinationSnapshot.layout.items.map(({id}) => id);\n queueMicrotask(() => {\n if (\n operationSequence !== current.id\n || (active !== null && active !== current)\n || !source.isConnected\n || !destination.el.isConnected\n ) return;\n const sourceChanged = sourceSnapshot\n ? !sameOrder(sourceSnapshot.controller.itemIds(), sourceOrder)\n : false;\n const destinationChanged = !sameOrder(destination.itemIds(), destinationOrder);\n // A reactive handler or morph already owns this commit. Moving its keyed nodes again can corrupt its DOM index.\n if (!sourceChanged && !destinationChanged) {\n mutateSortableDom(() => {\n const anchorId = placement.anchor?.id;\n if (anchorId) {\n const anchor = directItems(destination.el)\n .find((item) => sortableIdentity(item) === anchorId);\n if (!anchor?.parentNode) return;\n anchor.parentNode.insertBefore(\n source,\n placement.anchor?.edge === 'after' ? anchor.nextSibling : anchor,\n );\n return;\n }\n\n const indicator = destination.indicator();\n if (indicator?.parentNode) indicator.parentNode.insertBefore(source, indicator);\n else destination.el.append(source);\n });\n }\n restoreInteractionState();\n });\n};\n\nconst settle = (operation: SortableDragOperation): void => {\n if (operation.settled) return;\n operation.settled = true;\n operation.ghost.remove();\n if (active === operation) active = null;\n};\n\nconst sendEnd = (operation: SortableDragOperation): void => {\n if (active !== operation || operation.settled || operation.endSent || !operation.terminalData) return;\n operation.endSent = true;\n operation.controller.machine.send({type: 'END', data: operation.terminalData});\n};\n\nconst finish = (\n outcome: 'drop' | 'cancel',\n reason: SortableCancelReason = 'outside',\n operation: SortableDragOperation | null = active,\n options: Readonly<{\n placement?: SortableResolvedPlacement;\n dispatchTerminalEvent?: () => void;\n }> = {},\n): void => {\n const current = operation;\n if (!current || active !== current || current.phase !== 'dragging') return;\n current.phase = 'ending';\n preventUnhandled.stop();\n const placement = options.placement ?? current.placement;\n const sourceSnapshot = current.source.groupId === null ? null : current.layouts.get(current.source.groupId) ?? null;\n const destinationSnapshot = placement ? current.layouts.get(placement.destination.groupId) ?? null : null;\n const targetSlot = outcome === 'drop' && placement && destinationSnapshot\n ? resolveSortableDropFrame({\n source: current.source,\n placement,\n sourceLayout: sourceSnapshot ? currentLayout(sourceSnapshot) : null,\n destinationLayout: currentLayout(destinationSnapshot),\n })\n : null;\n const targetFrame = targetSlot\n ? {x: targetSlot.left, y: targetSlot.top, width: targetSlot.width, height: targetSlot.height}\n : frameFromRect(current.controller.el.getBoundingClientRect());\n if (outcome === 'drop') scheduleAcceptedReorderPromotion();\n clearActiveGroup();\n current.controller.el.removeAttribute('data-dragging');\n current.controller.el.removeAttribute('data-drag-operation');\n current.controller.el.removeAttribute('data-sortable-phase');\n current.controller.el.style.opacity = current.previousOpacity;\n current.restoreCursor();\n clearRejectedTargets();\n const fromFrame = current.ghost.frame();\n current.terminalData = {\n operationId: current.id,\n outcome,\n source: current.source,\n placement: outcome === 'drop' ? placement : null,\n ...(outcome === 'cancel' ? {reason} : {}),\n fromFrame,\n toFrame: targetFrame ?? fromFrame,\n fromTransform: current.ghost.positioner.style.transform,\n toTransform: targetFrame\n ? `translate3d(${targetFrame.x}px, ${targetFrame.y}px, 0)`\n : current.ghost.positioner.style.transform,\n };\n if (outcome === 'cancel') dispatch({\n el: current.controller.el,\n name: 'ui:sortable-cancel',\n composed: true,\n detail: Object.freeze({source: current.source, reason}),\n });\n options.dispatchTerminalEvent?.();\n if (active !== current || current.settled) return;\n sendEnd(current);\n};\n\nconst forceSettle = (operation: SortableDragOperation): void => {\n if (active !== operation) return;\n if (operation.phase === 'dragging') finish('cancel', 'outside', operation);\n if (active !== operation || operation.settled) return;\n sendEnd(operation);\n if (active !== operation || operation.settled) return;\n operation.controller.machine.send('ENDING_DONE');\n settle(operation);\n};\n\nconst updatePlacement = (\n controller: GroupController,\n input: {clientX: number; clientY: number},\n): void => {\n if (!active) return;\n const previous = active.placement;\n const destinationChanged = active.group !== controller;\n if (destinationChanged) clearActiveGroupSurface();\n const group = controller.group();\n const feedback = active.source.operation === 'insert' ? 'indicator' : group.feedback;\n const layoutSnapshot = active.layouts.get(group.id);\n const layout = layoutSnapshot ? currentLayout(layoutSnapshot) : captureLayout(controller).layout;\n // Same-group rows occupy their projected slots after a swap. Use those\n // midpoint thresholds without measuring an animation while it is running.\n const placementLayout = feedback === 'reorder' && group.id === active.source.groupId\n && previous?.destination.groupId === group.id\n ? projectSortableReorderLayout(layout, resolveSortableReorderOffsets({\n source: active.source, placement: previous, sourceLayout: layout,\n }))\n : layout;\n const items = placementLayout.items;\n const itemIds = items.map(({id}) => id);\n const sourceId = active.source.id;\n const placementItems = feedback === 'reorder' && group.id === active.source.groupId\n ? items.filter(({id}) => id !== sourceId)\n : items;\n const geometry = {\n groupId: group.id,\n orientation: group.orientation,\n direction: layout.direction,\n columns: group.columns,\n groupRect: layout.groupRect,\n items: placementItems,\n } as const;\n const ghostFrame = active.ghost.projectedSourceFrame(input);\n const placementInput = feedback !== 'reorder' ? input : {\n clientX: group.orientation === 'vertical' ? input.clientX : ghostFrame.x + ghostFrame.width / 2,\n clientY: group.orientation === 'horizontal' ? input.clientY : ghostFrame.y + ghostFrame.height / 2,\n };\n const rawPlacement = (feedback === 'reorder'\n ? resolveSortableReorderPlacement\n : resolveSortablePlacement)({\n ...geometry,\n input: placementInput,\n });\n const indicatorFrame = feedback === 'indicator'\n ? resolveSortableIndicatorFrame({...geometry, items}, rawPlacement)\n : null;\n const placement = feedback !== 'reorder' ? projectSortablePlacement({\n placement: rawPlacement, sourceId: active.source.id, sourceGroupId: active.source.groupId, itemIds,\n }) : rawPlacement;\n controller.el.setAttribute('data-drag-over', '');\n if (!destinationChanged && isSameSortablePlacement(previous, placement)) return;\n const sourceSnapshot = active.source.groupId === null ? null : active.layouts.get(active.source.groupId) ?? null;\n const destinationSnapshot = active.layouts.get(group.id);\n const noop = registry.isNoop(active.source, {\n destination: placement.destination,\n anchor: placement.anchor,\n });\n const offsets = feedback === 'reorder' && !noop ? resolveSortableReorderOffsets({\n source: active.source,\n placement,\n sourceLayout: sourceSnapshot ? currentLayout(sourceSnapshot) : null,\n destinationLayout: destinationSnapshot ? currentLayout(destinationSnapshot) : null,\n }) : [];\n active.group = controller;\n active.placement = placement;\n controller.el.dataset.dropEdge = placement.anchor?.edge ?? 'empty';\n controller.el.dataset.dropEffect = active.source.operation === 'insert' ? 'copy' : 'move';\n controller.el.toggleAttribute('data-drop-noop', noop);\n active.controller.el.dataset.sortablePhase = 'placing';\n controller.el.setAttribute('data-placing', '');\n if (feedback === 'reorder' && !noop) {\n applyReorderProjection(offsets);\n setIndicator(controller, null);\n } else {\n applyReorderProjection([]);\n setIndicator(controller, noop ? null : placement, active.source.operation, indicatorFrame);\n }\n dispatch({\n el: controller.el,\n name: 'ui:sortable-placement-change',\n composed: true,\n detail: Object.freeze({source: active.source, previous, placement}),\n });\n active.controller.machine.send({\n type: 'LAYOUT_PROPOSED',\n data: {\n operationId: active.id,\n source: active.source,\n previous,\n placement,\n feedback,\n offsets,\n indicatorFrame,\n noop,\n } satisfies PlacingTransitionData,\n });\n};\n\nconst registerGroup = (el: HTMLElement, utilities: Alpine.DirectiveUtilities): void => {\n const releaseWindowAutoScroll = retainWindowAutoScroll();\n el.setAttribute('data-ui-sortable', '');\n declareMorphAttributes(\n el,\n 'data-ui-sortable',\n 'data-drop-target-for-element',\n 'data-auto-scrollable',\n );\n let refresh = (): void => undefined;\n const props = defineProps({el, schema: groupSchema, onChange: () => refresh()});\n const controller: GroupController = {\n el,\n group: () => Object.freeze({\n scopeId: props.sortableScope, id: sortableIdentity(el, props.sortableId), orientation: props.orientation,\n columns: props.orientation === 'grid' ? props.columns : null, accepts: props.accepts,\n disabled: props.disabled, readOnly: props.readonly, ...(props.label ? {label: props.label} : {}),\n feedback: props.feedback, sourceOpacity: props.sourceOpacity, ghostOpacity: props.ghostOpacity,\n dragCursor: props.dragCursor,\n previewPosition: props.previewPosition, color: props.color, interaction: props.interaction,\n ...(Object.keys(props.sortableData).length ? {data: Object.freeze({...props.sortableData})} : {}),\n }),\n itemIds: () => directItems(el).map((item) => sortableIdentity(item)).filter(Boolean),\n indicator: () => [...el.querySelectorAll<HTMLElement>(INDICATOR_SELECTOR)]\n .find((item) => directOwner(item.parentElement ?? item, GROUP_SELECTOR) === el) ?? null,\n refresh: () => refresh(),\n };\n if (!props.sortableScope || !controller.group().id || props.accepts.length === 0) warn('Invalid sortable group props', el);\n if (props.orientation === 'grid' && !isValidGridColumns(props.columns)) warn('Grid sortable groups require positive data-columns', el);\n groups.set(el, controller);\n groupControllers.add(controller);\n const registration = registry.registerGroup({\n element: el,\n getGroup: controller.group,\n getItemIds: controller.itemIds,\n canDrop: (context) => canDropPolicies.get(el)?.(context) !== false,\n });\n refresh = () => {\n if (active?.group === controller) finish('cancel', 'removed');\n registration.refresh();\n };\n const unregisterInvalidationOwner = registerDomInvalidationOwner(el, {\n invalidateDom: controller.refresh,\n });\n const cleanupTarget = dropTargetForElements({\n element: el,\n canDrop: ({source, input}) => {\n const current = active;\n const relevant = source.data.marker === MARKER && current !== null;\n const accepted = relevant && registry.canDrop(current.source, controller.group().id, {\n clientX: input.clientX,\n clientY: input.clientY,\n });\n el.toggleAttribute('data-drag-rejected', relevant && !accepted);\n return accepted;\n },\n getDropEffect: () => 'move',\n onDrop: () => {\n const operation = active;\n const placement = operation?.placement;\n if (!operation || operation.group !== controller || !placement) return;\n const group = controller.group();\n const prepared = prepareSortableDrop(registry, operation.source, {\n destination: placement.destination,\n anchor: placement.anchor,\n }, operation.input);\n if (!prepared) {\n finish('cancel', group.disabled || group.readOnly ? 'disabled' : 'outside', operation);\n return;\n }\n finish('drop', 'outside', operation, {\n placement: prepared.placement,\n dispatchTerminalEvent: prepared.commit,\n });\n },\n });\n const cleanupScroll = autoScrollForElements({element: el});\n utilities.cleanup(() => {\n const operation = active;\n if (\n operation?.phase === 'dragging'\n && (operation.group === controller || operation.layouts.get(controller.group().id)?.controller === controller)\n ) finish('cancel', 'removed', operation);\n cleanupScroll();\n cleanupTarget();\n unregisterInvalidationOwner();\n registration();\n props.disconnect();\n groups.delete(el);\n groupControllers.delete(controller);\n el.removeAttribute('data-drag-rejected');\n releaseWindowAutoScroll();\n });\n};\n\nconst registerSource = (el: HTMLElement, role: 'item' | 'source', utilities: Alpine.DirectiveUtilities): void => {\n const releaseWindowAutoScroll = retainWindowAutoScroll();\n const marker = role === 'item' ? 'data-ui-sortable-item' : 'data-ui-sortable-source';\n el.setAttribute(marker, '');\n declareMorphAttributes(el, marker, 'draggable');\n const owner = (): HTMLElement | null => (\n role === 'item' ? directOwner(el.parentElement ?? el, GROUP_SELECTOR) : null\n );\n let controller!: SourceController;\n const machine = createAlpineMachine<SourceTransitionContext, typeof sourceSchema, typeof sourceHooks>({\n schema: sourceSchema,\n hooks: sourceHooks,\n createMachine: ({props}) => createSortableSourceMachine<SourceProps>({\n props,\n effects: {\n resolvePlacement: ({context}) => {\n const current = active;\n const pointer = context.pointer;\n if (!current || current.controller !== controller || current.phase !== 'dragging' || !pointer) return;\n const destination = pointer.destinationId === null\n ? null\n : current.layouts.get(pointer.destinationId)?.controller ?? null;\n if (destination) {\n updatePlacement(destination, pointer.input);\n } else if (current.group?.group().feedback === 'reorder') {\n current.group.el.removeAttribute('data-drag-over');\n } else {\n clearActiveGroup();\n }\n },\n synced: () => {\n if (active?.controller !== controller || active.phase !== 'dragging') return;\n el.removeAttribute('data-sortable-phase');\n active.group?.el.removeAttribute('data-placing');\n },\n complete: ({context}) => {\n const operationId = (context.data as {operationId?: number}).operationId;\n const operation = active;\n if (operation && operation.id === operationId && operation.controller === controller) settle(operation);\n },\n reconcile: () => controller.refresh(),\n },\n }),\n resolveTransitionElement: ({name, data}) => {\n const operationId = (data as {operationId?: number}).operationId;\n const operation = active?.controller === controller\n && (operationId === undefined || active.id === operationId) ? active : null;\n if (name === 'starting') return operation?.ghost.visual as Alpine.ElementWithXAttributes | null;\n if (name === 'placing') return operation?.group?.el as Alpine.ElementWithXAttributes | null;\n return operation?.ghost.positioner as Alpine.ElementWithXAttributes | null;\n },\n });\n machine.connect(el as HTMLElement & Alpine.ElementWithXAttributes);\n const props = (): SourceProps => machine.getCommittedSnapshot().props;\n controller = {\n el,\n owner,\n source: () => {\n const sourceProps = props();\n const groupOwner = owner();\n const group = groupOwner ? groups.get(groupOwner)?.group() : null;\n const details = {\n scopeId: role === 'item' ? group?.scopeId ?? '' : sourceProps.sortableScope,\n id: sortableIdentity(el, sourceProps.sortableId), type: sourceProps.sortableType,\n ...(sourceProps.label ? {label: sourceProps.label} : {}),\n ...(Object.keys(sourceProps.sortableData).length\n ? {data: Object.freeze({...sourceProps.sortableData})}\n : {}),\n };\n return Object.freeze(role === 'item'\n ? {operation: 'move', groupId: group?.id ?? '', ...details}\n : {operation: 'insert', groupId: null, ...details});\n },\n disabled: () => {\n const groupOwner = owner();\n const group = groupOwner ? groups.get(groupOwner)?.group() : null;\n return props().disabled || group?.disabled === true || group?.readOnly === true;\n },\n appearance: () => {\n const sourceProps = props();\n const groupOwner = owner();\n const group = groupOwner ? groups.get(groupOwner)?.group() : null;\n return {\n sourceOpacity: group?.sourceOpacity ?? sourceProps.sourceOpacity,\n ghostOpacity: group?.ghostOpacity ?? sourceProps.ghostOpacity,\n dragCursor: group?.dragCursor ?? sourceProps.dragCursor,\n previewPosition: group?.previewPosition ?? sourceProps.previewPosition,\n color: group?.color ?? sourceProps.color,\n interaction: group?.interaction ?? sourceProps.interaction,\n };\n },\n refresh: () => undefined,\n machine,\n };\n const hasCustomEnding = el.getAttributeNames().some((name) => name === 'x-ui-transition:ending');\n const cleanupDefaultEnding = hasCustomEnding ? () => undefined : machine.onTransition('ending', (transition) => {\n const toFrame = (transition.data as {toFrame?: ReturnType<typeof frameFromRect>}).toFrame ?? null;\n const operationId = (transition.data as {operationId?: number}).operationId;\n const operation = active;\n if (!operation || operation.id !== operationId || operation.controller !== controller) return;\n return operation.ghost.finish(toFrame);\n });\n const initial = controller.source();\n if (!initial.scopeId || !initial.id || !initial.type) warn('Invalid sortable source props', el);\n const registration = registry.registerSource({element: el, getSource: controller.source, isDisabled: controller.disabled});\n controller.refresh = () => {\n if (active?.controller === controller) finish('cancel', 'removed');\n registration.refresh();\n };\n const handle = [...el.querySelectorAll<HTMLElement>(HANDLE_SELECTOR)]\n .find((candidate) => directOwner(candidate, `${ITEM_SELECTOR}, ${SOURCE_SELECTOR}`) === el);\n const preview = [...el.querySelectorAll<HTMLTemplateElement>(PREVIEW_SELECTOR)]\n .find((candidate) => directOwner(candidate, `${ITEM_SELECTOR}, ${SOURCE_SELECTOR}`) === el);\n const updatePointer = (event: ElementDragEvent): void => {\n if (active?.controller !== controller || active.phase !== 'dragging') return;\n const input = currentDragInput(event);\n const destination = event.location.current.dropTargets\n .map(({element}) => element instanceof HTMLElement ? groups.get(element) : undefined)\n .find((candidate) => candidate !== undefined);\n machine.send({\n type: 'POINTER_MOVED',\n pointer: {destinationId: destination?.group().id ?? null, input},\n });\n const hovered = document.elementFromPoint(input.clientX, input.clientY)?.closest<HTMLElement>(GROUP_SELECTOR) ?? null;\n clearRejectedTargets(hovered);\n };\n // PDD owns target dropEffect, but intentionally does not constrain the source effectAllowed.\n // Publish it before PDD's document-level dragstart handler so the browser never advertises copy.\n const cleanupNativeEffect = bindDragEffectAllowed(el, 'move');\n const cleanupDrag = draggable({\n element: el,\n ...(handle ? {dragHandle: handle} : {}),\n canDrag: ({input}) => {\n const target = document.elementFromPoint(input.clientX, input.clientY);\n const interactive = target?.closest(INTERACTIVE_SELECTOR) ?? null;\n return !controller.disabled() && (Boolean(handle) || interactive === null || interactive === el);\n },\n getInitialData: () => {\n const source = controller.source();\n return {marker: MARKER, scopeId: source.scopeId, sortableId: source.id, sortableType: source.type};\n },\n onGenerateDragPreview: disableNativeDragPreview,\n onDragStart: (event) => {\n // A session owns one operation. A later drag synchronously settles an ending predecessor.\n if (active) forceSettle(active);\n preventUnhandled.start();\n const source = controller.source();\n const input = currentDragInput(event);\n const appearance = controller.appearance();\n const ghost = createSortableGhost({\n source: el,\n input: initialDragInput(event),\n preview: preview ?? null,\n previewPosition: preview?.dataset.previewPosition || appearance.previewPosition,\n opacity: appearance.ghostOpacity,\n color: appearance.color,\n interaction: appearance.interaction,\n });\n ghost.move(input);\n const previousOpacity = el.style.opacity;\n el.style.opacity = `${appearance.sourceOpacity}`;\n const restoreCursor = activateSortableCursor(appearance.dragCursor);\n active = {\n id: ++operationSequence,\n phase: 'dragging',\n controller, source, ghost, placement: null, group: null,\n layouts: new Map([...groupControllers].flatMap((groupController) => {\n const group = groupController.group();\n return group.scopeId === source.scopeId\n ? [[group.id, captureLayout(groupController)] as const]\n : [];\n })),\n projections: new Map(), input, timestamp: performance.now(), restoreCursor,\n previousOpacity, settled: false, endSent: false, terminalData: null,\n };\n el.setAttribute('data-dragging', '');\n el.dataset.dragOperation = source.operation;\n dispatch({\n el,\n name: 'ui:sortable-start',\n composed: true,\n detail: Object.freeze({source}),\n });\n machine.send({\n type: 'START',\n data: {\n operationId: active.id,\n source,\n sourceFrame: frameFromRect(el.getBoundingClientRect()),\n ghostFrame: ghost.frame(),\n },\n });\n },\n onDropTargetChange: updatePointer,\n onDrag: (event) => {\n if (active?.controller !== controller) return;\n const input = currentDragInput(event);\n const previousInput = active.input;\n const timestamp = performance.now();\n const elapsed = Math.max(timestamp - active.timestamp, 1);\n active.input = input;\n active.timestamp = timestamp;\n active.ghost.move(input);\n updatePointer(event);\n dispatch({\n el,\n name: 'ui:sortable-drag',\n composed: true,\n detail: Object.freeze({\n source: active.source,\n input: Object.freeze(input),\n previousInput: Object.freeze(previousInput),\n delta: Object.freeze({\n x: input.clientX - previousInput.clientX,\n y: input.clientY - previousInput.clientY,\n }),\n velocity: Object.freeze({\n x: (input.clientX - previousInput.clientX) / elapsed,\n y: (input.clientY - previousInput.clientY) / elapsed,\n }),\n ghostFrame: Object.freeze({...active.ghost.frame()}),\n }),\n });\n },\n onDrop: (event) => {\n if (active?.controller === controller) active.input = currentDragInput(event);\n updatePointer(event);\n const operation = active?.controller === controller ? active : null;\n queueMicrotask(() => {\n if (active === operation && operation?.phase === 'dragging') {\n finish('cancel', controller.disabled() ? 'disabled' : 'outside', operation);\n }\n });\n },\n });\n utilities.cleanup(() => {\n if (active?.controller === controller) {\n const current = active;\n if (current.phase === 'dragging') finish('cancel', 'removed', current);\n forceSettle(current);\n }\n cleanupDrag();\n cleanupNativeEffect();\n cleanupDefaultEnding();\n registration();\n machine.disconnect();\n releaseWindowAutoScroll();\n });\n};\n\nreturn {registerGroup, registerSource, canDropPolicies};\n};\n\nconst registerSortableDirective = (AlpineInstance: Alpine.Alpine): SortableRegistry => {\n AlpineInstance.addInitSelector(() => '[x-ui-sortable], [x-ui-sortable\\\\:item], [x-ui-sortable\\\\:source]');\n const registry = createSortableRegistry();\n const session = createSortableSession(registry, (callback) => AlpineInstance.mutateDom(callback));\n AlpineInstance.directive('ui-sortable', AlpineInstance.skipDuringClone((el, {value, expression}, utilities) => {\n if (!(el instanceof HTMLElement)) return;\n if (!value) session.registerGroup(el, utilities);\n else if (value === 'item' || value === 'source') session.registerSource(el, value, utilities);\n else if (value === 'handle') {\n el.setAttribute('data-ui-sortable-handle', '');\n declareMorphAttributes(el, 'data-ui-sortable-handle');\n }\n else if (value === 'indicator') {\n el.setAttribute('data-ui-sortable-indicator', '');\n declareMorphAttributes(el, 'data-ui-sortable-indicator', 'aria-hidden', 'hidden');\n el.setAttribute('aria-hidden', 'true');\n (el as HTMLElement).hidden = true;\n } else if (value === 'preview') {\n el.setAttribute('data-ui-sortable-preview', '');\n declareMorphAttributes(el, 'data-ui-sortable-preview', 'data-preview-position');\n }\n else if (value === 'can-drop' && expression?.trim()) {\n session.canDropPolicies.set(el, (context) => utilities.evaluate(expression, {scope: {$sortable: context}}) !== false);\n utilities.cleanup(() => session.canDropPolicies.delete(el));\n }\n }));\n return registry;\n};\n\nexport {groupSchema, registerSortableDirective, sourceSchema};\n","import type {Alpine as AlpineType} from 'alpinejs';\n\nimport {registerSortableDirective} from '../directives/sortable';\nimport {createSortableRegistry} from '../runtime/drag-and-drop';\nimport {registerUiSortable} from '../runtime/ui';\n\nconst registered = new WeakSet<AlpineType>();\n\nconst registerSortableCapability = (AlpineInstance: AlpineType): void => {\n if (registered.has(AlpineInstance)) return;\n registered.add(AlpineInstance);\n const registry = registerSortableDirective(AlpineInstance);\n registerUiSortable(AlpineInstance, registry);\n};\n\nexport {createSortableRegistry, registerSortableCapability, registerSortableDirective};\nexport type * from '../runtime/drag-and-drop/sortable';\n"],"x_google_ignoreList":[2,5,6,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56],"mappings":"6pBA+GA,IAAM,EAAsB,GACxB,IAAY,MAAQ,OAAO,UAAU,CAAO,GAAK,EAAU,EC1FzD,EAAyB,EAEzB,IACF,EACA,IACU,IAAS,GAAS,GAC5B,GAAQ,GACL,EAAK,YAAY,UAAY,EAAM,YAAY,SAC/C,EAAK,QAAQ,KAAO,EAAM,QAAQ,IAClC,EAAK,QAAQ,OAAS,EAAM,QAAQ,MACpC,EAAK,QAAU,EAAM,OAGtB,GAAqB,CACvB,QACA,QACA,SAKU,CACV,IAAM,EAAK,EAAI,EAAI,EAAM,EACnB,EAAK,EAAI,EAAI,EAAM,EACnB,EAAgB,EAAK,EAAK,EAAK,EACrC,GAAI,IAAkB,EAAG,OAAO,KAAK,MAAM,EAAM,EAAI,EAAM,EAAG,EAAM,EAAI,EAAM,CAAC,EAC/E,IAAM,EAAW,KAAK,IAAI,EAAG,KAAK,IAAI,IACjC,EAAM,EAAI,EAAM,GAAK,GAAM,EAAM,EAAI,EAAM,GAAK,GACjD,CAAa,CAAC,EAClB,OAAO,KAAK,MAAM,EAAM,GAAK,EAAM,EAAI,EAAW,GAAK,EAAM,GAAK,EAAM,EAAI,EAAW,EAAG,CAC9F,EAEM,EAAsB,GA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
1
+ {"version":3,"file":"capability-sortable-Bl6ng6Hd.js","names":["ownKeys","_objectSpread","isWithin","bind","bindAll","_navigator","start","bindAll","ledger","ownKeys","_objectSpread","_createForOfIteratorHelper","_unsupportedIterableToArray","_arrayLikeToArray","_createForOfIteratorHelper","_unsupportedIterableToArray","_arrayLikeToArray","ownKeys","_objectSpread","bind","_state","ownKeys","_objectSpread","bindAll","getBindingsForBrokenDrags"],"sources":["../../../../../../../../client/src/runtime/drag-and-drop/sortable/contract.ts","../../../../../../../../client/src/runtime/drag-and-drop/sortable/placement.ts","../../../../../../../../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop@2.0.2/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/public-utils/reorder.js","../../../../../../../../client/src/runtime/drag-and-drop/sortable/feedback.ts","../../../../../../../../client/src/runtime/drag-and-drop/sortable/ghost.ts","../../../../../../../../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop-live-region@2.1.0/node_modules/@atlaskit/pragmatic-drag-and-drop-live-region/dist/esm/constants.js","../../../../../../../../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop-live-region@2.1.0/node_modules/@atlaskit/pragmatic-drag-and-drop-live-region/dist/esm/index.js","../../../../../../../../client/src/runtime/drag-and-drop/sortable/registry.ts","../../../../../../../../client/src/runtime/drag-and-drop/sortable/cursor.ts","../../../../../../../../client/src/runtime/drag-and-drop/sortable/source-machine.ts","../../../../../../../../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop@3.1.0/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/honey-pot-fix/honey-pot-data-attribute.js","../../../../../../../../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop@3.1.0/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/honey-pot-fix/is-honey-pot-element.js","../../../../../../../../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop@3.1.0/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/honey-pot-fix/get-element-from-point-without-honey-pot.js","../../../../../../../../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop@3.1.0/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/max-z-index.js","../../../../../../../../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop@3.1.0/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/popover-reset-styles.js","../../../../../../../../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop@3.1.0/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/public-utils/once.js","../../../../../../../../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop@3.1.0/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/supports-popover.js","../../../../../../../../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop@3.1.0/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/honey-pot-fix/make-honey-pot-fix.js","../../../../../../../../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop@3.1.0/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/is-firefox.js","../../../../../../../../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop@3.1.0/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/is-safari.js","../../../../../../../../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop@3.1.0/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/changing-window/is-from-another-window.js","../../../../../../../../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop@3.1.0/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/changing-window/count-events-for-safari.js","../../../../../../../../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop@3.1.0/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/changing-window/is-leaving-window-in-safari.js","../../../../../../../../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop@3.1.0/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/changing-window/is-leaving-window.js","../../../../../../../../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop@3.1.0/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/detect-broken-drag.js","../../../../../../../../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop@3.1.0/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/get-input.js","../../../../../../../../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop@3.1.0/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/ledger/dispatch-consumer-event.js","../../../../../../../../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop@3.1.0/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/ledger/lifecycle-manager.js","../../../../../../../../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop@3.1.0/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/ledger/usage-ledger.js","../../../../../../../../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop@3.1.0/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/public-utils/combine.js","../../../../../../../../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop@3.1.0/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/add-attribute.js","../../../../../../../../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop@3.1.0/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/make-adapter/make-drop-target.js","../../../../../../../../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop@3.1.0/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/make-adapter/make-monitor.js","../../../../../../../../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop@3.1.0/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/make-adapter/make-adapter.js","../../../../../../../../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop@3.1.0/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/android.js","../../../../../../../../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop@3.1.0/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/media-types/text-media-type.js","../../../../../../../../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop@3.1.0/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/media-types/url-media-type.js","../../../../../../../../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop@3.1.0/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/adapter/element-adapter-native-data-key.js","../../../../../../../../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop@3.1.0/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/adapter/element-adapter.js","../../../../../../../../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop-auto-scroll@3.2.0/node_modules/@atlaskit/pragmatic-drag-and-drop-auto-scroll/dist/esm/shared/engagement-history.js","../../../../../../../../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop-auto-scroll@3.2.0/node_modules/@atlaskit/pragmatic-drag-and-drop-auto-scroll/dist/esm/shared/scheduler.js","../../../../../../../../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop-auto-scroll@3.2.0/node_modules/@atlaskit/pragmatic-drag-and-drop-auto-scroll/dist/esm/over-element/data-attributes.js","../../../../../../../../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop-auto-scroll@3.2.0/node_modules/@atlaskit/pragmatic-drag-and-drop-auto-scroll/dist/esm/shared/configuration.js","../../../../../../../../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop-auto-scroll@3.2.0/node_modules/@atlaskit/pragmatic-drag-and-drop-auto-scroll/dist/esm/shared/can-scroll-on-edge.js","../../../../../../../../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop-auto-scroll@3.2.0/node_modules/@atlaskit/pragmatic-drag-and-drop-auto-scroll/dist/esm/shared/edges.js","../../../../../../../../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop-auto-scroll@3.2.0/node_modules/@atlaskit/pragmatic-drag-and-drop-auto-scroll/dist/esm/shared/axis.js","../../../../../../../../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop-auto-scroll@3.2.0/node_modules/@atlaskit/pragmatic-drag-and-drop-auto-scroll/dist/esm/shared/side.js","../../../../../../../../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop-auto-scroll@3.2.0/node_modules/@atlaskit/pragmatic-drag-and-drop-auto-scroll/dist/esm/shared/get-over-element-hitbox.js","../../../../../../../../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop-auto-scroll@3.2.0/node_modules/@atlaskit/pragmatic-drag-and-drop-auto-scroll/dist/esm/shared/get-percentage-in-range.js","../../../../../../../../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop-auto-scroll@3.2.0/node_modules/@atlaskit/pragmatic-drag-and-drop-auto-scroll/dist/esm/shared/get-scroll-change.js","../../../../../../../../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop-auto-scroll@3.2.0/node_modules/@atlaskit/pragmatic-drag-and-drop-auto-scroll/dist/esm/shared/is-axis-allowed.js","../../../../../../../../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop-auto-scroll@3.2.0/node_modules/@atlaskit/pragmatic-drag-and-drop-auto-scroll/dist/esm/shared/is-within.js","../../../../../../../../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop-auto-scroll@3.2.0/node_modules/@atlaskit/pragmatic-drag-and-drop-auto-scroll/dist/esm/over-element/get-scroll-by.js","../../../../../../../../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop-auto-scroll@3.2.0/node_modules/@atlaskit/pragmatic-drag-and-drop-auto-scroll/dist/esm/over-element/try-scroll.js","../../../../../../../../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop-auto-scroll@3.2.0/node_modules/@atlaskit/pragmatic-drag-and-drop-auto-scroll/dist/esm/over-element/make-api.js","../../../../../../../../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop-auto-scroll@3.2.0/node_modules/@atlaskit/pragmatic-drag-and-drop-auto-scroll/dist/esm/entry-point/element.js","../../../../../../../../../node_modules/.pnpm/@atlaskit+pragmatic-drag-and-drop@2.0.2/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/public-utils/prevent-unhandled.js","../../../../../../../../client/src/directives/sortable.ts","../../../../../../../../client/src/capabilities/sortable.ts"],"sourcesContent":["type SortableOperation = 'insert' | 'move';\ntype SortableCancelReason = 'escape' | 'outside' | 'disabled' | 'removed';\ntype SortableOrientation = 'vertical' | 'horizontal' | 'grid';\ntype SortableFeedback = 'indicator' | 'reorder';\ntype SortableColor = 'neutral' | 'accent';\ntype SortableInteraction = 'tonal' | 'edge' | 'combined';\ntype SortableEdge = 'before' | 'after';\ntype SortableDirection = 'ltr' | 'rtl';\n\ntype SortableFrame = Readonly<{\n left: number;\n top: number;\n right: number;\n bottom: number;\n width: number;\n height: number;\n}>;\n\ntype SortableInput = Readonly<{\n clientX: number;\n clientY: number;\n}>;\n\ntype SortableDragDetail = Readonly<{\n source: SortableSource;\n input: SortableInput;\n previousInput: SortableInput;\n delta: Readonly<{x: number; y: number}>;\n velocity: Readonly<{x: number; y: number}>;\n ghostFrame: Readonly<{x: number; y: number; width: number; height: number}>;\n}>;\n\ntype SortableSourceFields = Readonly<{\n scopeId: string;\n id: string;\n type: string;\n label?: string;\n data?: Readonly<Record<string, unknown>>;\n}>;\ntype SortableInsertSource = SortableSourceFields & Readonly<{\n operation: 'insert';\n groupId: null;\n}>;\ntype SortableMoveSource = SortableSourceFields & Readonly<{\n operation: 'move';\n groupId: string;\n}>;\ntype SortableSource = SortableInsertSource | SortableMoveSource;\n\ntype SortableAnchor = Readonly<{\n id: string;\n edge: SortableEdge;\n}>;\n\ntype SortableDropIntent = Readonly<{\n destination: Readonly<{groupId: string}>;\n anchor: SortableAnchor | null;\n index?: never;\n}>;\n\ntype SortableResolvedPlacement = Readonly<{\n destination: Readonly<{groupId: string}>;\n anchor: SortableAnchor | null;\n index: number;\n}>;\n\ntype SortableGroup = Readonly<{\n scopeId: string;\n id: string;\n orientation: SortableOrientation;\n columns: number | null;\n accepts: readonly string[];\n disabled: boolean;\n readOnly: boolean;\n feedback: SortableFeedback;\n sourceOpacity: number;\n ghostOpacity: number;\n dragCursor: string;\n previewPosition: string;\n color: SortableColor;\n interaction: SortableInteraction;\n data?: Readonly<Record<string, unknown>>;\n label?: string;\n}>;\n\ntype SortableCanDropContext = Readonly<{\n source: SortableSource;\n destination: SortableGroup;\n itemIds: readonly string[];\n input: SortableInput | null;\n}>;\n\ntype SortableDropDetail =\n | (SortableResolvedPlacement & Readonly<{operation: 'insert'; source: SortableInsertSource}>)\n | (SortableResolvedPlacement & Readonly<{operation: 'move'; source: SortableMoveSource}>);\n\ntype SortableMoveOptions = Readonly<{\n scope: string;\n sourceId: string;\n destinationGroupId?: string;\n}>;\n\ntype SortableMoveRelativeOptions = SortableMoveOptions & Readonly<{anchorId: string}>;\n\ninterface UiSortableService {\n moveBefore(options: SortableMoveRelativeOptions): boolean;\n moveAfter(options: SortableMoveRelativeOptions): boolean;\n moveToStart(options: SortableMoveOptions & {destinationGroupId: string}): boolean;\n moveToEnd(options: SortableMoveOptions & {destinationGroupId: string}): boolean;\n}\n\nconst isValidGridColumns = (columns: number | null): columns is number => (\n columns !== null && Number.isInteger(columns) && columns > 0\n);\n\ntype SortableItemGeometry = Readonly<{\n id: string;\n rect: SortableFrame;\n}>;\n\ntype ResolveSortablePlacementOptions = Readonly<{\n groupId: string;\n orientation: SortableOrientation;\n direction: SortableDirection;\n columns: number | null;\n groupRect: SortableFrame;\n items: readonly SortableItemGeometry[];\n input: SortableInput;\n}>;\n\nexport type {\n ResolveSortablePlacementOptions,\n SortableAnchor,\n SortableCancelReason,\n SortableColor,\n SortableCanDropContext,\n SortableDirection,\n SortableDragDetail,\n SortableEdge,\n SortableFeedback,\n SortableFrame,\n SortableGroup,\n SortableDropIntent,\n SortableDropDetail,\n SortableInput,\n SortableInteraction,\n SortableInsertSource,\n SortableItemGeometry,\n SortableOperation,\n SortableOrientation,\n SortableResolvedPlacement,\n SortableMoveSource,\n SortableSource,\n SortableMoveOptions,\n SortableMoveRelativeOptions,\n UiSortableService,\n};\n\nexport {isValidGridColumns};\n","import type {\n ResolveSortablePlacementOptions,\n SortableAnchor,\n SortableItemGeometry,\n SortableResolvedPlacement,\n} from './contract';\nimport {isValidGridColumns} from './contract';\n\ntype Boundary = Readonly<{\n anchor: SortableAnchor | null;\n index: number;\n distance(input: ResolveSortablePlacementOptions['input']): number;\n}>;\n\ntype SortableIndicatorFrame = Readonly<{\n x: number;\n y: number;\n width: number;\n height: number;\n kind: 'inline-boundary' | 'block-boundary';\n}>;\n\nconst OUTER_INDICATOR_OFFSET = 4;\n\nconst isSameSortablePlacement = (\n left: SortableResolvedPlacement | null,\n right: SortableResolvedPlacement | null,\n): boolean => left === right || Boolean(\n left && right\n && left.destination.groupId === right.destination.groupId\n && left.anchor?.id === right.anchor?.id\n && left.anchor?.edge === right.anchor?.edge\n && left.index === right.index,\n);\n\nconst distanceToSegment = ({\n point,\n start,\n end,\n}: {\n point: {x: number; y: number};\n start: {x: number; y: number};\n end: {x: number; y: number};\n}): number => {\n const dx = end.x - start.x;\n const dy = end.y - start.y;\n const lengthSquared = dx * dx + dy * dy;\n if (lengthSquared === 0) return Math.hypot(point.x - start.x, point.y - start.y);\n const progress = Math.max(0, Math.min(1, (\n (point.x - start.x) * dx + (point.y - start.y) * dy\n ) / lengthSquared));\n return Math.hypot(point.x - (start.x + progress * dx), point.y - (start.y + progress * dy));\n};\n\nconst verticalBoundaries = (items: readonly SortableItemGeometry[]): Boundary[] => items.length === 0 ? [] : [\n {\n anchor: {id: items[0]!.id, edge: 'before'},\n index: 0,\n distance: (input) => Math.abs(input.clientY - items[0]!.rect.top),\n },\n ...items.slice(1).map((item, index) => {\n const previous = items[index]!;\n const y = (previous.rect.bottom + item.rect.top) / 2;\n return {\n anchor: {id: item.id, edge: 'before'} as const,\n index: index + 1,\n distance: (input: ResolveSortablePlacementOptions['input']) => Math.abs(input.clientY - y),\n };\n }),\n {\n anchor: {id: items.at(-1)!.id, edge: 'after'},\n index: items.length,\n distance: (input) => Math.abs(input.clientY - items.at(-1)!.rect.bottom),\n },\n];\n\nconst horizontalBoundaries = (\n items: readonly SortableItemGeometry[],\n direction: ResolveSortablePlacementOptions['direction'],\n): Boundary[] => {\n if (items.length === 0) return [];\n const inlineStart = (item: SortableItemGeometry): number => (\n direction === 'rtl' ? item.rect.right : item.rect.left\n );\n const inlineEnd = (item: SortableItemGeometry): number => (\n direction === 'rtl' ? item.rect.left : item.rect.right\n );\n return [\n {\n anchor: {id: items[0]!.id, edge: 'before'},\n index: 0,\n distance: (input) => Math.abs(input.clientX - inlineStart(items[0]!)),\n },\n ...items.slice(1).map((item, index) => {\n const previous = items[index]!;\n const x = (inlineEnd(previous) + inlineStart(item)) / 2;\n return {\n anchor: {id: item.id, edge: 'before'} as const,\n index: index + 1,\n distance: (input: ResolveSortablePlacementOptions['input']) => Math.abs(input.clientX - x),\n };\n }),\n {\n anchor: {id: items.at(-1)!.id, edge: 'after'},\n index: items.length,\n distance: (input) => Math.abs(input.clientX - inlineEnd(items.at(-1)!)),\n },\n ];\n};\n\nconst gridBoundaries = ({\n columns,\n direction,\n groupRect,\n items,\n}: Pick<ResolveSortablePlacementOptions, 'columns' | 'direction' | 'groupRect' | 'items'>): Boundary[] => {\n if (!isValidGridColumns(columns)) {\n throw new TypeError('Grid sortable groups require a positive integer columns value.');\n }\n if (items.length === 0) return [];\n\n const inlineStart = (item: SortableItemGeometry): number => (\n direction === 'rtl' ? item.rect.right : item.rect.left\n );\n const inlineEnd = (item: SortableItemGeometry): number => (\n direction === 'rtl' ? item.rect.left : item.rect.right\n );\n const rowItems = (row: number): readonly SortableItemGeometry[] => (\n items.slice(row * columns, (row + 1) * columns)\n );\n const rowTop = (row: number): number => Math.min(...rowItems(row).map((item) => item.rect.top));\n const rowBottom = (row: number): number => Math.max(...rowItems(row).map((item) => item.rect.bottom));\n const verticalBoundary = (\n x: number,\n row: number,\n anchor: SortableAnchor | null,\n index: number,\n ): Boundary => ({\n anchor,\n index,\n distance: (input) => distanceToSegment({\n point: {x: input.clientX, y: input.clientY},\n start: {x, y: rowTop(row)},\n end: {x, y: rowBottom(row)},\n }),\n });\n const horizontalBoundary = (\n y: number,\n anchor: SortableAnchor | null,\n index: number,\n ): Boundary => ({\n anchor,\n index,\n distance: (input) => distanceToSegment({\n point: {x: input.clientX, y: input.clientY},\n start: {x: groupRect.left, y},\n end: {x: groupRect.right, y},\n }),\n });\n\n const boundaries: Boundary[] = [verticalBoundary(\n inlineStart(items[0]!),\n 0,\n {id: items[0]!.id, edge: 'before'},\n 0,\n )];\n\n for (let index = 1; index < items.length; index += 1) {\n const item = items[index]!;\n const previous = items[index - 1]!;\n if (index % columns === 0) {\n const row = index / columns;\n boundaries.push(horizontalBoundary(\n (rowBottom(row - 1) + rowTop(row)) / 2,\n {id: item.id, edge: 'before'},\n index,\n ));\n } else {\n const row = Math.floor(index / columns);\n boundaries.push(verticalBoundary(\n (inlineEnd(previous) + inlineStart(item)) / 2,\n row,\n {id: item.id, edge: 'before'},\n index,\n ));\n }\n }\n\n const lastIndex = items.length - 1;\n const last = items[lastIndex]!;\n const lastRow = Math.floor(lastIndex / columns);\n const finalRowCount = items.length % columns;\n if (finalRowCount === 0) {\n boundaries.push(horizontalBoundary(\n rowBottom(lastRow),\n {id: last.id, edge: 'after'},\n items.length,\n ));\n } else {\n const exemplar = items[finalRowCount];\n const x = exemplar === undefined\n ? inlineEnd(last)\n : (inlineEnd(last) + inlineStart(exemplar)) / 2;\n boundaries.push(verticalBoundary(\n x,\n lastRow,\n {id: last.id, edge: 'after'},\n items.length,\n ));\n }\n\n return boundaries;\n};\n\nconst nearestBoundary = (\n boundaries: readonly Boundary[],\n input: ResolveSortablePlacementOptions['input'],\n): Boundary => boundaries.reduce((nearest, boundary) => (\n boundary.distance(input) < nearest.distance(input) ? boundary : nearest\n));\n\nconst resolveSortablePlacement = (options: ResolveSortablePlacementOptions): SortableResolvedPlacement => {\n if (options.items.length === 0) {\n return {destination: {groupId: options.groupId}, anchor: null, index: 0};\n }\n\n const boundaries = options.orientation === 'horizontal'\n ? horizontalBoundaries(options.items, options.direction)\n : options.orientation === 'grid'\n ? gridBoundaries(options)\n : verticalBoundaries(options.items);\n const boundary = nearestBoundary(boundaries, options.input);\n return {\n destination: {groupId: options.groupId},\n anchor: boundary.anchor,\n index: boundary.index,\n };\n};\n\nconst resolveSortableReorderPlacement = (options: ResolveSortablePlacementOptions): SortableResolvedPlacement => {\n if (options.items.length === 0 || options.orientation === 'grid') {\n return resolveSortablePlacement(options);\n }\n const coordinate = options.orientation === 'vertical'\n ? options.input.clientY\n : options.input.clientX * (options.direction === 'rtl' ? -1 : 1);\n const index = options.items.findIndex(({rect}) => {\n const midpoint = options.orientation === 'vertical'\n ? rect.top + rect.height / 2\n : (rect.left + rect.width / 2) * (options.direction === 'rtl' ? -1 : 1);\n return coordinate < midpoint;\n });\n const insertionIndex = index < 0 ? options.items.length : index;\n const anchor = insertionIndex === options.items.length\n ? {id: options.items.at(-1)!.id, edge: 'after' as const}\n : {id: options.items[insertionIndex]!.id, edge: 'before' as const};\n return {destination: {groupId: options.groupId}, anchor, index: insertionIndex};\n};\n\nconst projectSortablePlacement = ({\n placement,\n sourceId,\n sourceGroupId,\n itemIds,\n}: {\n placement: SortableResolvedPlacement;\n sourceId: string;\n sourceGroupId: string | null;\n itemIds: readonly string[];\n}): SortableResolvedPlacement => {\n if (sourceGroupId !== placement.destination.groupId) return placement;\n const sourceIndex = itemIds.indexOf(sourceId);\n if (sourceIndex < 0) return placement;\n const projectedIds = itemIds.filter((id) => id !== sourceId);\n const index = Math.max(0, Math.min(\n projectedIds.length,\n placement.index > sourceIndex ? placement.index - 1 : placement.index,\n ));\n const anchor = projectedIds.length === 0\n ? null\n : index === projectedIds.length\n ? {id: projectedIds.at(-1)!, edge: 'after' as const}\n : {id: projectedIds[index]!, edge: 'before' as const};\n return {destination: placement.destination, anchor, index};\n};\n\nconst resolveSortableIndicatorFrame = (\n options: Omit<ResolveSortablePlacementOptions, 'input'>,\n placement: SortableResolvedPlacement,\n): SortableIndicatorFrame => {\n const {groupRect, items, orientation, direction} = options;\n if (items.length === 0 || placement.anchor === null) {\n if (orientation === 'horizontal') {\n const x = direction === 'rtl'\n ? groupRect.right - OUTER_INDICATOR_OFFSET\n : groupRect.left + OUTER_INDICATOR_OFFSET;\n return {x, y: groupRect.top, width: 0, height: groupRect.height, kind: 'inline-boundary'};\n }\n return {\n x: groupRect.left,\n y: groupRect.top + OUTER_INDICATOR_OFFSET,\n width: groupRect.width,\n height: 0,\n kind: 'block-boundary',\n };\n }\n const index = placement.index;\n const previous = index > 0 ? items[index - 1] : undefined;\n const next = index < items.length ? items[index] : undefined;\n if (orientation === 'vertical') {\n const y = previous && next ? (previous.rect.bottom + next.rect.top) / 2\n : next ? next.rect.top - OUTER_INDICATOR_OFFSET : previous!.rect.bottom + OUTER_INDICATOR_OFFSET;\n return {x: groupRect.left, y, width: groupRect.width, height: 0, kind: 'block-boundary'};\n }\n const inlineStart = (item: SortableItemGeometry): number => direction === 'rtl' ? item.rect.right : item.rect.left;\n const inlineEnd = (item: SortableItemGeometry): number => direction === 'rtl' ? item.rect.left : item.rect.right;\n if (orientation === 'horizontal') {\n const x = previous && next ? (inlineEnd(previous) + inlineStart(next)) / 2\n : next ? inlineStart(next) + (direction === 'rtl' ? OUTER_INDICATOR_OFFSET : -OUTER_INDICATOR_OFFSET)\n : inlineEnd(previous!) + (direction === 'rtl' ? -OUTER_INDICATOR_OFFSET : OUTER_INDICATOR_OFFSET);\n return {x, y: groupRect.top, width: 0, height: groupRect.height, kind: 'inline-boundary'};\n }\n const columns = options.columns;\n if (!isValidGridColumns(columns)) {\n throw new TypeError('Grid sortable groups require a positive integer columns value.');\n }\n const isRowBoundary = index > 0 && index % columns === 0;\n if (isRowBoundary) {\n const y = next ? (previous!.rect.bottom + next.rect.top) / 2 : previous!.rect.bottom + OUTER_INDICATOR_OFFSET;\n return {x: groupRect.left, y, width: groupRect.width, height: 0, kind: 'block-boundary'};\n }\n let x: number;\n if (previous && next) x = (inlineEnd(previous) + inlineStart(next)) / 2;\n else if (next) x = inlineStart(next) + (direction === 'rtl' ? OUTER_INDICATOR_OFFSET : -OUTER_INDICATOR_OFFSET);\n else {\n const finalRowCount = items.length % columns;\n const exemplar = finalRowCount === 0 ? undefined : items[finalRowCount];\n x = exemplar ? (inlineEnd(previous!) + inlineStart(exemplar)) / 2\n : inlineEnd(previous!) + (direction === 'rtl' ? -OUTER_INDICATOR_OFFSET : OUTER_INDICATOR_OFFSET);\n }\n const rowStart = Math.floor(Math.min(index, items.length - 1) / columns) * columns;\n const row = items.slice(rowStart, rowStart + columns);\n return {\n x,\n y: Math.min(...row.map((item) => item.rect.top)),\n width: 0,\n height: Math.max(...row.map((item) => item.rect.bottom)) - Math.min(...row.map((item) => item.rect.top)),\n kind: 'inline-boundary',\n };\n};\n\nexport {\n distanceToSegment,\n isSameSortablePlacement,\n projectSortablePlacement,\n resolveSortableIndicatorFrame,\n resolveSortablePlacement,\n resolveSortableReorderPlacement,\n};\nexport type {SortableIndicatorFrame};\n","import _slicedToArray from \"@babel/runtime/helpers/slicedToArray\";\n/**\n * A function that will reorder an array (`list`).\n * `reorder` returns a new array with reordered items and does not\n * modify the original array. The items in the array are also not modified.\n */\nexport function reorder(_ref) {\n var list = _ref.list,\n startIndex = _ref.startIndex,\n finishIndex = _ref.finishIndex;\n if (startIndex === -1 || finishIndex === -1) {\n // Making this function consistently return a new array reference.\n // This is consistent with .toSorted() which always returns a new array\n // even when it does not do anything\n return Array.from(list);\n }\n var result = Array.from(list);\n var _result$splice = result.splice(startIndex, 1),\n _result$splice2 = _slicedToArray(_result$splice, 1),\n removed = _result$splice2[0];\n result.splice(finishIndex, 0, removed);\n return result;\n}","import {reorder} from '@atlaskit/pragmatic-drag-and-drop/reorder';\n\nimport type {\n SortableDirection,\n SortableFrame,\n SortableItemGeometry,\n SortableOrientation,\n SortableResolvedPlacement,\n} from './contract';\n\ntype SortableReorderLayout = Readonly<{\n groupId: string;\n orientation: SortableOrientation;\n direction: SortableDirection;\n columns: number | null;\n groupRect: SortableFrame;\n items: readonly SortableItemGeometry[];\n}>;\n\ntype SortableReorderOffset = Readonly<{\n groupId: string;\n id: string;\n x: number;\n y: number;\n}>;\n\nconst translate = (\n groupId: string,\n item: SortableItemGeometry,\n slot: SortableFrame,\n): SortableReorderOffset => ({\n groupId,\n id: item.id,\n x: slot.left - item.rect.left,\n y: slot.top - item.rect.top,\n});\nconst moved = ({x, y}: SortableReorderOffset): boolean => x !== 0 || y !== 0;\n\nconst moveFrame = (frame: SortableFrame, x: number, y: number): SortableFrame => ({\n left: frame.left + x,\n top: frame.top + y,\n right: frame.right + x,\n bottom: frame.bottom + y,\n width: frame.width,\n height: frame.height,\n});\n\nconst nextSlot = (layout: SortableReorderLayout): SortableFrame | null => {\n const {items, orientation, direction, columns} = layout;\n const last = items.at(-1);\n if (!last) return null;\n const previous = items.at(-2);\n if (orientation === 'vertical') {\n const step = previous ? last.rect.top - previous.rect.top : last.rect.height + 8;\n return moveFrame(last.rect, 0, step);\n }\n if (orientation === 'horizontal') {\n const step = previous\n ? last.rect.left - previous.rect.left\n : (last.rect.width + 8) * (direction === 'rtl' ? -1 : 1);\n return moveFrame(last.rect, step, 0);\n }\n if (columns && items.length >= columns) {\n const previousRow = items[items.length - columns]!;\n return moveFrame(previousRow.rect, 0, last.rect.top - previousRow.rect.top || last.rect.height + 8);\n }\n const step = previous\n ? last.rect.left - previous.rect.left\n : (last.rect.width + 8) * (direction === 'rtl' ? -1 : 1);\n return moveFrame(last.rect, step, 0);\n};\n\nconst slotsWithEnd = (layout: SortableReorderLayout): readonly SortableFrame[] => {\n const end = nextSlot(layout);\n return end ? [...layout.items.map(({rect}) => rect), end] : [];\n};\n\nconst projectSortableReorderLayout = (\n layout: SortableReorderLayout,\n offsets: readonly SortableReorderOffset[],\n): SortableReorderLayout => {\n const byItem = new Map(offsets\n .filter(({groupId}) => groupId === layout.groupId)\n .map((offset) => [offset.id, offset]));\n return {\n ...layout,\n items: layout.items.map((item) => {\n const offset = byItem.get(item.id);\n return offset ? {...item, rect: moveFrame(item.rect, offset.x, offset.y)} : item;\n }),\n };\n};\n\nconst resolveSortableDropFrame = ({\n source,\n placement,\n sourceLayout,\n destinationLayout = sourceLayout,\n}: {\n source: Readonly<{id: string; groupId: string | null}>;\n placement: SortableResolvedPlacement;\n sourceLayout: SortableReorderLayout | null;\n destinationLayout?: SortableReorderLayout | null;\n}): SortableFrame | null => {\n if (!destinationLayout) return null;\n const destinationIndex = Math.max(0, Math.min(\n destinationLayout.items.length,\n placement.index,\n ));\n if (source.groupId === destinationLayout.groupId && sourceLayout) {\n return sourceLayout.items[Math.min(destinationIndex, sourceLayout.items.length - 1)]?.rect\n ?? destinationLayout.groupRect;\n }\n return slotsWithEnd(destinationLayout)[destinationIndex] ?? destinationLayout.groupRect;\n};\n\nconst resolveSortableReorderOffsets = ({\n source,\n placement,\n sourceLayout,\n destinationLayout = sourceLayout,\n}: {\n source: Readonly<{id: string; groupId: string | null}>;\n placement: SortableResolvedPlacement;\n sourceLayout: SortableReorderLayout | null;\n destinationLayout?: SortableReorderLayout | null;\n}): readonly SortableReorderOffset[] => {\n if (!destinationLayout) return [];\n const destinationIndex = Math.max(0, Math.min(\n destinationLayout.items.length,\n placement.index,\n ));\n\n if (source.groupId === destinationLayout.groupId && sourceLayout) {\n const sourceIndex = sourceLayout.items.findIndex(({id}) => id === source.id);\n if (sourceIndex < 0) return [];\n const reordered = reorder({list: [...sourceLayout.items], startIndex: sourceIndex, finishIndex: destinationIndex});\n const projectedFramesByItemId = new Map<string, SortableFrame>();\n reordered.forEach((item, index) => {\n const itemId = item.id;\n const projectedFrame = sourceLayout.items[index]?.rect;\n if (projectedFrame && !projectedFramesByItemId.has(itemId)) {\n projectedFramesByItemId.set(itemId, projectedFrame);\n }\n });\n return sourceLayout.items\n .map((item) => {\n const projectedFrame = projectedFramesByItemId.get(item.id);\n return projectedFrame ? translate(sourceLayout.groupId, item, projectedFrame) : null;\n })\n .filter((offset): offset is SortableReorderOffset => offset !== null)\n .filter(moved);\n }\n\n const destinationSlots = slotsWithEnd(destinationLayout);\n const offsets: SortableReorderOffset[] = destinationLayout.items\n .map((item, index) => translate(\n destinationLayout.groupId,\n item,\n destinationSlots[index < destinationIndex ? index : index + 1]!,\n ))\n .filter(moved);\n\n if (!sourceLayout || source.groupId === null) return offsets;\n const sourceIndex = sourceLayout.items.findIndex(({id}) => id === source.id);\n if (sourceIndex < 0) return offsets;\n const sourceItem = sourceLayout.items[sourceIndex]!;\n const sourceOffset = translate(\n sourceLayout.groupId,\n sourceItem,\n destinationSlots[destinationIndex] ?? destinationLayout.groupRect,\n );\n if (moved(sourceOffset)) offsets.push(sourceOffset);\n sourceLayout.items.slice(sourceIndex + 1).forEach((item, index) => {\n offsets.push(translate(sourceLayout.groupId, item, sourceLayout.items[sourceIndex + index]!.rect));\n });\n return offsets;\n};\n\nexport {projectSortableReorderLayout, resolveSortableDropFrame, resolveSortableReorderOffsets};\nexport type {SortableReorderLayout, SortableReorderOffset};\n","import type {SortableColor, SortableInput, SortableInteraction} from './contract';\nimport {motion} from '../../../motion';\n\ntype ManagedGhostFrame = Readonly<{x: number; y: number; width: number; height: number}>;\n\ntype SortablePreviewPositionOptions = Readonly<{\n value: string;\n input: SortableInput;\n initialInput: SortableInput;\n sourceRect: Readonly<{left: number; top: number}>;\n previewSize: Readonly<{width: number; height: number}>;\n}>;\n\nconst PIXEL_OFFSET = /^-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)(?:px)?$/;\n\nconst resolvePreviewAxis = (\n value: string,\n pointer: number,\n size: number,\n start: string,\n end: string,\n): number | null => {\n if (value === start) return pointer;\n if (value === 'center') return pointer - size / 2;\n if (value === end) return pointer - size;\n return PIXEL_OFFSET.test(value) ? pointer + Number.parseFloat(value) : null;\n};\n\nconst resolveSortablePreviewPosition = ({\n value,\n input,\n initialInput,\n sourceRect,\n previewSize,\n}: SortablePreviewPositionOptions): Readonly<{x: number; y: number}> => {\n const preserve = {\n x: input.clientX - (initialInput.clientX - sourceRect.left),\n y: input.clientY - (initialInput.clientY - sourceRect.top),\n };\n const tokens = value.trim().toLowerCase().split(/\\s+/).filter(Boolean);\n if (tokens.length === 0 || (tokens.length === 1 && tokens[0] === 'preserve')) return preserve;\n if (tokens.length !== 2) return preserve;\n const x = resolvePreviewAxis(tokens[0]!, input.clientX, previewSize.width, 'left', 'right');\n const y = resolvePreviewAxis(tokens[1]!, input.clientY, previewSize.height, 'top', 'bottom');\n return x === null || y === null ? preserve : {x, y};\n};\n\ntype SortableGhost = Readonly<{\n positioner: HTMLElement;\n visual: HTMLElement;\n frame(): ManagedGhostFrame;\n projectedFrame(input: SortableInput): ManagedGhostFrame;\n projectedSourceFrame(input: SortableInput): ManagedGhostFrame;\n move(input: SortableInput): void;\n finish(to: ManagedGhostFrame | null): Promise<void>;\n remove(): void;\n}>;\n\nconst sanitizeClone = (root: HTMLElement): void => {\n root.setAttribute('x-ignore', '');\n [root, ...root.querySelectorAll<HTMLElement>('*')].forEach((element) => {\n element.removeAttribute('id');\n element.removeAttribute('data-ui-motion-key');\n element.removeAttribute('data-ui-motion-layout');\n if (element instanceof HTMLInputElement || element instanceof HTMLButtonElement) element.disabled = true;\n if (element instanceof HTMLSelectElement || element instanceof HTMLTextAreaElement) element.disabled = true;\n });\n};\n\nconst copyControlValues = (source: HTMLElement, clone: HTMLElement): void => {\n const sourceControls = [source, ...source.querySelectorAll<HTMLElement>('input, textarea, select')];\n const cloneControls = [clone, ...clone.querySelectorAll<HTMLElement>('input, textarea, select')];\n sourceControls.forEach((control, index) => {\n const cloned = cloneControls[index];\n if (control instanceof HTMLInputElement && cloned instanceof HTMLInputElement) {\n cloned.value = control.value;\n cloned.checked = control.checked;\n } else if (control instanceof HTMLTextAreaElement && cloned instanceof HTMLTextAreaElement) {\n cloned.value = control.value;\n } else if (control instanceof HTMLSelectElement && cloned instanceof HTMLSelectElement) {\n cloned.selectedIndex = control.selectedIndex;\n }\n });\n};\n\nconst frameFromRect = (rect: DOMRect | DOMRectReadOnly): ManagedGhostFrame => ({\n x: rect.left,\n y: rect.top,\n width: rect.width,\n height: rect.height,\n});\n\nconst createSortableGhost = ({\n source,\n input,\n preview,\n previewPosition = 'preserve',\n opacity = 0.92,\n color = 'neutral',\n interaction = 'edge',\n}: {\n source: HTMLElement;\n input: SortableInput;\n preview?: HTMLTemplateElement | null;\n previewPosition?: string;\n opacity?: number;\n color?: SortableColor;\n interaction?: SortableInteraction;\n}): SortableGhost => {\n const sourceRect = source.getBoundingClientRect();\n const overlay = document.createElement('div');\n const positioner = document.createElement('div');\n const visual = document.createElement('div');\n const previewNode = preview?.content.firstElementChild?.cloneNode(true);\n const hasCustomPreview = previewNode instanceof HTMLElement;\n const content = hasCustomPreview ? previewNode : source.cloneNode(true) as HTMLElement;\n if (!hasCustomPreview) copyControlValues(source, content);\n sanitizeClone(content);\n\n overlay.setAttribute('data-ui-sortable-overlay', '');\n overlay.setAttribute('popover', 'manual');\n positioner.setAttribute('data-ui-sortable-ghost-positioner', '');\n visual.setAttribute('data-ui-sortable-ghost', '');\n visual.setAttribute('aria-hidden', 'true');\n visual.setAttribute('inert', '');\n if (!hasCustomPreview) {\n visual.setAttribute('data-ui-sortable-default-preview', '');\n visual.setAttribute('data-ui-selection-color', '');\n visual.dataset.color = color;\n visual.dataset.uiInteraction = interaction;\n visual.dataset.selected = 'true';\n visual.dataset.uiSurface = '+1';\n visual.dataset.uiElevation = '2';\n }\n const themeOwner = source.closest<HTMLElement>('[data-theme], .dark, .light');\n if (themeOwner?.classList.contains('dark')) overlay.classList.add('dark');\n if (themeOwner?.classList.contains('light')) overlay.classList.add('light');\n if (themeOwner?.dataset.theme) overlay.dataset.theme = themeOwner.dataset.theme;\n Object.assign(overlay.style, {\n position: 'fixed', inset: '0', width: '100vw', height: '100vh', maxWidth: 'none', maxHeight: 'none',\n margin: '0', padding: '0', border: '0', background: 'transparent', overflow: 'clip', contain: 'strict',\n zIndex: '2147483647', pointerEvents: 'none',\n });\n Object.assign(positioner.style, {\n position: 'absolute', left: '0', top: '0',\n width: hasCustomPreview ? 'max-content' : `${sourceRect.width}px`,\n height: hasCustomPreview ? 'max-content' : `${sourceRect.height}px`,\n pointerEvents: 'none',\n });\n Object.assign(visual.style, {\n width: hasCustomPreview ? 'max-content' : '100%',\n height: hasCustomPreview ? 'max-content' : '100%',\n opacity: `${opacity}`, pointerEvents: 'none',\n ...(hasCustomPreview ? {} : {\n overflow: 'hidden',\n borderRadius: 'var(--radius-overlay-sm)',\n }),\n });\n visual.append(content);\n positioner.append(visual);\n overlay.append(positioner);\n document.body.append(overlay);\n overlay.showPopover?.();\n\n const previewRect = positioner.getBoundingClientRect();\n const size = hasCustomPreview\n ? {width: previewRect.width, height: previewRect.height}\n : {width: sourceRect.width, height: sourceRect.height};\n const position = (nextInput: SortableInput): Readonly<{x: number; y: number}> => (\n resolveSortablePreviewPosition({\n value: previewPosition,\n input: nextInput,\n initialInput: input,\n sourceRect,\n previewSize: size,\n })\n );\n const sourcePosition = (nextInput: SortableInput): Readonly<{x: number; y: number}> => (\n resolveSortablePreviewPosition({\n value: 'preserve',\n input: nextInput,\n initialInput: input,\n sourceRect,\n previewSize: {width: sourceRect.width, height: sourceRect.height},\n })\n );\n const initialPosition = position(input);\n const movement = motion.createController({\n values: {\n x: {initial: initialPosition.x, transition: motion.roles.layout},\n y: {initial: initialPosition.y, transition: motion.roles.layout},\n },\n style: ({x, y}) => ({transform: `translate3d(${x}px, ${y}px, 0)`}),\n });\n movement.mount(positioner);\n\n return {\n positioner,\n visual,\n frame: () => ({...movement.current(), ...size}),\n projectedFrame: (nextInput) => ({...position(nextInput), ...size}),\n projectedSourceFrame: (nextInput) => ({\n ...sourcePosition(nextInput), width: sourceRect.width, height: sourceRect.height,\n }),\n move(nextInput) {\n movement.set(position(nextInput));\n },\n async finish(to) {\n if (to) await movement.animate({x: to.x, y: to.y}).finished;\n },\n remove: () => {\n movement.destroy();\n overlay.remove();\n },\n };\n};\n\nexport {createSortableGhost, frameFromRect, resolveSortablePreviewPosition, sanitizeClone};\nexport type {ManagedGhostFrame, SortableGhost, SortablePreviewPositionOptions};\n","/**\n * Delay until the text content of the live region is updated.\n *\n * This value was reached through some experimentation, and may need tweaking in the future.\n */\nexport var announceDelay = 1000;","import { announceDelay } from './constants';\nvar node = null;\nvar size = '1px';\nvar visuallyHiddenStyles = {\n // Standard visually hidden styles.\n // Copied from our VisuallyHidden (react) package.\n width: size,\n height: size,\n padding: '0',\n position: 'absolute',\n border: '0',\n clip: \"rect(\".concat(size, \", \").concat(size, \", \").concat(size, \", \").concat(size, \")\"),\n overflow: 'hidden',\n whiteSpace: 'nowrap',\n // Pulling upwards slightly to prevent the page\n // from growing when appended to a body that contains\n // an element with height:100%\n marginTop: \"-\".concat(size),\n // Just being safe and letting this element not interfere with hitboxes\n pointerEvents: 'none'\n};\n\n/**\n * Creates a live region node, appends it to the body, and returns it.\n */\nfunction createNode() {\n var node = document.createElement('div');\n /**\n * Using `role=\"status\"` instead of `role=\"alert\"` so that the message\n * can be queued and read when able.\n *\n * We found with `role=\"alert\"` the message was not reliably read when\n * focus changed.\n */\n node.setAttribute('role', 'status');\n Object.assign(node.style, visuallyHiddenStyles);\n document.body.append(node);\n return node;\n}\n\n/**\n * Returns the live region node, creating one if necessary.\n */\nfunction getNode() {\n if (node === null) {\n node = createNode();\n }\n return node;\n}\nvar timerId = null;\nfunction tryClearTimer() {\n if (timerId !== null) {\n clearTimeout(timerId);\n }\n timerId = null;\n}\n\n/**\n * Announces the provided message to assistive technology.\n */\nexport function announce(message) {\n /**\n * Calling this immediately to ensure a node exists and has time to be parsed\n * and exposed in the accessibility tree.\n */\n getNode();\n\n /**\n * Updating the message in a timeout so that it's less likely to be interrupted.\n *\n * This function is often called right before focus changes,\n * because the user has just taken an action.\n * This focus change would often cause the message to be skipped / interrupted.\n */\n tryClearTimer();\n timerId = setTimeout(function () {\n timerId = null;\n var node = getNode();\n node.textContent = message;\n }, announceDelay);\n return;\n}\n\n/**\n * Removes the created live region. If there is no live region this is a no-op.\n */\n// eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports\nexport function cleanup() {\n var _node;\n tryClearTimer();\n (_node = node) === null || _node === void 0 || _node.remove();\n node = null;\n}","import {announce} from '@atlaskit/pragmatic-drag-and-drop-live-region';\nimport {dispatch} from '../../../utils';\n\nimport type {\n SortableCanDropContext,\n SortableDropIntent,\n SortableDropDetail,\n SortableGroup,\n SortableResolvedPlacement,\n SortableSource,\n SortableInput,\n UiSortableService,\n} from './contract';\nimport {isValidGridColumns} from './contract';\n\ntype GroupRecord = Readonly<{\n element: HTMLElement;\n getGroup(): SortableGroup;\n getItemIds(): readonly string[];\n canDrop?(context: SortableCanDropContext): boolean;\n}>;\n\ntype SourceRecord = Readonly<{\n element: HTMLElement;\n getSource(): SortableSource;\n isDisabled(): boolean;\n}>;\n\ntype SortableRegistration = (() => void) & Readonly<{\n refresh(): void;\n}>;\n\ntype SortableRegistry = UiSortableService & Readonly<{\n registerGroup(record: GroupRecord): SortableRegistration;\n registerSource(record: SourceRecord): SortableRegistration;\n group(scopeId: string, groupId: string): GroupRecord | null;\n source(scopeId: string, sourceId: string): SourceRecord | null;\n canDrop(source: SortableSource, destinationGroupId: string, input?: SortableInput | null): boolean;\n isNoop(source: SortableSource, intent: SortableDropIntent): boolean;\n emitDrop(source: SortableSource, intent: SortableDropIntent, input?: SortableInput | null): boolean;\n}>;\ntype PreparedSortableDrop = Readonly<{\n placement: SortableResolvedPlacement;\n commit(): void;\n}>;\ntype SortableDropPreparer = (\n source: SortableSource,\n intent: SortableDropIntent,\n input?: SortableInput | null,\n) => PreparedSortableDrop | null;\n\nconst dropPreparers = new WeakMap<SortableRegistry, SortableDropPreparer>();\n\nconst keyFor = (scope: string, id: string): string => `${scope}\\u0000${id}`;\n\nconst frozenDropDetail = (source: SortableSource, placement: SortableResolvedPlacement): SortableDropDetail => {\n const placementDetail = {\n destination: Object.freeze({...placement.destination}),\n anchor: placement.anchor === null ? null : Object.freeze({...placement.anchor}),\n index: placement.index,\n };\n return source.operation === 'insert'\n ? Object.freeze({operation: 'insert', source: Object.freeze({...source}), ...placementDetail})\n : Object.freeze({operation: 'move', source: Object.freeze({...source}), ...placementDetail});\n};\n\nconst createSortableRegistry = (): SortableRegistry => {\n const groups = new Map<string, GroupRecord>();\n const sources = new Map<string, SourceRecord>();\n\n const register = <T extends {element: HTMLElement}>(\n records: Map<string, T>,\n initialKey: string,\n currentKey: () => string,\n value: T,\n kind: string,\n ): SortableRegistration => {\n let key = initialKey;\n let active = true;\n const initialExisting = records.get(key);\n if (initialExisting && (initialExisting.element.isConnected || !value.element.isConnected)) {\n throw new Error(`Duplicate sortable ${kind} identity: ${key.replace('\\u0000', '/')}`);\n }\n records.set(key, value);\n const unregister = (): void => {\n if (!active) return;\n active = false;\n if (records.get(key) === value) records.delete(key);\n };\n const refresh = (): void => {\n if (!active) return;\n const nextKey = currentKey();\n if (nextKey === key) return;\n const existing = records.get(nextKey);\n if (\n existing\n && existing !== value\n && (existing.element.isConnected || !value.element.isConnected)\n ) {\n throw new Error(`Duplicate sortable ${kind} identity: ${nextKey.replace('\\u0000', '/')}`);\n }\n if (records.get(key) === value) records.delete(key);\n records.set(nextKey, value);\n key = nextKey;\n };\n return Object.assign(unregister, {refresh});\n };\n\n const group = (scopeId: string, groupId: string): GroupRecord | null => (\n groups.get(keyFor(scopeId, groupId)) ?? null\n );\n const source = (scopeId: string, sourceId: string): SourceRecord | null => (\n sources.get(keyFor(scopeId, sourceId)) ?? null\n );\n\n const canDrop = (\n sortableSource: SortableSource,\n destinationGroupId: string,\n input: SortableInput | null = null,\n ): boolean => {\n const destination = group(sortableSource.scopeId, destinationGroupId);\n const sourceRecord = source(sortableSource.scopeId, sortableSource.id);\n if (!destination || !sourceRecord || sourceRecord.isDisabled()) return false;\n const destinationGroup = destination.getGroup();\n if (destinationGroup.disabled || destinationGroup.readOnly) return false;\n if (destinationGroup.orientation === 'grid' && !isValidGridColumns(destinationGroup.columns)) return false;\n if (!destinationGroup.accepts.includes(sortableSource.type)) return false;\n const itemIds = destination.getItemIds().filter((id) => (\n sortableSource.operation !== 'move'\n || sortableSource.groupId !== destinationGroupId\n || id !== sortableSource.id\n ));\n const context: SortableCanDropContext = Object.freeze({\n source: sortableSource,\n destination: destinationGroup,\n itemIds: Object.freeze(itemIds),\n input: input === null ? null : Object.freeze({...input}),\n });\n return destination.canDrop?.(context) !== false;\n };\n\n const resolveDropIntent = (sortableSource: SortableSource, intent: SortableDropIntent): {\n originalIds: readonly string[];\n placement: SortableResolvedPlacement;\n } | null => {\n const destination = group(sortableSource.scopeId, intent.destination.groupId);\n if (!destination) return null;\n const originalIds = destination.getItemIds();\n const projectedIds = sortableSource.operation === 'move' && sortableSource.groupId === intent.destination.groupId\n ? originalIds.filter((id) => id !== sortableSource.id)\n : [...originalIds];\n if (intent.anchor !== null && !projectedIds.includes(intent.anchor.id)) return null;\n const index = intent.anchor === null\n ? 0\n : projectedIds.indexOf(intent.anchor.id) + (intent.anchor.edge === 'after' ? 1 : 0);\n return {\n originalIds,\n placement: {destination: intent.destination, anchor: intent.anchor, index},\n };\n };\n\n const isResolvedNoop = (\n sortableSource: SortableSource,\n originalIds: readonly string[],\n placement: SortableResolvedPlacement,\n ): boolean => (\n sortableSource.operation === 'move'\n && sortableSource.groupId === placement.destination.groupId\n && originalIds.indexOf(sortableSource.id) === placement.index\n );\n\n const isNoop = (sortableSource: SortableSource, intent: SortableDropIntent): boolean => {\n const resolved = resolveDropIntent(sortableSource, intent);\n return resolved !== null && isResolvedNoop(sortableSource, resolved.originalIds, resolved.placement);\n };\n\n const prepareDrop: SortableDropPreparer = (\n sortableSource: SortableSource,\n intent: SortableDropIntent,\n input: SortableInput | null = null,\n ) => {\n const destination = group(sortableSource.scopeId, intent.destination.groupId);\n if (!destination || !canDrop(sortableSource, intent.destination.groupId, input)) return null;\n const destinationGroup = destination.getGroup();\n\n const resolved = resolveDropIntent(sortableSource, intent);\n if (!resolved || isResolvedNoop(sortableSource, resolved.originalIds, resolved.placement)) return null;\n\n const detail = frozenDropDetail(sortableSource, resolved.placement);\n let committed = false;\n return Object.freeze({\n placement: resolved.placement,\n commit: () => {\n if (committed) return;\n committed = true;\n dispatch({\n el: destination.element,\n name: 'ui:sortable-drop',\n composed: true,\n detail,\n });\n if (sortableSource.label && destinationGroup.label) {\n announce(`${sortableSource.label} moved to ${destinationGroup.label}.`);\n }\n },\n });\n };\n\n const emitDrop = (\n sortableSource: SortableSource,\n intent: SortableDropIntent,\n input: SortableInput | null = null,\n ): boolean => {\n const prepared = prepareDrop(sortableSource, intent, input);\n if (!prepared) return false;\n prepared.commit();\n return true;\n };\n\n const moveRelative = (edge: 'before' | 'after', options: {\n scope: string;\n sourceId: string;\n anchorId: string;\n destinationGroupId?: string;\n }): boolean => {\n const sourceRecord = source(options.scope, options.sourceId);\n if (!sourceRecord) return false;\n const sortableSource = sourceRecord.getSource();\n const destinationGroupId = options.destinationGroupId ?? sortableSource.groupId;\n if (!destinationGroupId || options.anchorId === options.sourceId) return false;\n return emitDrop(sortableSource, {\n destination: {groupId: destinationGroupId},\n anchor: {id: options.anchorId, edge},\n });\n };\n\n const moveToEdge = (edge: 'start' | 'end', options: {\n scope: string;\n sourceId: string;\n destinationGroupId: string;\n }): boolean => {\n const sourceRecord = source(options.scope, options.sourceId);\n const destination = group(options.scope, options.destinationGroupId);\n if (!sourceRecord || !destination) return false;\n const sortableSource = sourceRecord.getSource();\n const ids = destination.getItemIds().filter((id) => (\n sortableSource.groupId !== options.destinationGroupId || id !== sortableSource.id\n ));\n const anchor = ids.length === 0\n ? null\n : edge === 'start'\n ? {id: ids[0]!, edge: 'before' as const}\n : {id: ids.at(-1)!, edge: 'after' as const};\n return emitDrop(sortableSource, {destination: {groupId: options.destinationGroupId}, anchor});\n };\n\n const registry: SortableRegistry = {\n registerGroup: (record) => {\n const value = record.getGroup();\n return register(\n groups,\n keyFor(value.scopeId, value.id),\n () => {\n const current = record.getGroup();\n return keyFor(current.scopeId, current.id);\n },\n record,\n 'group',\n );\n },\n registerSource: (record) => {\n const value = record.getSource();\n return register(\n sources,\n keyFor(value.scopeId, value.id),\n () => {\n const current = record.getSource();\n return keyFor(current.scopeId, current.id);\n },\n record,\n 'source',\n );\n },\n group,\n source,\n canDrop,\n isNoop,\n emitDrop,\n moveBefore: (options) => moveRelative('before', options),\n moveAfter: (options) => moveRelative('after', options),\n moveToStart: (options) => moveToEdge('start', options),\n moveToEnd: (options) => moveToEdge('end', options),\n };\n dropPreparers.set(registry, prepareDrop);\n return registry;\n};\n\nconst prepareSortableDrop = (\n registry: SortableRegistry,\n source: SortableSource,\n intent: SortableDropIntent,\n input: SortableInput | null = null,\n): PreparedSortableDrop | null => dropPreparers.get(registry)?.(source, intent, input) ?? null;\n\nexport {createSortableRegistry, prepareSortableDrop};\nexport type {GroupRecord, SortableRegistration, SortableRegistry, SourceRecord};\n","const CURSOR_PROPERTY = '--ui-sortable-drag-cursor';\nconst DRAGGING_ATTRIBUTE = 'data-ui-sortable-dragging';\n\nconst activateSortableCursor = (cursor: string): (() => void) => {\n const root = document.documentElement;\n const previousAttribute = root.getAttribute(DRAGGING_ATTRIBUTE);\n const previousCursor = root.style.getPropertyValue(CURSOR_PROPERTY);\n root.setAttribute(DRAGGING_ATTRIBUTE, '');\n root.style.setProperty(CURSOR_PROPERTY, cursor.trim() || 'default');\n\n return () => {\n if (previousAttribute === null) root.removeAttribute(DRAGGING_ATTRIBUTE);\n else root.setAttribute(DRAGGING_ATTRIBUTE, previousAttribute);\n if (previousCursor) root.style.setProperty(CURSOR_PROPERTY, previousCursor);\n else root.style.removeProperty(CURSOR_PROPERTY);\n };\n};\n\nexport {activateSortableCursor};\n","import {createMachine, type Machine, type MachineScope} from '../../state-machine';\n\ntype SortablePointerSnapshot = Readonly<{\n destinationId: string | null;\n input: Readonly<{clientX: number; clientY: number}>;\n}>;\ntype SortableSourceMachineContext = {\n data: Record<string, unknown>;\n pointer: SortablePointerSnapshot | null;\n};\ntype SortableSourceMachineEffects<TProps> = Readonly<{\n resolvePlacement(scope: MachineScope<SortableSourceMachineContext, TProps>): void;\n synced(scope: MachineScope<SortableSourceMachineContext, TProps>): void;\n complete(scope: MachineScope<SortableSourceMachineContext, TProps>): void;\n reconcile(scope: MachineScope<SortableSourceMachineContext, TProps>): void;\n}>;\n\nconst createSortableSourceMachine = <TProps>({props, effects}: {\n props: TProps;\n effects: SortableSourceMachineEffects<TProps>;\n}): Machine<SortableSourceMachineContext, TProps> => createMachine<SortableSourceMachineContext, TProps>({\n type: 'parallel',\n on: {\n PROPS_CHANGED: {reduce: 'props', effects: 'reconcile'},\n DOM_INVALIDATED: {effects: 'reconcile'},\n POINTER_MOVED: {reduce: 'pointer', effects: 'resolvePlacement'},\n },\n states: {\n interaction: {\n initial: 'idle',\n states: {\n idle: {on: {START: {target: 'starting', reduce: 'start'}}},\n starting: {on: {\n STARTING_DONE: {target: 'dragging'},\n END: {target: 'ending', reduce: 'data'},\n }},\n dragging: {on: {END: {target: 'ending', reduce: 'data'}}},\n ending: {on: {ENDING_DONE: {target: 'idle', effects: 'complete'}}},\n },\n },\n layout: {\n initial: 'inactive',\n states: {\n inactive: {on: {START: {target: 'ready'}}},\n ready: {on: {\n LAYOUT_PROPOSED: {target: 'placing', reduce: 'data'},\n END: {target: 'inactive'},\n }},\n placing: {on: {\n LAYOUT_PROPOSED: {target: 'placing', reduce: 'data'},\n PLACING_DONE: {target: 'ready', effects: 'synced'},\n END: {target: 'inactive', effects: 'synced'},\n }},\n },\n },\n },\n}, {\n props,\n context: {data: {}, pointer: null},\n reducers: {\n start: ({event}) => ({context: {\n data: event.data as Record<string, unknown>,\n pointer: null,\n }}),\n data: ({context, event}) => ({context: {...context, data: event.data as Record<string, unknown>}}),\n pointer: ({context, event}) => ({context: {\n ...context,\n pointer: event.pointer as SortablePointerSnapshot,\n }}),\n props: ({context, event}) => ({context, props: event.props as TProps}),\n },\n effects,\n});\n\nexport {createSortableSourceMachine};\nexport type {SortablePointerSnapshot, SortableSourceMachineContext, SortableSourceMachineEffects};\n","// pulling this into a separate file so adapter(s) that don't\n// need the honey pot can pay as little as possible for it.\nexport var honeyPotDataAttribute = 'data-pdnd-honey-pot';","import { honeyPotDataAttribute } from './honey-pot-data-attribute';\nexport function isHoneyPotElement(target) {\n return target instanceof Element && target.hasAttribute(honeyPotDataAttribute);\n}","import _slicedToArray from \"@babel/runtime/helpers/slicedToArray\";\nimport { isHoneyPotElement } from './is-honey-pot-element';\nexport function getElementFromPointWithoutHoneypot(client) {\n // eslint-disable-next-line no-restricted-syntax\n var _document$elementsFro = document.elementsFromPoint(client.x, client.y),\n _document$elementsFro2 = _slicedToArray(_document$elementsFro, 2),\n top = _document$elementsFro2[0],\n second = _document$elementsFro2[1];\n if (!top) {\n return null;\n }\n if (isHoneyPotElement(top)) {\n return second !== null && second !== void 0 ? second : null;\n }\n return top;\n}","// Maximum possible z-index\n// https://stackoverflow.com/questions/491052/minimum-and-maximum-value-of-z-index\nexport var maxZIndex = 2147483647;","/**\n * Resets user agent styles for `[popover]` elements.\n *\n * Browsers apply these defaults to popovers (per the WHATWG HTML spec rendering section):\n * - `inset: 0` + `margin: auto` → centers the popover in the viewport\n * - `border: solid` → visible border\n * - `padding: 0.25em` → internal spacing\n * - `overflow: auto` → scrollbars when content overflows\n * - `color: CanvasText` + `background-color: Canvas` → system theme colors\n *\n * This object neutralizes those defaults so the popover behaves like a plain\n * positioned `<div>`, matching the sizing of the legacy (non-popover)\n * fallback container exactly.\n *\n * **Width and height (`auto`)**\n *\n * `width` and `height` override the spec user agent value of `fit-content`\n * with `auto`.\n *\n * _Why?_\n *\n * - When a `[popover]` is sized with `fit-content` and contains a flex\n * container, Safari collapses any flex item that uses `overflow: auto`\n * to `0px`.\n * - Setting the popover's `width` and `height` to `auto` skips the `fit-content`\n * pass and avoids the bug in Safari\n * - Chromium and Firefox tolerate `fit-content` here, but `auto` is safe\n * everywhere and matches our non-popover path\n */\nexport var popoverResetUserAgentStyles = {\n inset: 'unset',\n border: 'none',\n padding: 0,\n margin: 0,\n overflow: 'visible',\n color: 'inherit',\n background: 'transparent',\n width: 'auto',\n height: 'auto'\n};","/** Provide a function that you only ever want to be called a single time */\nexport function once(fn) {\n var cache = null;\n return function wrapped() {\n if (!cache) {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n var result = fn.apply(this, args);\n cache = {\n result: result\n };\n }\n return cache.result;\n };\n}","import { once } from '../public-utils/once';\n\n// Using `once` as the value won't change in a browser\n\n/**\n * Returns `true` if the browser supports the Popover API (top-layer).\n *\n * When supported, elements with `popover=\"manual\"` can be promoted to the\n * browser's top layer via `element.showPopover()`, which is more reliable\n * than `z-index` for ensuring an element renders above everything else.\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/API/Popover_API\n */\nexport var supportsPopover = once(function supportsPopover() {\n return typeof HTMLElement !== 'undefined' && typeof HTMLElement.prototype.showPopover === 'function';\n});","import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nimport { bind, bindAll } from 'bind-event-listener';\nimport { maxZIndex } from '../util/max-z-index';\nimport { popoverResetUserAgentStyles } from '../util/popover-reset-styles';\nimport { supportsPopover } from '../util/supports-popover';\nimport { honeyPotDataAttribute } from './honey-pot-data-attribute';\nvar honeyPotSize = 2;\nvar halfHoneyPotSize = honeyPotSize / 2;\n\n/**\n * `clientX` and `clientY` can be in sub pixels (eg `2.332`)\n * However, browser hitbox testing is commonly do to the closest pixel.\n *\n * → https://issues.chromium.org/issues/40940531\n *\n * To be sure that the honey pot will be over the `client` position,\n * we `.floor()` `clientX` and`clientY` and then make it `2px` in size.\n **/\nfunction floorToClosestPixel(point) {\n return {\n x: Math.floor(point.x),\n y: Math.floor(point.y)\n };\n}\n\n/**\n * We want to make sure the honey pot sits around the users position.\n * This seemed to be the most resilient while testing.\n */\nfunction pullBackByHalfHoneyPotSize(point) {\n return {\n x: point.x - halfHoneyPotSize,\n y: point.y - halfHoneyPotSize\n };\n}\n\n/**\n * Prevent the honey pot from changing the window size.\n * This is super unlikely to occur, but just being safe.\n */\nfunction preventGoingBackwardsOffScreen(point) {\n return {\n x: Math.max(point.x, 0),\n y: Math.max(point.y, 0)\n };\n}\n\n/**\n * Prevent the honey pot from changing the window size.\n * This is super unlikely to occur, but just being safe.\n */\nfunction preventGoingForwardsOffScreen(point) {\n return {\n x: Math.min(point.x, window.innerWidth - honeyPotSize),\n y: Math.min(point.y, window.innerHeight - honeyPotSize)\n };\n}\n\n/**\n * Create a `2x2` `DOMRect` around the `client` position\n */\nfunction getHoneyPotRectFor(_ref) {\n var client = _ref.client;\n var point = preventGoingForwardsOffScreen(preventGoingBackwardsOffScreen(pullBackByHalfHoneyPotSize(floorToClosestPixel(client))));\n\n // When debugging, it is helpful to\n // make this element a bit bigger\n return DOMRect.fromRect({\n x: point.x,\n y: point.y,\n width: honeyPotSize,\n height: honeyPotSize\n });\n}\nfunction getRectStyles(_ref2) {\n var clientRect = _ref2.clientRect;\n return {\n left: \"\".concat(clientRect.left, \"px\"),\n top: \"\".concat(clientRect.top, \"px\"),\n width: \"\".concat(clientRect.width, \"px\"),\n height: \"\".concat(clientRect.height, \"px\")\n };\n}\nfunction isWithin(_ref3) {\n var client = _ref3.client,\n clientRect = _ref3.clientRect;\n return (\n // is within horizontal bounds\n client.x >= clientRect.x && client.x <= clientRect.x + clientRect.width &&\n // is within vertical bounds\n client.y >= clientRect.y && client.y <= clientRect.y + clientRect.height\n );\n}\n/**\n * The honey pot fix is designed to get around a painful bug in all browsers.\n *\n * [Overview](https://www.youtube.com/watch?v=udE9qbFTeQg)\n *\n * **Background**\n *\n * When a drag starts, browsers incorrectly think that the users pointer is\n * still depressed where the drag started. Any element that goes under this position\n * will be entered into, causing `\"mouseenter\"` events and `\":hover\"` styles to be applied.\n *\n * _This is a violation of the spec_\n *\n * > \"From the moment that the user agent is to initiate the drag-and-drop operation,\n * > until the end \tof the drag-and-drop operation, device input events\n * > (e.g. mouse and keyboard events) must be suppressed.\"\n * >\n * > - https://html.spec.whatwg.org/multipage/dnd.html#drag-and-drop-processing-model\n *\n * _Some impacts_\n *\n * - `\":hover\"` styles being applied where they shouldn't (looks messy)\n * - components such as tooltips responding to `\"mouseenter\"` can show during a drag,\n * and on an element the user isn't even over\n *\n * Bug: https://issues.chromium.org/issues/41129937\n *\n * **Honey pot fix**\n *\n * 1. Create an element where the browser thinks the depressed pointer is\n * to absorb the incorrect pointer events\n * 2. Remove that element when it is no longer needed\n */\nfunction mountHoneyPot(_ref4) {\n var initial = _ref4.initial;\n var element = document.createElement('div');\n element.setAttribute(honeyPotDataAttribute, 'true');\n\n // Using popover=\"manual\" to place the element in the browser's top layer.\n // This ensures the honey pot is visually on top of everything else,\n // including elements using z-index and other stacking contexts.\n // \"manual\" means no light dismiss — we manage the lifecycle ourselves.\n // Falls back to position:fixed + maxZIndex when the popover API is not available.\n if (supportsPopover()) {\n element.setAttribute('popover', 'manual');\n }\n\n // can shift during the drag thanks to Firefox\n var clientRect = getHoneyPotRectFor({\n client: initial\n });\n Object.assign(element.style, _objectSpread(_objectSpread({\n position: 'fixed'\n }, supportsPopover() ?\n // needs to come first as it has 'inset: unset' which\n // needs to be overridden by our top / left values\n popoverResetUserAgentStyles : {\n // Fallback: using maximum possible z-index so that this element\n // will always be on top of other positioned content.\n zIndex: maxZIndex\n }), {}, {\n // Setting a background color explicitly to avoid any inherited styles.\n // Looks like this could be `opacity: 0`, but worried that _might_\n // cause the element to be ignored on some platforms.\n // When debugging, set backgroundColor to something like \"red\".\n backgroundColor: 'transparent',\n // Being explicit to avoid inheriting styles\n padding: 0,\n margin: 0,\n boxSizing: 'border-box',\n // We want this element to absorb pointer events,\n // it's kind of the whole point 😉\n pointerEvents: 'auto'\n }, getRectStyles({\n clientRect: clientRect\n })));\n document.body.appendChild(element);\n if (supportsPopover()) {\n element.showPopover();\n }\n\n /**\n * 🦊 In firefox we can get `\"pointermove\"` events after the drag\n * has started, which is a spec violation.\n * The final `\"pointermove\"` will reveal where the \"depressed\" position\n * is for our honey pot fix.\n */\n var unbindPointerMove = bind(window, {\n type: 'pointermove',\n listener: function listener(event) {\n var client = {\n x: event.clientX,\n y: event.clientY\n };\n clientRect = getHoneyPotRectFor({\n client: client\n });\n Object.assign(element.style, getRectStyles({\n clientRect: clientRect\n }));\n },\n // using capture so we are less likely to be impacted by event stopping\n options: {\n capture: true\n }\n });\n return function finish(_ref5) {\n var current = _ref5.current;\n // Don't need this any more\n unbindPointerMove();\n\n // If the user is hover the honey pot, we remove it\n // so that the user can continue to interact with the page normally.\n if (isWithin({\n client: current,\n clientRect: clientRect\n })) {\n element.remove();\n return;\n }\n function cleanup() {\n unbindPostDragEvents();\n element.remove();\n }\n var unbindPostDragEvents = bindAll(window, [{\n type: 'pointerdown',\n listener: cleanup\n }, {\n type: 'pointermove',\n listener: cleanup\n }, {\n type: 'focusin',\n listener: cleanup\n }, {\n type: 'focusout',\n listener: cleanup\n },\n // a 'pointerdown' should happen before 'dragstart', but just being super safe\n {\n type: 'dragstart',\n listener: cleanup\n },\n // if the user has dragged something out of the window\n // and then is dragging something back into the window\n // the first events we will see are \"dragenter\" (and then \"dragover\").\n // So if we see any of these we need to clear the post drag fix.\n {\n type: 'dragenter',\n listener: cleanup\n }, {\n type: 'dragover',\n listener: cleanup\n }\n\n // Not adding a \"wheel\" event listener, as \"wheel\" by itself does not\n // resolve the bug.\n ], {\n // Using `capture` so less likely to be impacted by other code stopping events\n capture: true\n });\n };\n}\nexport function makeHoneyPotFix() {\n var latestPointerMove = null;\n function bindEvents() {\n // For sanity, only collecting this value from when events are first bound.\n // This prevents the case where a super old \"pointermove\" could be used\n // from a prior interaction.\n latestPointerMove = null;\n return bind(window, {\n type: 'pointermove',\n listener: function listener(event) {\n latestPointerMove = {\n x: event.clientX,\n y: event.clientY\n };\n },\n // listening for pointer move in capture phase\n // so we are less likely to be impacted by events being stopped.\n options: {\n capture: true\n }\n });\n }\n function getOnPostDispatch() {\n var finish = null;\n return function onPostEvent(_ref6) {\n var eventName = _ref6.eventName,\n payload = _ref6.payload;\n // We are adding the honey pot `onDragStart` so we don't\n // impact the creation of the native drag preview.\n if (eventName === 'onDragStart') {\n var input = payload.location.initial.input;\n\n // Sometimes there will be no latest \"pointermove\" (eg iOS).\n // In which case, we use the start position of the drag.\n var initial = latestPointerMove !== null && latestPointerMove !== void 0 ? latestPointerMove : {\n x: input.clientX,\n y: input.clientY\n };\n\n // Don't need to defensively call `finish()` as `onDrop` from\n // one interaction is guaranteed to be called before `onDragStart`\n // of the next.\n finish = mountHoneyPot({\n initial: initial\n });\n }\n if (eventName === 'onDrop') {\n var _finish;\n var _input = payload.location.current.input;\n (_finish = finish) === null || _finish === void 0 || _finish({\n current: {\n x: _input.clientX,\n y: _input.clientY\n }\n });\n finish = null;\n // this interaction is finished, we want to use\n // the latest \"pointermove\" for each interaction\n latestPointerMove = null;\n }\n };\n }\n return {\n bindEvents: bindEvents,\n getOnPostDispatch: getOnPostDispatch\n };\n}","import { once } from '../public-utils/once';\n\n// using `cache` as our `isFirefox()` result will not change in a browser\n\n/**\n * Returns `true` if a `Firefox` browser\n * */\nexport var isFirefox = once(function isFirefox() {\n if (process.env.NODE_ENV === 'test') {\n return false;\n }\n return navigator.userAgent.includes('Firefox');\n});","import { once } from '../public-utils/once';\n\n// using `cache` as our `isSafari()` result will not change in a browser\n\n/**\n * Returns `true` if a `Safari` browser.\n * Returns `true` if the browser is running on iOS (they are all Safari).\n *\n * Use `isSafariOnIOS` if you want to check if something is Safari + iOS\n * */\nexport var isSafari = once(function isSafari() {\n if (process.env.NODE_ENV === 'test') {\n return false;\n }\n var _navigator = navigator,\n userAgent = _navigator.userAgent;\n return userAgent.includes('AppleWebKit') && !userAgent.includes('Chrome');\n});","/**\n * Does the `EventTarget` look like a `Node` based on \"duck typing\".\n *\n * Helpful when the `Node` might be outside of the current document\n * so we cannot to an `target instanceof Node` check.\n */\nfunction isNodeLike(target) {\n return 'nodeName' in target;\n}\n\n/**\n * Is an `EventTarget` a `Node` from another `window`?\n */\nexport function isFromAnotherWindow(eventTarget) {\n return isNodeLike(eventTarget) && eventTarget.ownerDocument !== document;\n}","import { bindAll } from 'bind-event-listener';\nimport { isSafari } from '../is-safari';\n\n/* For \"dragenter\" events, the browser should set `relatedTarget` to the previous element.\n * For external drag operations, our first \"dragenter\" event should have a `event.relatedTarget` of `null`.\n *\n * Unfortunately in Safari `event.relatedTarget` is *always* set to `null`\n * Safari bug: https://bugs.webkit.org/show_bug.cgi?id=242627\n * To work around this we count \"dragenter\" and \"dragleave\" events */\n// Using symbols for event properties so we don't clash with\n// anything on the `event` object\nexport var symbols = {\n isLeavingWindow: Symbol('leaving'),\n isEnteringWindow: Symbol('entering')\n};\n(function fixSafari() {\n // Don't do anything when server side rendering\n if (typeof window === 'undefined') {\n return;\n }\n\n // rather than checking the userAgent for \"jsdom\" we can do this check\n // so that the check will be removed completely in production code\n if (process.env.NODE_ENV === 'test') {\n return;\n }\n if (!isSafari()) {\n return;\n }\n function getInitialState() {\n return {\n enterCount: 0,\n isOverWindow: false\n };\n }\n var state = getInitialState();\n function resetState() {\n state = getInitialState();\n }\n\n // These event listeners are bound _forever_ and _never_ removed\n // We don't bother cleaning up these event listeners (for now)\n // as this workaround is only for Safari\n\n // This is how the event count works:\n //\n // lift (+1 enterCount)\n // - dragstart(draggable) [enterCount: 0]\n // - dragenter(draggable) [enterCount: 1]\n // leaving draggable (+0 enterCount)\n // - dragenter(document.body) [enterCount: 2]\n // - dragleave(draggable) [enterCount: 1]\n // leaving window (-1 enterCount)\n // - dragleave(document.body) [enterCount: 0] {leaving the window}\n\n // Things to note:\n // - dragenter and dragleave bubble\n // - the first dragenter when entering a window might not be on `window`\n // - it could be on an element that is pressed up against the window\n // - (so we cannot rely on `event.target` values)\n\n bindAll(window, [{\n type: 'dragstart',\n listener: function listener() {\n state.enterCount = 0;\n // drag start occurs in the source window\n state.isOverWindow = true;\n // When a drag first starts it will also trigger a \"dragenter\" on the draggable element\n }\n }, {\n type: 'drop',\n listener: resetState\n }, {\n type: 'dragend',\n listener: resetState\n }, {\n type: 'dragenter',\n listener: function listener(event) {\n if (!state.isOverWindow && state.enterCount === 0) {\n // Patching the `event` object\n // The `event` object is shared with all event listeners for the event\n event[symbols.isEnteringWindow] = true;\n }\n state.isOverWindow = true;\n state.enterCount++;\n }\n }, {\n type: 'dragleave',\n listener: function listener(event) {\n state.enterCount--;\n if (state.isOverWindow && state.enterCount === 0) {\n // Patching the `event` object as it is shared with all event listeners\n // The `event` object is shared with all event listeners for the event\n event[symbols.isLeavingWindow] = true;\n state.isOverWindow = false;\n }\n }\n }],\n // using `capture: true` so that adding event listeners\n // in bubble phase will have the correct symbols\n {\n capture: true\n });\n})();","import { isSafari } from '../is-safari';\nimport { symbols } from './count-events-for-safari';\n\n// eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports\nexport function isLeavingWindowInSafari(_ref) {\n var dragLeave = _ref.dragLeave;\n if (!isSafari()) {\n return false;\n }\n return dragLeave.hasOwnProperty(symbols.isLeavingWindow);\n}","import { isFirefox } from '../is-firefox';\nimport { isSafari } from '../is-safari';\nimport { isFromAnotherWindow } from './is-from-another-window';\nimport { isLeavingWindowInSafari } from './is-leaving-window-in-safari';\nexport function isLeavingWindow(_ref) {\n var dragLeave = _ref.dragLeave;\n var type = dragLeave.type,\n relatedTarget = dragLeave.relatedTarget;\n if (type !== 'dragleave') {\n return false;\n }\n if (isSafari()) {\n return isLeavingWindowInSafari({\n dragLeave: dragLeave\n });\n }\n\n // Standard check: if going to `null` we are leaving the `window`\n if (relatedTarget == null) {\n return true;\n }\n\n /**\n * 🦊 Exception: `iframe` in Firefox (`125.0`)\n *\n * Case 1: parent `window` → child `iframe`\n * `dragLeave.relatedTarget` is element _inside_ the child `iframe`\n * (foreign element)\n *\n * Case 2: child `iframe` → parent `window`\n * `dragLeave.relatedTarget` is the `iframe` in the parent `window`\n * (foreign element)\n */\n\n if (isFirefox()) {\n return isFromAnotherWindow(relatedTarget);\n }\n\n /**\n * 🌏 Exception: `iframe` in Chrome (`124.0`)\n *\n * Case 1: parent `window` → child `iframe`\n * `dragLeave.relatedTarget` is the `iframe` in the parent `window`\n *\n * Case 2: child `iframe` → parent `window`\n * `dragLeave.relatedTarget` is `null` *(standard check)*\n */\n\n // Case 2\n // Using `instanceof` check as the element will be in the same `window`\n return relatedTarget instanceof HTMLIFrameElement;\n}","export function getBindingsForBrokenDrags(_ref) {\n var onDragEnd = _ref.onDragEnd;\n return [\n // ## Detecting drag ending for removed draggables\n //\n // If a draggable element is removed during a drag and the user drops:\n // 1. if over a valid drop target: we get a \"drop\" event to know the drag is finished\n // 2. if not over a valid drop target (or cancelled): we get nothing\n // The \"dragend\" event will not fire on the source draggable if it has been\n // removed from the DOM.\n // So we need to figure out if a drag operation has finished by looking at other events\n // We can do this by looking at other events\n\n // ### First detection: \"pointermove\" events\n\n // 1. \"pointermove\" events cannot fire during a drag and drop operation\n // according to the spec. So if we get a \"pointermove\" it means that\n // the drag and drop operations has finished. So if we get a \"pointermove\"\n // we know that the drag is over\n // 2. 🦊😤 Drag and drop operations are _supposed_ to suppress\n // other pointer events. However, firefox will allow a few\n // pointer event to get through after a drag starts.\n // The most I've seen is 3\n {\n type: 'pointermove',\n listener: function () {\n var callCount = 0;\n return function listener() {\n // Using 20 as it is far bigger than the most observed (3)\n if (callCount < 20) {\n callCount++;\n return;\n }\n onDragEnd();\n };\n }()\n },\n // ### Second detection: \"pointerdown\" events\n\n // If we receive this event then we know that a drag operation has finished\n // and potentially another one is about to start.\n // Note: `pointerdown` fires on all browsers / platforms before \"dragstart\"\n {\n type: 'pointerdown',\n listener: onDragEnd\n }];\n}","export function getInput(event) {\n return {\n altKey: event.altKey,\n button: event.button,\n buttons: event.buttons,\n ctrlKey: event.ctrlKey,\n metaKey: event.metaKey,\n shiftKey: event.shiftKey,\n clientX: event.clientX,\n clientY: event.clientY,\n pageX: event.pageX,\n pageY: event.pageY\n };\n}","import rafSchd from 'raf-schd';\nvar scheduleOnDrag = rafSchd(function (fn) {\n return fn();\n});\nvar dragStart = function () {\n var scheduled = null;\n function schedule(fn) {\n var frameId = requestAnimationFrame(function () {\n scheduled = null;\n fn();\n });\n scheduled = {\n frameId: frameId,\n fn: fn\n };\n }\n function flush() {\n if (scheduled) {\n cancelAnimationFrame(scheduled.frameId);\n scheduled.fn();\n scheduled = null;\n }\n }\n return {\n schedule: schedule,\n flush: flush\n };\n}();\nexport function makeDispatch(_ref) {\n var source = _ref.source,\n initial = _ref.initial,\n dispatchEvent = _ref.dispatchEvent;\n var previous = {\n dropTargets: []\n };\n function safeDispatch(args) {\n dispatchEvent(args);\n previous = {\n dropTargets: args.payload.location.current.dropTargets\n };\n }\n var dispatch = {\n start: function start(_ref2) {\n var nativeSetDragImage = _ref2.nativeSetDragImage;\n // Ensuring that both `onGenerateDragPreview` and `onDragStart` get the same location.\n // We do this so that `previous` is`[]` in `onDragStart` (which is logical)\n var location = {\n current: initial,\n previous: previous,\n initial: initial\n };\n // a `onGenerateDragPreview` does _not_ add another entry for `previous`\n // onDragPreview\n safeDispatch({\n eventName: 'onGenerateDragPreview',\n payload: {\n source: source,\n location: location,\n nativeSetDragImage: nativeSetDragImage\n }\n });\n dragStart.schedule(function () {\n safeDispatch({\n eventName: 'onDragStart',\n payload: {\n source: source,\n location: location\n }\n });\n });\n },\n dragUpdate: function dragUpdate(_ref3) {\n var current = _ref3.current;\n dragStart.flush();\n scheduleOnDrag.cancel();\n safeDispatch({\n eventName: 'onDropTargetChange',\n payload: {\n source: source,\n location: {\n initial: initial,\n previous: previous,\n current: current\n }\n }\n });\n },\n drag: function drag(_ref4) {\n var current = _ref4.current;\n scheduleOnDrag(function () {\n dragStart.flush();\n var location = {\n initial: initial,\n previous: previous,\n current: current\n };\n safeDispatch({\n eventName: 'onDrag',\n payload: {\n source: source,\n location: location\n }\n });\n });\n },\n drop: function drop(_ref5) {\n var current = _ref5.current,\n updatedSourcePayload = _ref5.updatedSourcePayload;\n dragStart.flush();\n scheduleOnDrag.cancel();\n safeDispatch({\n eventName: 'onDrop',\n payload: {\n source: updatedSourcePayload !== null && updatedSourcePayload !== void 0 ? updatedSourcePayload : source,\n location: {\n current: current,\n previous: previous,\n initial: initial\n }\n }\n });\n }\n };\n return dispatch;\n}","import _toConsumableArray from \"@babel/runtime/helpers/toConsumableArray\";\nimport { bindAll } from 'bind-event-listener';\nimport { getElementFromPointWithoutHoneypot } from '../honey-pot-fix/get-element-from-point-without-honey-pot';\nimport { isHoneyPotElement } from '../honey-pot-fix/is-honey-pot-element';\nimport { isLeavingWindow } from '../util/changing-window/is-leaving-window';\nimport { getBindingsForBrokenDrags } from '../util/detect-broken-drag';\nimport { getInput } from '../util/get-input';\nimport { makeDispatch } from './dispatch-consumer-event';\nvar globalState = {\n isActive: false\n};\nfunction canStart() {\n return !globalState.isActive;\n}\nfunction getNativeSetDragImage(event) {\n if (event.dataTransfer) {\n // need to use `.bind` as `setDragImage` is required\n // to be run with `event.dataTransfer` as the \"this\" context\n return event.dataTransfer.setDragImage.bind(event.dataTransfer);\n }\n return null;\n}\nfunction hasHierarchyChanged(_ref) {\n var current = _ref.current,\n next = _ref.next;\n if (current.length !== next.length) {\n return true;\n }\n // not checking stickiness, data or dropEffect,\n // just whether the hierarchy has changed\n for (var i = 0; i < current.length; i++) {\n if (current[i].element !== next[i].element) {\n return true;\n }\n }\n return false;\n}\nfunction start(_ref2) {\n var event = _ref2.event,\n dragType = _ref2.dragType,\n getDropTargetsOver = _ref2.getDropTargetsOver,\n dispatchEvent = _ref2.dispatchEvent;\n if (!canStart()) {\n return;\n }\n var initial = getStartLocation({\n event: event,\n dragType: dragType,\n getDropTargetsOver: getDropTargetsOver\n });\n globalState.isActive = true;\n var state = {\n current: initial\n };\n\n // Setting initial drop effect for the drag\n setDropEffectOnEvent({\n event: event,\n current: initial.dropTargets\n });\n var dispatch = makeDispatch({\n source: dragType.payload,\n dispatchEvent: dispatchEvent,\n initial: initial\n });\n function updateState(next) {\n // only looking at whether hierarchy has changed to determine whether something as 'changed'\n var hasChanged = hasHierarchyChanged({\n current: state.current.dropTargets,\n next: next.dropTargets\n });\n\n // Always updating the state to include latest data, dropEffect and stickiness\n // Only updating consumers if the hierarchy has changed in some way\n // Consumers can get the latest data by using `onDrag`\n state.current = next;\n if (hasChanged) {\n dispatch.dragUpdate({\n current: state.current\n });\n }\n }\n function onUpdateEvent(event) {\n var input = getInput(event);\n\n // If we are over the honey pot, we need to get the element\n // that the user would have been over if not for the honey pot\n var target = isHoneyPotElement(event.target) ? getElementFromPointWithoutHoneypot({\n x: input.clientX,\n y: input.clientY\n }) : event.target;\n var nextDropTargets = getDropTargetsOver({\n target: target,\n input: input,\n source: dragType.payload,\n current: state.current.dropTargets\n });\n if (nextDropTargets.length) {\n // 🩸 must call `event.preventDefault()` to allow a browser drop to occur\n event.preventDefault();\n setDropEffectOnEvent({\n event: event,\n current: nextDropTargets\n });\n }\n updateState({\n dropTargets: nextDropTargets,\n input: input\n });\n }\n function cancel() {\n // The spec behaviour is that when a drag is cancelled, or when dropping on no drop targets,\n // a \"dragleave\" event is fired on the active drop target before a \"dragend\" event.\n // We are replicating that behaviour in `cancel` if there are any active drop targets to\n // ensure consistent behaviour.\n //\n // Note: When cancelling, or dropping on no drop targets, a \"dragleave\" event\n // will have already cleared the dropTargets to `[]` (as that particular \"dragleave\" has a `relatedTarget` of `null`)\n\n if (state.current.dropTargets.length) {\n updateState({\n dropTargets: [],\n input: state.current.input\n });\n }\n dispatch.drop({\n current: state.current,\n updatedSourcePayload: null\n });\n finish();\n }\n function finish() {\n globalState.isActive = false;\n unbindEvents();\n }\n var unbindEvents = bindAll(window, [{\n // 👋 Note: we are repurposing the `dragover` event as our `drag` event\n // this is because firefox does not publish pointer coordinates during\n // a `drag` event, but does for every other type of drag event\n // `dragover` fires on all elements that are being dragged over\n // Because we are binding to `window` - our `dragover` is effectively the same as a `drag`\n // 🦊😤\n type: 'dragover',\n listener: function listener(event) {\n // We need to regularly calculate the drop targets in order to allow:\n // - dynamic `canDrop()` checks\n // - rapid updating `getData()` calls to attach data in response to user input (eg for edge detection)\n // Sadly we cannot schedule inspecting changes resulting from this event\n // we need to be able to conditionally cancel the event with `event.preventDefault()`\n // to enable the correct native drop experience.\n\n // 1. check to see if anything has changed\n onUpdateEvent(event);\n\n // 2. let consumers know a move has occurred\n // This will include the latest 'input' values\n dispatch.drag({\n current: state.current\n });\n }\n }, {\n type: 'dragenter',\n listener: onUpdateEvent\n }, {\n type: 'dragleave',\n listener: function listener(event) {\n if (!isLeavingWindow({\n dragLeave: event\n })) {\n return;\n }\n\n /**\n * At this point we don't know if a drag is being cancelled,\n * or if a drag is leaving the `window`.\n *\n * Both have:\n * 1. \"dragleave\" (with `relatedTarget: null`)\n * 2. \"dragend\" (a \"dragend\" can occur when outside the `window`)\n *\n * **Clearing drop targets**\n *\n * For either case we are clearing the the drop targets\n *\n * - cancelling: we clear drop targets in `\"dragend\"` anyway\n * - leaving the `window`: we clear the drop targets (to clear stickiness)\n *\n * **Leaving the window and finishing the drag**\n *\n * _internal drags_\n *\n * - The drag continues when the user is outside the `window`\n * and can resume if the user drags back over the `window`,\n * or end when the user drops in an external `window`.\n * - We will get a `\"dragend\"`, or we can listen for other\n * events to determine the drag is finished when the user re-enters the `window`).\n *\n * _external drags_\n *\n * - We conclude the drag operation.\n * - We have no idea if the user will drag back over the `window`,\n * or if the drag ends elsewhere.\n * - We will create a new drag if the user re-enters the `window`.\n *\n * **Not updating `input`**\n *\n * 🐛 Bug[Chrome] the final `\"dragleave\"` has default input values (eg `clientX == 0`)\n * Workaround: intentionally not updating `input` in \"dragleave\"\n * rather than the users current input values\n * - [Conversation](https://twitter.com/alexandereardon/status/1642697633864241152)\n * - [Bug](https://bugs.chromium.org/p/chromium/issues/detail?id=1429937)\n **/\n\n updateState({\n input: state.current.input,\n dropTargets: []\n });\n if (dragType.startedFrom === 'external') {\n cancel();\n }\n }\n }, {\n // A \"drop\" can only happen if the browser allowed the drop\n type: 'drop',\n listener: function listener(event) {\n // Capture the final input.\n // We are capturing the final `input` for the\n // most accurate honey pot experience\n state.current = {\n dropTargets: state.current.dropTargets,\n input: getInput(event)\n };\n\n /** If there are no drop targets, then we will get\n * a \"drop\" event if:\n * - `preventUnhandled()` is being used\n * - there is an unmanaged drop target (eg another library)\n * In these cases, it's up to the consumer\n * to handle the drop if it's not over one of our drop targets\n * - `preventUnhandled()` will cancel the \"drop\"\n * - unmanaged drop targets can handle the \"drop\" how they want to\n * We won't call `event.preventDefault()` in this call path */\n\n if (!state.current.dropTargets.length) {\n cancel();\n return;\n }\n event.preventDefault();\n\n // applying the latest drop effect to the event\n setDropEffectOnEvent({\n event: event,\n current: state.current.dropTargets\n });\n dispatch.drop({\n current: state.current,\n // When dropping something native, we need to extract the latest\n // `.items` from the \"drop\" event as it is now accessible\n updatedSourcePayload: dragType.type === 'external' ? dragType.getDropPayload(event) : null\n });\n finish();\n }\n }, {\n // \"dragend\" fires when on the drag source (eg a draggable element)\n // when the drag is finished.\n // \"dragend\" will fire after \"drop\" (if there was a successful drop)\n // \"dragend\" does not fire if the draggable source has been removed during the drag\n // or for external drag sources (eg files)\n\n // This \"dragend\" listener will not fire if there was a successful drop\n // as we will have already removed the event listener\n\n type: 'dragend',\n listener: function listener(event) {\n // In firefox, the position of the \"dragend\" event can\n // be a bit different to the last \"dragover\" event.\n // Updating the input so we can get the best possible\n // information for the honey pot.\n state.current = {\n dropTargets: state.current.dropTargets,\n input: getInput(event)\n };\n cancel();\n }\n }].concat(_toConsumableArray(getBindingsForBrokenDrags({\n onDragEnd: cancel\n }))),\n // Once we have started a managed drag operation it is important that we see / own all drag events\n // We got one adoption bug pop up where some code was stopping (`event.stopPropagation()`)\n // all \"drop\" events in the bubble phase on the `document.body`.\n // This meant that we never saw the \"drop\" event.\n {\n capture: true\n });\n dispatch.start({\n nativeSetDragImage: getNativeSetDragImage(event)\n });\n}\nfunction setDropEffectOnEvent(_ref3) {\n var _current$;\n var event = _ref3.event,\n current = _ref3.current;\n // setting the `dropEffect` to be the innerMost drop targets dropEffect\n var innerMost = (_current$ = current[0]) === null || _current$ === void 0 ? void 0 : _current$.dropEffect;\n if (innerMost != null && event.dataTransfer) {\n event.dataTransfer.dropEffect = innerMost;\n }\n}\nfunction getStartLocation(_ref4) {\n var event = _ref4.event,\n dragType = _ref4.dragType,\n getDropTargetsOver = _ref4.getDropTargetsOver;\n var input = getInput(event);\n\n // When dragging from outside of the browser,\n // the drag is not being sourced from any local drop targets\n if (dragType.startedFrom === 'external') {\n return {\n input: input,\n dropTargets: []\n };\n }\n var dropTargets = getDropTargetsOver({\n input: input,\n source: dragType.payload,\n target: event.target,\n current: []\n });\n return {\n input: input,\n dropTargets: dropTargets\n };\n}\nexport var lifecycle = {\n canStart: canStart,\n start: start\n};","// Extending `Map` to allow us to link Key and Values together\n\nvar ledger = new Map();\nfunction registerUsage(_ref) {\n var typeKey = _ref.typeKey,\n mount = _ref.mount;\n var entry = ledger.get(typeKey);\n if (entry) {\n entry.usageCount++;\n return entry;\n }\n var initial = {\n typeKey: typeKey,\n unmount: mount(),\n usageCount: 1\n };\n ledger.set(typeKey, initial);\n return initial;\n}\nexport function register(args) {\n var entry = registerUsage(args);\n return function unregister() {\n entry.usageCount--;\n if (entry.usageCount > 0) {\n return;\n }\n // Only a single usage left, remove it\n entry.unmount();\n ledger.delete(args.typeKey);\n };\n}","/** Create a new combined function that will call all the provided functions */\nexport function combine() {\n for (var _len = arguments.length, fns = new Array(_len), _key = 0; _key < _len; _key++) {\n fns[_key] = arguments[_key];\n }\n return function cleanup() {\n fns.forEach(function (fn) {\n return fn();\n });\n };\n}","export function addAttribute(element, _ref) {\n var attribute = _ref.attribute,\n value = _ref.value;\n element.setAttribute(attribute, value);\n return function () {\n return element.removeAttribute(attribute);\n };\n}","import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport _toConsumableArray from \"@babel/runtime/helpers/toConsumableArray\";\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _createForOfIteratorHelper(r, e) { var t = \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && \"number\" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nimport { combine } from '../public-utils/combine';\nimport { once } from '../public-utils/once';\nimport { addAttribute } from '../util/add-attribute';\nfunction copyReverse(array) {\n return array.slice(0).reverse();\n}\nexport function makeDropTarget(_ref) {\n var typeKey = _ref.typeKey,\n defaultDropEffect = _ref.defaultDropEffect;\n var registry = new WeakMap();\n var dropTargetDataAtt = \"data-drop-target-for-\".concat(typeKey);\n var dropTargetSelector = \"[\".concat(dropTargetDataAtt, \"]\");\n function addToRegistry(args) {\n registry.set(args.element, args);\n return function () {\n return registry.delete(args.element);\n };\n }\n function dropTargetForConsumers(args) {\n // Guardrail: warn if the draggable element is already registered\n if (process.env.NODE_ENV !== 'production') {\n var existing = registry.get(args.element);\n if (existing) {\n // eslint-disable-next-line no-console\n console.warn(\"You have already registered a [\".concat(typeKey, \"] dropTarget on the same element\"), {\n existing: existing,\n proposed: args\n });\n }\n if (args.element instanceof HTMLIFrameElement) {\n // eslint-disable-next-line no-console\n console.warn(\"\\n We recommend not registering <iframe> elements as drop targets\\n as it can result in some strange browser event ordering.\\n \" // Removing newlines and excessive whitespace\n .replace(/\\s{2,}/g, ' ').trim());\n }\n }\n var cleanup = combine(addAttribute(args.element, {\n attribute: dropTargetDataAtt,\n value: 'true'\n }), addToRegistry(args));\n\n // Wrapping in `once` to prevent unexpected side effects if consumers call\n // the clean up function multiple times.\n return once(cleanup);\n }\n function getActualDropTargets(_ref2) {\n var _args$getData, _args$getData2, _args$getDropEffect, _args$getDropEffect2;\n var source = _ref2.source,\n target = _ref2.target,\n input = _ref2.input,\n _ref2$result = _ref2.result,\n result = _ref2$result === void 0 ? [] : _ref2$result;\n if (target == null) {\n return result;\n }\n if (!(target instanceof Element)) {\n // For \"text-selection\" drags, the original `target`\n // is not an `Element`, so we need to start looking from\n // the parent element\n if (target instanceof Node) {\n return getActualDropTargets({\n source: source,\n target: target.parentElement,\n input: input,\n result: result\n });\n }\n\n // not sure what we are working with,\n // so we can exit.\n return result;\n }\n var closest = target.closest(dropTargetSelector);\n\n // Cannot find anything else\n if (closest == null) {\n return result;\n }\n var args = registry.get(closest);\n\n // error: something had a dropTargetSelector but we could not\n // find a match. For now, failing silently\n if (args == null) {\n return result;\n }\n var feedback = {\n input: input,\n source: source,\n element: args.element\n };\n\n // if dropping is not allowed, skip this drop target\n // and continue looking up the DOM tree\n if (args.canDrop && !args.canDrop(feedback)) {\n return getActualDropTargets({\n source: source,\n target: args.element.parentElement,\n input: input,\n result: result\n });\n }\n\n // calculate our new record\n var data = (_args$getData = (_args$getData2 = args.getData) === null || _args$getData2 === void 0 ? void 0 : _args$getData2.call(args, feedback)) !== null && _args$getData !== void 0 ? _args$getData : {};\n var dropEffect = (_args$getDropEffect = (_args$getDropEffect2 = args.getDropEffect) === null || _args$getDropEffect2 === void 0 ? void 0 : _args$getDropEffect2.call(args, feedback)) !== null && _args$getDropEffect !== void 0 ? _args$getDropEffect : defaultDropEffect;\n var record = {\n data: data,\n element: args.element,\n dropEffect: dropEffect,\n // we are collecting _actual_ drop targets, so these are\n // being applied _not_ due to stickiness\n isActiveDueToStickiness: false\n };\n return getActualDropTargets({\n source: source,\n target: args.element.parentElement,\n input: input,\n // Using bubble ordering. Same ordering as `event.getPath()`\n result: [].concat(_toConsumableArray(result), [record])\n });\n }\n function notifyCurrent(_ref3) {\n var eventName = _ref3.eventName,\n payload = _ref3.payload;\n var _iterator = _createForOfIteratorHelper(payload.location.current.dropTargets),\n _step;\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var _entry$eventName;\n var record = _step.value;\n var entry = registry.get(record.element);\n var args = _objectSpread(_objectSpread({}, payload), {}, {\n self: record\n });\n entry === null || entry === void 0 || (_entry$eventName = entry[eventName]) === null || _entry$eventName === void 0 || _entry$eventName.call(entry,\n // I cannot seem to get the types right here.\n // TS doesn't seem to like that one event can need `nativeSetDragImage`\n // @ts-expect-error\n args);\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n }\n var actions = {\n onGenerateDragPreview: notifyCurrent,\n onDrag: notifyCurrent,\n onDragStart: notifyCurrent,\n onDrop: notifyCurrent,\n onDropTargetChange: function onDropTargetChange(_ref4) {\n var payload = _ref4.payload;\n var isCurrent = new Set(payload.location.current.dropTargets.map(function (record) {\n return record.element;\n }));\n var visited = new Set();\n var _iterator2 = _createForOfIteratorHelper(payload.location.previous.dropTargets),\n _step2;\n try {\n for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {\n var _entry$onDropTargetCh;\n var record = _step2.value;\n visited.add(record.element);\n var entry = registry.get(record.element);\n var isOver = isCurrent.has(record.element);\n var args = _objectSpread(_objectSpread({}, payload), {}, {\n self: record\n });\n entry === null || entry === void 0 || (_entry$onDropTargetCh = entry.onDropTargetChange) === null || _entry$onDropTargetCh === void 0 || _entry$onDropTargetCh.call(entry, args);\n\n // if we cannot find the drop target in the current array, then it has been left\n if (!isOver) {\n var _entry$onDragLeave;\n entry === null || entry === void 0 || (_entry$onDragLeave = entry.onDragLeave) === null || _entry$onDragLeave === void 0 || _entry$onDragLeave.call(entry, args);\n }\n }\n } catch (err) {\n _iterator2.e(err);\n } finally {\n _iterator2.f();\n }\n var _iterator3 = _createForOfIteratorHelper(payload.location.current.dropTargets),\n _step3;\n try {\n for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {\n var _entry$onDropTargetCh2, _entry$onDragEnter;\n var _record = _step3.value;\n // already published an update to this drop target\n if (visited.has(_record.element)) {\n continue;\n }\n // at this point we have a new drop target that is being entered into\n var _args = _objectSpread(_objectSpread({}, payload), {}, {\n self: _record\n });\n var _entry = registry.get(_record.element);\n _entry === null || _entry === void 0 || (_entry$onDropTargetCh2 = _entry.onDropTargetChange) === null || _entry$onDropTargetCh2 === void 0 || _entry$onDropTargetCh2.call(_entry, _args);\n _entry === null || _entry === void 0 || (_entry$onDragEnter = _entry.onDragEnter) === null || _entry$onDragEnter === void 0 || _entry$onDragEnter.call(_entry, _args);\n }\n } catch (err) {\n _iterator3.e(err);\n } finally {\n _iterator3.f();\n }\n }\n };\n function dispatchEvent(args) {\n actions[args.eventName](args);\n }\n function getIsOver(_ref5) {\n var source = _ref5.source,\n target = _ref5.target,\n input = _ref5.input,\n current = _ref5.current;\n var actual = getActualDropTargets({\n source: source,\n target: target,\n input: input\n });\n\n // stickiness is only relevant when we have less\n // drop targets than we did before\n if (actual.length >= current.length) {\n return actual;\n }\n\n // less 'actual' drop targets than before,\n // we need to see if 'stickiness' applies\n\n // An old drop target will continue to be dropped on if:\n // 1. it has the same parent\n // 2. nothing exists in it's previous index\n\n var lastCaptureOrdered = copyReverse(current);\n var actualCaptureOrdered = copyReverse(actual);\n var resultCaptureOrdered = [];\n for (var index = 0; index < lastCaptureOrdered.length; index++) {\n var _argsForLast$getIsSti;\n var last = lastCaptureOrdered[index];\n var fresh = actualCaptureOrdered[index];\n\n // if a record is in the new index -> use that\n // it will have the latest data + dropEffect\n if (fresh != null) {\n resultCaptureOrdered.push(fresh);\n continue;\n }\n\n // At this point we have no drop target in the old spot\n // Check to see if we can use a previous sticky drop target\n\n // The \"parent\" is the one inside of `resultCaptureOrdered`\n // (the parent might be a drop target that was sticky)\n var parent = resultCaptureOrdered[index - 1];\n var lastParent = lastCaptureOrdered[index - 1];\n\n // Stickiness is based on parent relationships, so if the parent relationship has change\n // then we can stop our search\n if ((parent === null || parent === void 0 ? void 0 : parent.element) !== (lastParent === null || lastParent === void 0 ? void 0 : lastParent.element)) {\n break;\n }\n\n // We need to check whether the old drop target can still be dropped on\n\n var argsForLast = registry.get(last.element);\n\n // We cannot drop on a drop target that is no longer mounted\n if (!argsForLast) {\n break;\n }\n var feedback = {\n input: input,\n source: source,\n element: argsForLast.element\n };\n\n // We cannot drop on a drop target that no longer allows being dropped on\n if (argsForLast.canDrop && !argsForLast.canDrop(feedback)) {\n break;\n }\n\n // We cannot drop on a drop target that is no longer sticky\n if (!((_argsForLast$getIsSti = argsForLast.getIsSticky) !== null && _argsForLast$getIsSti !== void 0 && _argsForLast$getIsSti.call(argsForLast, feedback))) {\n break;\n }\n\n // Note: intentionally not recollecting `getData()` or `getDropEffect()`\n // Previous values for `data` and `dropEffect` will be borrowed\n // This is to prevent things like the 'closest edge' changing when\n // no longer over a drop target.\n // We could change our mind on this behaviour in the future\n\n resultCaptureOrdered.push(_objectSpread(_objectSpread({}, last), {}, {\n // making it clear to consumers this drop target is active due to stickiness\n isActiveDueToStickiness: true\n }));\n }\n\n // return bubble ordered result\n return copyReverse(resultCaptureOrdered);\n }\n return {\n dropTargetForConsumers: dropTargetForConsumers,\n getIsOver: getIsOver,\n dispatchEvent: dispatchEvent\n };\n}","import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nfunction _createForOfIteratorHelper(r, e) { var t = \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && \"number\" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nimport { once } from '../public-utils/once';\nexport function makeMonitor() {\n var registry = new Set();\n var dragging = null;\n function tryAddToActive(monitor) {\n if (!dragging) {\n return;\n }\n // Monitor is allowed to monitor events if:\n // 1. It has no `canMonitor` function (default is that a monitor can listen to everything)\n // 2. `canMonitor` returns true\n if (!monitor.canMonitor || monitor.canMonitor(dragging.canMonitorArgs)) {\n dragging.active.add(monitor);\n }\n }\n function monitorForConsumers(args) {\n // We are giving each `args` a new reference so that you\n // can create multiple monitors with the same `args`.\n var entry = _objectSpread({}, args);\n registry.add(entry);\n\n // if there is an active drag we need to see if this new monitor is relevant\n tryAddToActive(entry);\n function cleanup() {\n registry.delete(entry);\n\n // We need to stop publishing events during a drag to this monitor!\n if (dragging) {\n dragging.active.delete(entry);\n }\n }\n\n // Wrapping in `once` to prevent unexpected side effects if consumers call\n // the clean up function multiple times.\n return once(cleanup);\n }\n function dispatchEvent(_ref) {\n var eventName = _ref.eventName,\n payload = _ref.payload;\n if (eventName === 'onGenerateDragPreview') {\n dragging = {\n canMonitorArgs: {\n initial: payload.location.initial,\n source: payload.source\n },\n active: new Set()\n };\n var _iterator = _createForOfIteratorHelper(registry),\n _step;\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var monitor = _step.value;\n tryAddToActive(monitor);\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n }\n\n // This should never happen.\n if (!dragging) {\n return;\n }\n\n // Creating an array from the set _before_ iterating\n // This is so that monitors added during the current event will not be called.\n // This behaviour matches native EventTargets where an event listener\n // cannot add another event listener during an active event to the same\n // event target in the same event (for us we have a single global event target)\n var active = Array.from(dragging.active);\n for (var _i = 0, _active = active; _i < _active.length; _i++) {\n var _monitor = _active[_i];\n // A monitor can be removed by another monitor during an event.\n // We need to check that the monitor is still registered before calling it\n if (dragging.active.has(_monitor)) {\n var _monitor$eventName;\n // @ts-expect-error: I cannot get this type working!\n (_monitor$eventName = _monitor[eventName]) === null || _monitor$eventName === void 0 || _monitor$eventName.call(_monitor, payload);\n }\n }\n if (eventName === 'onDrop') {\n dragging.active.clear();\n dragging = null;\n }\n }\n return {\n dispatchEvent: dispatchEvent,\n monitorForConsumers: monitorForConsumers\n };\n}","import { lifecycle } from '../ledger/lifecycle-manager';\nimport { register } from '../ledger/usage-ledger';\nimport { makeDropTarget } from './make-drop-target';\nimport { makeMonitor } from './make-monitor';\nexport function makeAdapter(_ref) {\n var typeKey = _ref.typeKey,\n mount = _ref.mount,\n dispatchEventToSource = _ref.dispatchEventToSource,\n onPostDispatch = _ref.onPostDispatch,\n defaultDropEffect = _ref.defaultDropEffect;\n var monitorAPI = makeMonitor();\n var dropTargetAPI = makeDropTarget({\n typeKey: typeKey,\n defaultDropEffect: defaultDropEffect\n });\n function dispatchEvent(args) {\n // 1. forward the event to source\n dispatchEventToSource === null || dispatchEventToSource === void 0 || dispatchEventToSource(args);\n\n // 2. forward the event to relevant dropTargets\n dropTargetAPI.dispatchEvent(args);\n\n // 3. forward event to monitors\n monitorAPI.dispatchEvent(args);\n\n // 4. post consumer dispatch (used for honey pot fix)\n onPostDispatch === null || onPostDispatch === void 0 || onPostDispatch(args);\n }\n function start(_ref2) {\n var event = _ref2.event,\n dragType = _ref2.dragType;\n lifecycle.start({\n event: event,\n dragType: dragType,\n getDropTargetsOver: dropTargetAPI.getIsOver,\n dispatchEvent: dispatchEvent\n });\n }\n function registerUsage() {\n function mountAdapter() {\n var api = {\n canStart: lifecycle.canStart,\n start: start\n };\n return mount(api);\n }\n return register({\n typeKey: typeKey,\n mount: mountAdapter\n });\n }\n return {\n registerUsage: registerUsage,\n dropTarget: dropTargetAPI.dropTargetForConsumers,\n monitor: monitorAPI.monitorForConsumers\n };\n}","import { once } from '../public-utils/once';\n\n// Using `once` as the value won't change in a browser\n\nexport var isAndroid = once(function isAndroid() {\n return navigator.userAgent.toLocaleLowerCase().includes('android');\n});\n\n// eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports\nexport var androidFallbackText = 'pdnd:android-fallback';","// Why we put the media types in their own files:\n//\n// - we are not putting them all in one file as not all adapters need all types\n// - we are not putting them in the external helpers as some things just need the\n// types and not the external functions code\nexport var textMediaType = 'text/plain';","// Why we put the media types in their own files:\n//\n// - we are not putting them all in one file as not all adapters need all types\n// - we are not putting them in the external helpers as some things just need the\n// types and not the external functions code\nexport var URLMediaType = 'text/uri-list';","/**\n * This key has been pulled into a separate module\n * so that the external adapter does not need to import\n * the element adapter\n */\nexport var elementAdapterNativeDataKey = 'application/vnd.pdnd';","import _slicedToArray from \"@babel/runtime/helpers/slicedToArray\";\nimport { bind } from 'bind-event-listener';\nimport { getElementFromPointWithoutHoneypot } from '../honey-pot-fix/get-element-from-point-without-honey-pot';\nimport { makeHoneyPotFix } from '../honey-pot-fix/make-honey-pot-fix';\nimport { makeAdapter } from '../make-adapter/make-adapter';\nimport { combine } from '../public-utils/combine';\nimport { once } from '../public-utils/once';\nimport { addAttribute } from '../util/add-attribute';\nimport { androidFallbackText, isAndroid } from '../util/android';\nimport { getInput } from '../util/get-input';\nimport { textMediaType } from '../util/media-types/text-media-type';\nimport { URLMediaType } from '../util/media-types/url-media-type';\nimport { elementAdapterNativeDataKey } from './element-adapter-native-data-key';\n\n// Payload for the draggable being dragged\n// eslint-disable-next-line @atlaskit/volt-strict-mode/no-re-exports\n\nvar draggableRegistry = new WeakMap();\nfunction addToRegistry(args) {\n draggableRegistry.set(args.element, args);\n return function cleanup() {\n draggableRegistry.delete(args.element);\n };\n}\nvar honeyPotFix = makeHoneyPotFix();\nvar adapter = makeAdapter({\n typeKey: 'element',\n defaultDropEffect: 'move',\n mount: function mount(api) {\n /** Binding event listeners the `document` rather than `window` so that\n * this adapter always gets preference over the text adapter.\n * `document` is the first `EventTarget` under `window`\n * https://twitter.com/alexandereardon/status/1604658588311465985\n */\n return combine(honeyPotFix.bindEvents(), bind(document, {\n type: 'dragstart',\n listener: function listener(event) {\n var _entry$dragHandle, _entry$getInitialData, _entry$getInitialData2, _entry$dragHandle2, _entry$getInitialData3, _entry$getInitialData4;\n if (!api.canStart(event)) {\n return;\n }\n\n // If the \"dragstart\" event is cancelled, then a drag won't start\n // There will be no further drag operation events (eg no \"dragend\" event)\n if (event.defaultPrevented) {\n return;\n }\n\n // Technically `dataTransfer` can be `null` according to the types\n // But that behaviour does not seem to appear in the spec.\n // If there is not `dataTransfer`, we can assume something is wrong and not\n // start a drag\n if (!event.dataTransfer) {\n // Including this code on \"test\" and \"development\" environments:\n // - Browser tests commonly run against \"development\" builds\n // - Unit tests commonly run in \"test\"\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line no-console\n console.warn(\"\\n It appears as though you have are not testing DragEvents correctly.\\n\\n - If you are unit testing, ensure you have polyfilled DragEvent.\\n - If you are browser testing, ensure you are dispatching drag events correctly.\\n\\n Please see our testing guides for more information:\\n https://atlassian.design/components/pragmatic-drag-and-drop/core-package/testing\\n \".replace(/ {2}/g, ''));\n }\n return;\n }\n\n // the closest parent that is a draggable element will be marked as\n // the `event.target` for the event\n var target = event.target;\n\n // this source is only for elements\n // Note: only HTMLElements can have the \"draggable\" attribute\n if (!(target instanceof HTMLElement)) {\n return;\n }\n\n // see if the thing being dragged is owned by us\n var entry = draggableRegistry.get(target);\n\n // no matching element found\n // → dragging an element with `draggable=\"true\"` that is not controlled by us\n if (!entry) {\n return;\n }\n\n /**\n * A text selection drag _can_ have the `draggable` element be\n * the `event.target` if the user is dragging the text selection\n * from the `draggable`.\n *\n * To know if the `draggable` is being dragged, we look at whether any\n * `\"text/plain\"` data is being dragged. If it is, then a text selection\n * drag is occurring.\n *\n * This behaviour has been validated on:\n *\n * - Chrome@128 on Android@14\n * - Chrome@128 on iOS@17.6.1\n * - Chrome@128 on Windows@11\n * - Chrome@128 on MacOS@14.6.1\n * - Firefox@129 on Windows@11 (not possible for user to select text in a draggable)\n * - Firefox@129 on MacOS@14.6.1 (not possible for user to select text in a draggable)\n *\n * Note: Could usually just use: `event.dataTransfer.types.includes(textMediaType)`\n * but unfortunately ProseMirror is always setting `\"\"` as the dragged text\n *\n * Note: Unfortunately editor is (heavily) leaning on the current functionality today\n * and unwinding it will be a decent amount of effort. So for now, a text selection\n * where the `event.target` is a `draggable` element will still trigger the\n * element adapter.\n *\n * // Future state:\n * if(event.dataTransfer.getData(textMediaType)) {\n * \treturn;\n * }\n *\n */\n\n var input = getInput(event);\n var feedback = {\n element: entry.element,\n dragHandle: (_entry$dragHandle = entry.dragHandle) !== null && _entry$dragHandle !== void 0 ? _entry$dragHandle : null,\n input: input\n };\n\n // Check: does the draggable want to allow dragging?\n if (entry.canDrag && !entry.canDrag(feedback)) {\n // cancel drag operation if we cannot drag\n event.preventDefault();\n return;\n }\n\n // Check: is there a drag handle and is the user using it?\n if (entry.dragHandle) {\n // technically don't need this util, but just being\n // consistent with how we look up what is under the users\n // cursor.\n var over = getElementFromPointWithoutHoneypot({\n x: input.clientX,\n y: input.clientY\n });\n\n // if we are not dragging from the drag handle (or something inside the drag handle)\n // then we will cancel the active drag\n if (!entry.dragHandle.contains(over)) {\n event.preventDefault();\n return;\n }\n }\n\n /**\n * **Goal**\n * Pass information to other applications\n *\n * **Approach**\n * Put data into the native data store\n *\n * **What about the native adapter?**\n * When the element adapter puts native data into the native data store\n * the native adapter is not triggered in the current window,\n * but a native adapter in an external window _can_ be triggered\n *\n * **Why bake this into core?**\n * This functionality could be pulled out and exposed inside of\n * `onGenerateDragPreview`. But decided to make it a part of the\n * base API as it felt like a common enough use case and ended\n * up being a similar amount of code to include this function as\n * it was to expose the hook for it\n */\n var nativeData = (_entry$getInitialData = (_entry$getInitialData2 = entry.getInitialDataForExternal) === null || _entry$getInitialData2 === void 0 ? void 0 : _entry$getInitialData2.call(entry, feedback)) !== null && _entry$getInitialData !== void 0 ? _entry$getInitialData : null;\n if (nativeData) {\n for (var _i = 0, _Object$entries = Object.entries(nativeData); _i < _Object$entries.length; _i++) {\n var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),\n key = _Object$entries$_i[0],\n data = _Object$entries$_i[1];\n event.dataTransfer.setData(key, data !== null && data !== void 0 ? data : '');\n }\n }\n\n /**\n * 📱 For Android devices, a drag operation will not start unless\n * \"text/plain\" or \"text/uri-list\" data exists in the native data store\n * https://twitter.com/alexandereardon/status/1732189803754713424\n *\n * Tested on:\n * Device: Google Pixel 5\n * Android version: 14 (November 5, 2023)\n * Chrome version: 120.0\n */\n if (isAndroid() && !event.dataTransfer.types.includes(textMediaType) && !event.dataTransfer.types.includes(URLMediaType)) {\n event.dataTransfer.setData(textMediaType, androidFallbackText);\n }\n\n /**\n * 1. Must set any media type for `iOS15` to work\n * 2. We are also doing adding data so that the native adapter\n * can know that the element adapter has handled this drag\n *\n * We used to wrap this `setData()` in a `try/catch` for Firefox,\n * but it looks like that was not needed.\n *\n * Tested using: https://codesandbox.io/s/checking-firefox-throw-behaviour-on-dragstart-qt8h4f\n *\n * - ✅ Firefox@70.0 (Oct 2019) on macOS Sonoma\n * - ✅ Firefox@70.0 (Oct 2019) on macOS Big Sur\n * - ✅ Firefox@70.0 (Oct 2019) on Windows 10\n *\n * // just checking a few more combinations to be super safe\n *\n * - ✅ Chrome@78 (Oct 2019) on macOS Big Sur\n * - ✅ Chrome@78 (Oct 2019) on Windows 10\n * - ✅ Safari@14.1 on macOS Big Sur\n */\n event.dataTransfer.setData(elementAdapterNativeDataKey, '');\n var payload = {\n element: entry.element,\n dragHandle: (_entry$dragHandle2 = entry.dragHandle) !== null && _entry$dragHandle2 !== void 0 ? _entry$dragHandle2 : null,\n data: (_entry$getInitialData3 = (_entry$getInitialData4 = entry.getInitialData) === null || _entry$getInitialData4 === void 0 ? void 0 : _entry$getInitialData4.call(entry, feedback)) !== null && _entry$getInitialData3 !== void 0 ? _entry$getInitialData3 : {}\n };\n var dragType = {\n type: 'element',\n payload: payload,\n startedFrom: 'internal'\n };\n api.start({\n event: event,\n dragType: dragType\n });\n }\n }));\n },\n dispatchEventToSource: function dispatchEventToSource(_ref) {\n var _draggableRegistry$ge, _draggableRegistry$ge2;\n var eventName = _ref.eventName,\n payload = _ref.payload;\n // During a drag operation, a draggable can be:\n // - remounted with different functions\n // - removed completely\n // So we need to get the latest entry from the registry in order\n // to call the latest event functions\n\n (_draggableRegistry$ge = draggableRegistry.get(payload.source.element)) === null || _draggableRegistry$ge === void 0 || (_draggableRegistry$ge2 = _draggableRegistry$ge[eventName]) === null || _draggableRegistry$ge2 === void 0 || _draggableRegistry$ge2.call(_draggableRegistry$ge,\n // I cannot seem to get the types right here.\n // TS doesn't seem to like that one event can need `nativeSetDragImage`\n // @ts-expect-error\n payload);\n },\n onPostDispatch: honeyPotFix.getOnPostDispatch()\n});\nexport var dropTargetForElements = adapter.dropTarget;\n// eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports\nexport var monitorForElements = adapter.monitor;\n\n// eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports\nexport function draggable(args) {\n // Guardrail: warn if the drag handle is not contained in draggable element\n if (process.env.NODE_ENV !== 'production') {\n if (args.dragHandle && !args.element.contains(args.dragHandle)) {\n // eslint-disable-next-line no-console\n console.warn('Drag handle element must be contained in draggable element', {\n element: args.element,\n dragHandle: args.dragHandle\n });\n }\n }\n // Guardrail: warn if the draggable element is already registered\n if (process.env.NODE_ENV !== 'production') {\n var existing = draggableRegistry.get(args.element);\n if (existing) {\n // eslint-disable-next-line no-console\n console.warn('You have already registered a `draggable` on the same element', {\n existing: existing,\n proposed: args\n });\n }\n }\n var cleanup = combine(\n // making the draggable register the adapter rather than drop targets\n // this is because you *must* have a draggable element to start a drag\n // but you _might_ not have any drop targets immediately\n // (You might create drop targets async)\n adapter.registerUsage(), addToRegistry(args), addAttribute(args.element, {\n attribute: 'draggable',\n value: 'true'\n }));\n\n // Wrapping in `once` to prevent unexpected side effects if consumers call\n // the clean up function multiple times.\n return once(cleanup);\n}\n\n/** Common event payload for all events */\n\n/** A map containing payloads for all events */\n\n/** Common event payload for all drop target events */\n\n/** A map containing payloads for all events on drop targets */\n\n/** Arguments given to all feedback functions (eg `canDrag()`) on for a `draggable()` */\n\n/** Arguments given to all feedback functions (eg `canDrop()`) on a `dropTargetForElements()` */\n\n/** Arguments given to all monitor feedback functions (eg `canMonitor()`) for a `monitorForElements` */","var ledger = new Map();\nvar requested = new Set();\nexport function markAndGetEngagement(element) {\n markEngagement(element);\n var entry = ledger.get(element);\n if (entry) {\n return entry;\n }\n var fresh = {\n timeOfEngagementStart: Date.now()\n };\n ledger.set(element, fresh);\n return fresh;\n}\n\n// eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports\nexport function markEngagement(element) {\n requested.add(element);\n}\n\n// eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports\nexport function clearUnusedEngagements(fn) {\n // make sure previous engagement requests don't linger\n requested.clear();\n\n // perform the required work\n fn();\n\n // if engagements where not requested, purge it\n ledger.forEach(function (_, element) {\n if (!requested.has(element)) {\n ledger.delete(element);\n }\n });\n\n // cleaning up after ourselves\n requested.clear();\n}\n\n// eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports\nexport function clearEngagementHistory() {\n ledger.clear();\n}","import { getElementFromPointWithoutHoneypot } from '@atlaskit/pragmatic-drag-and-drop/get-element-from-point-without-honey-pot';\nimport { clearEngagementHistory, clearUnusedEngagements } from './engagement-history';\n// We keep this map so that \"over element\" scrolling and \"overflow\" scrolling\n// can leverage the same scheduler.\n// The 'monitor' is the key for looking up schedulers\nvar schedulers = new Map();\nexport function getScheduler(monitor) {\n var scheduler = schedulers.get(monitor);\n if (scheduler) {\n // @ts-expect-error: I don't know how to link the DragType generic between the key and the value when the\n // monitor itself is the key\n return scheduler;\n }\n var created = makeScheduler(monitor);\n schedulers.set(monitor, created);\n return created;\n}\nfunction makeScheduler(monitor) {\n var state = {\n type: 'idle'\n };\n var callbacks = [];\n function loop(timeLastFrameFinished) {\n if (state.type !== 'running') {\n return;\n }\n var timeSinceLastFrame = timeLastFrameFinished - state.timeLastFrameFinished;\n var _state = state,\n latestArgs = _state.latestArgs;\n\n // A common starting lookup point for determining\n // which auto scroller should be used, and what should be scrolled.\n var underUsersPointer = getElementFromPointWithoutHoneypot({\n x: latestArgs.location.current.input.clientX,\n y: latestArgs.location.current.input.clientY\n });\n clearUnusedEngagements(function () {\n callbacks.forEach(function (onFrame) {\n return onFrame({\n underUsersPointer: underUsersPointer,\n latestArgs: latestArgs,\n timeSinceLastFrame: timeSinceLastFrame\n });\n });\n });\n state.timeLastFrameFinished = timeLastFrameFinished;\n state.frameId = requestAnimationFrame(loop);\n }\n function reset() {\n if (state.type === 'idle') {\n return;\n }\n cancelAnimationFrame(state.frameId);\n clearEngagementHistory();\n state = {\n type: 'idle'\n };\n }\n function start(args) {\n if (state.type !== 'idle') {\n return;\n }\n state = {\n // Waiting a frame so we can accurately determine `timeSinceLastFrame`.\n type: 'initializing',\n latestArgs: args,\n frameId: requestAnimationFrame(function (timeLastFrameFinished) {\n if (state.type !== 'initializing') {\n return;\n }\n state = {\n type: 'running',\n timeLastFrameFinished: timeLastFrameFinished,\n latestArgs: state.latestArgs,\n frameId: requestAnimationFrame(loop)\n };\n })\n };\n }\n\n // this module might have been imported after a drag has started\n // We are starting the auto scroller if we get an update event and\n // the auto scroller has not started yet\n function update(args) {\n if (state.type === 'idle') {\n start(args);\n return;\n }\n state.latestArgs = args;\n }\n\n // Not exposing a way to stop listening\n monitor({\n onDragStart: start,\n onDropTargetChange: update,\n onDrag: update,\n onDrop: reset\n });\n var api = {\n onFrame: function onFrame(fn) {\n callbacks.push(fn);\n }\n };\n return api;\n}","export var dataAttribute = 'data-auto-scrollable';\n// eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports\nexport var selector = \"[\".concat(dataAttribute, \"=\\\"true\\\"]\");\n\n// eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports\nexport function addScrollableAttribute(element) {\n element.setAttribute(dataAttribute, 'true');\n return function () {\n return element.removeAttribute(dataAttribute);\n };\n}","import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nvar baseConfig = {\n startHitboxAtPercentageRemainingOfElement: {\n top: 0.25,\n right: 0.25,\n bottom: 0.25,\n left: 0.25\n },\n maxScrollAtPercentageRemainingOfHitbox: {\n top: 0.5,\n right: 0.5,\n bottom: 0.5,\n left: 0.5\n },\n timeDampeningDurationMs: 400,\n // Too big and it's too easy to trigger auto scrolling\n // Too small and it's too hard 😅\n maxMainAxisHitboxSize: 180\n};\n\n/** What the max scroll should be per second. Using \"per second\" rather than \"per frame\"\n * as we want a consistent scroll speed regardless of frame rate.\n *\n *\n * I explored trying to make the max scroll speed dynamic based on particular factors.\n * However, it ended up being difficult to find a _perfect_ formula.\n *\n * Likely the perfect answer would involve:\n * - the size of the scrollable element\n * - the size of the scrollable element relative to the screen size\n * - the size of the drag preview\n * - the size of elements being scrolled in scrollable elements (expensive and difficult to compute)\n */\nvar maxPixelScrollPerSecond = {\n // What the value would be if we were scrolling at 15px per frame at 60fps.\n // This is the default as it works well for most experiences.\n // In certain scenarios though it can feel a bit slow.\n standard: 15 * 60,\n // What the value would be if we were scrolling at 25px per frame at 60fps.\n // This is not the default as it feels too fast for a lot of experiences.\n fast: 25 * 60\n};\nexport function getInternalConfig(provided) {\n var _provided$maxScrollSp;\n return _objectSpread(_objectSpread({}, baseConfig), {}, {\n // only allowing limited control over the config at this stage\n maxPixelScrollPerSecond: maxPixelScrollPerSecond[(_provided$maxScrollSp = provided === null || provided === void 0 ? void 0 : provided.maxScrollSpeed) !== null && _provided$maxScrollSp !== void 0 ? _provided$maxScrollSp : 'standard']\n });\n}","export var canScrollOnEdge = {\n // Notes:\n //\n // 🌏 Chrome 115.0: uses fractional units for `scrollLeft` and `scrollTop`\n // (and fractional units don't reach true integer maximum when zoomed in / out)\n // 🍎 Safari 16.5.2: no fractional units\n // 🦊 Firefox 115.0: no fractional units\n\n // we have some scroll we can move backwards into\n top: function top(element) {\n return element.scrollTop > 0;\n },\n // We have some scroll we can move forward into\n right: function right(element) {\n return Math.ceil(element.scrollLeft) + element.clientWidth < element.scrollWidth;\n },\n // We have some scroll we can move forwards into\n bottom: function bottom(element) {\n return Math.ceil(element.scrollTop) + element.clientHeight < element.scrollHeight;\n },\n // we have some scroll we can move back into.\n left: function left(element) {\n return element.scrollLeft > 0;\n }\n};","export var edges = ['top', 'right', 'bottom', 'left'];\n\n// eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports\nexport var edgeAxisLookup = {\n top: 'vertical',\n right: 'horizontal',\n bottom: 'vertical',\n left: 'horizontal'\n};","var vertical = {\n start: 'top',\n end: 'bottom',\n point: 'y',\n size: 'height'\n};\nvar horizontal = {\n start: 'left',\n end: 'right',\n point: 'x',\n size: 'width'\n};\nexport var axisLookup = {\n vertical: {\n mainAxis: vertical,\n crossAxis: horizontal\n },\n horizontal: {\n mainAxis: horizontal,\n crossAxis: vertical\n }\n};","export var mainAxisSideLookup = {\n top: 'start',\n right: 'end',\n bottom: 'end',\n left: 'start'\n};","import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport { axisLookup } from './axis';\nimport { mainAxisSideLookup } from './side';\nfunction makeGetHitbox(_ref) {\n var edge = _ref.edge,\n axis = _ref.axis;\n return function hitbox(_ref2) {\n var clientRect = _ref2.clientRect,\n config = _ref2.config;\n var _axisLookup$axis = axisLookup[axis],\n mainAxis = _axisLookup$axis.mainAxis,\n crossAxis = _axisLookup$axis.crossAxis;\n var side = mainAxisSideLookup[edge];\n var mainAxisHitboxSize = Math.min(\n // scale the size of the hitbox down for smaller elements\n config.startHitboxAtPercentageRemainingOfElement[edge] * clientRect[mainAxis.size],\n // Don't let the hitbox grow too big for big elements\n config.maxMainAxisHitboxSize);\n return DOMRect.fromRect(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, mainAxis.point, side === 'start' ?\n // begin from the start edge and grow inwards\n clientRect[mainAxis.point] :\n // begin from inside the end edge and grow towards the end edge\n clientRect[mainAxis.point] + clientRect[mainAxis.size] - mainAxisHitboxSize), crossAxis.point, clientRect[crossAxis.point]), mainAxis.size, mainAxisHitboxSize), crossAxis.size, clientRect[crossAxis.size]));\n };\n}\nexport var getOverElementHitbox = {\n top: makeGetHitbox({\n axis: 'vertical',\n edge: 'top'\n }),\n right: makeGetHitbox({\n axis: 'horizontal',\n edge: 'right'\n }),\n bottom: makeGetHitbox({\n axis: 'vertical',\n edge: 'bottom'\n }),\n left: makeGetHitbox({\n axis: 'horizontal',\n edge: 'left'\n })\n};","export function getPercentageInRange(_ref) {\n var startOfRange = _ref.startOfRange,\n endOfRange = _ref.endOfRange,\n value = _ref.value;\n // checking inputs\n var isValid = startOfRange < endOfRange;\n if (!isValid) {\n return 0;\n }\n if (value < startOfRange) {\n return 0;\n }\n if (value > endOfRange) {\n return 1;\n }\n var range = endOfRange - startOfRange;\n return (value - startOfRange) / range;\n}","import { axisLookup } from './axis';\nimport { getPercentageInRange } from './get-percentage-in-range';\nimport { mainAxisSideLookup } from './side';\n\n// We want a consistent scroll speed across devices, regardless of framerate\nfunction getMaxScrollChange(_ref) {\n var timeSinceLastFrame = _ref.timeSinceLastFrame,\n config = _ref.config;\n var targetScrollPerMs = config.maxPixelScrollPerSecond / 1000;\n\n // Adjusting out target scroll rate to match the frame rate of the target device\n // This will pull the scroll speed down on high frame rate devices\n // so we get a consistent visual scroll speed regardless of device.\n var proposed = Math.ceil(targetScrollPerMs * timeSinceLastFrame);\n\n // If lots of time as passed since that last frame (such on lower frame rate devices)\n // we don't want the scroll speed to be too fast, otherwise it can feel jumpy\n // We are capping the scroll speed at what it would be if we were hitting 60fps\n var maximum = config.maxPixelScrollPerSecond / 60;\n return Math.min(proposed, maximum);\n}\nfunction getDistanceDampening(_ref2) {\n var client = _ref2.client,\n axis = _ref2.axis,\n edge = _ref2.edge,\n hitbox = _ref2.hitbox,\n config = _ref2.config;\n var mainAxis = axisLookup[axis].mainAxis;\n var side = mainAxisSideLookup[edge];\n\n // We want to hit the max speed before the edge of the hitbox\n var maxSpeedBuffer = hitbox[mainAxis.size] * config.maxScrollAtPercentageRemainingOfHitbox[edge];\n if (side === 'end') {\n return getPercentageInRange({\n startOfRange: hitbox[mainAxis.start],\n endOfRange: hitbox[mainAxis.end] - maxSpeedBuffer,\n value: client[mainAxis.point]\n });\n }\n\n // Moving towards start edge\n\n var raw = getPercentageInRange({\n startOfRange: hitbox[mainAxis.start] + maxSpeedBuffer,\n endOfRange: hitbox[mainAxis.end],\n value: client[mainAxis.point]\n });\n // When moving near start edge\n // - the 'end' edge is where we start scrolling\n // - the 'start' edge is where we reach max speed\n // So we need to invert the percentage when moving backwards\n return 1 - raw;\n}\nexport function getScrollChange(_ref3) {\n var client = _ref3.client,\n timeSinceLastFrame = _ref3.timeSinceLastFrame,\n engagement = _ref3.engagement,\n axis = _ref3.axis,\n hitbox = _ref3.hitbox,\n edge = _ref3.edge,\n isDistanceDampeningEnabled = _ref3.isDistanceDampeningEnabled,\n config = _ref3.config;\n // We have two forms of speed dampening:\n // 1. 🗺️ Distance\n // The closer you are to a hitbox edge, the faster the scroll speed will be\n // 2. ⏱️ Time\n // When first entering a scroll container we want to dampening all scrolling\n // This is to prevent super fast auto scrolling when first entering into\n // a scroll container, or when lifting in a scroll container\n\n var maxScroll = getMaxScrollChange({\n timeSinceLastFrame: timeSinceLastFrame,\n config: config\n });\n var percentageDistanceDampening = isDistanceDampeningEnabled ? getDistanceDampening({\n client: client,\n edge: edge,\n hitbox: hitbox,\n axis: axis,\n config: config\n }) : 1;\n\n // Dampen speed by time\n var percentageThroughTimeDampening = getPercentageInRange({\n startOfRange: engagement.timeOfEngagementStart,\n endOfRange: engagement.timeOfEngagementStart + config.timeDampeningDurationMs,\n value: Date.now()\n });\n\n // Calculate how much of the max scroll we should apply based on dampening\n var percentageOfMaxScroll = percentageDistanceDampening * percentageThroughTimeDampening;\n\n // We _could_ ease this update (`Math.pow(percentageOfMaxSpeed, 2)`)\n // But linear is feeling really good\n // Always scrolling by at least one pixel, otherwise the scroll does nothing\n var scroll = Math.max(maxScroll * percentageOfMaxScroll, 1);\n var side = mainAxisSideLookup[edge];\n\n // When moving backwards, we will be scrolling backwards\n return side === 'end' ? scroll : -1 * scroll;\n}","export function isAxisAllowed(axis, allowedAxis) {\n return allowedAxis === 'all' || axis === allowedAxis;\n}","export function isWithin(_ref) {\n var client = _ref.client,\n clientRect = _ref.clientRect;\n return (\n // is within horizontal bounds\n client.x >= clientRect.x && client.x <= clientRect.x + clientRect.width &&\n // is within vertical bounds\n client.y >= clientRect.y && client.y <= clientRect.y + clientRect.height\n );\n}","import { canScrollOnEdge } from '../shared/can-scroll-on-edge';\nimport { edgeAxisLookup, edges } from '../shared/edges';\nimport { getOverElementHitbox } from '../shared/get-over-element-hitbox';\nimport { getScrollChange } from '../shared/get-scroll-change';\nimport { isAxisAllowed } from '../shared/is-axis-allowed';\nimport { isWithin } from '../shared/is-within';\nfunction getRectDefault(element) {\n return element.getBoundingClientRect();\n}\nexport function getScrollBy(_ref) {\n var element = _ref.element,\n input = _ref.input,\n timeSinceLastFrame = _ref.timeSinceLastFrame,\n engagement = _ref.engagement,\n config = _ref.config,\n allowedAxis = _ref.allowedAxis,\n _ref$getRect = _ref.getRect,\n getRect = _ref$getRect === void 0 ? getRectDefault : _ref$getRect;\n var client = {\n x: input.clientX,\n y: input.clientY\n };\n var clientRect = getRect(element);\n var scrollableEdges = edges.reduce(function (map, edge) {\n var hitbox = getOverElementHitbox[edge]({\n clientRect: clientRect,\n config: config\n });\n var axis = edgeAxisLookup[edge];\n\n // Note: changing the allowed axis during a drag will not\n // reset time dampening. It was decided it would be too\n // complex to implement initially, and we can add it\n // later if needed.\n if (!isAxisAllowed(axis, allowedAxis)) {\n return map;\n }\n if (!isWithin({\n client: client,\n clientRect: hitbox\n })) {\n return map;\n }\n if (!canScrollOnEdge[edge](element)) {\n return map;\n }\n map.set(edge, {\n edge: edge,\n hitbox: hitbox\n });\n return map;\n }, new Map());\n var left = function () {\n var axis = 'horizontal';\n var leftEdge = scrollableEdges.get('left');\n if (leftEdge) {\n return getScrollChange({\n client: client,\n edge: leftEdge.edge,\n hitbox: leftEdge.hitbox,\n axis: axis,\n timeSinceLastFrame: timeSinceLastFrame,\n engagement: engagement,\n isDistanceDampeningEnabled: true,\n config: config\n });\n }\n var rightEdge = scrollableEdges.get('right');\n if (rightEdge) {\n return getScrollChange({\n client: client,\n edge: rightEdge.edge,\n hitbox: rightEdge.hitbox,\n axis: axis,\n timeSinceLastFrame: timeSinceLastFrame,\n engagement: engagement,\n isDistanceDampeningEnabled: true,\n config: config\n });\n }\n return 0;\n }();\n var top = function () {\n var axis = 'vertical';\n var bottomEdge = scrollableEdges.get('bottom');\n if (bottomEdge) {\n return getScrollChange({\n client: client,\n edge: bottomEdge.edge,\n hitbox: bottomEdge.hitbox,\n axis: axis,\n timeSinceLastFrame: timeSinceLastFrame,\n engagement: engagement,\n isDistanceDampeningEnabled: true,\n config: config\n });\n }\n var topEdge = scrollableEdges.get('top');\n if (topEdge) {\n return getScrollChange({\n client: client,\n edge: topEdge.edge,\n hitbox: topEdge.hitbox,\n axis: axis,\n timeSinceLastFrame: timeSinceLastFrame,\n engagement: engagement,\n isDistanceDampeningEnabled: true,\n config: config\n });\n }\n return 0;\n }();\n return {\n left: left,\n top: top\n };\n}","function _createForOfIteratorHelper(r, e) { var t = \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && \"number\" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nimport { getInternalConfig } from '../shared/configuration';\nimport { markAndGetEngagement } from '../shared/engagement-history';\nimport { selector } from './data-attributes';\nimport { getScrollBy } from './get-scroll-by';\nfunction isScrollingAvailable(value) {\n return Boolean(value.top || value.left);\n}\nfunction tryScrollElements(_ref) {\n var _container$getConfigu, _container$getAllowed, _container$getAllowed2;\n var target = _ref.target,\n input = _ref.input,\n source = _ref.source,\n findEntry = _ref.findEntry,\n timeSinceLastFrame = _ref.timeSinceLastFrame,\n _ref$available = _ref.available,\n available = _ref$available === void 0 ? {\n top: true,\n left: true\n } : _ref$available;\n // we cannot do any more scrolling\n if (!isScrollingAvailable(available)) {\n return available;\n }\n\n // run out of parents to search\n if (!target) {\n return available;\n }\n var element = target.closest(selector);\n\n // cannot find any more scroll containers\n if (!element) {\n return available;\n }\n var container = findEntry(element);\n\n // cannot find registration, this is bad.\n // fail and just exit\n if (!container) {\n return available;\n }\n function continueSearchUp() {\n var _element$parentElemen;\n return tryScrollElements({\n target: (_element$parentElemen = element === null || element === void 0 ? void 0 : element.parentElement) !== null && _element$parentElemen !== void 0 ? _element$parentElemen : null,\n findEntry: findEntry,\n source: source,\n timeSinceLastFrame: timeSinceLastFrame,\n input: input,\n available: available\n });\n }\n var feedback = {\n input: input,\n source: source,\n element: element\n };\n\n // Engagement is not marked if scrolling is explicitly not allowed\n if (container.canScroll && !container.canScroll(feedback)) {\n return continueSearchUp();\n }\n\n // Marking engagement even if no edges are scrollable.\n // We are marking engagement as soon as the element is scrolled over\n var engagement = markAndGetEngagement(element);\n var config = getInternalConfig((_container$getConfigu = container.getConfiguration) === null || _container$getConfigu === void 0 ? void 0 : _container$getConfigu.call(container, feedback));\n var allowedAxis = (_container$getAllowed = (_container$getAllowed2 = container.getAllowedAxis) === null || _container$getAllowed2 === void 0 ? void 0 : _container$getAllowed2.call(container, feedback)) !== null && _container$getAllowed !== void 0 ? _container$getAllowed : 'all';\n var scrollBy = getScrollBy({\n element: element,\n engagement: engagement,\n input: input,\n timeSinceLastFrame: timeSinceLastFrame,\n allowedAxis: allowedAxis,\n config: config\n });\n\n // Only allow scrolling in directions that have not already been used\n var scroll = {\n top: 0,\n left: 0\n };\n if (available.top && scrollBy.top !== 0) {\n scroll.top = scrollBy.top;\n // can no longer scroll on the top after this\n available.top = false;\n }\n if (available.left && scrollBy.left !== 0) {\n scroll.left = scrollBy.left;\n // can no longer scroll on the left after this\n available.left = false;\n }\n\n // Only scroll if there is something to scroll\n if (scroll.top !== 0 || scroll.left !== 0) {\n element.scrollBy(scroll);\n }\n return continueSearchUp();\n}\nfunction tryScrollWindow(_ref2) {\n var input = _ref2.input,\n timeSinceLastFrame = _ref2.timeSinceLastFrame,\n available = _ref2.available,\n source = _ref2.source,\n entries = _ref2.entries;\n var element = document.documentElement;\n var feedback = {\n input: input,\n source: source,\n element: element\n };\n var _iterator = _createForOfIteratorHelper(entries),\n _step;\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var _entry$getConfigurati, _entry$getAllowedAxis, _entry$getAllowedAxis2;\n var entry = _step.value;\n // this entry is not allowing scrolling, we need to look for another\n if (entry.canScroll && !entry.canScroll(feedback)) {\n continue;\n }\n\n // Note: if we had an event for when the user is leaving a tab\n // we _could_ conceptually reset the engagement\n var engagement = markAndGetEngagement(element);\n var config = getInternalConfig((_entry$getConfigurati = entry.getConfiguration) === null || _entry$getConfigurati === void 0 ? void 0 : _entry$getConfigurati.call(entry, feedback));\n var allowedAxis = (_entry$getAllowedAxis = (_entry$getAllowedAxis2 = entry.getAllowedAxis) === null || _entry$getAllowedAxis2 === void 0 ? void 0 : _entry$getAllowedAxis2.call(entry, feedback)) !== null && _entry$getAllowedAxis !== void 0 ? _entry$getAllowedAxis : 'all';\n var scrollBy = getScrollBy({\n element: element,\n engagement: engagement,\n input: input,\n config: config,\n allowedAxis: allowedAxis,\n getRect: function getRect(element) {\n return DOMRect.fromRect({\n y: 0,\n x: 0,\n width: element.clientWidth,\n height: element.clientHeight\n });\n },\n timeSinceLastFrame: timeSinceLastFrame\n });\n var scroll = {\n top: available.top ? scrollBy.top : 0,\n left: available.left ? scrollBy.left : 0\n };\n\n // only trigger a scroll if we are actually scrolling\n if (scroll.top !== 0 || scroll.left !== 0) {\n element.scrollBy(scroll);\n }\n\n // We only want the window to scroll once\n break;\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n}\nexport function tryScroll(_ref3) {\n var input = _ref3.input,\n findEntry = _ref3.findEntry,\n timeSinceLastFrame = _ref3.timeSinceLastFrame,\n source = _ref3.source,\n getWindowScrollEntries = _ref3.getWindowScrollEntries,\n underUsersPointer = _ref3.underUsersPointer;\n // We are matching browser behaviour and scrolling inner elements\n // before outer ones. So we try to scroll scroller containers before\n // the window.\n var remainder = tryScrollElements({\n target: underUsersPointer,\n timeSinceLastFrame: timeSinceLastFrame,\n input: input,\n source: source,\n findEntry: findEntry\n });\n\n // Check if we can do any window scrolling\n if (!isScrollingAvailable(remainder)) {\n return;\n }\n tryScrollWindow({\n input: input,\n source: source,\n entries: getWindowScrollEntries(),\n timeSinceLastFrame: timeSinceLastFrame,\n available: remainder\n });\n}","import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nimport { combine } from '@atlaskit/pragmatic-drag-and-drop/utils/combine';\nimport { once } from '@atlaskit/pragmatic-drag-and-drop/utils/once';\nimport { getScheduler } from '../shared/scheduler';\nimport { addScrollableAttribute } from './data-attributes';\nimport { tryScroll } from './try-scroll';\nexport function makeApi(_ref) {\n var monitor = _ref.monitor;\n var elementRegistry = new Map();\n var windowRegistry = new Set();\n function autoScroll(args) {\n // Warn during development if trying to add auto scroll to an element\n // that is not scrollable.\n // Note: this can produce a false positive when a scroll container is not\n // scrollable initially, but becomes scrollable during a drag.\n // I thought of adding the warning as I think it would be a more common pitfall\n // to accidentally register auto scrolling on the wrong element\n // If requested, we could provide a mechanism to opt out of this warning\n if (process.env.NODE_ENV !== 'production') {\n var _window$getComputedSt = window.getComputedStyle(args.element),\n overflowX = _window$getComputedSt.overflowX,\n overflowY = _window$getComputedSt.overflowY;\n var isScrollable = overflowX === 'auto' || overflowX === 'scroll' || overflowY === 'auto' || overflowY === 'scroll';\n if (!isScrollable) {\n // eslint-disable-next-line no-console\n console.warn('Auto scrolling has been attached to an element that appears not to be scrollable', {\n element: args.element,\n overflowX: overflowX,\n overflowY: overflowY\n });\n }\n }\n\n // Warn if there is an existing registration\n if (process.env.NODE_ENV !== 'production') {\n var existing = elementRegistry.get(args.element);\n if (existing) {\n // eslint-disable-next-line no-console\n console.warn('You have already registered autoScrolling on the same element', {\n existing: existing,\n proposed: args\n });\n }\n }\n elementRegistry.set(args.element, args);\n var cleanup = combine(addScrollableAttribute(args.element), function () {\n return elementRegistry.delete(args.element);\n });\n return once(cleanup);\n }\n function autoScrollWindow() {\n var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n // Putting `args` in a unique object so that\n // each call will create a unique entry, even if a consumer\n // shares the `args` object between calls.\n // Just being safe here.\n var unique = _objectSpread({}, args);\n windowRegistry.add(unique);\n function cleanup() {\n windowRegistry.delete(unique);\n }\n return once(cleanup);\n }\n function findEntry(element) {\n var _elementRegistry$get;\n return (_elementRegistry$get = elementRegistry.get(element)) !== null && _elementRegistry$get !== void 0 ? _elementRegistry$get : null;\n }\n function getWindowScrollEntries() {\n return Array.from(windowRegistry);\n }\n function onFrame(_ref2) {\n var latestArgs = _ref2.latestArgs,\n underUsersPointer = _ref2.underUsersPointer,\n timeSinceLastFrame = _ref2.timeSinceLastFrame;\n tryScroll({\n input: latestArgs.location.current.input,\n source: latestArgs.source,\n findEntry: findEntry,\n underUsersPointer: underUsersPointer,\n timeSinceLastFrame: timeSinceLastFrame,\n getWindowScrollEntries: getWindowScrollEntries\n });\n }\n getScheduler(monitor).onFrame(onFrame);\n return {\n autoScroll: autoScroll,\n autoScrollWindow: autoScrollWindow\n };\n}","import { monitorForElements } from '@atlaskit/pragmatic-drag-and-drop/adapter/element-adapter';\nimport { makeApi } from '../over-element/make-api';\nvar api = makeApi({\n monitor: monitorForElements\n});\nexport var autoScrollForElements = api.autoScroll;\n// eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports\nexport var autoScrollWindowForElements = api.autoScrollWindow;","import _toConsumableArray from \"@babel/runtime/helpers/toConsumableArray\";\nimport { bindAll } from 'bind-event-listener';\nimport { getBindingsForBrokenDrags } from '../util/detect-broken-drag';\nfunction acceptDrop(event) {\n // if the event is already prevented the event we don't need to do anything\n if (event.defaultPrevented) {\n return;\n }\n // Using \"move\" as the drop effect as that uses the standard\n // cursor. Doing this so the user doesn't think they are dropping\n // on the page\n // Note: using \"none\" will not allow a \"drop\" to occur, so we are using \"move\"\n if (event.dataTransfer) {\n event.dataTransfer.dropEffect = 'move';\n }\n // cancel the default browser behaviour\n // doing this will tell the browser that we have handled the drop\n event.preventDefault();\n}\nvar unbindEvents = null;\n\n/**\n * Block drag operations outside of `@atlaskit/pragmatic-drag-and-drop`\n */\nfunction start() {\n cleanup();\n unbindEvents = bindAll(window, [{\n type: 'dragover',\n listener: acceptDrop\n }, {\n type: 'dragenter',\n listener: acceptDrop\n }, {\n type: 'drop',\n listener: function listener(event) {\n // our lifecycle manager already prevents events, but just being super safe\n event.preventDefault();\n\n // not setting dropEffect, as `drop.dropEffect` has already been published to the user\n // (lifecycle-manager binds events in the capture phase)\n\n // we don't need to wait for \"dragend\", and \"dragend\" might not even happen,\n // such as when the draggable has been removed during a drag.\n cleanup();\n }\n }, {\n type: 'dragend',\n listener: cleanup\n }].concat(_toConsumableArray(getBindingsForBrokenDrags({\n onDragEnd: cleanup\n }))),\n // being clear that these are added in the bubble phase\n {\n capture: false\n });\n}\nfunction cleanup() {\n var _unbindEvents;\n (_unbindEvents = unbindEvents) === null || _unbindEvents === void 0 || _unbindEvents();\n unbindEvents = null;\n}\n\n/**\n * TODO: for next major, we could look at do the following:\n *\n * ```diff\n * - preventUnhandled.start();\n * - preventUnhandled.stop();\n * + const stop = preventUnhandled();\n * ```\n */\n\nfunction stop() {\n var _window$event;\n /**\n * if `stop()` is called in a `\"drop\"` event, then `event.preventDefault()` won't be called.\n * Our `\"drop\"` listener calls `event.preventDefault()` for handled drop events\n * (\"drop\" events caused by dropping over a drop target)\n * `preventUnhandled()` causes every element to become a drop target (according to the browser)\n *\n * To opt out of the default behaviour for a `\"drop\"` event, we need to make sure\n * that we cancel it.\n *\n * The `\"drop\"` event listener in core is in the `capture` phase, so people calling\n * `preventUnhandled.stop()` in `onDrop()` will remove the `\"drop\"` event listener in this\n * file before it has the chance to cancel the event.\n *\n * Being sneaky and using the `window.event` global to sniff out the current event\n */\n if (((_window$event = window.event) === null || _window$event === void 0 ? void 0 : _window$event.type) === 'drop') {\n var _window$event2;\n (_window$event2 = window.event) === null || _window$event2 === void 0 || _window$event2.preventDefault();\n }\n cleanup();\n}\nexport var preventUnhandled = {\n start: start,\n stop: stop\n};","import {autoScrollForElements, autoScrollWindowForElements} from '@atlaskit/pragmatic-drag-and-drop-auto-scroll/element';\nimport {\n draggable,\n dropTargetForElements,\n} from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\nimport {disableNativeDragPreview} from '@atlaskit/pragmatic-drag-and-drop/element/disable-native-drag-preview';\nimport {preventUnhandled} from '@atlaskit/pragmatic-drag-and-drop/prevent-unhandled';\nimport type Alpine from 'alpinejs';\n\nimport {INTERACTION_TREATMENTS, SELECTION_COLORS} from '@client/components/common';\nimport {motion, resolveMotionRole, type Controller} from '@client/motion';\nimport {createAlpineMachine} from '@client/runtime/alpine-machine';\nimport {bool, defineProps, json, number, oneOf, string, type SchemaToProps} from '@client/runtime/codecs';\nimport {registerDomInvalidationOwner} from '@client/runtime/dom-invalidation';\nimport {stableIdentity} from '@client/runtime/identity';\nimport {focusElement} from '@client/runtime/focus';\nimport {declareMorphAttributes} from '@client/runtime/morph';\nimport {defineHook} from '@client/runtime/transition-coordinator';\nimport {bindDragEffectAllowed, currentDragInput, initialDragInput, type ElementDragEvent} from '@client/runtime/drag-and-drop/pdd';\nimport {prepareSortableDrop} from '@client/runtime/drag-and-drop/sortable/registry';\nimport {\n createSortableGhost,\n createSortableSourceMachine,\n activateSortableCursor,\n frameFromRect,\n isSameSortablePlacement,\n isValidGridColumns,\n projectSortablePlacement,\n projectSortableReorderLayout,\n resolveSortableDropFrame,\n resolveSortableReorderOffsets,\n resolveSortableIndicatorFrame,\n resolveSortablePlacement,\n resolveSortableReorderPlacement,\n createSortableRegistry,\n type SortableRegistry,\n type SortableGroup,\n type SortableIndicatorFrame,\n type SortableResolvedPlacement,\n type SortableReorderLayout,\n type SortableReorderOffset,\n type SortableCancelReason,\n type SortableCanDropContext,\n type SortableSource,\n} from '@client/runtime/drag-and-drop/sortable';\nimport {dispatch, warn} from '@client/utils';\n\nconst GROUP_SELECTOR = '[data-ui-sortable]';\nconst ITEM_SELECTOR = '[data-ui-sortable-item]';\nconst SOURCE_SELECTOR = '[data-ui-sortable-source]';\nconst HANDLE_SELECTOR = '[x-ui-sortable\\\\:handle], [data-ui-sortable-handle]';\nconst PREVIEW_SELECTOR = '[x-ui-sortable\\\\:preview], [data-ui-sortable-preview]';\nconst INDICATOR_SELECTOR = '[x-ui-sortable\\\\:indicator], [data-ui-sortable-indicator]';\nconst MARKER = 'ui-sortable';\nconst INDICATOR_THICKNESS = 2;\nconst INTERACTIVE_SELECTOR = 'a, button, input, select, textarea, summary, [contenteditable], [role=\"button\"], [role=\"link\"]';\n\nconst groupSchema = {\n sortableScope: string.trim,\n sortableId: string.trim,\n orientation: oneOf(['vertical', 'horizontal', 'grid'] as const, 'vertical'),\n columns: number.default(0),\n accepts: json.array<string>([]),\n disabled: bool,\n readonly: bool,\n feedback: oneOf(['indicator', 'reorder'] as const, 'indicator'),\n sourceOpacity: number.clamp(0, 1).default(0.4),\n ghostOpacity: number.clamp(0, 1).default(0.92),\n dragCursor: string.trim.default('default'),\n previewPosition: string.trim.default('preserve'),\n color: oneOf(SELECTION_COLORS, 'neutral'),\n interaction: oneOf(INTERACTION_TREATMENTS, 'edge'),\n label: string.trim,\n sortableData: json.object<Record<string, unknown>>({}),\n};\nconst sourceSchema = {\n sortableScope: string.trim,\n sortableId: string.trim,\n sortableType: string.trim,\n label: string.trim,\n disabled: bool,\n sortableData: json.object<Record<string, unknown>>({}),\n sourceOpacity: number.clamp(0, 1).default(0.4),\n ghostOpacity: number.clamp(0, 1).default(0.92),\n dragCursor: string.trim.default('default'),\n previewPosition: string.trim.default('12px 12px'),\n color: oneOf(SELECTION_COLORS, 'neutral'),\n interaction: oneOf(INTERACTION_TREATMENTS, 'edge'),\n};\ntype SourceProps = SchemaToProps<typeof sourceSchema>;\ntype SourceTransitionContext = {data: Record<string, unknown>};\ntype PlacingTransitionData = Readonly<{\n operationId: number;\n source: SortableSource;\n previous: SortableResolvedPlacement | null;\n placement: SortableResolvedPlacement;\n feedback: 'indicator' | 'reorder';\n offsets: readonly SortableReorderOffset[];\n indicatorFrame: SortableIndicatorFrame | null;\n noop: boolean;\n}>;\ntype CanDropPolicy = (context: SortableCanDropContext) => boolean;\nconst startingHook = defineHook<SourceTransitionContext, SourceProps, Record<string, unknown>, 'starting'>({\n name: 'starting', state: 'interaction.starting', project: ({context}) => context.data,\n onDone: 'STARTING_DONE', onError: 'STARTING_DONE',\n});\nconst placingHook = defineHook<SourceTransitionContext, SourceProps, PlacingTransitionData, 'placing'>({\n name: 'placing', state: 'layout.placing', project: ({context}) => context.data as PlacingTransitionData,\n onDone: 'PLACING_DONE', onError: 'PLACING_DONE',\n});\nconst endingHook = defineHook<SourceTransitionContext, SourceProps, Record<string, unknown>, 'ending'>({\n name: 'ending', state: 'interaction.ending', project: ({context}) => context.data,\n onDone: 'ENDING_DONE', onError: 'ENDING_DONE',\n});\nconst sourceHooks = [startingHook, placingHook, endingHook] as const;\n\ntype GroupController = {\n el: HTMLElement;\n group(): SortableGroup;\n itemIds(): readonly string[];\n indicator(): HTMLElement | null;\n refresh(): void;\n};\ntype GroupLayoutSnapshot = Readonly<{\n controller: GroupController;\n layout: SortableReorderLayout;\n}>;\ntype ReorderProjection = {\n baseline: string;\n target: string;\n motion: Controller<{translate: string}>;\n};\ntype SourceController = {\n el: HTMLElement;\n owner(): HTMLElement | null;\n source(): SortableSource;\n disabled(): boolean;\n appearance(): Readonly<{\n sourceOpacity: number;\n ghostOpacity: number;\n dragCursor: string;\n previewPosition: string;\n color: typeof SELECTION_COLORS[number];\n interaction: typeof INTERACTION_TREATMENTS[number];\n }>;\n refresh(): void;\n machine: ReturnType<typeof createAlpineMachine<SourceTransitionContext, typeof sourceSchema, typeof sourceHooks>>;\n};\n\ntype SortableDragOperation = {\n readonly id: number;\n phase: 'dragging' | 'ending';\n controller: SourceController;\n source: SortableSource;\n ghost: ReturnType<typeof createSortableGhost>;\n placement: SortableResolvedPlacement | null;\n group: GroupController | null;\n layouts: ReadonlyMap<string, GroupLayoutSnapshot>;\n projections: Map<HTMLElement, ReorderProjection>;\n input: Readonly<{clientX: number; clientY: number}>;\n timestamp: number;\n restoreCursor: () => void;\n previousOpacity: string;\n settled: boolean;\n endSent: boolean;\n terminalData: Record<string, unknown> | null;\n};\n\nconst createSortableSession = (\n registry: SortableRegistry,\n mutateSortableDom: (callback: () => void) => void,\n) => {\n// Session state is isolated per Alpine registration. PDD prevention, cursor, ghost, and window scrolling remain\n// primitives of the current document realm, matching the supported one-runtime-owner-per-document path.\nlet operationSequence = 0;\nconst groups = new WeakMap<HTMLElement, GroupController>();\nconst groupControllers = new Set<GroupController>();\nconst canDropPolicies = new WeakMap<HTMLElement, CanDropPolicy>();\nlet active: SortableDragOperation | null = null;\nlet registrationCount = 0;\nlet windowAutoScrollCleanup: (() => void) | null = null;\n\nconst retainWindowAutoScroll = (): (() => void) => {\n registrationCount += 1;\n windowAutoScrollCleanup ??= autoScrollWindowForElements();\n return () => {\n registrationCount -= 1;\n if (registrationCount !== 0) return;\n windowAutoScrollCleanup?.();\n windowAutoScrollCleanup = null;\n };\n};\n\nconst directOwner = (element: Element, selector: string): HTMLElement | null => element.closest<HTMLElement>(selector);\nconst directItems = (group: HTMLElement): HTMLElement[] => [...group.querySelectorAll<HTMLElement>(ITEM_SELECTOR)]\n .filter((item) => directOwner(item.parentElement ?? item, GROUP_SELECTOR) === group);\nconst sortableIdentity = (element: HTMLElement, explicit = element.dataset.sortableId): string => (\n stableIdentity(element, explicit) ?? ''\n);\n\nconst captureLayout = (controller: GroupController): GroupLayoutSnapshot => {\n const group = controller.group();\n const items = directItems(controller.el);\n return {\n controller,\n layout: {\n groupId: group.id,\n orientation: group.orientation,\n direction: getComputedStyle(controller.el).direction === 'rtl' ? 'rtl' : 'ltr',\n columns: group.columns,\n groupRect: controller.el.getBoundingClientRect(),\n items: items.map((item) => ({\n id: sortableIdentity(item),\n rect: item.getBoundingClientRect(),\n })),\n },\n };\n};\n\nconst currentLayout = (snapshot: GroupLayoutSnapshot): SortableReorderLayout => {\n const group = snapshot.controller.group();\n const groupRect = snapshot.controller.el.getBoundingClientRect();\n const x = groupRect.left - snapshot.layout.groupRect.left;\n const y = groupRect.top - snapshot.layout.groupRect.top;\n const move = (rect: SortableReorderLayout['groupRect']) => ({\n left: rect.left + x, right: rect.right + x,\n top: rect.top + y, bottom: rect.bottom + y,\n width: rect.width, height: rect.height,\n });\n return {\n ...snapshot.layout,\n orientation: group.orientation,\n columns: group.columns,\n groupRect,\n items: snapshot.layout.items.map((item) => ({...item, rect: move(item.rect)})),\n };\n};\n\nconst animateProjection = (element: HTMLElement, state: ReorderProjection, target: string): void => {\n if (state.target === target) return;\n state.target = target;\n state.motion.animate({translate: target}, resolveMotionRole(element, 'layout'));\n};\n\nconst clearRejectedTargets = (hovered: HTMLElement | null = null): void => {\n groupControllers.forEach(({el}) => {\n if (el !== hovered) el.removeAttribute('data-drag-rejected');\n });\n};\n\nconst applyReorderProjection = (offsets: readonly SortableReorderOffset[]): void => {\n const current = active;\n if (!current) return;\n const projected = new Map<HTMLElement, Readonly<{x: number; y: number; group: GroupController}>>();\n offsets.forEach(({groupId, id, x, y}) => {\n const snapshot = current.layouts.get(groupId);\n const element = snapshot && directItems(snapshot.controller.el)\n .find((item) => sortableIdentity(item) === id);\n if (!element) return;\n projected.set(element, {x, y, group: snapshot.controller});\n });\n current.projections.forEach((state, element) => {\n if (projected.has(element)) return;\n animateProjection(element, state, state.baseline);\n element.removeAttribute('data-reordering');\n });\n const activeGroups = new Set<GroupController>();\n projected.forEach(({x, y, group}, element) => {\n let state = current.projections.get(element);\n if (!state) {\n const baseline = element.style.translate && element.style.translate !== 'none'\n ? element.style.translate : '0px 0px';\n const controller = motion.createController({\n values: {translate: baseline},\n style: ({translate}) => ({translate}),\n });\n controller.mount(element);\n element.setAttribute('data-ui-sortable-projection', '');\n state = {baseline, target: baseline, motion: controller};\n current.projections.set(element, state);\n }\n const translate = `${x}px ${y}px`;\n animateProjection(element, state, translate);\n element.setAttribute('data-reordering', '');\n activeGroups.add(group);\n });\n groupControllers.forEach((controller) => controller.el.toggleAttribute('data-reordering', activeGroups.has(controller)));\n};\n\nconst setIndicator = (\n controller: GroupController,\n placement: SortableResolvedPlacement | null,\n operation?: string,\n frame: SortableIndicatorFrame | null = null,\n): void => {\n const indicator = controller.indicator();\n if (!indicator) return;\n if (!placement || !frame) {\n indicator.hidden = true;\n return;\n }\n Object.assign(indicator.style, {position: 'absolute', left: '0', top: '0'});\n indicator.hidden = false;\n const edge = placement.anchor?.edge ?? 'empty';\n const offsetParent = indicator.offsetParent;\n const offsetRect = offsetParent instanceof Element\n ? offsetParent.getBoundingClientRect()\n : {left: -window.scrollX, top: -window.scrollY};\n const scrollLeft = offsetParent instanceof HTMLElement ? offsetParent.scrollLeft : 0;\n const scrollTop = offsetParent instanceof HTMLElement ? offsetParent.scrollTop : 0;\n const inlineBoundary = frame.kind === 'inline-boundary';\n const blockBoundary = frame.kind === 'block-boundary';\n const x = frame.x - offsetRect.left + scrollLeft - (inlineBoundary ? INDICATOR_THICKNESS / 2 : 0);\n const y = frame.y - offsetRect.top + scrollTop - (blockBoundary ? INDICATOR_THICKNESS / 2 : 0);\n Object.assign(indicator.style, {\n transform: `translate3d(${x}px, ${y}px, 0)`,\n width: `${inlineBoundary ? INDICATOR_THICKNESS : frame.width}px`,\n height: `${blockBoundary ? INDICATOR_THICKNESS : frame.height}px`,\n pointerEvents: 'none',\n zIndex: '2147483646',\n });\n indicator.dataset.orientation = controller.group().orientation;\n indicator.dataset.edge = edge;\n indicator.dataset.index = String(placement.index);\n indicator.dataset.operation = operation ?? '';\n indicator.dataset.indicatorKind = frame.kind;\n};\n\nconst clearActiveGroupSurface = (): void => {\n if (!active?.group) return;\n active.group.el.removeAttribute('data-drag-over');\n active.group.el.removeAttribute('data-drop-edge');\n active.group.el.removeAttribute('data-drop-effect');\n active.group.el.removeAttribute('data-drop-noop');\n active.group.el.removeAttribute('data-placing');\n setIndicator(active.group, null);\n active.group = null;\n};\n\nconst clearActiveGroup = (): void => {\n if (!active) return;\n active.projections.forEach((state, element) => {\n state.motion.destroy();\n element.removeAttribute('data-ui-sortable-projection');\n element.removeAttribute('data-reordering');\n });\n active.projections.clear();\n groupControllers.forEach(({el}) => el.removeAttribute('data-reordering'));\n clearActiveGroupSurface();\n active.placement = null;\n};\n\nconst sameOrder = (left: readonly string[], right: readonly string[]): boolean => (\n left.length === right.length && left.every((id, index) => id === right[index])\n);\n\nconst scheduleAcceptedReorderPromotion = (): void => {\n const current = active;\n const placement = current?.placement;\n const destination = current?.group;\n const source = current?.controller.el;\n const sourceSnapshot = current?.source.groupId === null\n ? null\n : current?.layouts.get(current.source.groupId) ?? null;\n const destinationSnapshot = placement\n ? current?.layouts.get(placement.destination.groupId) ?? null\n : null;\n if (\n !current\n || !placement\n || !destination\n || !source?.isConnected\n || !destinationSnapshot\n || current.source.operation !== 'move'\n || destination.group().feedback !== 'reorder'\n ) return;\n\n const activeItemIds = new Set(\n [...current.layouts.values()].flatMap(({controller}) => (\n directItems(controller.el)\n .filter((item) => item.getAttribute('data-active') === 'true')\n .map((item) => sortableIdentity(item))\n )),\n );\n const focusedItemId = [...current.layouts.values()].flatMap(({controller}) => directItems(controller.el))\n .find((item) => item === document.activeElement || item.contains(document.activeElement))\n ?.dataset.sortableId;\n const restoreInteractionState = (): void => {\n current.layouts.forEach(({controller}) => {\n directItems(controller.el).forEach((item) => {\n if (activeItemIds.has(sortableIdentity(item))) item.setAttribute('data-active', 'true');\n else item.removeAttribute('data-active');\n });\n });\n if (!focusedItemId) return;\n const focusedItem = [...current.layouts.values()]\n .flatMap(({controller}) => directItems(controller.el))\n .find((item) => sortableIdentity(item) === focusedItemId);\n focusElement(focusedItem ?? null);\n };\n const sourceOrder = sourceSnapshot?.layout.items.map(({id}) => id) ?? [];\n const destinationOrder = destinationSnapshot.layout.items.map(({id}) => id);\n queueMicrotask(() => {\n if (\n operationSequence !== current.id\n || (active !== null && active !== current)\n || !source.isConnected\n || !destination.el.isConnected\n ) return;\n const sourceChanged = sourceSnapshot\n ? !sameOrder(sourceSnapshot.controller.itemIds(), sourceOrder)\n : false;\n const destinationChanged = !sameOrder(destination.itemIds(), destinationOrder);\n // A reactive handler or morph already owns this commit. Moving its keyed nodes again can corrupt its DOM index.\n if (!sourceChanged && !destinationChanged) {\n mutateSortableDom(() => {\n const anchorId = placement.anchor?.id;\n if (anchorId) {\n const anchor = directItems(destination.el)\n .find((item) => sortableIdentity(item) === anchorId);\n if (!anchor?.parentNode) return;\n anchor.parentNode.insertBefore(\n source,\n placement.anchor?.edge === 'after' ? anchor.nextSibling : anchor,\n );\n return;\n }\n\n const indicator = destination.indicator();\n if (indicator?.parentNode) indicator.parentNode.insertBefore(source, indicator);\n else destination.el.append(source);\n });\n }\n restoreInteractionState();\n });\n};\n\nconst settle = (operation: SortableDragOperation): void => {\n if (operation.settled) return;\n operation.settled = true;\n operation.ghost.remove();\n if (active === operation) active = null;\n};\n\nconst sendEnd = (operation: SortableDragOperation): void => {\n if (active !== operation || operation.settled || operation.endSent || !operation.terminalData) return;\n operation.endSent = true;\n operation.controller.machine.send({type: 'END', data: operation.terminalData});\n};\n\nconst finish = (\n outcome: 'drop' | 'cancel',\n reason: SortableCancelReason = 'outside',\n operation: SortableDragOperation | null = active,\n options: Readonly<{\n placement?: SortableResolvedPlacement;\n dispatchTerminalEvent?: () => void;\n }> = {},\n): void => {\n const current = operation;\n if (!current || active !== current || current.phase !== 'dragging') return;\n current.phase = 'ending';\n preventUnhandled.stop();\n const placement = options.placement ?? current.placement;\n const sourceSnapshot = current.source.groupId === null ? null : current.layouts.get(current.source.groupId) ?? null;\n const destinationSnapshot = placement ? current.layouts.get(placement.destination.groupId) ?? null : null;\n const targetSlot = outcome === 'drop' && placement && destinationSnapshot\n ? resolveSortableDropFrame({\n source: current.source,\n placement,\n sourceLayout: sourceSnapshot ? currentLayout(sourceSnapshot) : null,\n destinationLayout: currentLayout(destinationSnapshot),\n })\n : null;\n const targetFrame = targetSlot\n ? {x: targetSlot.left, y: targetSlot.top, width: targetSlot.width, height: targetSlot.height}\n : frameFromRect(current.controller.el.getBoundingClientRect());\n if (outcome === 'drop') scheduleAcceptedReorderPromotion();\n clearActiveGroup();\n current.controller.el.removeAttribute('data-dragging');\n current.controller.el.removeAttribute('data-drag-operation');\n current.controller.el.removeAttribute('data-sortable-phase');\n current.controller.el.style.opacity = current.previousOpacity;\n current.restoreCursor();\n clearRejectedTargets();\n const fromFrame = current.ghost.frame();\n current.terminalData = {\n operationId: current.id,\n outcome,\n source: current.source,\n placement: outcome === 'drop' ? placement : null,\n ...(outcome === 'cancel' ? {reason} : {}),\n fromFrame,\n toFrame: targetFrame ?? fromFrame,\n fromTransform: current.ghost.positioner.style.transform,\n toTransform: targetFrame\n ? `translate3d(${targetFrame.x}px, ${targetFrame.y}px, 0)`\n : current.ghost.positioner.style.transform,\n };\n if (outcome === 'cancel') dispatch({\n el: current.controller.el,\n name: 'ui:sortable-cancel',\n composed: true,\n detail: Object.freeze({source: current.source, reason}),\n });\n options.dispatchTerminalEvent?.();\n if (active !== current || current.settled) return;\n sendEnd(current);\n};\n\nconst forceSettle = (operation: SortableDragOperation): void => {\n if (active !== operation) return;\n if (operation.phase === 'dragging') finish('cancel', 'outside', operation);\n if (active !== operation || operation.settled) return;\n sendEnd(operation);\n if (active !== operation || operation.settled) return;\n operation.controller.machine.send('ENDING_DONE');\n settle(operation);\n};\n\nconst updatePlacement = (\n controller: GroupController,\n input: {clientX: number; clientY: number},\n): void => {\n if (!active) return;\n const previous = active.placement;\n const destinationChanged = active.group !== controller;\n if (destinationChanged) clearActiveGroupSurface();\n const group = controller.group();\n const feedback = active.source.operation === 'insert' ? 'indicator' : group.feedback;\n const layoutSnapshot = active.layouts.get(group.id);\n const layout = layoutSnapshot ? currentLayout(layoutSnapshot) : captureLayout(controller).layout;\n // Same-group rows occupy their projected slots after a swap. Use those\n // midpoint thresholds without measuring an animation while it is running.\n const placementLayout = feedback === 'reorder' && group.id === active.source.groupId\n && previous?.destination.groupId === group.id\n ? projectSortableReorderLayout(layout, resolveSortableReorderOffsets({\n source: active.source, placement: previous, sourceLayout: layout,\n }))\n : layout;\n const items = placementLayout.items;\n const itemIds = items.map(({id}) => id);\n const sourceId = active.source.id;\n const placementItems = feedback === 'reorder' && group.id === active.source.groupId\n ? items.filter(({id}) => id !== sourceId)\n : items;\n const geometry = {\n groupId: group.id,\n orientation: group.orientation,\n direction: layout.direction,\n columns: group.columns,\n groupRect: layout.groupRect,\n items: placementItems,\n } as const;\n const ghostFrame = active.ghost.projectedSourceFrame(input);\n const placementInput = feedback !== 'reorder' ? input : {\n clientX: group.orientation === 'vertical' ? input.clientX : ghostFrame.x + ghostFrame.width / 2,\n clientY: group.orientation === 'horizontal' ? input.clientY : ghostFrame.y + ghostFrame.height / 2,\n };\n const rawPlacement = (feedback === 'reorder'\n ? resolveSortableReorderPlacement\n : resolveSortablePlacement)({\n ...geometry,\n input: placementInput,\n });\n const indicatorFrame = feedback === 'indicator'\n ? resolveSortableIndicatorFrame({...geometry, items}, rawPlacement)\n : null;\n const placement = feedback !== 'reorder' ? projectSortablePlacement({\n placement: rawPlacement, sourceId: active.source.id, sourceGroupId: active.source.groupId, itemIds,\n }) : rawPlacement;\n controller.el.setAttribute('data-drag-over', '');\n if (!destinationChanged && isSameSortablePlacement(previous, placement)) return;\n const sourceSnapshot = active.source.groupId === null ? null : active.layouts.get(active.source.groupId) ?? null;\n const destinationSnapshot = active.layouts.get(group.id);\n const noop = registry.isNoop(active.source, {\n destination: placement.destination,\n anchor: placement.anchor,\n });\n const offsets = feedback === 'reorder' && !noop ? resolveSortableReorderOffsets({\n source: active.source,\n placement,\n sourceLayout: sourceSnapshot ? currentLayout(sourceSnapshot) : null,\n destinationLayout: destinationSnapshot ? currentLayout(destinationSnapshot) : null,\n }) : [];\n active.group = controller;\n active.placement = placement;\n controller.el.dataset.dropEdge = placement.anchor?.edge ?? 'empty';\n controller.el.dataset.dropEffect = active.source.operation === 'insert' ? 'copy' : 'move';\n controller.el.toggleAttribute('data-drop-noop', noop);\n active.controller.el.dataset.sortablePhase = 'placing';\n controller.el.setAttribute('data-placing', '');\n if (feedback === 'reorder' && !noop) {\n applyReorderProjection(offsets);\n setIndicator(controller, null);\n } else {\n applyReorderProjection([]);\n setIndicator(controller, noop ? null : placement, active.source.operation, indicatorFrame);\n }\n dispatch({\n el: controller.el,\n name: 'ui:sortable-placement-change',\n composed: true,\n detail: Object.freeze({source: active.source, previous, placement}),\n });\n active.controller.machine.send({\n type: 'LAYOUT_PROPOSED',\n data: {\n operationId: active.id,\n source: active.source,\n previous,\n placement,\n feedback,\n offsets,\n indicatorFrame,\n noop,\n } satisfies PlacingTransitionData,\n });\n};\n\nconst registerGroup = (el: HTMLElement, utilities: Alpine.DirectiveUtilities): void => {\n const releaseWindowAutoScroll = retainWindowAutoScroll();\n el.setAttribute('data-ui-sortable', '');\n declareMorphAttributes(\n el,\n 'data-ui-sortable',\n 'data-drop-target-for-element',\n 'data-auto-scrollable',\n );\n let refresh = (): void => undefined;\n const props = defineProps({el, schema: groupSchema, onChange: () => refresh()});\n const controller: GroupController = {\n el,\n group: () => Object.freeze({\n scopeId: props.sortableScope, id: sortableIdentity(el, props.sortableId), orientation: props.orientation,\n columns: props.orientation === 'grid' ? props.columns : null, accepts: props.accepts,\n disabled: props.disabled, readOnly: props.readonly, ...(props.label ? {label: props.label} : {}),\n feedback: props.feedback, sourceOpacity: props.sourceOpacity, ghostOpacity: props.ghostOpacity,\n dragCursor: props.dragCursor,\n previewPosition: props.previewPosition, color: props.color, interaction: props.interaction,\n ...(Object.keys(props.sortableData).length ? {data: Object.freeze({...props.sortableData})} : {}),\n }),\n itemIds: () => directItems(el).map((item) => sortableIdentity(item)).filter(Boolean),\n indicator: () => [...el.querySelectorAll<HTMLElement>(INDICATOR_SELECTOR)]\n .find((item) => directOwner(item.parentElement ?? item, GROUP_SELECTOR) === el) ?? null,\n refresh: () => refresh(),\n };\n if (!props.sortableScope || !controller.group().id || props.accepts.length === 0) warn('Invalid sortable group props', el);\n if (props.orientation === 'grid' && !isValidGridColumns(props.columns)) warn('Grid sortable groups require positive data-columns', el);\n groups.set(el, controller);\n groupControllers.add(controller);\n const registration = registry.registerGroup({\n element: el,\n getGroup: controller.group,\n getItemIds: controller.itemIds,\n canDrop: (context) => canDropPolicies.get(el)?.(context) !== false,\n });\n refresh = () => {\n if (active?.group === controller) finish('cancel', 'removed');\n registration.refresh();\n };\n const unregisterInvalidationOwner = registerDomInvalidationOwner(el, {\n invalidateDom: controller.refresh,\n });\n const cleanupTarget = dropTargetForElements({\n element: el,\n canDrop: ({source, input}) => {\n const current = active;\n const relevant = source.data.marker === MARKER && current !== null;\n const accepted = relevant && registry.canDrop(current.source, controller.group().id, {\n clientX: input.clientX,\n clientY: input.clientY,\n });\n el.toggleAttribute('data-drag-rejected', relevant && !accepted);\n return accepted;\n },\n getDropEffect: () => 'move',\n onDrop: () => {\n const operation = active;\n const placement = operation?.placement;\n if (!operation || operation.group !== controller || !placement) return;\n const group = controller.group();\n const prepared = prepareSortableDrop(registry, operation.source, {\n destination: placement.destination,\n anchor: placement.anchor,\n }, operation.input);\n if (!prepared) {\n finish('cancel', group.disabled || group.readOnly ? 'disabled' : 'outside', operation);\n return;\n }\n finish('drop', 'outside', operation, {\n placement: prepared.placement,\n dispatchTerminalEvent: prepared.commit,\n });\n },\n });\n const cleanupScroll = autoScrollForElements({element: el});\n utilities.cleanup(() => {\n const operation = active;\n if (\n operation?.phase === 'dragging'\n && (operation.group === controller || operation.layouts.get(controller.group().id)?.controller === controller)\n ) finish('cancel', 'removed', operation);\n cleanupScroll();\n cleanupTarget();\n unregisterInvalidationOwner();\n registration();\n props.disconnect();\n groups.delete(el);\n groupControllers.delete(controller);\n el.removeAttribute('data-drag-rejected');\n releaseWindowAutoScroll();\n });\n};\n\nconst registerSource = (el: HTMLElement, role: 'item' | 'source', utilities: Alpine.DirectiveUtilities): void => {\n const releaseWindowAutoScroll = retainWindowAutoScroll();\n const marker = role === 'item' ? 'data-ui-sortable-item' : 'data-ui-sortable-source';\n el.setAttribute(marker, '');\n declareMorphAttributes(el, marker, 'draggable');\n const owner = (): HTMLElement | null => (\n role === 'item' ? directOwner(el.parentElement ?? el, GROUP_SELECTOR) : null\n );\n let controller!: SourceController;\n const machine = createAlpineMachine<SourceTransitionContext, typeof sourceSchema, typeof sourceHooks>({\n schema: sourceSchema,\n hooks: sourceHooks,\n createMachine: ({props}) => createSortableSourceMachine<SourceProps>({\n props,\n effects: {\n resolvePlacement: ({context}) => {\n const current = active;\n const pointer = context.pointer;\n if (!current || current.controller !== controller || current.phase !== 'dragging' || !pointer) return;\n const destination = pointer.destinationId === null\n ? null\n : current.layouts.get(pointer.destinationId)?.controller ?? null;\n if (destination) {\n updatePlacement(destination, pointer.input);\n } else if (current.group?.group().feedback === 'reorder') {\n current.group.el.removeAttribute('data-drag-over');\n } else {\n clearActiveGroup();\n }\n },\n synced: () => {\n if (active?.controller !== controller || active.phase !== 'dragging') return;\n el.removeAttribute('data-sortable-phase');\n active.group?.el.removeAttribute('data-placing');\n },\n complete: ({context}) => {\n const operationId = (context.data as {operationId?: number}).operationId;\n const operation = active;\n if (operation && operation.id === operationId && operation.controller === controller) settle(operation);\n },\n reconcile: () => controller.refresh(),\n },\n }),\n resolveTransitionElement: ({name, data}) => {\n const operationId = (data as {operationId?: number}).operationId;\n const operation = active?.controller === controller\n && (operationId === undefined || active.id === operationId) ? active : null;\n if (name === 'starting') return operation?.ghost.visual as Alpine.ElementWithXAttributes | null;\n if (name === 'placing') return operation?.group?.el as Alpine.ElementWithXAttributes | null;\n return operation?.ghost.positioner as Alpine.ElementWithXAttributes | null;\n },\n });\n machine.connect(el as HTMLElement & Alpine.ElementWithXAttributes);\n const props = (): SourceProps => machine.getCommittedSnapshot().props;\n controller = {\n el,\n owner,\n source: () => {\n const sourceProps = props();\n const groupOwner = owner();\n const group = groupOwner ? groups.get(groupOwner)?.group() : null;\n const details = {\n scopeId: role === 'item' ? group?.scopeId ?? '' : sourceProps.sortableScope,\n id: sortableIdentity(el, sourceProps.sortableId), type: sourceProps.sortableType,\n ...(sourceProps.label ? {label: sourceProps.label} : {}),\n ...(Object.keys(sourceProps.sortableData).length\n ? {data: Object.freeze({...sourceProps.sortableData})}\n : {}),\n };\n return Object.freeze(role === 'item'\n ? {operation: 'move', groupId: group?.id ?? '', ...details}\n : {operation: 'insert', groupId: null, ...details});\n },\n disabled: () => {\n const groupOwner = owner();\n const group = groupOwner ? groups.get(groupOwner)?.group() : null;\n return props().disabled || group?.disabled === true || group?.readOnly === true;\n },\n appearance: () => {\n const sourceProps = props();\n const groupOwner = owner();\n const group = groupOwner ? groups.get(groupOwner)?.group() : null;\n return {\n sourceOpacity: group?.sourceOpacity ?? sourceProps.sourceOpacity,\n ghostOpacity: group?.ghostOpacity ?? sourceProps.ghostOpacity,\n dragCursor: group?.dragCursor ?? sourceProps.dragCursor,\n previewPosition: group?.previewPosition ?? sourceProps.previewPosition,\n color: group?.color ?? sourceProps.color,\n interaction: group?.interaction ?? sourceProps.interaction,\n };\n },\n refresh: () => undefined,\n machine,\n };\n const hasCustomEnding = el.getAttributeNames().some((name) => name === 'x-ui-transition:ending');\n const cleanupDefaultEnding = hasCustomEnding ? () => undefined : machine.onTransition('ending', (transition) => {\n const toFrame = (transition.data as {toFrame?: ReturnType<typeof frameFromRect>}).toFrame ?? null;\n const operationId = (transition.data as {operationId?: number}).operationId;\n const operation = active;\n if (!operation || operation.id !== operationId || operation.controller !== controller) return;\n return operation.ghost.finish(toFrame);\n });\n const initial = controller.source();\n if (!initial.scopeId || !initial.id || !initial.type) warn('Invalid sortable source props', el);\n const registration = registry.registerSource({element: el, getSource: controller.source, isDisabled: controller.disabled});\n controller.refresh = () => {\n if (active?.controller === controller) finish('cancel', 'removed');\n registration.refresh();\n };\n const handle = [...el.querySelectorAll<HTMLElement>(HANDLE_SELECTOR)]\n .find((candidate) => directOwner(candidate, `${ITEM_SELECTOR}, ${SOURCE_SELECTOR}`) === el);\n const preview = [...el.querySelectorAll<HTMLTemplateElement>(PREVIEW_SELECTOR)]\n .find((candidate) => directOwner(candidate, `${ITEM_SELECTOR}, ${SOURCE_SELECTOR}`) === el);\n const updatePointer = (event: ElementDragEvent): void => {\n if (active?.controller !== controller || active.phase !== 'dragging') return;\n const input = currentDragInput(event);\n const destination = event.location.current.dropTargets\n .map(({element}) => element instanceof HTMLElement ? groups.get(element) : undefined)\n .find((candidate) => candidate !== undefined);\n machine.send({\n type: 'POINTER_MOVED',\n pointer: {destinationId: destination?.group().id ?? null, input},\n });\n const hovered = document.elementFromPoint(input.clientX, input.clientY)?.closest<HTMLElement>(GROUP_SELECTOR) ?? null;\n clearRejectedTargets(hovered);\n };\n // PDD owns target dropEffect, but intentionally does not constrain the source effectAllowed.\n // Publish it before PDD's document-level dragstart handler so the browser never advertises copy.\n const cleanupNativeEffect = bindDragEffectAllowed(el, 'move');\n const cleanupDrag = draggable({\n element: el,\n ...(handle ? {dragHandle: handle} : {}),\n canDrag: ({input}) => {\n const target = document.elementFromPoint(input.clientX, input.clientY);\n const interactive = target?.closest(INTERACTIVE_SELECTOR) ?? null;\n return !controller.disabled() && (Boolean(handle) || interactive === null || interactive === el);\n },\n getInitialData: () => {\n const source = controller.source();\n return {marker: MARKER, scopeId: source.scopeId, sortableId: source.id, sortableType: source.type};\n },\n onGenerateDragPreview: disableNativeDragPreview,\n onDragStart: (event) => {\n // A session owns one operation. A later drag synchronously settles an ending predecessor.\n if (active) forceSettle(active);\n preventUnhandled.start();\n const source = controller.source();\n const input = currentDragInput(event);\n const appearance = controller.appearance();\n const ghost = createSortableGhost({\n source: el,\n input: initialDragInput(event),\n preview: preview ?? null,\n previewPosition: preview?.dataset.previewPosition || appearance.previewPosition,\n opacity: appearance.ghostOpacity,\n color: appearance.color,\n interaction: appearance.interaction,\n });\n ghost.move(input);\n const previousOpacity = el.style.opacity;\n el.style.opacity = `${appearance.sourceOpacity}`;\n const restoreCursor = activateSortableCursor(appearance.dragCursor);\n active = {\n id: ++operationSequence,\n phase: 'dragging',\n controller, source, ghost, placement: null, group: null,\n layouts: new Map([...groupControllers].flatMap((groupController) => {\n const group = groupController.group();\n return group.scopeId === source.scopeId\n ? [[group.id, captureLayout(groupController)] as const]\n : [];\n })),\n projections: new Map(), input, timestamp: performance.now(), restoreCursor,\n previousOpacity, settled: false, endSent: false, terminalData: null,\n };\n el.setAttribute('data-dragging', '');\n el.dataset.dragOperation = source.operation;\n dispatch({\n el,\n name: 'ui:sortable-start',\n composed: true,\n detail: Object.freeze({source}),\n });\n machine.send({\n type: 'START',\n data: {\n operationId: active.id,\n source,\n sourceFrame: frameFromRect(el.getBoundingClientRect()),\n ghostFrame: ghost.frame(),\n },\n });\n },\n onDropTargetChange: updatePointer,\n onDrag: (event) => {\n if (active?.controller !== controller) return;\n const input = currentDragInput(event);\n const previousInput = active.input;\n const timestamp = performance.now();\n const elapsed = Math.max(timestamp - active.timestamp, 1);\n active.input = input;\n active.timestamp = timestamp;\n active.ghost.move(input);\n updatePointer(event);\n dispatch({\n el,\n name: 'ui:sortable-drag',\n composed: true,\n detail: Object.freeze({\n source: active.source,\n input: Object.freeze(input),\n previousInput: Object.freeze(previousInput),\n delta: Object.freeze({\n x: input.clientX - previousInput.clientX,\n y: input.clientY - previousInput.clientY,\n }),\n velocity: Object.freeze({\n x: (input.clientX - previousInput.clientX) / elapsed,\n y: (input.clientY - previousInput.clientY) / elapsed,\n }),\n ghostFrame: Object.freeze({...active.ghost.frame()}),\n }),\n });\n },\n onDrop: (event) => {\n if (active?.controller === controller) active.input = currentDragInput(event);\n updatePointer(event);\n const operation = active?.controller === controller ? active : null;\n queueMicrotask(() => {\n if (active === operation && operation?.phase === 'dragging') {\n finish('cancel', controller.disabled() ? 'disabled' : 'outside', operation);\n }\n });\n },\n });\n utilities.cleanup(() => {\n if (active?.controller === controller) {\n const current = active;\n if (current.phase === 'dragging') finish('cancel', 'removed', current);\n forceSettle(current);\n }\n cleanupDrag();\n cleanupNativeEffect();\n cleanupDefaultEnding();\n registration();\n machine.disconnect();\n releaseWindowAutoScroll();\n });\n};\n\nreturn {registerGroup, registerSource, canDropPolicies};\n};\n\nconst registerSortableDirective = (AlpineInstance: Alpine.Alpine): SortableRegistry => {\n AlpineInstance.addInitSelector(() => '[x-ui-sortable], [x-ui-sortable\\\\:item], [x-ui-sortable\\\\:source]');\n const registry = createSortableRegistry();\n const session = createSortableSession(registry, (callback) => AlpineInstance.mutateDom(callback));\n AlpineInstance.directive('ui-sortable', AlpineInstance.skipDuringClone((el, {value, expression}, utilities) => {\n if (!(el instanceof HTMLElement)) return;\n if (!value) session.registerGroup(el, utilities);\n else if (value === 'item' || value === 'source') session.registerSource(el, value, utilities);\n else if (value === 'handle') {\n el.setAttribute('data-ui-sortable-handle', '');\n declareMorphAttributes(el, 'data-ui-sortable-handle');\n }\n else if (value === 'indicator') {\n el.setAttribute('data-ui-sortable-indicator', '');\n declareMorphAttributes(el, 'data-ui-sortable-indicator', 'aria-hidden', 'hidden');\n el.setAttribute('aria-hidden', 'true');\n (el as HTMLElement).hidden = true;\n } else if (value === 'preview') {\n el.setAttribute('data-ui-sortable-preview', '');\n declareMorphAttributes(el, 'data-ui-sortable-preview', 'data-preview-position');\n }\n else if (value === 'can-drop' && expression?.trim()) {\n session.canDropPolicies.set(el, (context) => utilities.evaluate(expression, {scope: {$sortable: context}}) !== false);\n utilities.cleanup(() => session.canDropPolicies.delete(el));\n }\n }));\n return registry;\n};\n\nexport {groupSchema, registerSortableDirective, sourceSchema};\n","import type {Alpine as AlpineType} from 'alpinejs';\n\nimport {registerSortableDirective} from '../directives/sortable';\nimport {createSortableRegistry} from '../runtime/drag-and-drop';\nimport {registerUiSortable} from '../runtime/ui';\n\nconst registered = new WeakSet<AlpineType>();\n\nconst registerSortableCapability = (AlpineInstance: AlpineType): void => {\n if (registered.has(AlpineInstance)) return;\n registered.add(AlpineInstance);\n const registry = registerSortableDirective(AlpineInstance);\n registerUiSortable(AlpineInstance, registry);\n};\n\nexport {createSortableRegistry, registerSortableCapability, registerSortableDirective};\nexport type * from '../runtime/drag-and-drop/sortable';\n"],"x_google_ignoreList":[2,5,6,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56],"mappings":"6rBA+GA,IAAM,EAAsB,GACxB,IAAY,MAAQ,OAAO,UAAU,CAAO,GAAK,EAAU,EC1FzD,EAAyB,EAEzB,IACF,EACA,IACU,IAAS,GAAS,GAC5B,GAAQ,GACL,EAAK,YAAY,UAAY,EAAM,YAAY,SAC/C,EAAK,QAAQ,KAAO,EAAM,QAAQ,IAClC,EAAK,QAAQ,OAAS,EAAM,QAAQ,MACpC,EAAK,QAAU,EAAM,OAGtB,GAAqB,CACvB,QACA,QACA,SAKU,CACV,IAAM,EAAK,EAAI,EAAI,EAAM,EACnB,EAAK,EAAI,EAAI,EAAM,EACnB,EAAgB,EAAK,EAAK,EAAK,EACrC,GAAI,IAAkB,EAAG,OAAO,KAAK,MAAM,EAAM,EAAI,EAAM,EAAG,EAAM,EAAI,EAAM,CAAC,EAC/E,IAAM,EAAW,KAAK,IAAI,EAAG,KAAK,IAAI,IACjC,EAAM,EAAI,EAAM,GAAK,GAAM,EAAM,EAAI,EAAM,GAAK,GACjD,CAAa,CAAC,EAClB,OAAO,KAAK,MAAM,EAAM,GAAK,EAAM,EAAI,EAAW,GAAK,EAAM,GAAK,EAAM,EAAI,EAAW,EAAG,CAC9F,EAEM,EAAsB,GAAuD,EAAM,SAAW,EAAI,CAAC,EAAI,CACzG,CACI,OAAQ,CAAC,GAAI,EAAM,EAAE,CAAE,GAA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