@mintplayer/web-components 2.19.0 → 2.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1036) hide show
  1. package/a11y/index.mjs +1 -29
  2. package/accordion/index.mjs +190 -530
  3. package/calendar/index.mjs +1 -4
  4. package/card/index.mjs +59 -328
  5. package/card/src/mp-card.element.d.ts +5 -13
  6. package/carousel/index.mjs +392 -845
  7. package/charts/core/index.mjs +502 -32
  8. package/charts/hierarchy/index.mjs +812 -1197
  9. package/charts/sparkline/index.mjs +127 -161
  10. package/charts/trend/index.mjs +306 -411
  11. package/checkbox/index.mjs +1 -4
  12. package/chunks/a11y-C6aX-lsZ.mjs +532 -0
  13. package/chunks/ac-aJXc45zA.mjs +4 -0
  14. package/chunks/ad-BTMXfwNh.mjs +4 -0
  15. package/chunks/ae-BrzD6osX.mjs +4 -0
  16. package/chunks/af-3UZ2_zTj.mjs +4 -0
  17. package/chunks/ag-KRBsuK2a.mjs +4 -0
  18. package/chunks/ai-BswLJAYs.mjs +4 -0
  19. package/chunks/al-wkJnSVxF.mjs +4 -0
  20. package/chunks/all-flags.generated-DtfbMnSZ.mjs +249 -0
  21. package/chunks/am-CVqI42UW.mjs +4 -0
  22. package/chunks/ao-85WVAZW6.mjs +4 -0
  23. package/chunks/ar-DJGfKADQ.mjs +4 -0
  24. package/chunks/as-BA11KqFF.mjs +4 -0
  25. package/chunks/at-BWbwtZ8t.mjs +4 -0
  26. package/chunks/au-gcOCUxgy.mjs +4 -0
  27. package/chunks/aw-cquGJK0_.mjs +4 -0
  28. package/chunks/ax-CqFz-_7-.mjs +4 -0
  29. package/chunks/az-CtGxDo7C.mjs +4 -0
  30. package/chunks/ba-Du5giA_b.mjs +4 -0
  31. package/chunks/bb-Bv08A_ob.mjs +4 -0
  32. package/chunks/bd-DNB5oj3n.mjs +4 -0
  33. package/chunks/be-CRVNdrRc.mjs +4 -0
  34. package/chunks/bf-CkLDaLFq.mjs +4 -0
  35. package/chunks/bg-5J0EZyQA.mjs +4 -0
  36. package/chunks/bh-Dm3fVyBc.mjs +4 -0
  37. package/chunks/bi-BpldTGS9.mjs +4 -0
  38. package/chunks/bj-Bn2B1hkk.mjs +4 -0
  39. package/chunks/bl-Dozbp4JI.mjs +4 -0
  40. package/chunks/bm-DMwDEJDn.mjs +4 -0
  41. package/chunks/bn-38iFiYIW.mjs +4 -0
  42. package/chunks/bo-C7Z0bS7Y.mjs +4 -0
  43. package/chunks/bq-Bp_dK3bp.mjs +4 -0
  44. package/chunks/br-C1y3qYTo.mjs +4 -0
  45. package/chunks/bs-DvapNTm6.mjs +4 -0
  46. package/chunks/bt-4BBK2CzL.mjs +4 -0
  47. package/chunks/bw-gFoFnfsO.mjs +4 -0
  48. package/chunks/by-BcXeEIqn.mjs +4 -0
  49. package/chunks/bz-DiNvPmet.mjs +4 -0
  50. package/chunks/ca-B6_-P3Ki.mjs +4 -0
  51. package/chunks/calendar-BufRj_ob.mjs +270 -0
  52. package/chunks/cc-1.generated-Bz6a4Z5J.mjs +575 -0
  53. package/chunks/cc-20.generated-B2Zbp_CG.mjs +56 -0
  54. package/chunks/cc-211.generated-ChWU4ZnK.mjs +27 -0
  55. package/chunks/cc-212.generated-rW7bueR8.mjs +77 -0
  56. package/chunks/cc-213.generated-Dk100iVd.mjs +52 -0
  57. package/chunks/cc-216.generated-Da9XXIxn.mjs +37 -0
  58. package/chunks/cc-218.generated-B9dPA_jz.mjs +27 -0
  59. package/chunks/cc-220.generated-BD583LXg.mjs +26 -0
  60. package/chunks/cc-221.generated-FnrRCGhQ.mjs +41 -0
  61. package/chunks/cc-222.generated-RIcsN1By.mjs +30 -0
  62. package/chunks/cc-223.generated-BJYOhmxL.mjs +30 -0
  63. package/chunks/cc-224.generated-ZVRf4s4P.mjs +40 -0
  64. package/chunks/cc-225.generated-B37F4h_L.mjs +30 -0
  65. package/chunks/cc-226.generated-DX6w8SIQ.mjs +26 -0
  66. package/chunks/cc-227.generated-DWvIJCqw.mjs +35 -0
  67. package/chunks/cc-228.generated-CYnF-A2j.mjs +26 -0
  68. package/chunks/cc-229.generated-BHENEfHM.mjs +40 -0
  69. package/chunks/cc-230.generated-CCkgyUCO.mjs +53 -0
  70. package/chunks/cc-231.generated-Cy_W19Ec.mjs +50 -0
  71. package/chunks/cc-232.generated-bZc5ux9j.mjs +27 -0
  72. package/chunks/cc-233.generated-DtiURqLW.mjs +36 -0
  73. package/chunks/cc-234.generated-ISth71Yl.mjs +67 -0
  74. package/chunks/cc-235.generated-PAizMnHl.mjs +27 -0
  75. package/chunks/cc-236.generated-ZPS5oQTo.mjs +31 -0
  76. package/chunks/cc-237.generated-fOpKOXN1.mjs +34 -0
  77. package/chunks/cc-238.generated-DLsZAArj.mjs +36 -0
  78. package/chunks/cc-239.generated-Dq7UEEQw.mjs +26 -0
  79. package/chunks/cc-240.generated-B5rtjDFe.mjs +35 -0
  80. package/chunks/cc-241.generated-C2tPOfsp.mjs +40 -0
  81. package/chunks/cc-242.generated-12ELhWHE.mjs +35 -0
  82. package/chunks/cc-243.generated-Co_QscFq.mjs +64 -0
  83. package/chunks/cc-244.generated-CHVaQJzk.mjs +26 -0
  84. package/chunks/cc-245.generated-Dlfots5d.mjs +40 -0
  85. package/chunks/cc-246.generated-ml5FnCdW.mjs +26 -0
  86. package/chunks/cc-247.generated-D8iUb2b4.mjs +30 -0
  87. package/chunks/cc-248.generated-ByNbG_tW.mjs +37 -0
  88. package/chunks/cc-249.generated-B1uFXVYg.mjs +27 -0
  89. package/chunks/cc-250.generated-Db4-CYfI.mjs +44 -0
  90. package/chunks/cc-251.generated-Dk9Nsbz4.mjs +27 -0
  91. package/chunks/cc-252.generated-DzLVy7Wj.mjs +62 -0
  92. package/chunks/cc-253.generated-BAAxb4Dd.mjs +26 -0
  93. package/chunks/cc-254.generated-CQb3622R.mjs +55 -0
  94. package/chunks/cc-255.generated-CkU7A9vn.mjs +57 -0
  95. package/chunks/cc-256.generated-CPuR1ls2.mjs +46 -0
  96. package/chunks/cc-257.generated-Bop3IKkH.mjs +26 -0
  97. package/chunks/cc-258.generated-CrhWzLYO.mjs +34 -0
  98. package/chunks/cc-260.generated-CM31-F_r.mjs +42 -0
  99. package/chunks/cc-261.generated-Cc1Yk2ga.mjs +37 -0
  100. package/chunks/cc-262.generated-iNq4Bsyg.mjs +64 -0
  101. package/chunks/cc-263.generated-BNSZQW1U.mjs +100 -0
  102. package/chunks/cc-264.generated-BYq3HF_4.mjs +57 -0
  103. package/chunks/cc-265.generated-55Al2n2g.mjs +32 -0
  104. package/chunks/cc-266.generated-CC24vRZU.mjs +30 -0
  105. package/chunks/cc-267.generated-Cy1cO0r8.mjs +62 -0
  106. package/chunks/cc-268.generated-CuFPqOA0.mjs +40 -0
  107. package/chunks/cc-269.generated-CCOchMHW.mjs +31 -0
  108. package/chunks/cc-27.generated-CgwGi0oo.mjs +77 -0
  109. package/chunks/cc-290.generated-WRbX8Uzp.mjs +48 -0
  110. package/chunks/cc-291.generated-CHqtf344.mjs +27 -0
  111. package/chunks/cc-297.generated-BNaG__hC.mjs +36 -0
  112. package/chunks/cc-298.generated-BXnC-JHy.mjs +36 -0
  113. package/chunks/cc-299.generated-B9EtLFYo.mjs +36 -0
  114. package/chunks/cc-30.generated-JiXqSdPm.mjs +58 -0
  115. package/chunks/cc-31.generated-T-PhKf6W.mjs +91 -0
  116. package/chunks/cc-32.generated-3jhsIH05.mjs +58 -0
  117. package/chunks/cc-33.generated-CKpraBu-.mjs +43 -0
  118. package/chunks/cc-34.generated-4ZOoUv3E.mjs +41 -0
  119. package/chunks/cc-350.generated-BZeZIKv3.mjs +26 -0
  120. package/chunks/cc-351.generated-Ca4DVFZ8.mjs +41 -0
  121. package/chunks/cc-352.generated-C5JanZQk.mjs +96 -0
  122. package/chunks/cc-353.generated-BgLwqLra.mjs +98 -0
  123. package/chunks/cc-354.generated-BgTnQRlC.mjs +41 -0
  124. package/chunks/cc-355.generated-DGYepZoL.mjs +69 -0
  125. package/chunks/cc-356.generated-BsVo-WVa.mjs +36 -0
  126. package/chunks/cc-357.generated-b5F9kBHS.mjs +37 -0
  127. package/chunks/cc-358.generated-sIEQmG3a.mjs +136 -0
  128. package/chunks/cc-359.generated-Djbt0V64.mjs +92 -0
  129. package/chunks/cc-36.generated-GYQWm_pU.mjs +51 -0
  130. package/chunks/cc-370.generated-CRvXymMq.mjs +62 -0
  131. package/chunks/cc-371.generated-BR2fz2JU.mjs +37 -0
  132. package/chunks/cc-372.generated-DNvOnI-D.mjs +53 -0
  133. package/chunks/cc-373.generated-CIFhOyHu.mjs +52 -0
  134. package/chunks/cc-374.generated-C3JO10F2.mjs +58 -0
  135. package/chunks/cc-375.generated-CdSXpaA5.mjs +77 -0
  136. package/chunks/cc-376.generated-JuZXGLxH.mjs +47 -0
  137. package/chunks/cc-377.generated-D6OxfwEg.mjs +44 -0
  138. package/chunks/cc-378.generated-1P6hL48M.mjs +40 -0
  139. package/chunks/cc-380.generated-DgzzIFUj.mjs +58 -0
  140. package/chunks/cc-381.generated-D_ItFJFw.mjs +65 -0
  141. package/chunks/cc-382.generated-DuYOeAO_.mjs +37 -0
  142. package/chunks/cc-383.generated-R6R6iExY.mjs +58 -0
  143. package/chunks/cc-385.generated-CsDeMCh1.mjs +77 -0
  144. package/chunks/cc-386.generated-CprplXRX.mjs +67 -0
  145. package/chunks/cc-387.generated-7j6TIOUR.mjs +52 -0
  146. package/chunks/cc-389.generated-BoKyJU1O.mjs +52 -0
  147. package/chunks/cc-39.generated-CD2WXEy7.mjs +144 -0
  148. package/chunks/cc-40.generated-BXVz6ZEf.mjs +60 -0
  149. package/chunks/cc-41.generated-Blq73F9R.mjs +52 -0
  150. package/chunks/cc-420.generated-CGBM0u2Z.mjs +59 -0
  151. package/chunks/cc-421.generated-TZXTbujK.mjs +68 -0
  152. package/chunks/cc-423.generated-0jWk7aQw.mjs +51 -0
  153. package/chunks/cc-43.generated-CWC77-QL.mjs +124 -0
  154. package/chunks/cc-44.generated-BjNEEm72.mjs +185 -0
  155. package/chunks/cc-45.generated-D2fAEViK.mjs +31 -0
  156. package/chunks/cc-46.generated-Cc7ziKiQ.mjs +151 -0
  157. package/chunks/cc-47.generated-BfsXOmTn.mjs +68 -0
  158. package/chunks/cc-48.generated-qLLhGlDM.mjs +80 -0
  159. package/chunks/cc-49.generated-V5s3zaiK.mjs +207 -0
  160. package/chunks/cc-500.generated-BthGq2Lz.mjs +22 -0
  161. package/chunks/cc-501.generated-D3OEBYfs.mjs +34 -0
  162. package/chunks/cc-502.generated-DuGMlanj.mjs +35 -0
  163. package/chunks/cc-503.generated-D6WQdJRe.mjs +47 -0
  164. package/chunks/cc-504.generated-CnaVgqYu.mjs +30 -0
  165. package/chunks/cc-505.generated-BymEBjCD.mjs +30 -0
  166. package/chunks/cc-506.generated-DECPXw0C.mjs +40 -0
  167. package/chunks/cc-507.generated-B3GcK3L_.mjs +48 -0
  168. package/chunks/cc-508.generated-Dyuwoas9.mjs +45 -0
  169. package/chunks/cc-509.generated-CFrvVAgw.mjs +36 -0
  170. package/chunks/cc-51.generated-Chb_sPYg.mjs +59 -0
  171. package/chunks/cc-52.generated-ByiHdoYn.mjs +42 -0
  172. package/chunks/cc-53.generated-DJSsiaD5.mjs +63 -0
  173. package/chunks/cc-54.generated-CHWQhBUJ.mjs +99 -0
  174. package/chunks/cc-55.generated-B1A8n_Eu.mjs +62 -0
  175. package/chunks/cc-56.generated-BIagT3im.mjs +86 -0
  176. package/chunks/cc-57.generated-BI-iKXi5.mjs +56 -0
  177. package/chunks/cc-58.generated-ChHB0yFM.mjs +35 -0
  178. package/chunks/cc-590.generated-eh5bgg8N.mjs +96 -0
  179. package/chunks/cc-591.generated-DtljIXWS.mjs +48 -0
  180. package/chunks/cc-592.generated-BFJXRJtp.mjs +36 -0
  181. package/chunks/cc-593.generated-BnzrDC9X.mjs +57 -0
  182. package/chunks/cc-594.generated-GeVqoxTf.mjs +42 -0
  183. package/chunks/cc-595.generated-Cb147_Es.mjs +99 -0
  184. package/chunks/cc-596.generated-Awrujeyi.mjs +42 -0
  185. package/chunks/cc-597.generated-x82tPU7m.mjs +48 -0
  186. package/chunks/cc-598.generated-C0CFFA9e.mjs +90 -0
  187. package/chunks/cc-599.generated-CBNiFVLG.mjs +57 -0
  188. package/chunks/cc-60.generated-BsEWXQGR.mjs +72 -0
  189. package/chunks/cc-61.generated-D1GBs6cI.mjs +165 -0
  190. package/chunks/cc-62.generated-wMxDe6Yk.mjs +121 -0
  191. package/chunks/cc-63.generated-CdGxow0i.mjs +90 -0
  192. package/chunks/cc-64.generated-RnYaXyOf.mjs +88 -0
  193. package/chunks/cc-65.generated-DLu3ZfUr.mjs +57 -0
  194. package/chunks/cc-66.generated-Bak_QXSf.mjs +55 -0
  195. package/chunks/cc-670.generated-C99GtcUk.mjs +36 -0
  196. package/chunks/cc-672.generated-CSfxhA5g.mjs +30 -0
  197. package/chunks/cc-673.generated-CBepp8Kp.mjs +36 -0
  198. package/chunks/cc-674.generated-CUruGGLX.mjs +26 -0
  199. package/chunks/cc-675.generated-CJAYoKiM.mjs +41 -0
  200. package/chunks/cc-676.generated-D0aVoKBX.mjs +48 -0
  201. package/chunks/cc-677.generated-CboriHtH.mjs +36 -0
  202. package/chunks/cc-678.generated-tV4dzsm1.mjs +36 -0
  203. package/chunks/cc-679.generated-r1SqDRTw.mjs +35 -0
  204. package/chunks/cc-680.generated-CUJSNlon.mjs +26 -0
  205. package/chunks/cc-681.generated-CqZqTSzv.mjs +40 -0
  206. package/chunks/cc-682.generated-DsTDPJJe.mjs +26 -0
  207. package/chunks/cc-683.generated-C46F0xza.mjs +26 -0
  208. package/chunks/cc-685.generated-3mzM0WBI.mjs +47 -0
  209. package/chunks/cc-686.generated-B7jAfSaz.mjs +32 -0
  210. package/chunks/cc-687.generated-DUkxCl-t.mjs +31 -0
  211. package/chunks/cc-688.generated-Bwg6wtz6.mjs +42 -0
  212. package/chunks/cc-689.generated-DIjPyQbi.mjs +52 -0
  213. package/chunks/cc-690.generated-BkBOgCj0.mjs +27 -0
  214. package/chunks/cc-691.generated-CRgqR_eS.mjs +26 -0
  215. package/chunks/cc-692.generated-xoIqpcZG.mjs +36 -0
  216. package/chunks/cc-7.generated-CVaWdxzG.mjs +99 -0
  217. package/chunks/cc-81.generated-BsK5UKLx.mjs +100 -0
  218. package/chunks/cc-82.generated-BcgfVP49.mjs +96 -0
  219. package/chunks/cc-84.generated-C_NDe2op.mjs +81 -0
  220. package/chunks/cc-850.generated-5uPEB20Q.mjs +41 -0
  221. package/chunks/cc-852.generated-Cmcj41zv.mjs +66 -0
  222. package/chunks/cc-853.generated-5Q5aYzYP.mjs +34 -0
  223. package/chunks/cc-855.generated-CyoP_AvI.mjs +40 -0
  224. package/chunks/cc-856.generated-UaGUxAVX.mjs +45 -0
  225. package/chunks/cc-86.generated-C76vQ-PG.mjs +131 -0
  226. package/chunks/cc-880.generated-DTQZvOwQ.mjs +63 -0
  227. package/chunks/cc-886.generated-BlEIkmSb.mjs +89 -0
  228. package/chunks/cc-90.generated-B6QJof50.mjs +70 -0
  229. package/chunks/cc-91.generated-BFtdPEFf.mjs +120 -0
  230. package/chunks/cc-92.generated-Dmc8JLXg.mjs +84 -0
  231. package/chunks/cc-93.generated-zx8cBy1Z.mjs +27 -0
  232. package/chunks/cc-94.generated-Blu9IgSY.mjs +40 -0
  233. package/chunks/cc-95.generated-DCr59wbp.mjs +103 -0
  234. package/chunks/cc-960.generated-D1_nf00O.mjs +39 -0
  235. package/chunks/cc-961.generated-DxRflmbQ.mjs +42 -0
  236. package/chunks/cc-962.generated-DxZQb06J.mjs +58 -0
  237. package/chunks/cc-963.generated-uiT34jBy.mjs +34 -0
  238. package/chunks/cc-964.generated-BOKCnQHJ.mjs +45 -0
  239. package/chunks/cc-965.generated-CxNoEz0A.mjs +34 -0
  240. package/chunks/cc-966.generated-DhI8Ntyw.mjs +56 -0
  241. package/chunks/cc-967.generated-ContxwI-.mjs +36 -0
  242. package/chunks/cc-968.generated-v531jzFw.mjs +47 -0
  243. package/chunks/cc-970.generated-ChNVoJlm.mjs +55 -0
  244. package/chunks/cc-971.generated-xlS_839v.mjs +65 -0
  245. package/chunks/cc-972.generated-C5zT9loz.mjs +87 -0
  246. package/chunks/cc-973.generated-GoMZ3x5A.mjs +37 -0
  247. package/chunks/cc-974.generated-CHoLGfhR.mjs +48 -0
  248. package/chunks/cc-975.generated-BILSPn9k.mjs +30 -0
  249. package/chunks/cc-976.generated-4w3Zjm18.mjs +66 -0
  250. package/chunks/cc-977.generated-QcknaTKZ.mjs +48 -0
  251. package/chunks/cc-98.generated-C8ajgwoF.mjs +65 -0
  252. package/chunks/cc-992.generated-DUtoyFJd.mjs +44 -0
  253. package/chunks/cc-993.generated-DA_HUZYq.mjs +42 -0
  254. package/chunks/cc-994.generated-Bs9TDYzb.mjs +50 -0
  255. package/chunks/cc-995.generated-DeCplFKG.mjs +56 -0
  256. package/chunks/cc-996.generated-DIoF8HI4.mjs +45 -0
  257. package/chunks/cc-998.generated-mB6cuCsE.mjs +26 -0
  258. package/chunks/cc-C0VrlA3_.mjs +4 -0
  259. package/chunks/cd-TfcK0f07.mjs +4 -0
  260. package/chunks/cf-Cr0ikDYa.mjs +4 -0
  261. package/chunks/cg-BeLZ5g5O.mjs +4 -0
  262. package/chunks/ch-cyq7xzGy.mjs +4 -0
  263. package/chunks/checkbox-EnxkCGiC.mjs +271 -0
  264. package/chunks/ci-D2pSb2Ih.mjs +4 -0
  265. package/chunks/ck-htfFHGea.mjs +4 -0
  266. package/chunks/cl-CoYa3Pmk.mjs +4 -0
  267. package/chunks/cm-D6uug-DA.mjs +4 -0
  268. package/chunks/cn-D48FvmT7.mjs +4 -0
  269. package/chunks/co-Dww2Azv_.mjs +4 -0
  270. package/chunks/color-mode-warning-BWDrpfmR.mjs +11 -0
  271. package/chunks/cr-T0UM2nAQ.mjs +4 -0
  272. package/chunks/cu-CvSN3Q4W.mjs +4 -0
  273. package/chunks/cv-CselBvqy.mjs +4 -0
  274. package/chunks/cw-DBlAOQBG.mjs +4 -0
  275. package/chunks/cx-CT3aGae9.mjs +4 -0
  276. package/chunks/cy-BgOT9gkN.mjs +4 -0
  277. package/chunks/cz-pyOSY6aP.mjs +4 -0
  278. package/chunks/datatable-x_OgDL1V.mjs +1788 -0
  279. package/chunks/datetime-picker-BtroFVZZ.mjs +373 -0
  280. package/chunks/de-KGaNXoZN.mjs +4 -0
  281. package/chunks/decorate-_3lQte5d.mjs +9 -0
  282. package/chunks/dj-erTpydIV.mjs +4 -0
  283. package/chunks/dk-D1JuLNfO.mjs +4 -0
  284. package/chunks/dm-DCecBFF5.mjs +4 -0
  285. package/chunks/do-DSLfzWkU.mjs +4 -0
  286. package/chunks/dz-Ce9xahTz.mjs +4 -0
  287. package/chunks/ec-Bi76lWx3.mjs +4 -0
  288. package/chunks/ee-bSjXh051.mjs +4 -0
  289. package/chunks/eg-r6ELPNF6.mjs +4 -0
  290. package/chunks/eh-B9fkMRyx.mjs +4 -0
  291. package/chunks/er-udHBJByJ.mjs +4 -0
  292. package/chunks/es-Bu9WWdeR.mjs +4 -0
  293. package/chunks/et-CXZPC0sf.mjs +4 -0
  294. package/chunks/fi-dNG3mnm4.mjs +4 -0
  295. package/chunks/fj-DRC_-qUY.mjs +4 -0
  296. package/chunks/fk-J-PwBKbI.mjs +4 -0
  297. package/chunks/flags-BklZdqf-.mjs +268 -0
  298. package/chunks/fm-DdlXjhk_.mjs +4 -0
  299. package/chunks/fo-BF6Oan5b.mjs +4 -0
  300. package/chunks/form-check.styles-WIzQ8Lr8.mjs +5 -0
  301. package/chunks/form-control.styles-xkboF3PM.mjs +5 -0
  302. package/chunks/fr-m5fDKirC.mjs +4 -0
  303. package/chunks/ga-B4EBbkUA.mjs +4 -0
  304. package/chunks/gb-7vN41y_W.mjs +4 -0
  305. package/chunks/gd-oYxJTsCo.mjs +4 -0
  306. package/chunks/ge-DjFzwM58.mjs +4 -0
  307. package/chunks/gf-QpbaNTLf.mjs +4 -0
  308. package/chunks/gg-DD5U9436.mjs +4 -0
  309. package/chunks/gh-DwVF19eS.mjs +4 -0
  310. package/chunks/gi-UFWuuzET.mjs +4 -0
  311. package/chunks/gl-D6QboaPF.mjs +4 -0
  312. package/chunks/gm-DBMaPUVF.mjs +4 -0
  313. package/chunks/gn-CgBEf8H_.mjs +4 -0
  314. package/chunks/gp-CzgFkpC6.mjs +4 -0
  315. package/chunks/gq-Bnsg80y2.mjs +4 -0
  316. package/chunks/gr-BZRM9aE0.mjs +4 -0
  317. package/chunks/gt-BUUDyd82.mjs +4 -0
  318. package/chunks/gu-TRJAAUWQ.mjs +4 -0
  319. package/chunks/gw-D9LrzBrV.mjs +4 -0
  320. package/chunks/gy-DH746QP0.mjs +4 -0
  321. package/chunks/hk-JPHzGR1f.mjs +4 -0
  322. package/chunks/hn-tQE5mLlb.mjs +4 -0
  323. package/chunks/hr-BdLlK8MT.mjs +4 -0
  324. package/chunks/ht-efkMBTm5.mjs +4 -0
  325. package/chunks/hu-BQqGjm3B.mjs +4 -0
  326. package/chunks/id-DaJrUhdH.mjs +4 -0
  327. package/chunks/ie-BNbUpzRG.mjs +4 -0
  328. package/chunks/il-Cg79KHAv.mjs +4 -0
  329. package/chunks/im-Djx9n3WT.mjs +4 -0
  330. package/chunks/in-B43LtLH-.mjs +4 -0
  331. package/chunks/input-group-CjmHKUSw.mjs +48 -0
  332. package/chunks/invalid-feedback.styles-BAfKyqM0.mjs +5 -0
  333. package/chunks/io-BnYRzBj3.mjs +4 -0
  334. package/chunks/iq-DUn1QbRL.mjs +4 -0
  335. package/chunks/ir-DlyfLEkf.mjs +4 -0
  336. package/chunks/is-DQ_bn71q.mjs +4 -0
  337. package/chunks/it-BfPMagQk.mjs +4 -0
  338. package/chunks/je-BLm9fJmW.mjs +4 -0
  339. package/chunks/jm-CxLVl0Ry.mjs +4 -0
  340. package/chunks/jo-Cfupva0T.mjs +4 -0
  341. package/chunks/jp-iR_5eVnk.mjs +4 -0
  342. package/chunks/ke-QUXFhgYU.mjs +4 -0
  343. package/chunks/kg-C0ssUmgN.mjs +4 -0
  344. package/chunks/kh-9A3QNvDB.mjs +4 -0
  345. package/chunks/ki-bFdICXHj.mjs +4 -0
  346. package/chunks/km-CYuiTVlZ.mjs +4 -0
  347. package/chunks/kn-fqURi7WO.mjs +4 -0
  348. package/chunks/kp-B9J1sdkG.mjs +4 -0
  349. package/chunks/kr-hrrgo3DJ.mjs +4 -0
  350. package/chunks/kw-CsK5t1uI.mjs +4 -0
  351. package/chunks/ky-CIIoXV1x.mjs +4 -0
  352. package/chunks/kz-Q6lWH-Lp.mjs +4 -0
  353. package/chunks/la-BqrIQzV5.mjs +4 -0
  354. package/chunks/lb-f1wH5q4z.mjs +4 -0
  355. package/chunks/lc-DiPjKtKA.mjs +4 -0
  356. package/chunks/li-CC9A-Eoo.mjs +4 -0
  357. package/chunks/lk-DBBVyq9z.mjs +4 -0
  358. package/chunks/lr-CYmj0qzD.mjs +4 -0
  359. package/chunks/ls-5eFpOHA5.mjs +4 -0
  360. package/chunks/lt-DuXsTfKz.mjs +4 -0
  361. package/chunks/lu-l81BU1X-.mjs +4 -0
  362. package/chunks/lv-pBWGmb6y.mjs +4 -0
  363. package/chunks/ly-rQGukqgk.mjs +4 -0
  364. package/chunks/ma-D3s8fhJY.mjs +4 -0
  365. package/chunks/mc-C2UgSKD0.mjs +4 -0
  366. package/chunks/md-Bn-lDZyQ.mjs +4 -0
  367. package/chunks/me-CTM23YkQ.mjs +4 -0
  368. package/chunks/metadata-loaders.generated-BOHjz7Pm.mjs +250 -0
  369. package/chunks/mf-Dw6W2U1G.mjs +4 -0
  370. package/chunks/mg-BvSTuxdV.mjs +4 -0
  371. package/chunks/mh-DlNbre6t.mjs +4 -0
  372. package/chunks/mk-CMQgOxwU.mjs +4 -0
  373. package/chunks/ml-Dr5P0Yo_.mjs +4 -0
  374. package/chunks/mm-C6vWhwqu.mjs +4 -0
  375. package/chunks/mn-D3Xmr6k_.mjs +4 -0
  376. package/chunks/mo-BieTAs8C.mjs +4 -0
  377. package/chunks/mp-CkOXp1Ru.mjs +4 -0
  378. package/chunks/mq-Cjhq-UJo.mjs +4 -0
  379. package/chunks/mr-Dnfbj6zJ.mjs +4 -0
  380. package/chunks/ms-CTQctbcy.mjs +4 -0
  381. package/chunks/mt-CU4E0kx5.mjs +4 -0
  382. package/chunks/mu-D-VsOyS8.mjs +4 -0
  383. package/chunks/mv-BLAL7NFA.mjs +4 -0
  384. package/chunks/mw-v7uw9vtP.mjs +4 -0
  385. package/chunks/mx-eDyMiM1l.mjs +4 -0
  386. package/chunks/my-DZwL-5pY.mjs +4 -0
  387. package/chunks/mz-CUtVhMFS.mjs +4 -0
  388. package/chunks/na-BY29xZvs.mjs +4 -0
  389. package/chunks/nc-DeEXGMmA.mjs +4 -0
  390. package/chunks/ne-CLxU921A.mjs +4 -0
  391. package/chunks/nf-D_JOkQkl.mjs +4 -0
  392. package/chunks/ng-CR5xUr0F.mjs +4 -0
  393. package/chunks/ni-C15mTV4Y.mjs +4 -0
  394. package/chunks/nl-CLg7nWke.mjs +4 -0
  395. package/chunks/no-D56_k2KF.mjs +4 -0
  396. package/chunks/np-BAP7jy8o.mjs +4 -0
  397. package/chunks/nr-VKzWyaNU.mjs +4 -0
  398. package/chunks/nu-D3XZHNZP.mjs +4 -0
  399. package/chunks/nz-BdvILa2x.mjs +4 -0
  400. package/chunks/om-BuPCo8qp.mjs +4 -0
  401. package/chunks/overlay-kT0nfzL-.mjs +275 -0
  402. package/chunks/pa-CyYPeQbr.mjs +4 -0
  403. package/chunks/pagination-Bcz1TwlS.mjs +184 -0
  404. package/chunks/pe-B-P9yq9y.mjs +4 -0
  405. package/chunks/pf-BEygN2Xk.mjs +4 -0
  406. package/chunks/pg-BbFUBN-z.mjs +4 -0
  407. package/chunks/ph-BwijTsiw.mjs +4 -0
  408. package/chunks/pk-DyS4XqKp.mjs +4 -0
  409. package/chunks/pl-Bs4VwV81.mjs +4 -0
  410. package/chunks/pm-DLEa5i47.mjs +4 -0
  411. package/chunks/pr-BWsOEP9w.mjs +4 -0
  412. package/chunks/ps-B_qECKr4.mjs +4 -0
  413. package/chunks/pt-C2_djybD.mjs +4 -0
  414. package/chunks/pw-D_NY3JPr.mjs +4 -0
  415. package/chunks/py-CndItMw9.mjs +4 -0
  416. package/chunks/qa-CD1uNFb9.mjs +4 -0
  417. package/chunks/radio-BO6g4B91.mjs +260 -0
  418. package/chunks/re-BW_tVnq3.mjs +4 -0
  419. package/chunks/ro-1-zfxYpt.mjs +4 -0
  420. package/chunks/rs-BoYWG9vg.mjs +4 -0
  421. package/chunks/ru-CYVEtP_y.mjs +4 -0
  422. package/chunks/rw-Bg3jblyd.mjs +4 -0
  423. package/chunks/sa-B69Q0suF.mjs +4 -0
  424. package/chunks/sb-BsEiWQfb.mjs +4 -0
  425. package/chunks/sc-DbArtz_B.mjs +4 -0
  426. package/chunks/scheduler-core-CoFpfrl5.mjs +867 -0
  427. package/chunks/sd-BBHgjmhj.mjs +4 -0
  428. package/chunks/se-BIv2B636.mjs +4 -0
  429. package/chunks/select-R-96AksV.mjs +295 -0
  430. package/chunks/sg-C5hxvYqk.mjs +4 -0
  431. package/chunks/sh-HM3W4hDH.mjs +4 -0
  432. package/chunks/si-DP1aBcfC.mjs +4 -0
  433. package/chunks/sj-BW7y-uq5.mjs +4 -0
  434. package/chunks/sk-i105Khwu.mjs +4 -0
  435. package/chunks/sl-Di2GF_yv.mjs +4 -0
  436. package/chunks/sm-CBa0TK4H.mjs +4 -0
  437. package/chunks/sn-DUHpXra8.mjs +4 -0
  438. package/chunks/so-BNbpnsu-.mjs +4 -0
  439. package/chunks/splitter-ByLyrd5H.mjs +436 -0
  440. package/chunks/sr-ao-a5_9y.mjs +4 -0
  441. package/chunks/ss-DcnzauNo.mjs +4 -0
  442. package/chunks/st-UM_GVNxZ.mjs +4 -0
  443. package/chunks/sv-DGf1zbvG.mjs +4 -0
  444. package/chunks/swiper-core-kwEab-Zw.mjs +145 -0
  445. package/chunks/sx-BswzV8CI.mjs +4 -0
  446. package/chunks/sy-9m1S8Kc1.mjs +4 -0
  447. package/chunks/sz-D85TIkXG.mjs +4 -0
  448. package/chunks/tab-control-CW53taeE.mjs +202 -0
  449. package/chunks/tc-C7PcDjFx.mjs +4 -0
  450. package/chunks/td-BPQVoqMT.mjs +4 -0
  451. package/chunks/tg-BrHdehFU.mjs +4 -0
  452. package/chunks/th-Dy_pGi_n.mjs +4 -0
  453. package/chunks/timeline-core-B9Lu8Qq4.mjs +15 -0
  454. package/chunks/timepicker-LaSAPnxw.mjs +326 -0
  455. package/chunks/tj-DMpkq8L_.mjs +4 -0
  456. package/chunks/tk-BnQPtoCZ.mjs +4 -0
  457. package/chunks/tl-ogyf_25A.mjs +4 -0
  458. package/chunks/tm-ftTOaKfg.mjs +4 -0
  459. package/chunks/tn-DH-O9SRy.mjs +4 -0
  460. package/chunks/to-CDqWnE6l.mjs +4 -0
  461. package/chunks/toggle-button-H1Ty5nnF.mjs +196 -0
  462. package/chunks/tr-CRzwaC_7.mjs +4 -0
  463. package/chunks/treeview-BuznGbcj.mjs +302 -0
  464. package/chunks/tt-CddKczAn.mjs +4 -0
  465. package/chunks/tv-b-Y36_Oq.mjs +4 -0
  466. package/chunks/tw-BbdD_Tku.mjs +4 -0
  467. package/chunks/tz-Det_pKDO.mjs +4 -0
  468. package/chunks/ua-CdODx9f1.mjs +4 -0
  469. package/chunks/ug-CTIJi1Jn.mjs +4 -0
  470. package/chunks/us-Dsgn127D.mjs +4 -0
  471. package/chunks/uy-CtFb0Nfv.mjs +4 -0
  472. package/chunks/uz-CqlGrq2Q.mjs +4 -0
  473. package/chunks/va-C-PHbkgG.mjs +4 -0
  474. package/chunks/vc-CtVMqDKl.mjs +4 -0
  475. package/chunks/ve-CBHWNLnB.mjs +4 -0
  476. package/chunks/vg-BN0gTtPV.mjs +4 -0
  477. package/chunks/vi-D91NT7D5.mjs +4 -0
  478. package/chunks/vn-Dz72HCr4.mjs +4 -0
  479. package/chunks/vu-Cmk5qbSr.mjs +4 -0
  480. package/chunks/wf-DAPtyg32.mjs +4 -0
  481. package/chunks/ws-es9JGzNi.mjs +4 -0
  482. package/chunks/xk-st-Xu64D.mjs +4 -0
  483. package/chunks/ye-Dmo8XEYa.mjs +4 -0
  484. package/chunks/yt-CNEu1wkH.mjs +4 -0
  485. package/chunks/za-CiZ4NsPE.mjs +4 -0
  486. package/chunks/zm-DqQAAfzp.mjs +4 -0
  487. package/chunks/zw-BIGE1hob.mjs +4 -0
  488. package/code-snippet/index.mjs +472 -820
  489. package/custom-elements.json +6539 -5986
  490. package/datatable/index.mjs +1 -8
  491. package/datatable/src/components/mp-datatable.d.ts +4 -0
  492. package/datatable/src/types/tree.d.ts +7 -0
  493. package/datepicker/index.mjs +128 -215
  494. package/datetime-picker/index.mjs +1 -4
  495. package/dock/index.mjs +1871 -2471
  496. package/dropdown-menu/index.mjs +151 -602
  497. package/dropdown-menu/src/components/mp-dropdown-menu.d.ts +5 -8
  498. package/dropdown-menu/src/index.d.ts +1 -1
  499. package/dropdown-menu/src/types/dropdown.d.ts +0 -2
  500. package/dropdown-menu/src/types/index.d.ts +1 -1
  501. package/file-manager/index.mjs +771 -1180
  502. package/flags/index.mjs +1 -264
  503. package/index.mjs +0 -1
  504. package/input-group/index.mjs +1 -4
  505. package/light-dom/index.mjs +128 -11
  506. package/light-dom/src/install-light-styles.d.ts +10 -22
  507. package/light-dom/src/scoped-html.d.ts +0 -6
  508. package/machine/index.d.ts +1 -0
  509. package/machine/index.mjs +47 -0
  510. package/machine/src/index.d.ts +2 -0
  511. package/machine/src/machine-controller.d.ts +25 -0
  512. package/machine/src/props-directive.d.ts +21 -0
  513. package/multi-range/index.mjs +233 -402
  514. package/navbar/index.mjs +224 -1010
  515. package/otp-input/index.mjs +249 -374
  516. package/overlay/index.mjs +1 -7
  517. package/package.json +10 -1
  518. package/pagination/index.mjs +1 -5
  519. package/phone-core/index.mjs +120 -8
  520. package/phone-input/index.mjs +380 -493
  521. package/query-builder/index.mjs +1502 -2277
  522. package/radio/index.mjs +1 -4
  523. package/radio-group/index.mjs +126 -144
  524. package/ribbon/index.mjs +1158 -1497
  525. package/scheduler/index.mjs +3456 -6576
  526. package/scheduler-core/index.mjs +1 -197
  527. package/select/index.mjs +1 -4
  528. package/shell/index.mjs +98 -572
  529. package/signature-pad/index.mjs +180 -207
  530. package/splitter/index.mjs +1 -10
  531. package/swiper-core/index.mjs +1 -184
  532. package/tab-control/index.mjs +1 -6
  533. package/theming/index.mjs +229 -317
  534. package/tile-manager/index.mjs +746 -899
  535. package/timeline/index.mjs +476 -754
  536. package/timeline-core/index.mjs +1 -23
  537. package/timepicker/index.mjs +1 -9
  538. package/toggle-button/index.mjs +1 -5
  539. package/tree-select/index.mjs +475 -769
  540. package/tree-select/src/components/mp-tree-select.d.ts +16 -5
  541. package/treeview/index.mjs +1 -5
  542. package/typeahead/index.d.ts +1 -0
  543. package/typeahead/index.mjs +220 -0
  544. package/typeahead/src/components/mp-typeahead.d.ts +67 -0
  545. package/typeahead/src/index.d.ts +3 -0
  546. package/badge/src/styles/badge.styles.d.ts +0 -2
  547. package/chunks/ac-C5mj7mOe.mjs +0 -5
  548. package/chunks/ad-DuKUeTXh.mjs +0 -5
  549. package/chunks/ae-BFJrplpe.mjs +0 -5
  550. package/chunks/af-BIQlNFtj.mjs +0 -5
  551. package/chunks/ag-B9GDO0Ip.mjs +0 -5
  552. package/chunks/ai-pifHTP5K.mjs +0 -5
  553. package/chunks/al-CWQ3OuN9.mjs +0 -5
  554. package/chunks/all-flags-BtYcfgjy.mjs +0 -8
  555. package/chunks/all-flags.generated-B7Rctzuq.mjs +0 -493
  556. package/chunks/am-Do56ciQl.mjs +0 -5
  557. package/chunks/ao-Ci_fen-O.mjs +0 -5
  558. package/chunks/ar-BEZTIgF7.mjs +0 -5
  559. package/chunks/as-B29efaG_.mjs +0 -5
  560. package/chunks/at-c7xv31cV.mjs +0 -5
  561. package/chunks/attributes-L3eKsbdy.mjs +0 -16
  562. package/chunks/au-DK4ZROf6.mjs +0 -5
  563. package/chunks/aw-eEmOo-kc.mjs +0 -5
  564. package/chunks/ax-CF1cgQbd.mjs +0 -5
  565. package/chunks/az-BXPec7pf.mjs +0 -5
  566. package/chunks/ba-EoocSiX0.mjs +0 -5
  567. package/chunks/bb-BomyOgY0.mjs +0 -5
  568. package/chunks/bd-C2Y9A316.mjs +0 -5
  569. package/chunks/be-DcE56El1.mjs +0 -5
  570. package/chunks/bf-g7XzTHJG.mjs +0 -5
  571. package/chunks/bg-DAHpwJAh.mjs +0 -5
  572. package/chunks/bh-BiHF8vqO.mjs +0 -5
  573. package/chunks/bi-DVAoOy2o.mjs +0 -5
  574. package/chunks/bj-CB6I0T1J.mjs +0 -5
  575. package/chunks/bl-DhUObXcB.mjs +0 -5
  576. package/chunks/bm-d77E6A-Q.mjs +0 -5
  577. package/chunks/bn-CG1_6Vfv.mjs +0 -5
  578. package/chunks/bo-ulcQ_Lws.mjs +0 -5
  579. package/chunks/bq-wOjRpmJJ.mjs +0 -5
  580. package/chunks/br-BwQAEpKL.mjs +0 -5
  581. package/chunks/bs-Cmq3uDf9.mjs +0 -5
  582. package/chunks/bt-Cik-3ebf.mjs +0 -5
  583. package/chunks/bw-ZUkpxAL1.mjs +0 -5
  584. package/chunks/by-Dh-5h5x1.mjs +0 -5
  585. package/chunks/bz-DB0s7-5N.mjs +0 -5
  586. package/chunks/ca-Coq88_mc.mjs +0 -5
  587. package/chunks/cc-1.generated-CkRogBGA.mjs +0 -4
  588. package/chunks/cc-20.generated-DMpg7apl.mjs +0 -4
  589. package/chunks/cc-211.generated-DSnuuKPM.mjs +0 -4
  590. package/chunks/cc-212.generated-Dcg3rrip.mjs +0 -4
  591. package/chunks/cc-213.generated-DPwtGlxT.mjs +0 -4
  592. package/chunks/cc-216.generated-Cgber7dX.mjs +0 -4
  593. package/chunks/cc-218.generated-CZGwxl9D.mjs +0 -4
  594. package/chunks/cc-220.generated-CKmXmpGe.mjs +0 -4
  595. package/chunks/cc-221.generated-BYzgBejl.mjs +0 -4
  596. package/chunks/cc-222.generated-YwuXcbvd.mjs +0 -4
  597. package/chunks/cc-223.generated-9iiHnni6.mjs +0 -4
  598. package/chunks/cc-224.generated-Okty02TJ.mjs +0 -4
  599. package/chunks/cc-225.generated-CYkDnG14.mjs +0 -4
  600. package/chunks/cc-226.generated-GT_rqbCO.mjs +0 -4
  601. package/chunks/cc-227.generated-B1VkrgoB.mjs +0 -4
  602. package/chunks/cc-228.generated-Bhck-C6Z.mjs +0 -4
  603. package/chunks/cc-229.generated-aAR4PP7n.mjs +0 -4
  604. package/chunks/cc-230.generated-CG5TxZtb.mjs +0 -4
  605. package/chunks/cc-231.generated-BjYHl_BP.mjs +0 -4
  606. package/chunks/cc-232.generated-CFDyaA7o.mjs +0 -4
  607. package/chunks/cc-233.generated-ChwvrW0E.mjs +0 -4
  608. package/chunks/cc-234.generated-BIpIojaD.mjs +0 -4
  609. package/chunks/cc-235.generated-Dklizfb9.mjs +0 -4
  610. package/chunks/cc-236.generated-EJZlz23v.mjs +0 -4
  611. package/chunks/cc-237.generated-DwOapZWZ.mjs +0 -4
  612. package/chunks/cc-238.generated-BkCWtGDY.mjs +0 -4
  613. package/chunks/cc-239.generated-S_foXUit.mjs +0 -4
  614. package/chunks/cc-240.generated-CtKfcEWk.mjs +0 -4
  615. package/chunks/cc-241.generated-aAUw2QzS.mjs +0 -4
  616. package/chunks/cc-242.generated-D5jMR3KR.mjs +0 -4
  617. package/chunks/cc-243.generated-Bk5dwdUf.mjs +0 -4
  618. package/chunks/cc-244.generated-DywGvISM.mjs +0 -4
  619. package/chunks/cc-245.generated-Bm7wVXl5.mjs +0 -4
  620. package/chunks/cc-246.generated-CFSezynW.mjs +0 -4
  621. package/chunks/cc-247.generated-DKXGq8p1.mjs +0 -4
  622. package/chunks/cc-248.generated-CnI_kkbi.mjs +0 -4
  623. package/chunks/cc-249.generated-Zenj8WBl.mjs +0 -4
  624. package/chunks/cc-250.generated-140A9gFx.mjs +0 -4
  625. package/chunks/cc-251.generated-BYtVzI1w.mjs +0 -4
  626. package/chunks/cc-252.generated-C9By3_Ih.mjs +0 -4
  627. package/chunks/cc-253.generated-DZIADgzo.mjs +0 -4
  628. package/chunks/cc-254.generated-Bkb5VbuX.mjs +0 -4
  629. package/chunks/cc-255.generated-U_k4UlnG.mjs +0 -4
  630. package/chunks/cc-256.generated-BBGMRLJL.mjs +0 -4
  631. package/chunks/cc-257.generated-2Jiadm-X.mjs +0 -4
  632. package/chunks/cc-258.generated-CSHZFQtI.mjs +0 -4
  633. package/chunks/cc-260.generated-CWgOLjv4.mjs +0 -4
  634. package/chunks/cc-261.generated-DzpnYK1v.mjs +0 -4
  635. package/chunks/cc-262.generated-uZY0cJ08.mjs +0 -4
  636. package/chunks/cc-263.generated-D2QbPttm.mjs +0 -4
  637. package/chunks/cc-264.generated-DhUT_yRg.mjs +0 -4
  638. package/chunks/cc-265.generated-BKIU4vGv.mjs +0 -4
  639. package/chunks/cc-266.generated-O_zgqaDo.mjs +0 -4
  640. package/chunks/cc-267.generated-DpLBLCK1.mjs +0 -4
  641. package/chunks/cc-268.generated-B9Y4LS_4.mjs +0 -4
  642. package/chunks/cc-269.generated-DPQ0A8VW.mjs +0 -4
  643. package/chunks/cc-27.generated-BxeFhsuD.mjs +0 -4
  644. package/chunks/cc-290.generated-DGy2isg7.mjs +0 -4
  645. package/chunks/cc-291.generated-C4LSfffl.mjs +0 -4
  646. package/chunks/cc-297.generated-4k_1JOUj.mjs +0 -4
  647. package/chunks/cc-298.generated-A2xB0PKR.mjs +0 -4
  648. package/chunks/cc-299.generated-BwDC9B1N.mjs +0 -4
  649. package/chunks/cc-30.generated-JhyYglqU.mjs +0 -4
  650. package/chunks/cc-31.generated-5GOCJzfN.mjs +0 -4
  651. package/chunks/cc-32.generated-CpVvykA2.mjs +0 -4
  652. package/chunks/cc-33.generated-BDzHxbR_.mjs +0 -4
  653. package/chunks/cc-34.generated-P3nQfhBw.mjs +0 -4
  654. package/chunks/cc-350.generated-BGl8hYsP.mjs +0 -4
  655. package/chunks/cc-351.generated-pJBouwSG.mjs +0 -4
  656. package/chunks/cc-352.generated-8_NbdAx6.mjs +0 -4
  657. package/chunks/cc-353.generated-Cfz2tBdq.mjs +0 -4
  658. package/chunks/cc-354.generated-CEgaa6qB.mjs +0 -4
  659. package/chunks/cc-355.generated-DGZ-kJ0i.mjs +0 -4
  660. package/chunks/cc-356.generated-BZqLs86A.mjs +0 -4
  661. package/chunks/cc-357.generated-CfCB5cHL.mjs +0 -4
  662. package/chunks/cc-358.generated-wL2JzNDk.mjs +0 -4
  663. package/chunks/cc-359.generated-BxJe3xGt.mjs +0 -4
  664. package/chunks/cc-36.generated-CJdA4Rvi.mjs +0 -4
  665. package/chunks/cc-370.generated-B6SpL74q.mjs +0 -4
  666. package/chunks/cc-371.generated-Cx6lrGG9.mjs +0 -4
  667. package/chunks/cc-372.generated-Ckc30SHu.mjs +0 -4
  668. package/chunks/cc-373.generated-BK0ypz55.mjs +0 -4
  669. package/chunks/cc-374.generated-B51ogwAh.mjs +0 -4
  670. package/chunks/cc-375.generated-CMbmbMav.mjs +0 -4
  671. package/chunks/cc-376.generated-DZngLeqA.mjs +0 -4
  672. package/chunks/cc-377.generated-BYuCOf7K.mjs +0 -4
  673. package/chunks/cc-378.generated-CuNlUjOw.mjs +0 -4
  674. package/chunks/cc-380.generated-A2e4FwA4.mjs +0 -4
  675. package/chunks/cc-381.generated-Cvwf7aDo.mjs +0 -4
  676. package/chunks/cc-382.generated-B-x4jIQ_.mjs +0 -4
  677. package/chunks/cc-383.generated-B6E63WN4.mjs +0 -4
  678. package/chunks/cc-385.generated-CbYlsCsW.mjs +0 -4
  679. package/chunks/cc-386.generated-BUSyzthQ.mjs +0 -4
  680. package/chunks/cc-387.generated-IhkhnsGu.mjs +0 -4
  681. package/chunks/cc-389.generated-SNuHIdqu.mjs +0 -4
  682. package/chunks/cc-39.generated-BGZK1sVL.mjs +0 -4
  683. package/chunks/cc-40.generated-Bo8WnsNc.mjs +0 -4
  684. package/chunks/cc-41.generated-CG0098r3.mjs +0 -4
  685. package/chunks/cc-420.generated-C59jh2M8.mjs +0 -4
  686. package/chunks/cc-421.generated-BhxO-pTK.mjs +0 -4
  687. package/chunks/cc-423.generated-B4UJk2xr.mjs +0 -4
  688. package/chunks/cc-43.generated-BIdhhcvA.mjs +0 -4
  689. package/chunks/cc-44.generated-BfeK0wEP.mjs +0 -4
  690. package/chunks/cc-45.generated-BEJCwF4o.mjs +0 -4
  691. package/chunks/cc-46.generated-DeEMtTcI.mjs +0 -4
  692. package/chunks/cc-47.generated-DQy2Xk_0.mjs +0 -4
  693. package/chunks/cc-48.generated-C4yA7R1Q.mjs +0 -4
  694. package/chunks/cc-49.generated-a02djmT4.mjs +0 -4
  695. package/chunks/cc-500.generated-glAZ4AUe.mjs +0 -4
  696. package/chunks/cc-501.generated-D-GCAbI8.mjs +0 -4
  697. package/chunks/cc-502.generated-Co-n0usI.mjs +0 -4
  698. package/chunks/cc-503.generated-BM58qC_M.mjs +0 -4
  699. package/chunks/cc-504.generated-cTtfXvjR.mjs +0 -4
  700. package/chunks/cc-505.generated-DLSKmmzY.mjs +0 -4
  701. package/chunks/cc-506.generated-BMyMgwgZ.mjs +0 -4
  702. package/chunks/cc-507.generated-DWOdIJMd.mjs +0 -4
  703. package/chunks/cc-508.generated-DN3D0FwY.mjs +0 -4
  704. package/chunks/cc-509.generated-D-jyniz5.mjs +0 -4
  705. package/chunks/cc-51.generated-Bjy1G3kG.mjs +0 -4
  706. package/chunks/cc-52.generated-CDeO-q1n.mjs +0 -4
  707. package/chunks/cc-53.generated-Bg_ETBvx.mjs +0 -4
  708. package/chunks/cc-54.generated-BCfSFUZP.mjs +0 -4
  709. package/chunks/cc-55.generated-C1iLoSl1.mjs +0 -4
  710. package/chunks/cc-56.generated-ChgDDlud.mjs +0 -4
  711. package/chunks/cc-57.generated-qfDFimii.mjs +0 -4
  712. package/chunks/cc-58.generated-Cl6DzTam.mjs +0 -4
  713. package/chunks/cc-590.generated-DhG2cP7S.mjs +0 -4
  714. package/chunks/cc-591.generated-CjxsaggL.mjs +0 -4
  715. package/chunks/cc-592.generated-DnF2AtPs.mjs +0 -4
  716. package/chunks/cc-593.generated-J4b4KU_z.mjs +0 -4
  717. package/chunks/cc-594.generated-BDqHqvBX.mjs +0 -4
  718. package/chunks/cc-595.generated-Di23-NWq.mjs +0 -4
  719. package/chunks/cc-596.generated-B92oLPvz.mjs +0 -4
  720. package/chunks/cc-597.generated-pdvIpWWG.mjs +0 -4
  721. package/chunks/cc-598.generated-C9i6NuuS.mjs +0 -4
  722. package/chunks/cc-599.generated-Cot_Tjya.mjs +0 -4
  723. package/chunks/cc-60.generated-Dt21L5ED.mjs +0 -4
  724. package/chunks/cc-61.generated-CsF19uOz.mjs +0 -4
  725. package/chunks/cc-62.generated-CXe9l8jN.mjs +0 -4
  726. package/chunks/cc-63.generated-CyxqKEMz.mjs +0 -4
  727. package/chunks/cc-64.generated-B1U2VUWE.mjs +0 -4
  728. package/chunks/cc-65.generated-BqB9SL91.mjs +0 -4
  729. package/chunks/cc-66.generated-DSW4cKRJ.mjs +0 -4
  730. package/chunks/cc-670.generated-B5lMBLIA.mjs +0 -4
  731. package/chunks/cc-672.generated-rtLnRViR.mjs +0 -4
  732. package/chunks/cc-673.generated-CCfKxiHb.mjs +0 -4
  733. package/chunks/cc-674.generated-DqEenJAu.mjs +0 -4
  734. package/chunks/cc-675.generated-CDZsNVmA.mjs +0 -4
  735. package/chunks/cc-676.generated-CtuzuSpR.mjs +0 -4
  736. package/chunks/cc-677.generated-B6Vdcheb.mjs +0 -4
  737. package/chunks/cc-678.generated-Bu-wQLCv.mjs +0 -4
  738. package/chunks/cc-679.generated-C_vQNfa9.mjs +0 -4
  739. package/chunks/cc-680.generated-DgD0sTpR.mjs +0 -4
  740. package/chunks/cc-681.generated-CgCDLpTf.mjs +0 -4
  741. package/chunks/cc-682.generated-BBdb0LCA.mjs +0 -4
  742. package/chunks/cc-683.generated-BYq9qGSN.mjs +0 -4
  743. package/chunks/cc-685.generated-BeVt0xOD.mjs +0 -4
  744. package/chunks/cc-686.generated-DSuHUyGC.mjs +0 -4
  745. package/chunks/cc-687.generated-CAYCkQGn.mjs +0 -4
  746. package/chunks/cc-688.generated-BxoYuhyI.mjs +0 -4
  747. package/chunks/cc-689.generated-D1LJPuEc.mjs +0 -4
  748. package/chunks/cc-690.generated-wBJlIR_d.mjs +0 -4
  749. package/chunks/cc-691.generated-D3313DJE.mjs +0 -4
  750. package/chunks/cc-692.generated-BjRLK6LH.mjs +0 -4
  751. package/chunks/cc-7.generated-Be8Per3z.mjs +0 -4
  752. package/chunks/cc-81.generated-Bfr_1Ik4.mjs +0 -4
  753. package/chunks/cc-82.generated-CXvQgAj0.mjs +0 -4
  754. package/chunks/cc-84.generated-DsMrssxQ.mjs +0 -4
  755. package/chunks/cc-850.generated-B6dMNsJB.mjs +0 -4
  756. package/chunks/cc-852.generated-DoLs1jmz.mjs +0 -4
  757. package/chunks/cc-853.generated-C9J4qDF6.mjs +0 -4
  758. package/chunks/cc-855.generated-rriF89dH.mjs +0 -4
  759. package/chunks/cc-856.generated-DWMBTBFS.mjs +0 -4
  760. package/chunks/cc-86.generated-C8Ob3yVb.mjs +0 -4
  761. package/chunks/cc-880.generated-gteZx8SL.mjs +0 -4
  762. package/chunks/cc-886.generated-QyIDP1_q.mjs +0 -4
  763. package/chunks/cc-90.generated-DSXR50SV.mjs +0 -4
  764. package/chunks/cc-91.generated-C_cDq0Xp.mjs +0 -4
  765. package/chunks/cc-92.generated-Cxd7f_QX.mjs +0 -4
  766. package/chunks/cc-93.generated-Cyqo0e91.mjs +0 -4
  767. package/chunks/cc-94.generated-EsnmfbnH.mjs +0 -4
  768. package/chunks/cc-95.generated-D_8p55mp.mjs +0 -4
  769. package/chunks/cc-960.generated-DletKApH.mjs +0 -4
  770. package/chunks/cc-961.generated-CXVHoWFk.mjs +0 -4
  771. package/chunks/cc-962.generated-B7EPSakT.mjs +0 -4
  772. package/chunks/cc-963.generated-D71Y75mr.mjs +0 -4
  773. package/chunks/cc-964.generated-B8-RYrVD.mjs +0 -4
  774. package/chunks/cc-965.generated-tesjPkaP.mjs +0 -4
  775. package/chunks/cc-966.generated-CkCCmcR2.mjs +0 -4
  776. package/chunks/cc-967.generated-Bz1kG3rR.mjs +0 -4
  777. package/chunks/cc-968.generated-B8izDjLu.mjs +0 -4
  778. package/chunks/cc-970.generated-CKTkdIET.mjs +0 -4
  779. package/chunks/cc-971.generated-Wzj17K10.mjs +0 -4
  780. package/chunks/cc-972.generated-CJO02ZmJ.mjs +0 -4
  781. package/chunks/cc-973.generated-CL9ZE2Of.mjs +0 -4
  782. package/chunks/cc-974.generated-ZkYqGi9L.mjs +0 -4
  783. package/chunks/cc-975.generated-DP2Teiuc.mjs +0 -4
  784. package/chunks/cc-976.generated-GGNMRuFQ.mjs +0 -4
  785. package/chunks/cc-977.generated-KwvwlHUw.mjs +0 -4
  786. package/chunks/cc-98.generated-DW-Wj2k5.mjs +0 -4
  787. package/chunks/cc-992.generated-NRREmly7.mjs +0 -4
  788. package/chunks/cc-993.generated-BNlup4k-.mjs +0 -4
  789. package/chunks/cc-994.generated-BUD4e8ho.mjs +0 -4
  790. package/chunks/cc-995.generated-8P4TnVbi.mjs +0 -4
  791. package/chunks/cc-996.generated-CKCe7foO.mjs +0 -4
  792. package/chunks/cc-998.generated-CsAmnJYd.mjs +0 -4
  793. package/chunks/cc-BZdCRpNT.mjs +0 -5
  794. package/chunks/cd-9O28tBfy.mjs +0 -5
  795. package/chunks/cf-BdhmyWlv.mjs +0 -5
  796. package/chunks/cg-C-Qu4NMU.mjs +0 -5
  797. package/chunks/ch-A1RQVYLO.mjs +0 -5
  798. package/chunks/ci-DZY7fgO7.mjs +0 -5
  799. package/chunks/ck-D-2C9a72.mjs +0 -5
  800. package/chunks/cl-3HNgrmyT.mjs +0 -5
  801. package/chunks/cm-DJ4mixO9.mjs +0 -5
  802. package/chunks/cn-Cw6Qlqzd.mjs +0 -5
  803. package/chunks/co-B6rvgyRo.mjs +0 -5
  804. package/chunks/color-mode-warning-71FmlzWX.mjs +0 -13
  805. package/chunks/cr-jJzoBrc7.mjs +0 -5
  806. package/chunks/cu-BRzz3vV_.mjs +0 -5
  807. package/chunks/cv-BzZilEMp.mjs +0 -5
  808. package/chunks/cw-5PnLdxCt.mjs +0 -5
  809. package/chunks/cx-C0sAUlCS.mjs +0 -5
  810. package/chunks/cy-DeC9FFGV.mjs +0 -5
  811. package/chunks/cz-C3rh8aUO.mjs +0 -5
  812. package/chunks/de-Q2c2XZ_v.mjs +0 -5
  813. package/chunks/dj-DWAmmYDE.mjs +0 -5
  814. package/chunks/dk-FTaySAJe.mjs +0 -5
  815. package/chunks/dm-DgSJioJq.mjs +0 -5
  816. package/chunks/do-C549n3on.mjs +0 -5
  817. package/chunks/dz-CPgKocaY.mjs +0 -5
  818. package/chunks/ec-DkC-cDOb.mjs +0 -5
  819. package/chunks/ee-BQmFOHXA.mjs +0 -5
  820. package/chunks/eg-DMVarwMR.mjs +0 -5
  821. package/chunks/eh--oxmiCXh.mjs +0 -5
  822. package/chunks/er-DjB_DDiD.mjs +0 -5
  823. package/chunks/error-text-B45eDAt1.mjs +0 -17
  824. package/chunks/es-D__9e8wL.mjs +0 -5
  825. package/chunks/et-C3reU7Z2.mjs +0 -5
  826. package/chunks/fi-C1K0Kh4o.mjs +0 -5
  827. package/chunks/fj-Cs7ECsE1.mjs +0 -5
  828. package/chunks/fk-DYEJDgjs.mjs +0 -5
  829. package/chunks/fm-C7r_OFnj.mjs +0 -5
  830. package/chunks/fo-DsT-wW0Q.mjs +0 -5
  831. package/chunks/focus-restore-DxuP1Oe2.mjs +0 -94
  832. package/chunks/focus-trap-DTOLJ5bb.mjs +0 -121
  833. package/chunks/form-associated-BR-fUvZ1.mjs +0 -43
  834. package/chunks/form-check.styles-DqvBnspm.mjs +0 -172
  835. package/chunks/form-control.styles-C3j87Sn3.mjs +0 -171
  836. package/chunks/fr-oy8Uo1bo.mjs +0 -5
  837. package/chunks/ga-DESElBvk.mjs +0 -5
  838. package/chunks/gb-D5r9QI-K.mjs +0 -5
  839. package/chunks/gd-BuRviRXt.mjs +0 -5
  840. package/chunks/ge-BpGz5nUs.mjs +0 -5
  841. package/chunks/gf-BQgWe_yS.mjs +0 -5
  842. package/chunks/gg-BLNQrqls.mjs +0 -5
  843. package/chunks/gh-BzVF8tSr.mjs +0 -5
  844. package/chunks/gi-DfKOJdRQ.mjs +0 -5
  845. package/chunks/gl-C558Toee.mjs +0 -5
  846. package/chunks/gm-DNdinxnD.mjs +0 -5
  847. package/chunks/gn-DwEBOZ3-.mjs +0 -5
  848. package/chunks/gp-oy8Uo1bo.mjs +0 -5
  849. package/chunks/gq-BSkOSQWe.mjs +0 -5
  850. package/chunks/gr-CTJJbGEC.mjs +0 -5
  851. package/chunks/gt-D4BwgazI.mjs +0 -5
  852. package/chunks/gu-CQpMzEB_.mjs +0 -5
  853. package/chunks/gw-DxZDYMtv.mjs +0 -5
  854. package/chunks/gy-BWZVUGl8.mjs +0 -5
  855. package/chunks/hk-BHxjZMf4.mjs +0 -5
  856. package/chunks/hn-BEVgQ0QQ.mjs +0 -5
  857. package/chunks/host-aria-WSGs7SPQ.mjs +0 -152
  858. package/chunks/hr-BpVWlAoF.mjs +0 -5
  859. package/chunks/ht-CfzU-07O.mjs +0 -5
  860. package/chunks/hu-5Yy5WRy5.mjs +0 -5
  861. package/chunks/id-BfVg05v7.mjs +0 -5
  862. package/chunks/ie-DvpkJVl8.mjs +0 -5
  863. package/chunks/il-DDofIlI0.mjs +0 -5
  864. package/chunks/im-CW65ei4K.mjs +0 -5
  865. package/chunks/in-i60GVnCJ.mjs +0 -5
  866. package/chunks/inert-regions-DXCnn1LN.mjs +0 -48
  867. package/chunks/install-light-styles-DbCAGFOC.mjs +0 -209
  868. package/chunks/invalid-feedback.styles-he0JYrJm.mjs +0 -11
  869. package/chunks/io-Diyu5soM.mjs +0 -5
  870. package/chunks/iq-B74bFnMJ.mjs +0 -5
  871. package/chunks/ir-BWGwwJq9.mjs +0 -5
  872. package/chunks/is-CK4oIk76.mjs +0 -5
  873. package/chunks/it-Y7rj3hMY.mjs +0 -5
  874. package/chunks/je-DMoX3evy.mjs +0 -5
  875. package/chunks/jm-DZUStFkR.mjs +0 -5
  876. package/chunks/jo-DVQ6-ojE.mjs +0 -5
  877. package/chunks/jp-Y5R0MQfN.mjs +0 -5
  878. package/chunks/ke-CGq6XP7w.mjs +0 -5
  879. package/chunks/kg-DAoQwbeR.mjs +0 -5
  880. package/chunks/kh-kMI7MghQ.mjs +0 -5
  881. package/chunks/ki-Cu7fdPLn.mjs +0 -5
  882. package/chunks/km-CM7URKBO.mjs +0 -5
  883. package/chunks/kn-DBVGPz8w.mjs +0 -5
  884. package/chunks/kp-D3Ea15h2.mjs +0 -5
  885. package/chunks/kr-DKM0Jy7P.mjs +0 -5
  886. package/chunks/kw-B7J-nbX9.mjs +0 -5
  887. package/chunks/ky-p4ckNq_W.mjs +0 -5
  888. package/chunks/kz-D936idA9.mjs +0 -5
  889. package/chunks/la-CUKVKbGp.mjs +0 -5
  890. package/chunks/lb-CzUWz90e.mjs +0 -5
  891. package/chunks/lc-DuHqL5FW.mjs +0 -5
  892. package/chunks/li-DgJDzs_F.mjs +0 -5
  893. package/chunks/live-announcer-Bi0orG4n.mjs +0 -58
  894. package/chunks/lk-3zaagaQ9.mjs +0 -5
  895. package/chunks/lr-B6Vn6C_9.mjs +0 -5
  896. package/chunks/ls-DrI0Fh7Y.mjs +0 -5
  897. package/chunks/lt-PBck9Sgv.mjs +0 -5
  898. package/chunks/lu-B_xY22fB.mjs +0 -5
  899. package/chunks/lv-D16yLm3v.mjs +0 -5
  900. package/chunks/ly-C1adX4Zr.mjs +0 -5
  901. package/chunks/ma-B7rH3zoW.mjs +0 -5
  902. package/chunks/mc-Xqh4jc6i.mjs +0 -5
  903. package/chunks/md-wW4zZzbN.mjs +0 -5
  904. package/chunks/me-DCy_XMtC.mjs +0 -5
  905. package/chunks/metadata-loaders.generated-Bu_7pFwU.mjs +0 -250
  906. package/chunks/mf-DP_tIA6i.mjs +0 -5
  907. package/chunks/mg-InflpHX7.mjs +0 -5
  908. package/chunks/mh-VKf434Ww.mjs +0 -5
  909. package/chunks/mk-C64VS9I-.mjs +0 -5
  910. package/chunks/ml-BjOQYgou.mjs +0 -5
  911. package/chunks/mm-DgKeX7WQ.mjs +0 -5
  912. package/chunks/mn-BBubqCvd.mjs +0 -5
  913. package/chunks/mo-BtY-l2cE.mjs +0 -5
  914. package/chunks/mp-DlkcjH8B.mjs +0 -5
  915. package/chunks/mp-calendar.element-BIHS9SZZ.mjs +0 -433
  916. package/chunks/mp-checkbox-zV83gILn.mjs +0 -321
  917. package/chunks/mp-datatable-BeKunRfd.mjs +0 -2884
  918. package/chunks/mp-datetime-picker.element-Cxu5-qRE.mjs +0 -527
  919. package/chunks/mp-input-group-CQ55efCq.mjs +0 -206
  920. package/chunks/mp-pagination-hGy4dL7p.mjs +0 -334
  921. package/chunks/mp-radio-BhRVNdKp.mjs +0 -304
  922. package/chunks/mp-select-CgqYFvUj.mjs +0 -537
  923. package/chunks/mp-splitter-DLehrw3Y.mjs +0 -678
  924. package/chunks/mp-tab-page-CaCzX1ym.mjs +0 -415
  925. package/chunks/mp-timepicker.element-BiB9lkgc.mjs +0 -452
  926. package/chunks/mp-toggle-button-CaS9uYLE.mjs +0 -631
  927. package/chunks/mp-treeview-CaMTDrvY.mjs +0 -497
  928. package/chunks/mq-BK7HwZSV.mjs +0 -5
  929. package/chunks/mr-C0S-6dqR.mjs +0 -5
  930. package/chunks/ms-DpwSSTE-.mjs +0 -5
  931. package/chunks/mt-B1ie-04J.mjs +0 -5
  932. package/chunks/mu-DTA25SEP.mjs +0 -5
  933. package/chunks/mv-DW49amZl.mjs +0 -5
  934. package/chunks/mw-V-bbqGPN.mjs +0 -5
  935. package/chunks/mx-CtTJw0SX.mjs +0 -5
  936. package/chunks/my-DThIQKCq.mjs +0 -5
  937. package/chunks/mz-Btgk8Li_.mjs +0 -5
  938. package/chunks/na-D08-xA7q.mjs +0 -5
  939. package/chunks/nc-hb1s2KqL.mjs +0 -5
  940. package/chunks/ne-B5vEjeNk.mjs +0 -5
  941. package/chunks/nf-DDFUS5Ht.mjs +0 -5
  942. package/chunks/ng-DBhdmXcS.mjs +0 -5
  943. package/chunks/ni-_x4RKVT8.mjs +0 -5
  944. package/chunks/nl-DBxW_qVy.mjs +0 -5
  945. package/chunks/no-LyFCuMlU.mjs +0 -5
  946. package/chunks/np-DEvIQAys.mjs +0 -5
  947. package/chunks/nr-CuzElmFx.mjs +0 -5
  948. package/chunks/nu-C6vVHkwP.mjs +0 -5
  949. package/chunks/nz-BkhNYKha.mjs +0 -5
  950. package/chunks/om-BsI3oHrd.mjs +0 -5
  951. package/chunks/overlay-controller-BHDagokg.mjs +0 -389
  952. package/chunks/pa-CtNQVaHE.mjs +0 -5
  953. package/chunks/pe-vcSV6ioD.mjs +0 -5
  954. package/chunks/pf-BOetDvnB.mjs +0 -5
  955. package/chunks/pg-BDqa4YXR.mjs +0 -5
  956. package/chunks/ph-BlAaFzEE.mjs +0 -5
  957. package/chunks/pk-2auAZIDh.mjs +0 -5
  958. package/chunks/pl-W6WZfuq9.mjs +0 -5
  959. package/chunks/pm-oy8Uo1bo.mjs +0 -5
  960. package/chunks/pr-B3p98s5J.mjs +0 -5
  961. package/chunks/ps-RET8kTuo.mjs +0 -5
  962. package/chunks/pt-Z2yfZJAz.mjs +0 -5
  963. package/chunks/pw-Dm4Y4noS.mjs +0 -5
  964. package/chunks/py-1pKD7w9y.mjs +0 -5
  965. package/chunks/qa-DpK5_Q-a.mjs +0 -5
  966. package/chunks/re-oy8Uo1bo.mjs +0 -5
  967. package/chunks/resource.service--lqLwEqk.mjs +0 -1008
  968. package/chunks/ro-VYde6hop.mjs +0 -5
  969. package/chunks/roving-focus-CrL9982a.mjs +0 -129
  970. package/chunks/rs-Dj7Wicw9.mjs +0 -5
  971. package/chunks/ru-CkWEkuTy.mjs +0 -5
  972. package/chunks/rw-DjRHPIJ_.mjs +0 -5
  973. package/chunks/sa-BBdaW-_G.mjs +0 -5
  974. package/chunks/sb-nNr9S0gd.mjs +0 -5
  975. package/chunks/sc-DcbShXuj.mjs +0 -5
  976. package/chunks/scale-B0bRUdc7.mjs +0 -91
  977. package/chunks/sd-B1jbITc6.mjs +0 -5
  978. package/chunks/se-B-CIMrxu.mjs +0 -5
  979. package/chunks/sg-BIR0OErL.mjs +0 -5
  980. package/chunks/sh-BR9c9S8h.mjs +0 -5
  981. package/chunks/si-B5HzM3z8.mjs +0 -5
  982. package/chunks/sj-LyFCuMlU.mjs +0 -5
  983. package/chunks/sk-7ZEImIK5.mjs +0 -5
  984. package/chunks/sl-DuhHodH6.mjs +0 -5
  985. package/chunks/sm-BrM5UOOM.mjs +0 -5
  986. package/chunks/sn-jptojE_-.mjs +0 -5
  987. package/chunks/so-auBJUCeE.mjs +0 -5
  988. package/chunks/sr-DqWWIG11.mjs +0 -5
  989. package/chunks/ss-BcJF0rd5.mjs +0 -5
  990. package/chunks/st-D65H7-IP.mjs +0 -5
  991. package/chunks/sv-D8EgdK15.mjs +0 -5
  992. package/chunks/sx-Cmd53qC5.mjs +0 -5
  993. package/chunks/sy-LL8b7cLC.mjs +0 -5
  994. package/chunks/sz-D-qYq589.mjs +0 -5
  995. package/chunks/tc-AIE9LFuJ.mjs +0 -5
  996. package/chunks/td-C5AP4EiN.mjs +0 -5
  997. package/chunks/tg-Dt9WAF7L.mjs +0 -5
  998. package/chunks/th-DyfDlw-o.mjs +0 -5
  999. package/chunks/tj-U7xsGAAg.mjs +0 -5
  1000. package/chunks/tk-BWjKruB4.mjs +0 -5
  1001. package/chunks/tl-CcXsJf98.mjs +0 -5
  1002. package/chunks/tm-DTASSSkf.mjs +0 -5
  1003. package/chunks/tn-DttZvPz0.mjs +0 -5
  1004. package/chunks/to-ChsX5Z4Q.mjs +0 -5
  1005. package/chunks/tr-C2CRhai0.mjs +0 -5
  1006. package/chunks/tt-DPpP-HbL.mjs +0 -5
  1007. package/chunks/tv-CiTLokZi.mjs +0 -5
  1008. package/chunks/tw--J7h_fxf.mjs +0 -5
  1009. package/chunks/tz-qS3mKSkx.mjs +0 -5
  1010. package/chunks/ua-DiZstskV.mjs +0 -5
  1011. package/chunks/ug-BxVGZUby.mjs +0 -5
  1012. package/chunks/us-BvyIwpav.mjs +0 -5
  1013. package/chunks/uy-Dsr4HSrP.mjs +0 -5
  1014. package/chunks/uz-D25kmTp8.mjs +0 -5
  1015. package/chunks/va-hG27DTVe.mjs +0 -5
  1016. package/chunks/validation-ChktfuxI.mjs +0 -137
  1017. package/chunks/vc-7r46jyD5.mjs +0 -5
  1018. package/chunks/ve-R8UkJHAj.mjs +0 -5
  1019. package/chunks/vg-BLSugSwb.mjs +0 -5
  1020. package/chunks/vi-DSyJsPSD.mjs +0 -5
  1021. package/chunks/view-window-DGvFiDnW.mjs +0 -263
  1022. package/chunks/vn-BwGpRkWs.mjs +0 -5
  1023. package/chunks/vu-aFyzktTY.mjs +0 -5
  1024. package/chunks/wf-Ca9RrMIP.mjs +0 -5
  1025. package/chunks/ws-DphODgja.mjs +0 -5
  1026. package/chunks/xk-sugAykhS.mjs +0 -5
  1027. package/chunks/ye-D2MZq-93.mjs +0 -5
  1028. package/chunks/yt-tAecYEDU.mjs +0 -5
  1029. package/chunks/za-DadXcfMa.mjs +0 -5
  1030. package/chunks/zm--rp7ufAJ.mjs +0 -5
  1031. package/chunks/zw-BG5nNe2I.mjs +0 -5
  1032. package/query-builder/src/mp-query-builder.element.template.d.ts +0 -2
  1033. package/query-builder/src/mp-query-group.element.template.d.ts +0 -2
  1034. package/query-builder/src/mp-query-subquery.element.template.d.ts +0 -2
  1035. package/tree-select/src/styles/tree-select.styles.d.ts +0 -2
  1036. package/treeview/src/styles/treeview.styles.d.ts +0 -2
package/dock/index.mjs CHANGED
@@ -1,9 +1,9 @@
1
- import { html as G, unsafeCSS as tt, LitElement as et } from "lit";
2
- import "../chunks/mp-tab-page-CaCzX1ym.mjs";
3
- import "../chunks/mp-splitter-DLehrw3Y.mjs";
4
- import { L as it } from "../chunks/live-announcer-Bi0orG4n.mjs";
5
- import { F as nt } from "../chunks/focus-restore-DxuP1Oe2.mjs";
6
- const ot = G`<div class="dock-root">
1
+ import { g as e, y as t } from "../chunks/a11y-C6aX-lsZ.mjs";
2
+ import "../chunks/tab-control-CW53taeE.mjs";
3
+ import "../chunks/splitter-ByLyrd5H.mjs";
4
+ import { LitElement as n, html as r, unsafeCSS as i } from "lit";
5
+ //#region libs/mintplayer-web-components/dock/src/components/mint-dock-manager.element.template.ts
6
+ var a = r`<div class="dock-root">
7
7
  <div class="dock-docked"></div>
8
8
  <div class="dock-floating-layer"></div>
9
9
  <div class="dock-intersections-layer dock-intersection-layer"></div>
@@ -54,2468 +54,1868 @@ const ot = G`<div class="dock-root">
54
54
  ↓
55
55
  </button>
56
56
  <div class="dock-drop-joystick__spacer"></div>
57
- </div>`, rt = tt(`:host {
58
- display: block;
59
- position: relative;
60
- width: 100%;
61
- height: 100%;
62
- contain: layout paint size style;
63
- box-sizing: border-box;
64
- font-family: inherit;
65
- color: inherit;
66
- --dock-split-gap: 0.25rem;
67
- }
68
-
69
- .dock-root,
70
- .dock-docked,
71
- .dock-split,
72
- .dock-stack,
73
- .dock-stack__pane {
74
- box-sizing: border-box;
75
- min-width: 0;
76
- min-height: 0;
77
- }
78
-
79
- .dock-root {
80
- position: relative;
81
- width: 100%;
82
- height: 100%;
83
- }
84
-
85
- .dock-docked {
86
- position: absolute;
87
- inset: 0;
88
- display: flex;
89
- z-index: 0;
90
- }
91
-
92
- .dock-floating-layer {
93
- position: absolute;
94
- inset: 0;
95
- pointer-events: none;
96
- z-index: 5;
97
- }
98
-
99
- .dock-intersections-layer {
100
- position: absolute;
101
- inset: 0;
102
- pointer-events: none;
103
- z-index: 120;
104
- }
105
-
106
- .dock-floating {
107
- position: absolute;
108
- box-sizing: border-box;
109
- display: flex;
110
- flex-direction: column;
111
- pointer-events: auto;
112
- border: 1px solid var(--bs-border-color);
113
- border-radius: 0.5rem;
114
- background: var(--bs-body-bg);
115
- box-shadow: var(--bs-box-shadow-lg);
116
- overflow: hidden;
117
- min-width: 12rem;
118
- min-height: 8rem;
119
- }
120
-
121
- .dock-floating[data-dragging=true] {
122
- pointer-events: none;
123
- }
124
-
125
- .dock-floating__chrome {
126
- display: flex;
127
- align-items: center;
128
- gap: 0.5rem;
129
- padding: 0.35rem 0.75rem;
130
- cursor: move;
131
- touch-action: none;
132
- background: linear-gradient(to bottom, rgba(var(--bs-primary-rgb), 0.15), rgba(var(--bs-primary-rgb), 0.05));
133
- border-bottom: 1px solid var(--bs-primary-border-subtle);
134
- user-select: none;
135
- -webkit-user-select: none;
136
- }
137
-
138
- .dock-floating__title {
139
- flex: 1 1 auto;
140
- font-size: 0.875rem;
141
- font-weight: 500;
142
- color: var(--bs-body-color);
143
- overflow: hidden;
144
- text-overflow: ellipsis;
145
- white-space: nowrap;
146
- }
147
-
148
- .dock-floating__close {
149
- flex: 0 0 auto;
150
- appearance: none;
151
- background: transparent;
152
- border: 0;
153
- color: var(--bs-body-color);
154
- cursor: pointer;
155
- font-size: 1.25rem;
156
- line-height: 1;
157
- padding: 0 0.4rem;
158
- border-radius: 3px;
159
- margin-top: -1px;
160
- }
161
- .dock-floating__close:hover {
162
- background: rgba(var(--bs-primary-rgb), 0.15);
163
- }
164
- .dock-floating__close:focus-visible {
165
- outline: 2px solid var(--bs-primary);
166
- outline-offset: 1px;
167
- }
168
-
169
- .dock-floating > .dock-stack {
170
- flex: 1 1 auto;
171
- min-width: 12rem;
172
- min-height: 8rem;
173
- }
174
-
175
- .dock-floating__resizer {
176
- position: absolute;
177
- pointer-events: auto;
178
- z-index: 2;
179
- background: rgba(var(--bs-primary-rgb), 0.1);
180
- transition: background 120ms ease;
181
- touch-action: none;
182
- }
183
-
184
- .dock-floating__resizer:hover,
185
- .dock-floating__resizer[data-resizing=true] {
186
- background: rgba(var(--bs-primary-rgb), 0.3);
187
- }
188
-
189
- .dock-floating__resizer--top,
190
- .dock-floating__resizer--bottom {
191
- left: 0.75rem;
192
- right: 0.75rem;
193
- height: 0.5rem;
194
- }
195
-
196
- .dock-floating__resizer--top {
197
- top: 0;
198
- cursor: n-resize;
199
- }
200
-
201
- .dock-floating__resizer--bottom {
202
- bottom: 0;
203
- cursor: s-resize;
204
- }
205
-
206
- .dock-floating__resizer--left,
207
- .dock-floating__resizer--right {
208
- top: 1.75rem;
209
- bottom: 0.75rem;
210
- width: 0.5rem;
211
- }
212
-
213
- .dock-floating__resizer--left {
214
- left: 0;
215
- cursor: w-resize;
216
- }
217
-
218
- .dock-floating__resizer--right {
219
- right: 0;
220
- cursor: e-resize;
221
- }
222
-
223
- .dock-floating__resizer--top-left,
224
- .dock-floating__resizer--top-right,
225
- .dock-floating__resizer--bottom-left,
226
- .dock-floating__resizer--bottom-right {
227
- width: 0.75rem;
228
- height: 0.75rem;
229
- }
230
-
231
- .dock-floating__resizer--top-left {
232
- top: 0;
233
- left: 0;
234
- cursor: nw-resize;
235
- }
236
-
237
- .dock-floating__resizer--top-right {
238
- top: 0;
239
- right: 0;
240
- cursor: ne-resize;
241
- }
242
-
243
- .dock-floating__resizer--bottom-left {
244
- bottom: 0;
245
- left: 0;
246
- cursor: sw-resize;
247
- }
248
-
249
- .dock-floating__resizer--bottom-right {
250
- right: 0;
251
- bottom: 0;
252
- cursor: se-resize;
253
- }
254
-
255
- .dock-split {
256
- flex: 1 1 0;
257
- position: relative;
258
- }
259
-
260
- .dock-intersection-handle {
261
- position: absolute;
262
- width: 1rem;
263
- height: 1rem;
264
- margin-left: -0.5rem;
265
- margin-top: -0.5rem;
266
- border-radius: 0.375rem;
267
- background: rgba(var(--bs-primary-rgb), 0.4);
268
- border: 1px solid var(--bs-primary);
269
- box-shadow: var(--bs-box-shadow-sm);
270
- cursor: all-scroll;
271
- pointer-events: auto;
272
- touch-action: none;
273
- opacity: 0.6;
274
- transition: background 120ms ease, border-color 120ms ease, opacity 120ms ease;
275
- }
276
-
277
- .dock-intersection-handle:hover,
278
- .dock-intersection-handle:focus-visible,
279
- .dock-intersection-handle[data-visible=true],
280
- .dock-intersection-handle[data-resizing=true] {
281
- background: rgba(var(--bs-primary-rgb), 0.35);
282
- border-color: var(--bs-primary);
283
- opacity: 1;
284
- }
285
-
286
- .dock-intersection-handle:focus-visible {
287
- outline: 2px solid var(--bs-primary);
288
- outline-offset: 1px;
289
- }
290
-
291
- .dock-stack {
292
- flex: 1 1 0;
293
- border: 1px solid var(--bs-border-color);
294
- border-radius: 0.25rem;
295
- background: var(--bs-body-bg);
296
- backdrop-filter: blur(4px);
297
- }
298
-
299
- .dock-tab {
300
- cursor: grab;
301
- display: block;
302
- padding: 0.5rem 1rem;
303
- margin: -0.5rem -1rem;
304
- touch-action: none;
305
- user-select: none;
306
- -webkit-user-select: none;
307
- -webkit-touch-callout: none;
308
- }
309
-
310
- .dock-tab:active {
311
- cursor: grabbing;
312
- }
313
-
314
- .dock-tab[data-pressing=true] {
315
- background-color: var(--bs-secondary-bg-subtle, rgba(0, 0, 0, 0.05));
316
- transform: scale(1.02);
317
- transition: background-color 100ms ease-out, transform 100ms ease-out;
318
- }
319
-
320
- .dock-stack__pane {
321
- position: relative;
322
- display: flex;
323
- flex-direction: column;
324
- overflow: hidden;
325
- height: 100%;
326
- }
327
-
328
- .dock-drop-indicator {
329
- position: absolute;
330
- pointer-events: none;
331
- border: 2px solid var(--bs-primary);
332
- background: rgba(var(--bs-primary-rgb), 0.2);
333
- border-radius: 0.25rem;
334
- opacity: 0;
335
- transition: opacity 120ms ease;
336
- z-index: 100;
337
- }
338
-
339
- .dock-drop-indicator[data-visible=true] {
340
- opacity: 1;
341
- }
342
-
343
- .dock-drop-joystick {
344
- position: absolute;
345
- display: grid;
346
- grid-template-columns: repeat(3, min-content);
347
- grid-template-rows: repeat(3, min-content);
348
- gap: 0.125rem;
349
- padding: 0.125rem;
350
- border-radius: 999px;
351
- background: var(--bs-tertiary-bg);
352
- box-shadow: var(--bs-box-shadow);
353
- pointer-events: none;
354
- transform: translate(-50%, -50%);
355
- z-index: 110;
356
- }
357
-
358
- .dock-drop-joystick__spacer {
359
- width: 1.75rem;
360
- height: 1.75rem;
361
- pointer-events: none;
362
- }
363
-
364
- .dock-drop-joystick__button {
365
- width: 1.75rem;
366
- height: 1.75rem;
367
- display: inline-flex;
368
- align-items: center;
369
- justify-content: center;
370
- border-radius: 0.375rem;
371
- border: 1px solid var(--bs-primary-border-subtle);
372
- background: var(--bs-body-bg);
373
- color: var(--bs-primary);
374
- font-size: 0.75rem;
375
- line-height: 1;
376
- font-weight: 600;
377
- pointer-events: auto;
378
- cursor: pointer;
379
- transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
380
- }
381
-
382
- .dock-drop-joystick__button[data-active=true],
383
- .dock-drop-joystick__button:hover,
384
- .dock-drop-joystick__button:focus-visible {
385
- background: var(--bs-primary-bg-subtle);
386
- border-color: var(--bs-primary);
387
- color: var(--bs-primary);
388
- }
389
-
390
- .dock-drop-joystick__button:focus-visible {
391
- outline: 2px solid var(--bs-primary);
392
- outline-offset: 1px;
393
- }
394
-
395
- .dock-drop-joystick__button[data-zone=center] {
396
- border-radius: 0.5rem;
397
- }
398
-
399
- ::slotted(*) {
400
- flex: 1 1 auto;
401
- display: block;
402
- min-width: 0;
403
- min-height: 0;
404
- }
405
-
406
- @media (prefers-reduced-motion: reduce) {
407
- .dock-floating,
408
- .dock-floating__resizer,
409
- .dock-floating__close,
410
- .dock-intersection-handle,
411
- .dock-drop-indicator,
412
- .dock-drop-joystick__button {
413
- transition: none !important;
414
- animation: none !important;
415
- }
416
- }`);
417
- function T(s, t) {
418
- if (t.width <= 0 || t.height <= 0) return s;
419
- const e = Math.min(s.width, t.width), i = Math.min(s.height, t.height), n = Math.min(Math.max(s.left, 0), t.width - e), o = Math.min(Math.max(s.top, 0), t.height - i);
420
- return { left: n, top: o, width: e, height: i };
421
- }
422
- function j(s, t, e) {
423
- return t >= s.left && t <= s.right && e >= s.top && e <= s.bottom;
424
- }
425
- function H(s, t) {
426
- return s && typeof s.zIndex == "number" && Number.isFinite(s.zIndex) ? s.zIndex : 10 + t;
427
- }
428
- function x(s, t) {
429
- if (t <= 0)
430
- return [];
431
- if (!Array.isArray(s) || s.length !== t)
432
- return Array.from({ length: t }, () => 1 / t);
433
- const e = s.map((n) => Number.isFinite(n) ? Math.max(n, 0) : 0), i = e.reduce((n, o) => n + o, 0);
434
- return i <= 0 ? Array.from({ length: t }, () => 1 / t) : e.map((n) => n / i);
435
- }
436
- function st(s) {
437
- s.sizes = x(s.sizes, s.children.length);
438
- }
439
- function at(s, t, e) {
440
- const i = e - 1, n = x(s, i), o = 1 / e, r = 1 - o, c = [];
441
- for (let a = 0; a < e; a += 1)
442
- if (a === t)
443
- c.push(o);
444
- else {
445
- const l = a < t ? a : a - 1;
446
- c.push(n[l] * r);
447
- }
448
- return c;
449
- }
450
- function W(s, t) {
451
- let e = [];
452
- if (s)
453
- try {
454
- const d = JSON.parse(s);
455
- Array.isArray(d) && (e = d);
456
- } catch {
457
- e = [];
458
- }
459
- if (e.length > 0) return e;
460
- const i = (t ?? "").split("|");
461
- if (i.length !== 2) return [];
462
- const [n, o] = i, r = n.lastIndexOf(":"), c = o.lastIndexOf(":");
463
- if (r <= 0 || c <= 0) return [];
464
- const a = Number.parseInt(n.slice(r + 1), 10), l = Number.parseInt(o.slice(c + 1), 10);
465
- return [
466
- {
467
- h: { pathStr: n.slice(0, r), index: a },
468
- v: { pathStr: o.slice(0, c), index: l }
469
- }
470
- ];
471
- }
472
- function lt(s, t) {
473
- const e = [...s], i = (e[t] ?? 0) + (e[t + 1] ?? 0);
474
- if (i <= 0) return e;
475
- e[t] = i / 2, e[t + 1] = i / 2;
476
- const n = e.reduce((o, r) => o + r, 0);
477
- return n > 0 ? e.map((o) => o / n) : e;
478
- }
479
- function ct(s, t, e) {
480
- const i = { writes: [], remember: [], clearStored: !1 };
481
- if (s.length === 0) return i;
482
- const n = /* @__PURE__ */ new Set();
483
- if (s.forEach((l) => {
484
- n.add(l.h.pathStr), n.add(l.v.pathStr);
485
- }), [...n].some((l) => t.has(l)))
486
- return t.forEach((l, d) => {
487
- const u = e(d);
488
- u && i.writes.push({ pathStr: d, sizes: x(l, u.childCount) });
489
- }), i.clearStored = !0, i;
490
- const r = /* @__PURE__ */ new Map(), c = (l) => {
491
- const d = e(l);
492
- if (!d) return null;
493
- const u = r.get(l);
494
- return { childCount: d.childCount, sizes: u ?? d.sizes };
495
- }, a = /* @__PURE__ */ new Set();
496
- return s.forEach((l) => {
497
- [l.h.pathStr, l.v.pathStr].forEach((d) => {
498
- if (a.has(d)) return;
499
- a.add(d);
500
- const u = e(d);
501
- u && Array.isArray(u.sizes) && i.remember.push({ pathStr: d, sizes: [...u.sizes] });
502
- }), [l.h, l.v].forEach(({ pathStr: d, index: u }) => {
503
- const h = c(d);
504
- if (!h) return;
505
- const g = x(h.sizes ?? [], h.childCount), p = lt(g, u);
506
- r.set(d, p), i.writes.push({ pathStr: d, sizes: p });
507
- });
508
- }), i;
509
- }
510
- function M(s, t) {
511
- if (!s)
512
- return null;
513
- let e = s;
514
- if (t.length === 0)
515
- return e;
516
- for (const i of t) {
517
- if (!e || e.kind !== "split")
518
- return null;
519
- e = e.children[i] ?? null;
520
- }
521
- return e;
522
- }
523
- function X(s, t) {
524
- if (!s || s === t || s.kind !== "split")
525
- return null;
526
- const e = s.children.indexOf(t);
527
- if (e !== -1)
528
- return { parent: s, index: e };
529
- for (let i = 0; i < s.children.length; i += 1) {
530
- const n = X(s.children[i], t);
531
- if (n)
532
- return n;
533
- }
534
- return null;
535
- }
536
- function dt(s, t, e) {
537
- if (!s || s === t)
538
- return e;
539
- const i = X(s, t);
540
- return i && (i.parent.children[i.index] = e, st(i.parent)), s;
541
- }
542
- function I(s, t, e, i) {
543
- const n = i === "left" || i === "right" ? "horizontal" : "vertical", o = i === "left" || i === "top", r = X(s, t);
544
- if (r && r.parent.direction === n) {
545
- const a = o ? r.index : r.index + 1;
546
- return r.parent.children.splice(a, 0, e), r.parent.sizes = at(
547
- r.parent.sizes,
548
- a,
549
- r.parent.children.length
550
- ), s ?? e;
551
- }
552
- return dt(s, t, {
553
- kind: "split",
554
- direction: n,
555
- children: o ? [e, t] : [t, e],
556
- sizes: [0.5, 0.5]
557
- });
558
- }
559
- function N(s, t, e = []) {
560
- if (s) {
561
- if (s.kind === "stack") {
562
- t(s, e);
563
- return;
564
- }
565
- s.children.forEach((i, n) => N(i, t, [...e, n]));
566
- }
567
- }
568
- function E(s) {
569
- let t = null;
570
- return N(s, (e) => {
571
- t || e.panes.length === 0 || (e.activePane && e.panes.includes(e.activePane) ? t = e.activePane : t = e.panes[0]);
572
- }), t;
573
- }
574
- function _(s) {
575
- const t = [];
576
- return N(s, (e) => {
577
- e.panes.forEach((i) => t.push(i));
578
- }), t;
579
- }
580
- function ht(s, t) {
581
- return s.panes = s.panes.filter((e) => e !== t), s.panes.includes(s.activePane ?? "") || (s.panes.length > 0 ? s.activePane = s.panes[0] : delete s.activePane), s.panes.length === 0;
582
- }
583
- function $(s) {
584
- if (!s) return null;
585
- if (s.kind === "stack")
586
- return s.panes.length === 0 ? null : ((!s.activePane || !s.panes.includes(s.activePane)) && (s.activePane = s.panes[0]), s);
587
- const t = x(s.sizes, s.children.length), e = s.children.map((i, n) => ({ child: $(i), slot: t[n] })).filter((i) => i.child !== null).flatMap(({ child: i, slot: n }) => {
588
- if (i.kind === "split" && i.direction === s.direction) {
589
- const o = x(i.sizes, i.children.length);
590
- return i.children.map((r, c) => ({
591
- child: r,
592
- slot: n * o[c]
593
- }));
594
- }
595
- return [{ child: i, slot: n }];
596
- });
597
- return e.length === 0 ? null : e.length === 1 ? e[0].child : (s.children = e.map((i) => i.child), s.sizes = x(
598
- e.map((i) => i.slot),
599
- e.length
600
- ), s);
601
- }
602
- function F(s) {
603
- return s ? JSON.parse(JSON.stringify(s)) : null;
604
- }
605
- function J(s) {
606
- return s ? s.kind === "stack" ? s.panes.length : s.children.reduce((t, e) => t + J(e), 0) : 0;
607
- }
608
- function A(s, t, e) {
609
- const i = s.type === "docked" ? t : e[s.index]?.root ?? null;
610
- if (!i)
611
- return null;
612
- const n = M(i, s.segments);
613
- return n && n.kind === "split" ? n : null;
614
- }
615
- function ut(s) {
616
- const t = s.bounds ?? { left: 0, top: 0, width: 320, height: 200 };
617
- return {
618
- id: s.id,
619
- bounds: {
620
- left: Number.isFinite(t.left) ? t.left : 0,
621
- top: Number.isFinite(t.top) ? t.top : 0,
622
- width: Number.isFinite(t.width) ? Math.max(t.width, 160) : 320,
623
- height: Number.isFinite(t.height) ? Math.max(t.height, 120) : 200
624
- },
625
- zIndex: s.zIndex,
626
- root: s.root ? F(s.root) : null,
627
- activePane: s.activePane
628
- };
629
- }
630
- const pt = 192, gt = 128;
631
- function Z(s, t) {
632
- return t > 0 ? Math.min(s, t) : s;
633
- }
634
- function q(s, t, e, i) {
635
- const n = Z(pt, i.width), o = Z(gt, i.height);
636
- let r = s.width, c = s.height, a = s.left, l = s.top;
637
- return t.horizontal === "right" ? (r = Math.max(n, s.width + e.x), i.width > 0 && (r = Math.min(r, i.width - s.left))) : t.horizontal === "left" && (r = Math.max(n, s.width - e.x), r = Math.min(r, s.left + s.width), a = s.left + s.width - r), t.vertical === "bottom" ? (c = Math.max(o, s.height + e.y), i.height > 0 && (c = Math.min(c, i.height - s.top))) : t.vertical === "top" && (c = Math.max(o, s.height - e.y), c = Math.min(c, s.top + s.height), l = s.top + s.height - c), { left: a, top: l, width: r, height: c };
638
- }
639
- const C = [1 / 3, 1 / 2, 2 / 3];
640
- function ft(s, t) {
641
- if (t <= 0) return s;
642
- const e = s / t;
643
- let i = C[0], n = Math.abs(e - i);
644
- for (let o = 1; o < C.length; o += 1) {
645
- const r = Math.abs(e - C[o]);
646
- r < n && (n = r, i = C[o]);
647
- }
648
- return i * t;
649
- }
650
- function K(s, t, e) {
651
- let i = s, n = e + 1;
652
- for (const o of t) {
653
- const r = Math.abs(o - s);
654
- r < n && (n = r, i = o);
655
- }
656
- return n <= e ? i : s;
657
- }
658
- function mt(s, t, e, i, n = !1) {
659
- const o = s + t;
660
- let r = Math.min(Math.max(s + e, i), o - i);
661
- return n && (r = ft(r, o)), { before: r, after: o - r };
662
- }
663
- function yt(s, t, e, i, n = !1) {
664
- if (t < 0 || t + 1 >= s.length) return null;
665
- const o = s.reduce((l, d) => l + d, 0);
666
- if (!(o > 0)) return null;
667
- const { before: r, after: c } = mt(s[t], s[t + 1], e, i, n), a = s.map(
668
- (l, d) => d === t ? r : d === t + 1 ? c : l
669
- );
670
- return { pixels: a, weights: a.map((l) => l / o) };
671
- }
672
- function bt(s, t, e) {
673
- const { x: i, y: n } = s, o = n === null ? [] : t.filter(
674
- ({ direction: c, rect: a }) => c === "horizontal" && n >= a.top && n <= a.bottom
675
- ).map(({ rect: c }) => c.left + c.width / 2 - e.left), r = i === null ? [] : t.filter(
676
- ({ direction: c, rect: a }) => c === "vertical" && i >= a.left && i <= a.right
677
- ).map(({ rect: c }) => c.top + c.height / 2 - e.top);
678
- return { x: o, y: r };
679
- }
680
- function kt(s, t, e, i = 12) {
681
- for (let n = 0; n < s.length; n += 1) {
682
- const r = (e !== null ? s[n] >= e : !1) ? s[n] + i : s[n];
683
- if (t < r)
684
- return n;
685
- }
686
- return s.length;
687
- }
688
- function w(s) {
689
- if (s.type === "floating") {
690
- const e = s.segments.length > 0 ? `/${s.segments.map((i) => i.toString()).join("/")}` : "";
691
- return `f:${s.index}${e}`;
692
- }
693
- const t = s.segments.join("/");
694
- return t.length > 0 ? `d:${t}` : "d:";
695
- }
696
- function P(s) {
697
- if (s == null)
698
- return null;
699
- if (s.startsWith("f:")) {
700
- const i = s.slice(2), [n, ...o] = i.split("/"), r = Number.parseInt(n, 10);
701
- if (!Number.isFinite(r))
702
- return null;
703
- const c = o.filter((a) => a.length > 0).map((a) => Number.parseInt(a, 10)).filter((a) => Number.isFinite(a));
704
- return { type: "floating", index: r, segments: c };
705
- }
706
- const t = s.startsWith("d:") ? s.slice(2) : s;
707
- return t.length === 0 ? { type: "docked", segments: [] } : { type: "docked", segments: t.split("/").filter((i) => i.length > 0).map((i) => Number.parseInt(i, 10)).filter((i) => Number.isFinite(i)) };
708
- }
709
- function B(s, t) {
710
- if (s.type !== t.type)
711
- return !1;
712
- if (s.type === "floating") {
713
- const i = t;
714
- return s.index !== i.index || s.segments.length !== i.segments.length ? !1 : s.segments.every((n, o) => n === i.segments[o]);
715
- }
716
- const e = t;
717
- return s.segments.length !== e.segments.length ? !1 : s.segments.every((i, n) => i === e.segments[n]);
718
- }
719
- function R(s) {
720
- return s.type === "floating" ? { type: "floating", index: s.index, segments: [...s.segments] } : { type: "docked", segments: [...s.segments] };
721
- }
722
- function vt(s, t) {
723
- return s.type !== t.type || s.type === "floating" && t.index !== s.index || s.segments.length > t.segments.length ? !1 : s.segments.every((e, i) => e === t.segments[i]);
724
- }
725
- class z extends et {
726
- constructor() {
727
- super(), this.liveAnnouncer = new it(this), this.paneMoveMode = null, this.paneMoveCandidateIndex = null, this.dropJoystickTarget = null, this.rootLayout = null, this.floatingLayouts = [], this.titles = {}, this.pendingTabDragMetrics = null, this.dragState = null, this.floatingDragState = null, this.floatingResizeState = null, this.intersectionRaf = null, this.rootResizeObserver = null, this.dockedMutationObserver = null, this.cornerResizeState = null, this.pointerTrackingActive = !1, this.dragPointerTrackingActive = !1, this.lastDragPointerPosition = null, this.cornerSnapXTargets = [], this.cornerSnapYTargets = [], this.debugLayoutIntegrity = !1, this.pendingDragEndTimeout = null, this.previousSplitSizes = /* @__PURE__ */ new Map(), this.layoutFocusRestore = new nt(() => this.shadowRoot, {
728
- selector: ".dock-intersection-handle[data-key], mp-tab-control, .dock-tab[data-tab-id]",
729
- keyOf: (t) => t.dataset.key ?? t.dataset.tabId ?? (t.id || null)
730
- }), this.instanceId = `mint-dock-${++z.instanceCounter}`, this.windowRef = typeof window < "u" ? window : null, this.onPointerMove = this.onPointerMove.bind(this), this.onPointerUp = this.onPointerUp.bind(this), this.onPointerCancel = this.onPointerCancel.bind(this), this.onDragPointerMove = this.onDragPointerMove.bind(this), this.onDragPointerUp = this.onDragPointerUp.bind(this), this.onDragPointerCancel = this.onDragPointerCancel.bind(this), this.onSplitterResize = this.onSplitterResize.bind(this);
731
- }
732
- static {
733
- this.styles = [rt];
734
- }
735
- static {
736
- this.documentRef = typeof document < "u" ? document : null;
737
- }
738
- static configureDocument(t) {
739
- t && (z.documentRef = t);
740
- }
741
- static get observedAttributes() {
742
- return [...super.observedAttributes ?? [], "layout", "debug-layout-integrity"];
743
- }
744
- static {
745
- this.instanceCounter = 0;
746
- }
747
- static {
748
- this.TOUCH_LONG_PRESS_MS = 600;
749
- }
750
- static {
751
- this.TOUCH_LONG_PRESS_SLOP_PX = 10;
752
- }
753
- static {
754
- this.TOUCH_PRESS_FEEDBACK_DELAY_MS = 150;
755
- }
756
- static {
757
- this.PANE_MOVE_ZONE_ORDER = ["top", "right", "bottom", "left"];
758
- }
759
- render() {
760
- return G`${ot}${this.liveAnnouncer.template()}`;
761
- }
762
- firstUpdated() {
763
- const t = this.resolveDocument();
764
- this.documentRef = t, this.windowRef = this.resolveWindow(t);
765
- const e = this.shadowRoot, i = e.querySelector(".dock-root");
766
- if (!i)
767
- throw new Error("mint-dock-manager template is missing the root element.");
768
- const n = e.querySelector(".dock-docked");
769
- if (!n)
770
- throw new Error("mint-dock-manager template is missing the docked surface element.");
771
- const o = e.querySelector(".dock-floating-layer");
772
- if (!o)
773
- throw new Error("mint-dock-manager template is missing the floating layer element.");
774
- const r = e.querySelector(".dock-drop-indicator");
775
- if (!r)
776
- throw new Error("mint-dock-manager template is missing the drop indicator element.");
777
- const c = e.querySelector(".dock-drop-joystick");
778
- if (!c)
779
- throw new Error("mint-dock-manager template is missing the drop joystick element.");
780
- const a = Array.from(
781
- c.querySelectorAll(".dock-drop-joystick__button[data-zone]")
782
- );
783
- if (a.length === 0)
784
- throw new Error("mint-dock-manager template is missing drop joystick buttons.");
785
- this.rootEl = i, this.dockedEl = n, this.floatingLayerEl = o, this.dropIndicator = r, this.dropJoystick = c, this.dropJoystickButtons = a, this.dockedEl.dataset.path = w({ type: "docked", segments: [] }), i.addEventListener("keydown", (l) => this.onRootKeyDown(l), { capture: !0 }), i.addEventListener("focusout", (l) => this.onRootFocusOut(l)), this.renderLayout(), this.rootResizeObserver = new ResizeObserver(() => {
786
- this.scheduleRenderIntersectionHandles(), this.updateFloatingPanePositions();
787
- }), this.rootResizeObserver.observe(this.rootEl), this.dockedMutationObserver = new MutationObserver(() => this.scheduleRenderIntersectionHandles()), this.dockedMutationObserver.observe(this.dockedEl, { childList: !0, subtree: !0 }), this.dockedEl.addEventListener("resizing", this.onSplitterResize), this.dockedEl.addEventListener("resize-end", this.onSplitterResize);
788
- }
789
- connectedCallback() {
790
- super.connectedCallback(), this.hasAttribute("role") || this.setAttribute("role", "region"), this.hasAttribute("aria-label") || this.setAttribute("aria-label", "Dock layout");
791
- }
792
- disconnectedCallback() {
793
- const t = this.windowRef;
794
- this.stopDragPointerTracking(), t?.removeEventListener("pointermove", this.onPointerMove), t?.removeEventListener("pointerup", this.onPointerUp), t?.removeEventListener("pointercancel", this.onPointerCancel), this.pointerTrackingActive = !1, this.rootResizeObserver?.disconnect(), this.rootResizeObserver = null, this.dockedMutationObserver?.disconnect(), this.dockedMutationObserver = null, this.dockedEl?.removeEventListener("resizing", this.onSplitterResize), this.dockedEl?.removeEventListener("resize-end", this.onSplitterResize), this.intersectionRaf !== null && (this.windowRef?.clearTimeout(this.intersectionRaf), this.intersectionRaf = null), super.disconnectedCallback();
795
- }
796
- attributeChangedCallback(t, e, i) {
797
- super.attributeChangedCallback(t, e, i), t === "layout" ? this.layout = i ? this.parseLayout(i) : null : t === "debug-layout-integrity" && (this.debugLayoutIntegrity = !(i === null || i === "false" || i === "0"));
798
- }
799
- get layout() {
800
- return {
801
- root: F(this.rootLayout),
802
- floating: this.cloneFloatingArray(this.floatingLayouts),
803
- titles: { ...this.titles }
804
- };
805
- }
806
- set layout(t) {
807
- const e = this.ensureSnapshot(t);
808
- if (this.isInteracting()) return;
809
- const i = JSON.stringify({
810
- root: this.rootLayout,
811
- floating: this.floatingLayouts,
812
- titles: this.titles
813
- }), n = JSON.stringify(e);
814
- i !== n && (this.rootLayout = F(e.root), this.floatingLayouts = this.cloneFloatingArray(e.floating), this.titles = e.titles ? { ...e.titles } : {}, this.normalizeAllLayouts(), this.renderLayout());
815
- }
816
- /**
817
- * True while the user is actively interacting with the dock — pane drag,
818
- * floating window drag, floating window resize, or intersection corner
819
- * resize. The `set layout` setter consults this to refuse external
820
- * round-trips that would overwrite in-progress drag state.
821
- */
822
- isInteracting() {
823
- return !!(this.dragState || this.floatingDragState || this.floatingResizeState || this.cornerResizeState);
824
- }
825
- get snapshot() {
826
- return this.layout;
827
- }
828
- toJSON() {
829
- return this.snapshot;
830
- }
831
- resolveDocument() {
832
- const t = z.documentRef, e = this.ownerDocument ?? null, n = t ?? e ?? (typeof document < "u" ? document : null);
833
- if (!n)
834
- throw new Error("mint-dock-manager requires a Document to initialize.");
835
- return z.documentRef || (z.documentRef = n), n;
836
- }
837
- resolveWindow(t) {
838
- return typeof window < "u" ? window : t.defaultView ?? null;
839
- }
840
- parseLayout(t) {
841
- try {
842
- const e = JSON.parse(t);
843
- return this.ensureSnapshot(e);
844
- } catch (e) {
845
- return console.warn("mint-dock-manager: failed to parse layout attribute", e), null;
846
- }
847
- }
848
- ensureSnapshot(t) {
849
- if (!t)
850
- return { root: null, floating: [], titles: {} };
851
- if (t.kind)
852
- return { root: t, floating: [], titles: {} };
853
- const e = t;
854
- return {
855
- root: e.root ?? null,
856
- floating: Array.isArray(e.floating) ? e.floating.map((i) => ut(i)) : [],
857
- titles: e.titles ? { ...e.titles } : {}
858
- };
859
- }
860
- renderLayout() {
861
- if (this.dockedEl) {
862
- if (this.layoutFocusRestore.capture(), this.dockedEl.innerHTML = "", this.floatingLayerEl.innerHTML = "", this.hideDropIndicator(), this.rootLayout) {
863
- const t = this.renderNode(this.rootLayout, []);
864
- this.dockedEl.appendChild(t);
865
- }
866
- this.renderFloatingPanes(), this.layoutFocusRestore.restore(), this.verifyProjectionSlots();
867
- }
868
- }
869
- renderNode(t, e, i) {
870
- return t.kind === "split" ? this.renderSplit(t, e, i) : this.renderStack(t, e, i);
871
- }
872
- renderFloatingPanes() {
873
- this.floatingLayerEl.innerHTML = "";
874
- const t = this.getHostSize();
875
- this.floatingLayouts.forEach((e, i) => {
876
- const n = this.documentRef.createElement("div");
877
- n.classList.add("dock-floating"), n.dataset.path = w({
878
- type: "floating",
879
- index: i,
880
- segments: []
881
- });
882
- const o = this.getFloatingWindowTitle(e), r = `${this.instanceId}-floating-${i}-title`;
883
- n.setAttribute("role", "dialog"), n.setAttribute("aria-labelledby", r), n.setAttribute("aria-modal", "false");
884
- const { left: c, top: a, width: l, height: d } = T(e.bounds, t);
885
- n.style.left = `${c}px`, n.style.top = `${a}px`, n.style.width = `${l}px`, n.style.height = `${d}px`, n.style.minWidth = "0", n.style.minHeight = "0";
886
- const u = H(this.floatingLayouts[i], i);
887
- n.style.zIndex = String(u);
888
- const h = this.documentRef.createElement("div");
889
- h.classList.add("dock-floating__chrome"), h.addEventListener(
890
- "pointerdown",
891
- (m) => this.beginFloatingDrag(m, i, n, h)
892
- );
893
- const g = this.documentRef.createElement("div");
894
- g.classList.add("dock-floating__title"), g.id = r, g.textContent = o, h.appendChild(g);
895
- const p = this.documentRef.createElement("button");
896
- if (p.type = "button", p.classList.add("dock-floating__close"), p.setAttribute("aria-label", `Close pane: ${o}`), p.textContent = "×", p.addEventListener("click", (m) => {
897
- m.stopPropagation(), this.closeFloatingPane(i);
898
- }), p.addEventListener("pointerdown", (m) => m.stopPropagation()), h.appendChild(p), n.appendChild(h), e.root) {
899
- const m = this.renderNode(e.root, [], i);
900
- m.classList.add("dock-floating__stack"), n.appendChild(m);
901
- }
902
- [
903
- {
904
- classes: ["dock-floating__resizer", "dock-floating__resizer--top-left"],
905
- edges: { horizontal: "left", vertical: "top" }
906
- },
907
- {
908
- classes: ["dock-floating__resizer", "dock-floating__resizer--top"],
909
- edges: { horizontal: "none", vertical: "top" }
910
- },
911
- {
912
- classes: ["dock-floating__resizer", "dock-floating__resizer--top-right"],
913
- edges: { horizontal: "right", vertical: "top" }
914
- },
915
- {
916
- classes: ["dock-floating__resizer", "dock-floating__resizer--right"],
917
- edges: { horizontal: "right", vertical: "none" }
918
- },
919
- {
920
- classes: ["dock-floating__resizer", "dock-floating__resizer--bottom-right"],
921
- edges: { horizontal: "right", vertical: "bottom" }
922
- },
923
- {
924
- classes: ["dock-floating__resizer", "dock-floating__resizer--bottom"],
925
- edges: { horizontal: "none", vertical: "bottom" }
926
- },
927
- {
928
- classes: ["dock-floating__resizer", "dock-floating__resizer--bottom-left"],
929
- edges: { horizontal: "left", vertical: "bottom" }
930
- },
931
- {
932
- classes: ["dock-floating__resizer", "dock-floating__resizer--left"],
933
- edges: { horizontal: "left", vertical: "none" }
934
- }
935
- ].forEach(({ classes: m, edges: y }) => {
936
- const b = this.documentRef.createElement("div");
937
- b.classList.add(...m), b.setAttribute("role", "separator");
938
- const k = y.horizontal === "none" && y.vertical !== "none", D = y.vertical === "none" && y.horizontal !== "none";
939
- k ? b.setAttribute("aria-orientation", "horizontal") : D && b.setAttribute("aria-orientation", "vertical");
940
- const S = [];
941
- y.vertical === "top" ? S.push("top") : y.vertical === "bottom" && S.push("bottom"), y.horizontal === "left" ? S.push("left") : y.horizontal === "right" && S.push("right"), b.setAttribute(
942
- "aria-label",
943
- `Resize pane ${S.length === 2 ? "corner " : "edge "}${S.join("-")}`
944
- ), b.addEventListener(
945
- "pointerdown",
946
- (L) => this.beginFloatingResize(L, i, n, b, y)
947
- ), b.setAttribute("tabindex", "0"), b.setAttribute("aria-valuemin", "0"), b.setAttribute("aria-valuemax", "100"), this.syncFloatingResizerValue(b, i, y), b.addEventListener(
948
- "keydown",
949
- (L) => this.onFloatingResizeKeydown(L, i, n, b, y)
950
- ), n.appendChild(b);
951
- }), this.floatingLayerEl.appendChild(n);
952
- });
953
- }
954
- onSplitterResize() {
955
- this.scheduleRenderIntersectionHandles();
956
- }
957
- scheduleRenderIntersectionHandles() {
958
- if (this.intersectionRaf !== null) return;
959
- const t = this.windowRef;
960
- t && (this.intersectionRaf = t.setTimeout(() => {
961
- this.intersectionRaf = null, this.renderIntersectionHandles();
962
- }, 5));
963
- }
964
- renderIntersectionHandles() {
965
- const t = this.shadowRoot?.querySelector(".dock-intersections-layer, .dock-intersection-layer");
966
- if (!t) return;
967
- const e = this.rootEl.getBoundingClientRect();
968
- if (this.cornerResizeState) {
969
- const a = this.cornerResizeState, l = a.hs[0], d = a.vs[0], u = l ? this.getSplitterDividers(l.container)[l.index] : null, h = d ? this.getSplitterDividers(d.container)[d.index] : null;
970
- if (u && h) {
971
- const g = u.getBoundingClientRect(), p = h.getBoundingClientRect(), f = p.left + p.width / 2 - e.left, m = g.top + g.height / 2 - e.top;
972
- a.handle.style.left = `${f}px`, a.handle.style.top = `${m}px`, Array.from(t.querySelectorAll(".dock-intersection-handle")).forEach((y) => {
973
- y !== a.handle && y.remove();
974
- });
975
- }
976
- return;
977
- }
978
- t.replaceChildren();
979
- const i = [], n = [];
980
- Array.from(
981
- this.shadowRoot?.querySelectorAll(".dock-split") ?? []
982
- ).forEach((a) => {
983
- const l = a.dataset.direction, d = a.dataset.path ?? "", u = this.splitterLayerKey(a);
984
- this.getSplitterDividers(a).forEach((h, g) => {
985
- const p = { rect: h.getBoundingClientRect(), pathStr: d, index: g, layerKey: u };
986
- l === "horizontal" ? n.push(p) : l === "vertical" && i.push(p);
987
- });
988
- });
989
- const r = 24, c = /* @__PURE__ */ new Map();
990
- i.forEach((a) => {
991
- const l = a.rect.top + a.rect.height / 2;
992
- n.forEach((d) => {
993
- if (a.layerKey !== d.layerKey) return;
994
- const u = d.rect.left + d.rect.width / 2, h = u < a.rect.left ? a.rect.left - u : u > a.rect.right ? u - a.rect.right : 0, g = l < d.rect.top ? d.rect.top - l : l > d.rect.bottom ? l - d.rect.bottom : 0;
995
- if (h > r || g > r) return;
996
- const p = u - e.left, f = l - e.top, m = `${Math.round(p)}:${Math.round(f)}`, y = c.get(m) ?? { x: p, y: f, pairs: [] };
997
- y.pairs.push({ h: { pathStr: a.pathStr, index: a.index }, v: { pathStr: d.pathStr, index: d.index } }), c.set(m, y);
998
- });
999
- }), c.forEach((a, l) => {
1000
- const d = this.documentRef.createElement("div");
1001
- d.classList.add("dock-intersection-handle", "glyph"), d.setAttribute("role", "separator"), d.setAttribute("aria-label", "Resize split intersection");
1002
- const u = e.width > 0 ? Math.round(a.x / e.width * 100) : 0;
1003
- d.setAttribute("aria-valuemin", "0"), d.setAttribute("aria-valuemax", "100"), d.setAttribute("aria-valuenow", String(Math.min(100, Math.max(0, u)))), d.setAttribute("tabindex", "0");
1004
- const h = a.pairs[0], g = `${h.h.pathStr}:${h.h.index}|${h.v.pathStr}:${h.v.index}`;
1005
- d.dataset.key = g, d.dataset.pairs = JSON.stringify(a.pairs), d.style.left = `${a.x}px`, d.style.top = `${a.y}px`, d.addEventListener("pointerdown", (p) => this.beginCornerResize(p, d)), d.addEventListener("dblclick", (p) => this.onIntersectionDoubleClick(p, d)), d.addEventListener("keydown", (p) => this.onIntersectionKeyDown(p, d)), t.appendChild(d);
1006
- });
1007
- }
1008
- /**
1009
- * Keyboard resize on a focused intersection handle. ArrowLeft/Right resize
1010
- * the vertical divider the handle sits on; ArrowUp/Down resize the
1011
- * horizontal divider. Home/End shrink/grow the leading panel of whichever
1012
- * axis is implied by the key. Shift = fine 1% step.
1013
- *
1014
- * Internally delegates to mp-splitter.resizeDividerBy() so the percent-step
1015
- * + clamp math lives in one place. If a 2D handle straddles multiple split
1016
- * pairs (sibling splitters whose dividers happen to overlap), the first
1017
- * pair drives — same precedence as the pointer drag path.
1018
- */
1019
- onIntersectionKeyDown(t, e) {
1020
- const i = t.key === "ArrowLeft" || t.key === "ArrowRight", n = t.key === "ArrowUp" || t.key === "ArrowDown", o = t.key === "Home" || t.key === "End";
1021
- if (!i && !n && !o) return;
1022
- const r = e.dataset.pairs;
1023
- if (!r) return;
1024
- let c;
1025
- try {
1026
- c = JSON.parse(r);
1027
- } catch {
1028
- return;
1029
- }
1030
- if (c.length === 0) return;
1031
- t.preventDefault();
1032
- const a = t.shiftKey, d = i || o ? c[0].v : c[0].h;
1033
- this.findSplitterByPath(P(d.pathStr))?.resizeDividerBy?.(d.index, t.key, a);
1034
- }
1035
- beginCornerResize(t, e) {
1036
- t.preventDefault();
1037
- const i = W(e.dataset.pairs, e.dataset.key), n = ({ pathStr: h, index: g }, p) => {
1038
- const f = P(h), m = this.findSplitterByPath(f), y = m ? this.getSplitterPanels(m) : [];
1039
- return !f || !m || y.length === 0 ? null : { path: f, index: g, container: m, initialSizes: y.map((b) => b.getBoundingClientRect()[p]) };
1040
- }, o = i.map((h) => n(h.h, "height")).filter((h) => h !== null), r = i.map((h) => n(h.v, "width")).filter((h) => h !== null);
1041
- if (o.length === 0 && r.length === 0) return;
1042
- try {
1043
- e.setPointerCapture(t.pointerId);
1044
- } catch {
1045
- }
1046
- e.dataset.resizing = "true", e.classList.add("hovering"), this.cornerResizeState = {
1047
- pointerId: t.pointerId,
1048
- handle: e,
1049
- hs: o.map((h) => ({ path: R(h.path), index: h.index, container: h.container, initialSizes: h.initialSizes, startY: t.clientY })),
1050
- vs: r.map((h) => ({ path: R(h.path), index: h.index, container: h.container, initialSizes: h.initialSizes, startX: t.clientX }))
1051
- }, this.startPointerTracking(), e.dataset.key || (e.dataset.key = e.dataset.group ?? "");
1052
- const c = (h) => h ? this.getSplitterDividers(h.container)[h.index]?.getBoundingClientRect() ?? null : null, a = c(r[0]), l = c(o[0]), d = Array.from(
1053
- this.shadowRoot?.querySelectorAll(".dock-split") ?? []
1054
- ).flatMap((h) => {
1055
- const g = h.dataset.direction;
1056
- return this.getSplitterDividers(h).map((p) => ({ direction: g, rect: p.getBoundingClientRect() }));
1057
- }), u = bt(
1058
- { x: a ? a.left + a.width / 2 : null, y: l ? l.top + l.height / 2 : null },
1059
- d,
1060
- this.rootEl.getBoundingClientRect()
1061
- );
1062
- this.cornerSnapXTargets = u.x, this.cornerSnapYTargets = u.y;
1063
- }
1064
- handleCornerResizeMove(t) {
1065
- const e = this.cornerResizeState;
1066
- if (!e || e.pointerId !== t.pointerId) return;
1067
- const i = 10, n = this.rootEl.getBoundingClientRect(), o = K(
1068
- t.clientX,
1069
- this.cornerSnapXTargets.map((a) => n.left + a),
1070
- i
1071
- ), r = K(
1072
- t.clientY,
1073
- this.cornerSnapYTargets.map((a) => n.top + a),
1074
- i
1075
- ), c = (a, l) => {
1076
- const d = A(a.path, this.rootLayout, this.floatingLayouts);
1077
- if (!d) return;
1078
- const h = yt(a.initialSizes, a.index, l, 48, t.shiftKey);
1079
- h && (d.sizes = h.weights, a.container.setPanelSizes?.(h.pixels));
1080
- };
1081
- e.hs.forEach((a) => c(a, r - a.startY)), e.vs.forEach((a) => c(a, o - a.startX)), this.dispatchLayoutChanged(), this.scheduleRenderIntersectionHandles();
1082
- }
1083
- endCornerResize(t) {
1084
- const e = this.cornerResizeState;
1085
- if (!(!e || t !== e.pointerId)) {
1086
- try {
1087
- e.handle.releasePointerCapture(e.pointerId);
1088
- } catch {
1089
- }
1090
- e.handle.dataset.resizing = "false", this.cornerResizeState = null, this.scheduleRenderIntersectionHandles(), this.cornerSnapXTargets = [], this.cornerSnapYTargets = [];
1091
- }
1092
- }
1093
- onIntersectionDoubleClick(t, e) {
1094
- t.preventDefault();
1095
- const i = W(e.dataset.pairs, e.dataset.key);
1096
- if (i.length === 0) return;
1097
- const n = ct(
1098
- i,
1099
- this.previousSplitSizes,
1100
- (o) => {
1101
- const r = P(o), c = r ? A(r, this.rootLayout, this.floatingLayouts) : null;
1102
- return c ? { sizes: c.sizes, childCount: c.children.length } : null;
1103
- }
1104
- );
1105
- n.remember.forEach(({ pathStr: o, sizes: r }) => this.previousSplitSizes.set(o, r)), n.writes.forEach(({ pathStr: o, sizes: r }) => {
1106
- const c = P(o), a = c ? A(c, this.rootLayout, this.floatingLayouts) : null;
1107
- !a || !c || (a.sizes = r, this.pushSizesToSplitter(c, r));
1108
- }), n.clearStored && this.previousSplitSizes.clear(), this.dispatchLayoutChanged(), this.scheduleRenderIntersectionHandles();
1109
- }
1110
- /**
1111
- * Push normalized weights into the matching `<mp-splitter>` as pixel sizes.
1112
- * The splitter's panel wrappers live in its shadow DOM, so direct flex
1113
- * mutation is not an option.
1114
- *
1115
- * Returns without writing when the splitter has no measured size — which is
1116
- * every case under jsdom, and is why the double-click logic above had to move
1117
- * out of this method's shadow to become testable.
1118
- */
1119
- pushSizesToSplitter(t, e) {
1120
- const i = this.findSplitterByPath(t);
1121
- if (!i) return;
1122
- const o = (i.dataset.direction ?? "horizontal") === "horizontal" ? i.getBoundingClientRect().width : i.getBoundingClientRect().height;
1123
- if (!Number.isFinite(o) || o <= 0) return;
1124
- const r = e.reduce((a, l) => a + Math.max(l, 0), 0);
1125
- if (r <= 0) return;
1126
- const c = e.map((a) => Math.max(a, 0) / r * o);
1127
- i.setPanelSizes?.(c);
1128
- }
1129
- beginFloatingDrag(t, e, i, n) {
1130
- const o = this.floatingLayouts[e];
1131
- if (!o)
1132
- return;
1133
- t.preventDefault(), t.stopPropagation(), o.bounds = T(o.bounds, this.getHostSize());
1134
- const { left: r, top: c } = o.bounds;
1135
- try {
1136
- n.setPointerCapture(t.pointerId);
1137
- } catch {
1138
- }
1139
- this.promoteFloatingPane(e, i), i.dataset.dragging = "true", this.floatingDragState = {
1140
- index: e,
1141
- pointerId: t.pointerId,
1142
- startX: t.clientX,
1143
- startY: t.clientY,
1144
- startLeft: r,
1145
- startTop: c,
1146
- wrapper: i,
1147
- handle: n
1148
- }, this.startPointerTracking();
1149
- }
1150
- /** The percent-of-host size of the dimension a handle drives (width for
1151
- * horizontal/corner handles, height for pure-vertical ones). */
1152
- syncFloatingResizerValue(t, e, i) {
1153
- const n = this.floatingLayouts[e], o = this.getHostSize();
1154
- if (!n || o.width <= 0 || o.height <= 0) return;
1155
- const r = i.horizontal !== "none" ? n.bounds.width / o.width * 100 : n.bounds.height / o.height * 100;
1156
- t.setAttribute("aria-valuenow", String(Math.round(Math.min(100, Math.max(0, r)))));
1157
- }
1158
- /**
1159
- * Keyboard resize for floating panes — the same edge-anchored math as the
1160
- * pointer path (left/top handles move the edge outward, right/bottom grow),
1161
- * ±10px per arrow, Shift for 1px. Off-axis arrows and modifier chords pass
1162
- * through untouched.
1163
- */
1164
- onFloatingResizeKeydown(t, e, i, n, o) {
1165
- if (t.altKey || t.ctrlKey || t.metaKey) return;
1166
- const r = t.key === "ArrowLeft" ? -1 : t.key === "ArrowRight" ? 1 : 0, c = t.key === "ArrowUp" ? -1 : t.key === "ArrowDown" ? 1 : 0;
1167
- if (r === 0 && c === 0 || r !== 0 && o.horizontal === "none" || c !== 0 && o.vertical === "none") return;
1168
- const a = this.floatingLayouts[e];
1169
- if (!a) return;
1170
- t.preventDefault(), t.stopPropagation();
1171
- const l = t.shiftKey ? 1 : 10, d = q(
1172
- a.bounds,
1173
- o,
1174
- { x: r * l, y: c * l },
1175
- this.getHostSize()
1176
- );
1177
- this.applyFloatingBounds(i, e, d), this.syncFloatingResizerValue(n, e, o), this.dispatchLayoutChanged();
1178
- }
1179
- beginFloatingResize(t, e, i, n, o) {
1180
- const r = this.floatingLayouts[e];
1181
- if (r) {
1182
- t.preventDefault(), t.stopPropagation();
1183
- try {
1184
- n.setPointerCapture(t.pointerId);
1185
- } catch {
1186
- }
1187
- n.dataset.resizing = "true", this.promoteFloatingPane(e, i), r.bounds = T(r.bounds, this.getHostSize()), this.floatingResizeState = {
1188
- index: e,
1189
- pointerId: t.pointerId,
1190
- startX: t.clientX,
1191
- startY: t.clientY,
1192
- startWidth: r.bounds.width,
1193
- startHeight: r.bounds.height,
1194
- startLeft: r.bounds.left,
1195
- startTop: r.bounds.top,
1196
- wrapper: i,
1197
- handle: n,
1198
- edges: o
1199
- }, this.startPointerTracking();
1200
- }
1201
- }
1202
- handleFloatingDragMove(t) {
1203
- const e = this.floatingDragState;
1204
- if (!e || t.pointerId !== e.pointerId)
1205
- return;
1206
- const i = this.floatingLayouts[e.index];
1207
- if (!i) return;
1208
- const n = t.clientX - e.startX, o = t.clientY - e.startY, r = T(
1209
- {
1210
- left: e.startLeft + n,
1211
- top: e.startTop + o,
1212
- width: i.bounds.width,
1213
- height: i.bounds.height
1214
- },
1215
- this.getHostSize()
1216
- );
1217
- e.wrapper.style.left = `${r.left}px`, e.wrapper.style.top = `${r.top}px`, i.bounds = r, this.updateFloatingDragDropTarget(t);
1218
- }
1219
- endFloatingDrag(t) {
1220
- const e = this.floatingDragState;
1221
- if (!e || t !== e.pointerId)
1222
- return;
1223
- try {
1224
- e.handle.releasePointerCapture(e.pointerId);
1225
- } catch {
1226
- }
1227
- delete e.handle.dataset.resizing, delete e.wrapper.dataset.dragging;
1228
- const i = e.dropTarget ? this.handleFloatingStackDrop(e.index, e.dropTarget.path, e.dropTarget.zone) : !1;
1229
- this.floatingDragState = null, this.hideDropIndicator(), i || this.dispatchLayoutChanged();
1230
- }
1231
- updateFloatingDragDropTarget(t) {
1232
- const e = this.floatingDragState;
1233
- if (!e)
1234
- return;
1235
- const i = this.findStackAtPoint(t.clientX, t.clientY);
1236
- if (!i) {
1237
- e.dropTarget && (delete e.dropTarget, this.hideDropIndicator());
1238
- return;
1239
- }
1240
- const n = P(i.dataset.path);
1241
- if (!n || n.type === "floating" && n.index === e.index) {
1242
- e.dropTarget && (delete e.dropTarget, this.hideDropIndicator());
1243
- return;
1244
- }
1245
- this.dropJoystickTarget && this.dropJoystickTarget !== i && (delete this.dropJoystick.dataset.zone, this.updateDropJoystickActiveZone(null));
1246
- const o = this.computeDropZone(i, t, this.extractDropZoneFromEvent(t));
1247
- o ? e.dropTarget = { path: n, zone: o } : e.dropTarget && delete e.dropTarget, this.showDropIndicator(i, o);
1248
- }
1249
- handleFloatingResizeMove(t) {
1250
- const e = this.floatingResizeState;
1251
- if (!e || t.pointerId !== e.pointerId)
1252
- return;
1253
- const i = q(
1254
- {
1255
- left: e.startLeft,
1256
- top: e.startTop,
1257
- width: e.startWidth,
1258
- height: e.startHeight
1259
- },
1260
- e.edges,
1261
- { x: t.clientX - e.startX, y: t.clientY - e.startY },
1262
- this.getHostSize()
1263
- );
1264
- this.applyFloatingBounds(e.wrapper, e.index, i);
1265
- }
1266
- /**
1267
- * Commit resolved bounds to both the DOM and the layout. Written directly
1268
- * rather than through a re-render: a resize runs once per pointer move, and
1269
- * tearing the wrapper down would drop the pointer capture mid-gesture.
1270
- */
1271
- applyFloatingBounds(t, e, i) {
1272
- t.style.left = `${i.left}px`, t.style.top = `${i.top}px`, t.style.width = `${i.width}px`, t.style.height = `${i.height}px`;
1273
- const n = this.floatingLayouts[e];
1274
- n && (n.bounds = i);
1275
- }
1276
- endFloatingResize(t) {
1277
- const e = this.floatingResizeState;
1278
- if (!(!e || t !== e.pointerId)) {
1279
- try {
1280
- e.handle.releasePointerCapture(e.pointerId);
1281
- } catch {
1282
- }
1283
- delete e.handle.dataset.resizing, this.syncFloatingResizerValue(e.handle, e.index, e.edges), this.floatingResizeState = null, this.dispatchLayoutChanged();
1284
- }
1285
- }
1286
- getHostSize() {
1287
- return {
1288
- width: this.rootEl.clientWidth,
1289
- height: this.rootEl.clientHeight
1290
- };
1291
- }
1292
- // Re-clamp existing floating-pane wrappers in place. Avoids the full
1293
- // renderFloatingPanes() teardown (which would release pointer capture if
1294
- // a user is mid-drag when the host resizes).
1295
- updateFloatingPanePositions() {
1296
- if (!this.floatingLayerEl) return;
1297
- const t = this.getHostSize();
1298
- this.floatingLayouts.forEach((e, i) => {
1299
- const n = this.floatingLayerEl.children[i];
1300
- if (!n) return;
1301
- const { left: o, top: r, width: c, height: a } = T(e.bounds, t);
1302
- n.style.left = `${o}px`, n.style.top = `${r}px`, n.style.width = `${c}px`, n.style.height = `${a}px`, n.style.minWidth = "0", n.style.minHeight = "0";
1303
- });
1304
- }
1305
- promoteFloatingPane(t, e) {
1306
- const i = this.floatingLayouts[t];
1307
- if (!i)
1308
- return;
1309
- const n = this.floatingLayouts.reduce((r, c, a) => {
1310
- if (!c)
1311
- return r;
1312
- const l = a === t ? Number.NEGATIVE_INFINITY : H(this.floatingLayouts[a], a);
1313
- return Math.max(r, l);
1314
- }, 0), o = Math.max(n + 2, 12);
1315
- i.zIndex = o, e.style.zIndex = String(o);
1316
- }
1317
- getFloatingWrapper(t) {
1318
- const e = `.dock-floating[data-path="${w({
1319
- type: "floating",
1320
- index: t,
1321
- segments: []
1322
- })}"]`;
1323
- return this.floatingLayerEl.querySelector(e);
1324
- }
1325
- startPointerTracking() {
1326
- if (this.pointerTrackingActive)
1327
- return;
1328
- const t = this.windowRef;
1329
- t?.addEventListener("pointermove", this.onPointerMove), t?.addEventListener("pointerup", this.onPointerUp), t?.addEventListener("pointercancel", this.onPointerCancel), this.pointerTrackingActive = !0;
1330
- }
1331
- stopPointerTrackingIfIdle() {
1332
- if (this.pointerTrackingActive && !this.floatingDragState && !this.floatingResizeState && !this.cornerResizeState) {
1333
- const t = this.windowRef;
1334
- t?.removeEventListener("pointermove", this.onPointerMove), t?.removeEventListener("pointerup", this.onPointerUp), t?.removeEventListener("pointercancel", this.onPointerCancel), this.pointerTrackingActive = !1;
1335
- }
1336
- }
1337
- getFloatingWindowTitle(t) {
1338
- const e = "Floating Pane";
1339
- if (!t || !t.root)
1340
- return e;
1341
- const i = t.activePane ?? E(t.root);
1342
- return i ? this.titles[i] ?? i ?? e : e;
1343
- }
1344
- updateFloatingWindowTitle(t) {
1345
- const e = this.floatingLayouts[t];
1346
- if (!e)
1347
- return;
1348
- const i = `.dock-floating[data-path="${w({
1349
- type: "floating",
1350
- index: t,
1351
- segments: []
1352
- })}"]`, n = this.floatingLayerEl.querySelector(i);
1353
- if (!n)
1354
- return;
1355
- const o = n.querySelector(".dock-floating__title");
1356
- o && (o.textContent = this.getFloatingWindowTitle(e));
1357
- }
1358
- renderSplit(t, e, i) {
1359
- const n = this.documentRef.createElement("mp-splitter");
1360
- n.classList.add("dock-split"), n.dataset.direction = t.direction, n.setAttribute("orientation", t.direction);
1361
- const o = typeof i == "number" ? { type: "floating", index: i, segments: [...e] } : { type: "docked", segments: [...e] };
1362
- n.dataset.path = w(o), t.children.forEach((c, a) => {
1363
- n.appendChild(this.renderNode(c, [...e, a], i));
1364
- });
1365
- const r = Array.isArray(t.sizes) ? t.sizes : [];
1366
- return r.length > 0 && requestAnimationFrame(() => {
1367
- const c = r.reduce((d, u) => d + Math.max(u, 0), 0);
1368
- if (c <= 0) return;
1369
- const a = t.direction === "horizontal" ? n.getBoundingClientRect().width : n.getBoundingClientRect().height;
1370
- if (!Number.isFinite(a) || a <= 0) return;
1371
- const l = r.map((d) => Math.max(d, 0) / c * a);
1372
- n.setPanelSizes?.(l), requestAnimationFrame(() => this.scheduleRenderIntersectionHandles());
1373
- }), n.addEventListener("resize-end", (c) => {
1374
- if (c.target !== n) return;
1375
- const a = c.detail;
1376
- if (!Array.isArray(a?.sizes) || a.sizes.length === 0) return;
1377
- const l = A(o, this.rootLayout, this.floatingLayouts);
1378
- if (!l) return;
1379
- const d = (l.sizes ?? []).reduce(
1380
- (g, p) => g + Math.max(p, 0),
1381
- 0
1382
- ), u = a.sizes.reduce((g, p) => g + Math.max(p, 0), 0), h = d > 0 ? d : a.sizes.length;
1383
- u > 0 && (l.sizes = a.sizes.map(
1384
- (g) => Math.max(g, 0) / u * h
1385
- ), this.dispatchLayoutChanged());
1386
- }), n;
1387
- }
1388
- renderStack(t, e, i) {
1389
- const n = this.documentRef.createElement("mp-tab-control");
1390
- n.classList.add("dock-stack"), n.setAttribute("select-first-tab", "false"), n.setAttribute("border", "top");
1391
- const o = typeof i == "number" ? { type: "floating", index: i, segments: [...e] } : { type: "docked", segments: [...e] };
1392
- n.dataset.path = w(o);
1393
- const r = Array.from(new Set(t.panes));
1394
- if (r.length === 0) {
1395
- const d = this.documentRef.createElement("span");
1396
- d.setAttribute("slot", "__empty__-header"), d.textContent = "(empty)";
1397
- const u = this.documentRef.createElement("div");
1398
- return u.setAttribute("slot", "__empty__-content"), u.classList.add("dock-stack__pane"), u.textContent = "No panes configured", n.append(d, u), n.setAttribute("active-tab", "__empty__"), n;
1399
- }
1400
- const c = r.includes(t.activePane ?? "") ? t.activePane : r[0], a = e.length ? e.join("-") : "root", l = typeof i == "number" ? `f${i}-${a}` : a;
1401
- return r.forEach((d) => {
1402
- const u = d.replace(/[^a-zA-Z0-9_-]/g, "-"), h = u.length > 0 ? u : "pane", g = `${this.instanceId}-tab-${l}-${h}`, p = `${this.instanceId}-panel-${l}-${h}`, f = this.documentRef.createElement("span");
1403
- f.setAttribute("slot", `${g}-header`), f.classList.add("dock-tab"), f.dataset.pane = d, f.dataset.tabId = g, f.textContent = this.titles[d] ?? d, f.addEventListener("pointerdown", (b) => {
1404
- this.captureTabDragMetrics(b, n), this.armPaneDragGesture(b, R(o), d, n), b.stopPropagation();
1405
- });
1406
- const m = this.documentRef.createElement("div");
1407
- m.setAttribute("slot", `${g}-content`), m.classList.add("dock-stack__pane"), m.dataset.pane = d, m.dataset.tabId = g, m.id = p;
1408
- const y = this.documentRef.createElement("slot");
1409
- y.name = d, m.appendChild(y), n.append(f, m), d === c && n.setAttribute("active-tab", g);
1410
- }), n.dataset.activePane = c, n.addEventListener("tab-activate", (d) => {
1411
- const u = d.detail, g = this.stackChildren(n).find((p) => p.dataset.tabId === u.tabId)?.dataset.pane;
1412
- g && (this.activatePane(n, g, R(o)), this.dispatchEvent(
1413
- new CustomEvent("dock-pane-activated", {
1414
- detail: { pane: g },
1415
- bubbles: !0,
1416
- composed: !0
1417
- })
1418
- ));
1419
- }), n;
1420
- }
1421
- /**
1422
- * Returns the strip (`.tsc`) element inside an `<mp-tab-control>`'s shadow
1423
- * DOM. Used by drag/drop logic that needs the strip's geometry instead of
1424
- * the host element's bounds.
1425
- */
1426
- getStackStripEl(t) {
1427
- return t.tagName !== "MP-TAB-CONTROL" ? null : t.shadowRoot?.querySelector(".tsc") ?? null;
1428
- }
1429
- /**
1430
- * Returns the rendered tab buttons inside an `<mp-tab-control>`'s shadow
1431
- * strip — the light-DOM `.dock-tab` spans the dock owns are projected into
1432
- * these buttons via `<slot>`. Use these for geometry / position queries
1433
- * (insert-index computation, drop-indicator placement). Use the light-DOM
1434
- * `.dock-tab` spans for data queries (paneName, drag listeners).
1435
- */
1436
- getStackTabButtons(t) {
1437
- return t.tagName !== "MP-TAB-CONTROL" ? [] : Array.from(
1438
- t.shadowRoot?.querySelectorAll("button.nav-link") ?? []
1439
- );
1440
- }
1441
- /**
1442
- * Returns the dividers inside an `<mp-splitter>`'s shadow DOM, in DOM order.
1443
- * mp-splitter renders one `.divider` between each pair of adjacent panels,
1444
- * so for an N-child split, length N-1.
1445
- */
1446
- getSplitterDividers(t) {
1447
- return t.tagName !== "MP-SPLITTER" ? [] : Array.from(
1448
- t.shadowRoot?.querySelectorAll(".divider") ?? []
1449
- );
1450
- }
1451
- /**
1452
- * Returns the panel wrappers inside an `<mp-splitter>`'s shadow DOM, in
1453
- * DOM order. These are the elements mp-splitter sizes (via setPanelSizes)
1454
- * during a divider drag — the dock reads their geometry for intersection
1455
- * handle math and snap markers.
1456
- */
1457
- getSplitterPanels(t) {
1458
- return t.tagName !== "MP-SPLITTER" ? [] : Array.from(
1459
- t.shadowRoot?.querySelectorAll(".panel-wrapper") ?? []
1460
- );
1461
- }
1462
- /**
1463
- * Locate the rendered `<mp-splitter>` for a split path — layer included,
1464
- * so a floating window's splitter never answers for a docked one.
1465
- */
1466
- findSplitterByPath(t) {
1467
- return t ? this.shadowRoot?.querySelector(
1468
- `.dock-split[data-path="${w(t)}"]`
1469
- ) ?? null : null;
1470
- }
1471
- onPointerMove(t) {
1472
- this.cornerResizeState && t.pointerId === this.cornerResizeState.pointerId && this.handleCornerResizeMove(t), this.floatingResizeState && t.pointerId === this.floatingResizeState.pointerId && this.handleFloatingResizeMove(t), this.floatingDragState && t.pointerId === this.floatingDragState.pointerId && this.handleFloatingDragMove(t);
1473
- }
1474
- onPointerUp(t) {
1475
- this.cornerResizeState && t.pointerId === this.cornerResizeState.pointerId && this.endCornerResize(t.pointerId), this.floatingDragState && t.pointerId === this.floatingDragState.pointerId && this.endFloatingDrag(t.pointerId), this.floatingResizeState && t.pointerId === this.floatingResizeState.pointerId && this.endFloatingResize(t.pointerId), this.stopPointerTrackingIfIdle();
1476
- }
1477
- // OS-level cancel (pointer capture lost to a back-swipe, multi-touch
1478
- // arbitration, palm rejection, etc.). Without this, the wrapper's
1479
- // data-dragging marker stays set after the gesture is yanked away from
1480
- // us, leaving the pane permanently transparent to pointer events and
1481
- // ungrabbable. Cleans up the same states onPointerUp does but
1482
- // explicitly drops state.dropTarget for the floating drag so cancel
1483
- // never commits a phantom drop (mirrors onDragPointerCancel for the
1484
- // tab-drag path).
1485
- onPointerCancel(t) {
1486
- this.floatingDragState && t.pointerId === this.floatingDragState.pointerId && (delete this.floatingDragState.dropTarget, this.endFloatingDrag(t.pointerId)), this.floatingResizeState && t.pointerId === this.floatingResizeState.pointerId && this.endFloatingResize(t.pointerId), this.cornerResizeState && t.pointerId === this.cornerResizeState.pointerId && this.endCornerResize(t.pointerId), this.stopPointerTrackingIfIdle();
1487
- }
1488
- captureTabDragMetrics(t, e) {
1489
- if (!e) {
1490
- this.pendingTabDragMetrics = null;
1491
- return;
1492
- }
1493
- if (!Number.isFinite(t.clientX) || !Number.isFinite(t.clientY)) {
1494
- this.pendingTabDragMetrics = null;
1495
- return;
1496
- }
1497
- const i = this.getBoundingClientRect(), n = e.getBoundingClientRect(), o = t.clientX - n.left, r = t.clientY - n.top, c = n.left - i.left, a = n.top - i.top, l = Number.isFinite(n.width) ? n.width : 0, d = Number.isFinite(n.height) ? n.height : 0;
1498
- this.pendingTabDragMetrics = {
1499
- pointerOffsetX: o,
1500
- pointerOffsetY: r,
1501
- left: c,
1502
- top: a,
1503
- width: l,
1504
- height: d,
1505
- startClientX: t.clientX,
1506
- startClientY: t.clientY
1507
- };
1508
- }
1509
- clearPendingTabDragMetrics() {
1510
- this.pendingTabDragMetrics = null;
1511
- }
1512
- /**
1513
- * Pointerdown handler arms a "may become a drag" gesture. Mouse / pen use a
1514
- * 5 px distance threshold and arm immediately; touch dispatches to
1515
- * {@link armPaneDragGestureTouch} which requires a 600 ms stationary hold
1516
- * (so the user can scroll the tabstrip natively without undocking).
1517
- * Once armed, both paths converge on {@link beginPaneDrag}. All listeners
1518
- * self-clean on resolve so the gesture stays scoped to a single pointerdown.
1519
- */
1520
- armPaneDragGesture(t, e, i, n) {
1521
- if (t.pointerType === "touch") {
1522
- this.armPaneDragGestureTouch(t, e, i, n);
1523
- return;
1524
- }
1525
- if (t.pointerType === "mouse" && t.button !== 0) return;
1526
- const o = this.windowRef;
1527
- if (!o) return;
1528
- const r = t.clientX, c = t.clientY, a = t.pointerId, l = 5;
1529
- let d = !1;
1530
- const u = () => {
1531
- d = !0, o.removeEventListener("pointermove", h, !0), o.removeEventListener("pointerup", g, !0), o.removeEventListener("pointercancel", g, !0);
1532
- }, h = (p) => {
1533
- if (d || p.pointerId !== a) return;
1534
- const f = p.clientX - r, m = p.clientY - c;
1535
- Math.hypot(f, m) < l || (u(), this.beginPaneDrag(p, e, i, n));
1536
- }, g = (p) => {
1537
- d || p.pointerId !== a || (u(), this.clearPendingTabDragMetrics());
1538
- };
1539
- o.addEventListener("pointermove", h, !0), o.addEventListener("pointerup", g, !0), o.addEventListener("pointercancel", g, !0);
1540
- }
1541
- /**
1542
- * Touch-specific gesture arming. With `.dock-tab` set to `touch-action:
1543
- * none`, the browser never arbitrates the gesture itself, so JS owns it
1544
- * from frame 1. Three outcomes from the pending state:
1545
- *
1546
- * - User holds within {@link TOUCH_LONG_PRESS_SLOP_PX} for
1547
- * {@link TOUCH_LONG_PRESS_MS} → timer fires → drag arms via
1548
- * {@link beginPaneDrag}.
1549
- * - User moves past slop and the move is mostly horizontal, and the
1550
- * strip's `<ul>` is scrollable → enter `scrolling` mode and drive
1551
- * `ul.scrollLeft` from JS for the rest of the gesture (no drag, no
1552
- * momentum — direct 1:1 finger follow).
1553
- * - User moves past slop in any other direction, releases, or
1554
- * pointercancel fires → abandoned, no drag, no scroll. Releases
1555
- * under slop fire the synthesized click that drives `tab-activate`.
1556
- *
1557
- * `touch-action: pan-x` was the original PRD design but doesn't work:
1558
- * the policy is frozen at touchstart and `setPointerCapture` doesn't
1559
- * promote it, so first move after a long-press fires pointercancel and
1560
- * strands the panel. JS-driven scroll is the only model that holds.
1561
- */
1562
- armPaneDragGestureTouch(t, e, i, n) {
1563
- const o = this.windowRef;
1564
- if (!o) return;
1565
- const r = t.clientX, c = t.clientY, a = t.pointerId;
1566
- let l = r, d = c, u = r, h = !1, g = !1, p = !1;
1567
- const f = t.currentTarget instanceof HTMLElement ? t.currentTarget : t.target instanceof HTMLElement ? t.target.closest(".dock-tab") : null, m = n ? this.getStackStripEl(n)?.querySelector(
1568
- "ul.nav.nav-tabs"
1569
- ) ?? null : null, y = () => {
1570
- h || (h = !0, o.clearTimeout(S), o.clearTimeout(L), o.removeEventListener("pointermove", b, !0), o.removeEventListener("pointerup", k, !0), o.removeEventListener("pointercancel", D, !0), p && f && f.removeAttribute("data-pressing"));
1571
- }, b = (v) => {
1572
- if (h || v.pointerId !== a) return;
1573
- if (g) {
1574
- const Q = v.clientX - u;
1575
- u = v.clientX, m && (m.scrollLeft -= Q);
1576
- return;
1577
- }
1578
- l = v.clientX, d = v.clientY;
1579
- const O = v.clientX - r, Y = v.clientY - c;
1580
- if (Math.hypot(O, Y) <= z.TOUCH_LONG_PRESS_SLOP_PX)
1581
- return;
1582
- const V = !!m && m.scrollWidth > m.clientWidth;
1583
- if (Math.abs(O) > Math.abs(Y) && V) {
1584
- o.clearTimeout(S), o.clearTimeout(L), p && f && (f.removeAttribute("data-pressing"), p = !1), g = !0, u = v.clientX, m.scrollLeft -= O, this.clearPendingTabDragMetrics();
1585
- return;
1586
- }
1587
- y(), this.clearPendingTabDragMetrics();
1588
- }, k = (v) => {
1589
- h || v.pointerId !== a || (y(), this.clearPendingTabDragMetrics());
1590
- }, D = (v) => {
1591
- h || v.pointerId !== a || (y(), this.clearPendingTabDragMetrics());
1592
- }, S = o.setTimeout(() => {
1593
- if (h) return;
1594
- y();
1595
- try {
1596
- this.setPointerCapture(a);
1597
- } catch {
1598
- }
1599
- if (typeof navigator < "u" && typeof navigator.vibrate == "function")
1600
- try {
1601
- navigator.vibrate(10);
1602
- } catch {
1603
- }
1604
- const v = new PointerEvent("pointermove", {
1605
- pointerId: a,
1606
- pointerType: "touch",
1607
- isPrimary: !0,
1608
- clientX: l,
1609
- clientY: d,
1610
- bubbles: !1,
1611
- cancelable: !1
1612
- });
1613
- this.beginPaneDrag(v, e, i, n);
1614
- }, z.TOUCH_LONG_PRESS_MS), L = o.setTimeout(() => {
1615
- h || !f || (p = !0, f.setAttribute("data-pressing", "true"));
1616
- }, z.TOUCH_PRESS_FEEDBACK_DELAY_MS);
1617
- o.addEventListener("pointermove", b, !0), o.addEventListener("pointerup", k, !0), o.addEventListener("pointercancel", D, !0);
1618
- }
1619
- beginPaneDrag(t, e, i, n) {
1620
- const {
1621
- path: o,
1622
- floatingIndex: r,
1623
- pointerOffsetX: c,
1624
- pointerOffsetY: a
1625
- } = this.preparePaneDragSource(e, i, n, t), l = n ? this.getStackStripEl(n) : null, d = l ? l.getBoundingClientRect() : null, u = d ? { left: d.left, top: d.top, right: d.right, bottom: d.bottom } : null, h = this.pendingTabDragMetrics;
1626
- if (this.dragState = {
1627
- pane: i,
1628
- sourcePath: R(o),
1629
- floatingIndex: r,
1630
- pointerOffsetX: c,
1631
- pointerOffsetY: a,
1632
- dropHandled: !1,
1633
- sourceStackEl: n,
1634
- sourceHeaderBounds: u,
1635
- startClientX: h && Number.isFinite(h.startClientX) ? h.startClientX : t.clientX,
1636
- startClientY: h && Number.isFinite(h.startClientY) ? h.startClientY : t.clientY
1637
- }, this.lastDragPointerPosition = {
1638
- x: this.dragState.startClientX,
1639
- y: this.dragState.startClientY
1640
- }, this.updateDraggedFloatingPositionFromPoint(t.clientX, t.clientY), this.startDragPointerTracking(), this.markDraggedFloatingWrapper(), this.dragState && this.dragState.floatingIndex !== null && this.dragState.floatingIndex < 0) {
1641
- const g = this.resolveStackLocation(this.dragState.sourcePath);
1642
- if (g && Array.isArray(g.node.panes) && g.node.panes.length === 1) {
1643
- let p = !1;
1644
- if (g.context === "docked")
1645
- p = !0;
1646
- else if (g.context === "floating") {
1647
- const f = this.floatingLayouts[g.index];
1648
- p = (f && f.root ? J(f.root) : 0) > 1;
1649
- }
1650
- p && this.convertPendingTabDragToFloating(t.clientX, t.clientY);
1651
- }
1652
- }
1653
- }
1654
- preparePaneDragSource(t, e, i, n) {
1655
- const o = this.resolveStackLocation(t);
1656
- if (!o || !o.node.panes.includes(e))
1657
- return {
1658
- path: t,
1659
- floatingIndex: null,
1660
- pointerOffsetX: 0,
1661
- pointerOffsetY: 0
1662
- };
1663
- const r = this.pendingTabDragMetrics, c = !!i && Array.from(i.querySelectorAll(".dock-tab")).some(
1664
- (p) => p.dataset.pane && p.dataset.pane !== e
1665
- ), a = o.node.panes.some((p) => p !== e), l = o.context === "floating" ? this.floatingLayouts[o.index] : null, d = l && l.root ? J(l.root) : a ? 2 : 1;
1666
- if (o.context === "floating" && !!l && !a && !c && d <= 1) {
1667
- if (l) {
1668
- l.activePane = e, this.updateFloatingWindowTitle(o.index);
1669
- const p = this.getFloatingWrapper(o.index);
1670
- p && this.promoteFloatingPane(o.index, p);
1671
- const f = this.getBoundingClientRect(), m = r && Number.isFinite(r.pointerOffsetX) && Number.isFinite(r.left) && Number.isFinite(l.bounds.left) ? r.pointerOffsetX + (r.left - l.bounds.left) : Number.isFinite(n.clientX) && Number.isFinite(l.bounds.left) ? n.clientX - f.left - l.bounds.left : l.bounds.width / 2, y = r && Number.isFinite(r.pointerOffsetY) && Number.isFinite(r.top) && Number.isFinite(l.bounds.top) ? r.pointerOffsetY + (r.top - l.bounds.top) : Number.isFinite(n.clientY) && Number.isFinite(l.bounds.top) ? n.clientY - f.top - l.bounds.top : l.bounds.height / 2;
1672
- return {
1673
- path: t,
1674
- floatingIndex: o.index,
1675
- pointerOffsetX: m,
1676
- pointerOffsetY: y
1677
- };
1678
- }
1679
- return {
1680
- path: t,
1681
- floatingIndex: null,
1682
- pointerOffsetX: 0,
1683
- pointerOffsetY: 0
1684
- };
1685
- }
1686
- const h = r && Number.isFinite(r.pointerOffsetX) ? r.pointerOffsetX : 0, g = r && Number.isFinite(r.pointerOffsetY) ? r.pointerOffsetY : 0;
1687
- return {
1688
- path: t,
1689
- floatingIndex: -1,
1690
- pointerOffsetX: h,
1691
- pointerOffsetY: g
1692
- };
1693
- }
1694
- endPaneDrag() {
1695
- this.clearPendingDragEndTimeout(), this.clearHeaderDragPlaceholder(), this.clearDraggedFloatingWrapperMarkers();
1696
- const t = this.dragState;
1697
- this.dragState = null, this.hideDropIndicator(), this.stopDragPointerTracking(), this.lastDragPointerPosition = null, t && t.floatingIndex !== null && !t.dropHandled && this.dispatchLayoutChanged();
1698
- }
1699
- updateDraggedFloatingPositionFromPoint(t, e) {
1700
- if (!this.dragState || !Number.isFinite(t) || !Number.isFinite(e))
1701
- return;
1702
- if (this.dragState.floatingIndex !== null && this.dragState.floatingIndex < 0) {
1703
- const u = this.dragState.sourceHeaderBounds, h = this.dragState.startClientX ?? t, g = this.dragState.startClientY ?? e, p = Math.hypot(t - h, e - g), f = 8;
1704
- let m = !0;
1705
- const y = u ? j(u, t, e) : !0, b = this.isPointerOverSourceHeader(t, e);
1706
- m = y || b, !m && p > f && this.convertPendingTabDragToFloating(t, e);
1707
- }
1708
- this.updatePaneDragDropTargetFromPoint(t, e);
1709
- const { floatingIndex: i, pointerOffsetX: n, pointerOffsetY: o } = this.dragState;
1710
- if (i === null || i < 0)
1711
- return;
1712
- const r = this.floatingLayouts[i];
1713
- if (!r)
1714
- return;
1715
- const c = this.getBoundingClientRect(), a = t - c.left - n, l = e - c.top - o;
1716
- r.bounds.left = a, r.bounds.top = l;
1717
- const d = this.getFloatingWrapper(i);
1718
- d && (d.style.left = `${a}px`, d.style.top = `${l}px`);
1719
- }
1720
- updatePaneDragDropTargetFromPoint(t, e) {
1721
- if (!this.dragState)
1722
- return;
1723
- const i = this.findStackAtPoint(t, e), n = i ? P(i.dataset.path) : null;
1724
- if (!i || !n) {
1725
- this.dropJoystick.dataset.visible !== "true" && this.hideDropIndicator(), this.clearHeaderDragPlaceholder();
1726
- return;
1727
- }
1728
- if (this.dropJoystickTarget && this.dropJoystickTarget !== i && (delete this.dropJoystick.dataset.zone, this.updateDropJoystickActiveZone(null)), this.dragState && this.dragState.floatingIndex !== null && this.dragState.floatingIndex < 0 && n && B(n, this.dragState.sourcePath)) {
1729
- const c = !!this.dragState.sourceHeaderBounds && j(this.dragState.sourceHeaderBounds, t, e), a = this.isPointerOverSourceHeader(t, e);
1730
- if (c || a) {
1731
- this.ensureHeaderDragPlaceholder(i, this.dragState.pane);
1732
- const l = this.computeHeaderInsertIndex(i, t);
1733
- this.dragState.liveReorderIndex !== l && (this.updateHeaderDragPlaceholderPosition(i, l), this.dragState.liveReorderIndex = l), this.hideDropIndicator();
1734
- return;
1735
- }
1736
- }
1737
- this.clearHeaderDragPlaceholder();
1738
- const o = this.findDropZoneByPoint(t, e), r = this.computeDropZone(i, { clientX: t, clientY: e }, o);
1739
- this.showDropIndicator(i, r);
1740
- }
1741
- // Returns true when the pointer is currently over the source stack's header (tab strip).
1742
- // The strip lives inside the mp-tab-control's shadow as `.tsc`, so we test
1743
- // bounds directly rather than using elementsFromPoint(/contains) which won't
1744
- // pierce the shadow boundary cleanly.
1745
- isPointerOverSourceHeader(t, e) {
1746
- const i = this.dragState;
1747
- if (!i)
1748
- return !1;
1749
- const n = i.sourceStackEl ?? null, o = n ? this.getStackStripEl(n) : null;
1750
- if (!o)
1751
- return !0;
1752
- const r = o.getBoundingClientRect();
1753
- return t >= r.left && t <= r.right && e >= r.top && e <= r.bottom;
1754
- }
1755
- // Ensure a placeholder tab exists during in-header drag and hide the real dragged tab visually.
1756
- // Operates on the mp-tab-control stack: the dragged content div gets `data-hidden`
1757
- // (mp-tab-control then skips its tab in the strip), and a placeholder header+content
1758
- // pair is appended as light-DOM children of the stack. mp-tab-control's mutation
1759
- // observer picks up the change and renders the placeholder as a tab.
1760
- ensureHeaderDragPlaceholder(t, e) {
1761
- if (t.tagName !== "MP-TAB-CONTROL" || this.dragState?.placeholderHeader === t && this.dragState.placeholderEl)
1762
- return;
1763
- const i = this.stackChildForPane(t, "dock-tab", e), n = this.stackChildForPane(t, "dock-stack__pane", e);
1764
- if (!i || !n) return;
1765
- const o = this.windowRef ? this.windowRef.getComputedStyle(i) : globalThis.getComputedStyle(i), r = parseFloat(o.paddingLeft) + parseFloat(o.paddingRight), c = Math.max(
1766
- 0,
1767
- i.offsetWidth - r
1768
- );
1769
- n.setAttribute("data-hidden", "");
1770
- const a = "__dock-placeholder__", l = this.documentRef.createElement("span");
1771
- l.setAttribute("slot", `${a}-header`), l.classList.add("dock-tab"), l.dataset.placeholder = "true", l.dataset.tabId = a, l.setAttribute("aria-hidden", "true"), l.textContent = i.textContent, l.style.display = "inline-block", l.style.minWidth = `${c}px`, l.style.opacity = "0.5";
1772
- const d = this.documentRef.createElement("div");
1773
- d.setAttribute("slot", `${a}-content`), d.classList.add("dock-stack__pane"), d.dataset.placeholder = "true", t.insertBefore(l, i), t.insertBefore(d, n), this.dragState && (this.dragState.placeholderHeader = t, this.dragState.placeholderEl = l);
1774
- }
1775
- /**
1776
- * The slotted children of a stack — the header spans, pane hosts and drag
1777
- * placeholders the dock owns. Every lookup among them walks this list and
1778
- * matches on the dataset instead of building a `:scope > [data-…="…"]`
1779
- * selector: an arbitrary pane name then never has to survive CSS escaping,
1780
- * and nothing depends on `CSS.escape` or `:scope`, neither of which every
1781
- * DOM implementation provides (jsdom has no `CSS.escape`, and matches
1782
- * nothing for `:scope >` here). Same reasoning as verifyProjectionSlots.
1783
- */
1784
- stackChildren(t) {
1785
- return Array.from(t.children).filter((e) => e instanceof HTMLElement);
1786
- }
1787
- /** The direct child of `stack` carrying `className` for `pane`. */
1788
- stackChildForPane(t, e, i) {
1789
- return this.stackChildren(t).find(
1790
- (n) => n.classList.contains(e) && n.dataset.pane === i
1791
- ) ?? null;
1792
- }
1793
- /** The drag placeholder of `className` (header span or pane host) in `stack`. */
1794
- stackPlaceholder(t, e) {
1795
- return this.stackChildren(t).find(
1796
- (i) => i.classList.contains(e) && i.dataset.placeholder === "true"
1797
- ) ?? null;
1798
- }
1799
- // Move the placeholder to the computed target index within the strip.
1800
- // We reorder light-DOM children (header span + matching content div); the
1801
- // mp-tab-control then re-renders the strip in the new order on slotchange.
1802
- updateHeaderDragPlaceholderPosition(t, e) {
1803
- if (t.tagName !== "MP-TAB-CONTROL") return;
1804
- const i = this.dragState?.placeholderEl ?? null;
1805
- if (!i) return;
1806
- const n = this.dragState?.pane ?? null, o = this.stackChildren(t).filter(
1807
- (l) => l.classList.contains("dock-tab") && l !== i && (!n || l.dataset.pane !== n)
1808
- ), r = Math.max(0, Math.min(e, o.length)), c = o[r] ?? null;
1809
- t.insertBefore(i, c);
1810
- const a = this.stackPlaceholder(t, "dock-stack__pane");
1811
- a && i.nextElementSibling !== a && t.insertBefore(a, i.nextElementSibling);
1812
- }
1813
- // Remove placeholder and restore the dragged tab's visibility.
1814
- clearHeaderDragPlaceholder() {
1815
- const t = this.dragState?.placeholderEl ?? null, e = this.dragState?.placeholderHeader ?? null;
1816
- e && (this.dragState?.pane && this.stackChildForPane(e, "dock-stack__pane", this.dragState.pane)?.removeAttribute("data-hidden"), this.stackPlaceholder(e, "dock-stack__pane")?.remove()), t && t.parentElement && t.parentElement.removeChild(t), this.dragState && (this.dragState.placeholderEl = null, this.dragState.placeholderHeader = null);
1817
- }
1818
- startDragPointerTracking() {
1819
- if (this.dragPointerTrackingActive)
1820
- return;
1821
- this.lastDragPointerPosition = null;
1822
- const t = this.windowRef;
1823
- t?.addEventListener("pointermove", this.onDragPointerMove, !0), t?.addEventListener("pointerup", this.onDragPointerUp, !0), t?.addEventListener("pointercancel", this.onDragPointerCancel, !0), this.dragPointerTrackingActive = !0;
1824
- }
1825
- stopDragPointerTracking() {
1826
- if (!this.dragPointerTrackingActive)
1827
- return;
1828
- const t = this.windowRef;
1829
- t?.removeEventListener("pointermove", this.onDragPointerMove, !0), t?.removeEventListener("pointerup", this.onDragPointerUp, !0), t?.removeEventListener("pointercancel", this.onDragPointerCancel, !0), this.dragPointerTrackingActive = !1, this.lastDragPointerPosition = null, this.clearPendingDragEndTimeout();
1830
- }
1831
- onDragPointerMove(t) {
1832
- if (!this.dragState) {
1833
- this.stopDragPointerTracking();
1834
- return;
1835
- }
1836
- this.lastDragPointerPosition = { x: t.clientX, y: t.clientY }, this.updateDraggedFloatingPositionFromPoint(t.clientX, t.clientY);
1837
- }
1838
- onDragPointerUp(t) {
1839
- if (this.dragState) {
1840
- const e = Number.isFinite(t.clientX) ? t.clientX : this.lastDragPointerPosition?.x, i = Number.isFinite(t.clientY) ? t.clientY : this.lastDragPointerPosition?.y;
1841
- e !== void 0 && i !== void 0 && this.finalizeDropFromPoint(e, i);
1842
- }
1843
- this.handleDragPointerUpCommon();
1844
- }
1845
- onDragPointerCancel() {
1846
- this.handleDragPointerUpCommon();
1847
- }
1848
- // Convert a currently in-header tab drag into a floating window
1849
- convertPendingTabDragToFloating(t, e) {
1850
- if (!this.dragState)
1851
- return;
1852
- const i = this.dragState;
1853
- if (i.floatingIndex !== null && i.floatingIndex >= 0)
1854
- return;
1855
- this.clearHeaderDragPlaceholder();
1856
- const n = this.resolveStackLocation(i.sourcePath);
1857
- if (!n)
1858
- return;
1859
- const o = i.pane, r = i.sourceStackEl ?? null, c = this.getBoundingClientRect(), a = r?.getBoundingClientRect() ?? null, l = this.pendingTabDragMetrics, d = 320, u = 240, h = l && Number.isFinite(l.width) && l.width > 0 ? l.width : a && Number.isFinite(a.width) ? a.width : d, g = l && Number.isFinite(l.height) && l.height > 0 ? l.height : a && Number.isFinite(a.height) ? a.height : u, p = 1, f = l && Number.isFinite(l.left) ? l.left - p : Number.isFinite(t) ? t - c.left - h / 2 : 0, m = l && Number.isFinite(l.top) ? l.top - p : Number.isFinite(e) ? e - c.top - g / 2 : 0, y = T(
1860
- { left: f, top: m, width: h, height: g },
1861
- this.getHostSize()
1862
- ), b = Number.isFinite(t) ? t - c.left - y.left : y.width / 2, k = Number.isFinite(e) ? e - c.top - y.top : y.height / 2;
1863
- this.removePaneFromLocation(n, o);
1864
- const S = {
1865
- bounds: y,
1866
- root: {
1867
- kind: "stack",
1868
- panes: [o],
1869
- activePane: o
1870
- },
1871
- activePane: o
1872
- };
1873
- this.floatingLayouts.push(S);
1874
- const L = this.floatingLayouts.length - 1;
1875
- this.renderLayout();
1876
- const v = this.getFloatingWrapper(L);
1877
- v && this.promoteFloatingPane(L, v), this.liveAnnouncer.announce(`Pane ${this.titles[o] ?? o} torn off into a floating window.`), i.sourcePath = { type: "floating", index: L, segments: [] }, i.floatingIndex = L, i.pointerOffsetX = b, i.pointerOffsetY = k, this.markDraggedFloatingWrapper(), this.dispatchLayoutChanged();
1878
- }
1879
- // Toggle data-dragging on the floating wrapper currently associated with
1880
- // the active pane drag (dragState.floatingIndex), if any. Used to make the
1881
- // wrapper transparent to elementsFromPoint so drop zones can be shown on
1882
- // stacks underneath. clearDraggedFloatingWrapper() is the inverse.
1883
- markDraggedFloatingWrapper() {
1884
- const t = this.dragState?.floatingIndex;
1885
- if (t == null || t < 0) return;
1886
- const e = this.getFloatingWrapper(t);
1887
- e && (e.dataset.dragging = "true");
1888
- }
1889
- clearDraggedFloatingWrapperMarkers() {
1890
- const t = this.floatingLayerEl;
1891
- t && t.querySelectorAll('.dock-floating[data-dragging="true"]').forEach((e) => {
1892
- delete e.dataset.dragging;
1893
- });
1894
- }
1895
- // Compute the intended tab insert index within a stack's strip based on pointer X.
1896
- // Uses the rendered tab buttons inside mp-tab-control's shadow strip for geometry;
1897
- // the dragged tab is hidden during drag (its content has data-hidden), and the
1898
- // placeholder button (if present) gives us the dragged-position reference.
1899
- computeHeaderInsertIndex(t, e) {
1900
- if (t.tagName !== "MP-TAB-CONTROL") return 0;
1901
- const i = this.getStackTabButtons(t);
1902
- if (i.length === 0)
1903
- return 0;
1904
- const o = this.stackPlaceholder(t, "dock-tab")?.dataset.tabId, r = o ? i.find((f) => f.id === `${o}-header-button`) ?? null : null, c = this.dragState?.pane ?? null, a = c ? this.stackChildForPane(t, "dock-tab", c)?.dataset.tabId ?? null : null, l = a ? i.find((f) => f.id === `${a}-header-button`) ?? null : null, d = i.filter(
1905
- (f) => f !== r && f !== l
1906
- );
1907
- if (d.length === 0)
1908
- return 0;
1909
- const u = r ? r.getBoundingClientRect() : null, g = !!u && Number.isFinite(u.width) && u.width > 0 && u ? u.left + u.width / 2 : null, p = d.map((f) => {
1910
- const m = f.getBoundingClientRect();
1911
- return m.left + m.width / 2;
1912
- });
1913
- return kt(p, e, g);
1914
- }
1915
- reorderPaneInLocationAtIndex(t, e, i) {
1916
- const n = t.node.panes, o = n.indexOf(e);
1917
- if (o === -1)
1918
- return;
1919
- const r = Math.max(0, Math.min(i, n.length - 1));
1920
- if (r !== o && (n.splice(o, 1), n.splice(r, 0, e), t.node.activePane = e, t.context === "floating")) {
1921
- const c = this.floatingLayouts[t.index];
1922
- c && (c.activePane = e);
1923
- }
1924
- }
1925
- // Commit a drop using current pointer coordinates and joystick state
1926
- finalizeDropFromPoint(t, e) {
1927
- if (!this.dragState)
1928
- return;
1929
- const i = this.findStackAtPoint(t, e), n = i ? P(i.dataset.path) : null, o = this.dropJoystick.dataset.visible === "true", r = P(this.dropJoystick.dataset.path), c = this.dropJoystickTarget, a = c ? P(c.dataset.path) : null, l = (o ? r ?? a : null) ?? n, d = this.dropJoystick.dataset.zone, u = this.isDropZone(d) ? d : i ? this.computeDropZone(i, { clientX: t, clientY: e }, null) : null;
1930
- if (this.dragState && this.dragState.floatingIndex !== null && this.dragState.floatingIndex < 0 && i && l && n && B(n, this.dragState.sourcePath) && (!u || u === "center")) {
1931
- const h = this.resolveStackLocation(l);
1932
- if (h) {
1933
- const g = this.computeHeaderInsertIndex(i, t);
1934
- this.reorderPaneInLocationAtIndex(h, this.dragState.pane, g), this.renderLayout(), this.dispatchLayoutChanged(), this.dragState.dropHandled = !0;
1935
- return;
1936
- }
1937
- }
1938
- l && this.isDropZone(u) && (this.handleDrop(l, u), this.dragState.dropHandled = !0);
1939
- }
1940
- clearPendingDragEndTimeout() {
1941
- if (this.pendingDragEndTimeout !== null) {
1942
- const t = this.windowRef;
1943
- t && typeof this.pendingDragEndTimeout == "number" ? t.clearTimeout(this.pendingDragEndTimeout) : globalThis.clearTimeout(this.pendingDragEndTimeout), this.pendingDragEndTimeout = null;
1944
- }
1945
- }
1946
- scheduleDeferredDragEnd() {
1947
- if (this.pendingDragEndTimeout !== null)
1948
- return;
1949
- const t = () => {
1950
- if (this.pendingDragEndTimeout = null, this.hideDropIndicator(), !this.dragState) {
1951
- this.clearPendingTabDragMetrics();
1952
- return;
1953
- }
1954
- this.endPaneDrag(), this.clearPendingTabDragMetrics();
1955
- }, e = this.windowRef;
1956
- this.pendingDragEndTimeout = e ? e.setTimeout(t, 0) : setTimeout(t, 0);
1957
- }
1958
- handleDrop(t, e) {
1959
- if (!this.dragState || !t)
1960
- return;
1961
- const { pane: i, sourcePath: n } = this.dragState, o = this.resolveStackLocation(n), r = this.resolveStackLocation(t);
1962
- if (!r && t.type === "docked" && !this.rootLayout) {
1963
- if (!o)
1964
- return;
1965
- this.removePaneFromLocation(o, i, !0);
1966
- const a = {
1967
- kind: "stack",
1968
- panes: [i],
1969
- activePane: i
1970
- };
1971
- this.rootLayout = a, this.normalizeAllLayouts(), this.renderLayout(), this.dispatchLayoutChanged(), this.dragState && (this.dragState.dropHandled = !0);
1972
- return;
1973
- }
1974
- if (!o || !r)
1975
- return;
1976
- if (e === "center" && B(n, t)) {
1977
- if (!o.node.panes.includes(i))
1978
- return;
1979
- this.reorderPaneInLocation(o, i), this.normalizeAllLayouts(), this.renderLayout(), this.dispatchLayoutChanged(), this.dragState && (this.dragState.dropHandled = !0);
1980
- return;
1981
- }
1982
- if (this.removePaneFromLocation(o, i, !0), e === "center") {
1983
- this.addPaneToLocation(r, i), this.setActivePaneForLocation(r, i), this.normalizeAllLayouts(), this.renderLayout(), this.dispatchLayoutChanged(), this.dragState && (this.dragState.dropHandled = !0);
1984
- return;
1985
- }
1986
- const c = {
1987
- kind: "stack",
1988
- panes: [i],
1989
- activePane: i
1990
- };
1991
- if (r.context === "docked")
1992
- this.rootLayout = I(this.rootLayout, r.node, c, e);
1993
- else {
1994
- const a = this.floatingLayouts[r.index];
1995
- if (!a) {
1996
- this.normalizeAllLayouts(), this.renderLayout(), this.dispatchLayoutChanged();
1997
- return;
1998
- }
1999
- a.root = I(a.root, r.node, c, e), a.activePane = i;
2000
- }
2001
- this.normalizeAllLayouts(), this.renderLayout(), this.dispatchLayoutChanged(), this.dragState && (this.dragState.dropHandled = !0);
2002
- }
2003
- handleFloatingStackDrop(t, e, i) {
2004
- const n = this.floatingLayouts[t];
2005
- if (!n || !n.root)
2006
- return !1;
2007
- const o = this.resolveStackLocation(e);
2008
- if (!o && e.type === "docked" && !this.rootLayout)
2009
- return this.rootLayout = F(n.root), this.removeFloatingAt(t), this.normalizeAllLayouts(), this.renderLayout(), this.dispatchLayoutChanged(), !0;
2010
- if (!o || o.context === "floating" && o.index === t)
2011
- return !1;
2012
- if (i === "center") {
2013
- const r = _(n.root);
2014
- if (r.length === 0)
2015
- return !1;
2016
- r.forEach((a) => {
2017
- this.addPaneToLocation(o, a);
2018
- });
2019
- const c = n.activePane && r.includes(n.activePane) ? n.activePane : E(n.root) ?? r[0];
2020
- return c && this.setActivePaneForLocation(o, c), this.removeFloatingAt(t), this.normalizeAllLayouts(), this.renderLayout(), this.dispatchLayoutChanged(), !0;
2021
- }
2022
- if (o.context === "floating") {
2023
- const r = this.floatingLayouts[o.index];
2024
- return r ? (r.root = I(r.root, o.node, n.root, i), r.activePane = n.activePane ?? E(n.root) ?? void 0, this.removeFloatingAt(t), this.normalizeAllLayouts(), this.renderLayout(), this.dispatchLayoutChanged(), !0) : !1;
2025
- }
2026
- return this.rootLayout = I(this.rootLayout, o.node, n.root, i), this.removeFloatingAt(t), this.normalizeAllLayouts(), this.renderLayout(), this.dispatchLayoutChanged(), !0;
2027
- }
2028
- computeDropZone(t, e, i) {
2029
- const n = this.isDropZone(i) ? i : null;
2030
- if (n)
2031
- return this.updateDropJoystickActiveZone(n), n;
2032
- const o = e && Number.isFinite(e.clientX) && Number.isFinite(e.clientY) ? this.findDropZoneByPoint(e.clientX, e.clientY) : null;
2033
- if (o)
2034
- return this.updateDropJoystickActiveZone(o), o;
2035
- if (this.dropJoystickTarget === t) {
2036
- const r = this.dropJoystick.dataset.zone;
2037
- if (this.isDropZone(r))
2038
- return this.updateDropJoystickActiveZone(r), r;
2039
- this.updateDropJoystickActiveZone(null);
2040
- }
2041
- return null;
2042
- }
2043
- extractDropZoneFromEvent(t) {
2044
- if (!t)
2045
- return null;
2046
- if (typeof t.composedPath == "function") {
2047
- const e = t.composedPath(), i = this.findDropZoneInTargets(e);
2048
- if (i)
2049
- return i;
2050
- }
2051
- if ("clientX" in t && "clientY" in t) {
2052
- const e = t, i = this.findDropZoneByPoint(e.clientX, e.clientY);
2053
- if (i)
2054
- return i;
2055
- }
2056
- return null;
2057
- }
2058
- handleDragPointerUpCommon() {
2059
- if (!this.dragState) {
2060
- this.stopDragPointerTracking();
2061
- return;
2062
- }
2063
- this.scheduleDeferredDragEnd();
2064
- }
2065
- findDropZoneInTargets(t) {
2066
- for (const e of t)
2067
- if (e instanceof HTMLElement && e.classList.contains("dock-drop-joystick__button")) {
2068
- const i = e.dataset?.zone;
2069
- if (this.isDropZone(i))
2070
- return i;
2071
- }
2072
- return null;
2073
- }
2074
- findDropZoneByPoint(t, e) {
2075
- if (!this.dropJoystickButtons || this.dropJoystick.dataset.visible !== "true" || !this.dropJoystickTarget)
2076
- return null;
2077
- const i = this.elementsAt(t, e).filter(
2078
- (n) => n instanceof HTMLElement && this.dropJoystickButtons.includes(n) && n.dataset.hidden !== "true"
2079
- );
2080
- return this.findDropZoneInTargets(i);
2081
- }
2082
- updateDropJoystickActiveZone(t) {
2083
- const i = this.dropJoystick.dataset.visible === "true" ? this.dropJoystick.dataset.zone : void 0, n = t ?? (this.isDropZone(i) ? i : null);
2084
- this.dropJoystickButtons.forEach((o) => {
2085
- n !== null && o.dataset.zone === n ? o.dataset.active = "true" : delete o.dataset.active;
2086
- }), n ? this.dropJoystick.dataset.zone = n : delete this.dropJoystick.dataset.zone;
2087
- }
2088
- isDropZone(t) {
2089
- return t === "left" || t === "right" || t === "top" || t === "bottom" || t === "center";
2090
- }
2091
- showDropIndicator(t, e) {
2092
- const i = P(t.dataset.path), n = this.dragState?.sourcePath ?? null;
2093
- if (i && n && vt(i, n))
2094
- return;
2095
- const o = t.getBoundingClientRect(), r = this.getBoundingClientRect(), c = this.dropIndicator, a = this.dropJoystick;
2096
- a.hidden = !1;
2097
- const l = P(t.dataset.path);
2098
- let d = 100;
2099
- l && l.type === "floating" && (d = H(this.floatingLayouts[l.index], l.index) + 100), c.style.zIndex = String(d), a.style.zIndex = String(d + 1);
2100
- let u = o.left - r.left, h = o.top - r.top, g = o.width, p = o.height;
2101
- const f = 0.5;
2102
- if (e) {
2103
- switch (e) {
2104
- case "left":
2105
- g = o.width * f;
2106
- break;
2107
- case "right":
2108
- g = o.width * f, u += o.width * (1 - f);
2109
- break;
2110
- case "top":
2111
- p = o.height * f;
2112
- break;
2113
- case "bottom":
2114
- p = o.height * f, h += o.height * (1 - f);
2115
- break;
2116
- }
2117
- c.style.left = `${u}px`, c.style.top = `${h}px`, c.style.width = `${g}px`, c.style.height = `${p}px`, c.dataset.visible = "true";
2118
- } else
2119
- c.dataset.visible = "false";
2120
- a.style.left = `${o.left - r.left + o.width / 2}px`, a.style.top = `${o.top - r.top + o.height / 2}px`, a.dataset.visible = "true", this.dropJoystick.style.display = "grid", a.dataset.path = t.dataset.path ?? "";
2121
- const m = this.dropJoystickTarget && this.dropJoystickTarget !== t;
2122
- this.dropJoystickTarget = t, m && delete this.dropJoystick.dataset.zone;
2123
- const y = !this.rootLayout && (t === this.dockedEl || i && i.type === "docked" && i.segments.length === 0), b = Array.from(this.dropJoystick.querySelectorAll(".dock-drop-joystick__spacer"));
2124
- y ? (b.forEach((k) => {
2125
- k.style.display = "";
2126
- }), this.dropJoystickButtons.forEach((k) => {
2127
- k.dataset.zone === "center" ? (k.style.visibility = "", k.style.pointerEvents = "", delete k.dataset.hidden, k.style.display = "") : (k.style.visibility = "hidden", k.style.pointerEvents = "none", k.dataset.hidden = "true", k.style.display = "");
2128
- }), this.dropJoystick.style.gridTemplateColumns = "", this.dropJoystick.style.gridTemplateRows = "") : (this.dropJoystickButtons.forEach((k) => {
2129
- k.style.visibility = "", k.style.pointerEvents = "", delete k.dataset.hidden, k.style.display = "";
2130
- }), b.forEach((k) => k.style.display = ""), this.dropJoystick.style.gridTemplateColumns = "", this.dropJoystick.style.gridTemplateRows = ""), this.updateDropJoystickActiveZone(e);
2131
- }
2132
- hideDropIndicator() {
2133
- this.dropIndicator.dataset.visible = "false", this.dropJoystick.dataset.visible = "false", this.dropJoystick.style.display = "none", delete this.dropJoystick.dataset.path, this.dropJoystickTarget = null, this.updateDropJoystickActiveZone(null), this.dropJoystickButtons.forEach((t) => {
2134
- t.style.display = "", t.style.visibility = "", t.style.pointerEvents = "", delete t.dataset.hidden;
2135
- }), Array.from(this.dropJoystick.querySelectorAll(".dock-drop-joystick__spacer")).forEach((t) => t.style.display = ""), this.dropJoystick.style.gridTemplateColumns = "", this.dropJoystick.style.gridTemplateRows = "";
2136
- }
2137
- /**
2138
- * The dock's single hit-test: which of its own shadow elements lie under a
2139
- * client point, topmost first. Every "what is the pointer over" question —
2140
- * the target stack, the joystick button, the empty docked surface — is
2141
- * answered from this list, so the answers can never disagree with each
2142
- * other, and a test can say what is under the pointer in one place without
2143
- * inventing any geometry.
2144
- */
2145
- elementsAt(t, e) {
2146
- return this.shadowRoot?.elementsFromPoint(t, e) ?? [];
2147
- }
2148
- findStackAtPoint(t, e) {
2149
- const i = this.elementsAt(t, e), n = this.findStackInTargets(i);
2150
- return n || (!this.rootLayout && i.includes(this.dockedEl) ? this.dockedEl : null);
2151
- }
2152
- findStackInTargets(t) {
2153
- for (const e of t)
2154
- if (e instanceof HTMLElement) {
2155
- if (e.classList.contains("dock-stack"))
2156
- return e;
2157
- if (this.dropJoystickTarget && (e.classList.contains("dock-drop-joystick") || e.classList.contains("dock-drop-joystick__button") || e.classList.contains("dock-drop-joystick__spacer")))
2158
- return this.dropJoystickTarget;
2159
- }
2160
- return null;
2161
- }
2162
- activatePane(t, e, i) {
2163
- if (t.dataset.activePane = e, t.tagName === "MP-TAB-CONTROL") {
2164
- const r = this.stackChildForPane(t, "dock-tab", e)?.dataset.tabId;
2165
- r && t.setAttribute("active-tab", r);
2166
- }
2167
- const n = this.resolveStackLocation(i);
2168
- if (n) {
2169
- if (n.node.activePane = e, i.type === "floating") {
2170
- const o = this.floatingLayouts[i.index];
2171
- o && (o.activePane = e), this.updateFloatingWindowTitle(i.index);
2172
- }
2173
- this.dispatchLayoutChanged();
2174
- }
2175
- }
2176
- // Layer identity of a splitter in the rendered shadow tree. Splitters inside
2177
- // floating pane N are nested under `.dock-floating[data-path="f:N"]`;
2178
- // docked-layer splitters have no such ancestor. Two splitters share a layer
2179
- // iff their layer keys match — used by renderIntersectionHandles() to reject
2180
- // coincidental cross-layer (h, v) pairs that would otherwise produce a
2181
- // phantom intersection glyph between unrelated splitters.
2182
- splitterLayerKey(t) {
2183
- const e = t.closest(".dock-floating");
2184
- return e ? e.dataset.path ?? "f:?" : "d";
2185
- }
2186
- resolveStackLocation(t) {
2187
- if (t.type === "floating") {
2188
- const i = this.floatingLayouts[t.index];
2189
- if (!i || !i.root)
2190
- return null;
2191
- const n = M(i.root, t.segments);
2192
- return !n || n.kind !== "stack" ? null : { context: "floating", index: t.index, path: [...t.segments], node: n };
2193
- }
2194
- const e = M(this.rootLayout, t.segments);
2195
- return !e || e.kind !== "stack" ? null : { context: "docked", path: [...t.segments], node: e };
2196
- }
2197
- removePaneFromLocation(t, e, i = !1) {
2198
- if (t.context === "docked") {
2199
- const n = ht(t.node, e);
2200
- return n && !i && this.normalizeAllLayouts(), n;
2201
- }
2202
- return this.removePaneFromFloating(t.index, t.path, e, i);
2203
- }
2204
- addPaneToLocation(t, e) {
2205
- const i = t.node.panes, n = i.indexOf(e);
2206
- n !== -1 && i.splice(n, 1), i.push(e);
2207
- }
2208
- setActivePaneForLocation(t, e) {
2209
- if (t.node.activePane = e, t.context === "floating") {
2210
- const i = this.floatingLayouts[t.index];
2211
- i && (i.activePane = e);
2212
- }
2213
- }
2214
- reorderPaneInLocation(t, e) {
2215
- const i = t.node.panes, n = i.indexOf(e);
2216
- if (n !== -1 && (i.splice(n, 1), i.push(e), t.node.activePane = e, t.context === "floating")) {
2217
- const o = this.floatingLayouts[t.index];
2218
- o && (o.activePane = e);
2219
- }
2220
- }
2221
- removeFloatingAt(t) {
2222
- t < 0 || t >= this.floatingLayouts.length || this.floatingLayouts.splice(t, 1);
2223
- }
2224
- /**
2225
- * Keyboard handler on the dock root, registered in capture phase so it
2226
- * runs before mp-tab-control's shadow-internal handlers swallow Arrow /
2227
- * Home / End / Enter. M opens move mode on a focused tab; subsequent
2228
- * letter keys (T/R/B/L/F) commit the move, arrows cycle enumerated drop
2229
- * targets and Enter commits the highlighted one; Escape cancels.
2230
- */
2231
- onRootKeyDown(t) {
2232
- if (this.paneMoveMode) {
2233
- this.handlePaneMoveModeKey(t);
2234
- return;
2235
- }
2236
- if (t.altKey || t.ctrlKey || t.metaKey || t.key !== "m" && t.key !== "M") return;
2237
- const e = this.findFocusedPaneOrigin();
2238
- if (!e) return;
2239
- t.preventDefault(), t.stopPropagation(), this.paneMoveMode = e, this.paneMoveCandidateIndex = null;
2240
- const i = this.titles[e.paneName] ?? e.paneName;
2241
- this.liveAnnouncer.announce(
2242
- `Move mode for pane ${i}. Press T, R, B, or L to dock to top, right, bottom, or left of the current stack, F to float, arrow keys to cycle drop targets, Enter to commit, Escape to cancel.`
2243
- );
2244
- }
2245
- /**
2246
- * Cancel move mode when focus leaves the dock entirely. Moves WITHIN the
2247
- * dock (tab to tab, tab to pane content) keep it armed — the commit always
2248
- * applies to the pane captured at arm time, which the announcement named.
2249
- */
2250
- onRootFocusOut(t) {
2251
- if (!this.paneMoveMode) return;
2252
- const e = t.relatedTarget instanceof Node ? t.relatedTarget : null;
2253
- e && this.isWithinDock(e) || (this.clearPaneMoveState(), this.liveAnnouncer.announce("Move cancelled."));
2254
- }
2255
- /** Composed-tree containment: true for shadow content AND slotted light DOM. */
2256
- isWithinDock(t) {
2257
- for (let e = t; e; ) {
2258
- if (e === this) return !0;
2259
- e = e instanceof ShadowRoot ? e.host : e.parentNode;
2260
- }
2261
- return !1;
2262
- }
2263
- handlePaneMoveModeKey(t) {
2264
- if (t.key === "Escape") {
2265
- t.preventDefault(), t.stopPropagation(), this.clearPaneMoveState(), this.liveAnnouncer.announce("Move cancelled.");
2266
- return;
2267
- }
2268
- const e = t.composedPath()[0];
2269
- if (e instanceof HTMLElement && (e.isContentEditable || ["INPUT", "TEXTAREA", "SELECT"].includes(e.tagName)))
2270
- return;
2271
- const n = {
2272
- ArrowRight: 1,
2273
- ArrowDown: 1,
2274
- ArrowLeft: -1,
2275
- ArrowUp: -1
2276
- }[t.key];
2277
- if (n) {
2278
- t.preventDefault(), t.stopPropagation(), this.cyclePaneMoveCandidate(n);
2279
- return;
2280
- }
2281
- if (t.key === "Enter") {
2282
- if (this.paneMoveCandidateIndex === null) return;
2283
- t.preventDefault(), t.stopPropagation(), this.commitHighlightedPaneMoveCandidate();
2284
- return;
2285
- }
2286
- const o = t.key.toLowerCase(), c = {
2287
- t: "top",
2288
- r: "right",
2289
- b: "bottom",
2290
- l: "left",
2291
- f: "float"
2292
- }[o];
2293
- c && (t.preventDefault(), t.stopPropagation(), c === "float" ? this.commitPaneMoveAsFloat() : this.commitPaneMoveToZone(c));
2294
- }
2295
- /**
2296
- * Enumerated keyboard drop targets, in cycle order: every docked leaf stack
2297
- * except the one the moving pane currently sits in (T/R/B/L already split
2298
- * that one), each contributing its four side zones, then a single `float`
2299
- * candidate last. Rebuilt on every cycle step so it can never describe a
2300
- * layout that has since changed.
2301
- *
2302
- * The identity carried forward is `data-path`, produced by the same
2303
- * formatPath() that renderStack() stamps onto each `.dock-stack` and that the
2304
- * pointer drop path parses back — which is what makes an enumerated commit
2305
- * land exactly where a pointer drop on that stack would.
2306
- */
2307
- buildPaneMoveCandidates() {
2308
- const t = this.paneMoveMode ? w(this.paneMoveMode.sourcePath) : null, e = [];
2309
- return N(this.rootLayout, (i, n) => {
2310
- const o = w({ type: "docked", segments: n });
2311
- o !== t && e.push({
2312
- pathStr: o,
2313
- targetTitles: i.panes.map((r) => this.titles[r] ?? r).join(", ")
2314
- });
2315
- }), [
2316
- ...e.flatMap(
2317
- ({ pathStr: i, targetTitles: n }) => z.PANE_MOVE_ZONE_ORDER.map((o) => ({ pathStr: i, zone: o, targetTitles: n }))
2318
- ),
2319
- { pathStr: null, zone: "float", targetTitles: "" }
2320
- ];
2321
- }
2322
- cyclePaneMoveCandidate(t) {
2323
- const e = this.buildPaneMoveCandidates();
2324
- if (e.length === 0) return;
2325
- const i = this.paneMoveCandidateIndex, n = i === null ? t > 0 ? 0 : e.length - 1 : (i + t + e.length) % e.length;
2326
- this.paneMoveCandidateIndex = n;
2327
- const o = e[n];
2328
- this.highlightPaneMoveCandidate(o);
2329
- const r = o.zone === "float" ? "Float" : `${o.zone[0].toUpperCase()}${o.zone.slice(1)} of ${o.targetTitles}`;
2330
- this.liveAnnouncer.announce(`${r}, option ${n + 1} of ${e.length}.`);
2331
- }
2332
- highlightPaneMoveCandidate(t) {
2333
- if (this.hideDropIndicator(), t.zone === "float" || !t.pathStr) return;
2334
- const e = this.shadowRoot?.querySelector(
2335
- `.dock-stack[data-path="${t.pathStr}"]`
2336
- );
2337
- if (!e) return;
2338
- const i = e.getBoundingClientRect();
2339
- i.width === 0 || i.height === 0 || this.showDropIndicator(e, t.zone);
2340
- }
2341
- commitHighlightedPaneMoveCandidate() {
2342
- const t = this.paneMoveCandidateIndex;
2343
- if (t === null) return;
2344
- const e = this.buildPaneMoveCandidates()[t];
2345
- if (!e) {
2346
- this.clearPaneMoveState();
2347
- return;
2348
- }
2349
- if (e.zone === "float") {
2350
- this.commitPaneMoveAsFloat();
2351
- return;
2352
- }
2353
- this.commitPaneMoveToZone(e.zone, P(e.pathStr));
2354
- }
2355
- /** Sole exit point for move mode: drops the arming AND any highlight together. */
2356
- clearPaneMoveState() {
2357
- this.paneMoveMode = null, this.paneMoveCandidateIndex !== null && (this.paneMoveCandidateIndex = null, this.hideDropIndicator());
2358
- }
2359
- /**
2360
- * Walk the focused element through nested shadow roots to find a focused
2361
- * tab button, then map it back to the dock's pane name + source path via
2362
- * the data attributes on the slotted .dock-tab span.
2363
- */
2364
- findFocusedPaneOrigin() {
2365
- if (!this.shadowRoot) return null;
2366
- let t = this.shadowRoot.activeElement;
2367
- for (; t && t.shadowRoot && t.shadowRoot.activeElement; )
2368
- t = t.shadowRoot.activeElement;
2369
- if (!t || t.getAttribute("role") !== "tab") return null;
2370
- const e = t.id.replace(/-header-button$/, ""), i = this.shadowRoot.querySelector(
2371
- `.dock-tab[data-tab-id="${e}"]`
2372
- );
2373
- if (!i) return null;
2374
- const n = i.closest(".dock-stack");
2375
- if (!n) return null;
2376
- const o = P(n.dataset.path);
2377
- return o ? { paneName: i.dataset.pane, sourcePath: o } : null;
2378
- }
2379
- /**
2380
- * Synthesise a minimal dragState so handleDrop's existing pipeline can
2381
- * commit the keyboard-driven move. handleDrop reads {pane, sourcePath,
2382
- * dropHandled} — the rest of dragState is pointer-drag bookkeeping that
2383
- * doesn't apply here.
2384
- */
2385
- synthesiseDragStateForKeyboardMove() {
2386
- this.paneMoveMode && (this.dragState = {
2387
- pane: this.paneMoveMode.paneName,
2388
- sourcePath: R(this.paneMoveMode.sourcePath),
2389
- floatingIndex: this.paneMoveMode.sourcePath.type === "floating" ? this.paneMoveMode.sourcePath.index : null,
2390
- pointerOffsetX: 0,
2391
- pointerOffsetY: 0,
2392
- dropHandled: !1,
2393
- sourceStackEl: null,
2394
- sourceHeaderBounds: null,
2395
- startClientX: 0,
2396
- startClientY: 0
2397
- });
2398
- }
2399
- /**
2400
- * `targetPath` omitted (the T/R/B/L keys) means the source stack is also the
2401
- * target stack, and handleDrop creates a sibling split with the moved pane on
2402
- * the chosen side. An enumerated candidate passes its own target instead.
2403
- */
2404
- commitPaneMoveToZone(t, e) {
2405
- if (!this.paneMoveMode) return;
2406
- const i = this.paneMoveMode;
2407
- this.synthesiseDragStateForKeyboardMove(), this.handleDrop(e ?? i.sourcePath, t);
2408
- const n = this.dragState?.dropHandled === !0;
2409
- this.dragState = null, this.clearPaneMoveState();
2410
- const o = this.titles[i.paneName] ?? i.paneName;
2411
- this.liveAnnouncer.announce(
2412
- n ? `Pane ${o} docked to ${t}.` : `Move failed. Pane ${o} was not moved.`
2413
- );
2414
- }
2415
- commitPaneMoveAsFloat() {
2416
- if (!this.paneMoveMode) return;
2417
- const t = this.paneMoveMode, e = this.resolveStackLocation(t.sourcePath);
2418
- if (!e) {
2419
- this.clearPaneMoveState();
2420
- return;
2421
- }
2422
- this.removePaneFromLocation(e, t.paneName, !0);
2423
- const i = {
2424
- bounds: {
2425
- left: 100 + this.floatingLayouts.length * 24,
2426
- top: 100 + this.floatingLayouts.length * 24,
2427
- width: 320,
2428
- height: 200
2429
- },
2430
- root: { kind: "stack", panes: [t.paneName], activePane: t.paneName },
2431
- activePane: t.paneName
2432
- };
2433
- this.floatingLayouts.push(i), this.normalizeAllLayouts(), this.renderLayout(), this.dispatchLayoutChanged(), this.clearPaneMoveState();
2434
- const n = this.titles[t.paneName] ?? t.paneName;
2435
- this.liveAnnouncer.announce(`Pane ${n} torn off into a floating window.`);
2436
- }
2437
- /**
2438
- * Close a floating pane via the chrome's close button (or any external
2439
- * caller). Announces the close to SR users, redraws the dock, and emits a
2440
- * layout-changed event. Phase 4 of the WC ARIA PRD — the floating chrome
2441
- * had no close affordance before this; users had to programmatically pop
2442
- * the pane out of `floatingLayouts`.
2443
- */
2444
- closeFloatingPane(t) {
2445
- const e = this.floatingLayouts[t];
2446
- if (!e) return;
2447
- const i = this.getFloatingWindowTitle(e);
2448
- this.removeFloatingAt(t), this.renderLayout(), this.dispatchLayoutChanged(), this.liveAnnouncer.announce(`Closed floating pane ${i}.`);
2449
- }
2450
- removePaneFromFloating(t, e, i, n = !1) {
2451
- const o = this.floatingLayouts[t];
2452
- if (!o || !o.root)
2453
- return !1;
2454
- const r = M(o.root, e);
2455
- if (!r || r.kind !== "stack")
2456
- return !1;
2457
- if (r.panes = r.panes.filter((c) => c !== i), r.panes.includes(r.activePane ?? "") || (r.panes.length > 0 ? r.activePane = r.panes[0] : delete r.activePane), o.activePane === i) {
2458
- const c = E(o.root);
2459
- c ? o.activePane = c : delete o.activePane;
2460
- }
2461
- return r.panes.length > 0 ? !1 : (n || this.normalizeAllLayouts(), !0);
2462
- }
2463
- /**
2464
- * Apply `normalizeLayoutNode` to `rootLayout` and every floating window's
2465
- * root, drop floating windows whose root collapses to null, and repair
2466
- * stale `activePane` references on each floating window. Run this at the
2467
- * end of every public mutation entry point (drop handlers, layout setter,
2468
- * pane removal) so the tree the renderer sees is always in canonical form.
2469
- */
2470
- normalizeAllLayouts() {
2471
- this.rootLayout = $(this.rootLayout), this.floatingLayouts = this.floatingLayouts.map((t) => {
2472
- if (t.root = $(t.root), !t.root) return null;
2473
- const e = _(t.root);
2474
- if (!t.activePane || !e.includes(t.activePane)) {
2475
- const i = E(t.root);
2476
- i ? t.activePane = i : delete t.activePane;
2477
- }
2478
- return t;
2479
- }).filter((t) => t !== null);
2480
- }
2481
- /**
2482
- * Dev-mode integrity guard: walks every pane referenced by the current
2483
- * layout and asserts that the rendered shadow DOM contains a matching
2484
- * `<slot name="${pane}">`. A missing slot means the layout tree got into
2485
- * a state the renderer can't display — typically a missed normalize() call
2486
- * or a render bug. Opt in via the `debug-layout-integrity` attribute or
2487
- * the `debugLayoutIntegrity` property; off by default.
2488
- */
2489
- verifyProjectionSlots() {
2490
- if (!this.debugLayoutIntegrity) return;
2491
- const t = this.shadowRoot;
2492
- if (!t) return;
2493
- const e = new Set(
2494
- Array.from(t.querySelectorAll("slot")).map((o) => o.getAttribute("name")).filter((o) => !!o)
2495
- ), n = [
2496
- ..._(this.rootLayout),
2497
- ...this.floatingLayouts.flatMap((o) => _(o.root))
2498
- ].find((o) => !e.has(o));
2499
- if (n)
2500
- throw new Error(
2501
- `mint-dock-manager: pane "${n}" has no projection slot in the shadow DOM. The layout tree got into a state the renderer can't display — likely a missing normalize() call or a render bug.`
2502
- );
2503
- }
2504
- dispatchLayoutChanged() {
2505
- this.dispatchEvent(
2506
- new CustomEvent("dock-layout-changed", {
2507
- detail: this.snapshot,
2508
- bubbles: !0,
2509
- composed: !0
2510
- })
2511
- );
2512
- }
2513
- cloneFloatingArray(t) {
2514
- return JSON.parse(JSON.stringify(t));
2515
- }
2516
- }
2517
- const U = "mint-dock-manager";
2518
- typeof customElements < "u" && !customElements.get(U) && customElements.define(U, z);
2519
- export {
2520
- z as MintDockManagerElement
2521
- };
57
+ </div>`, o = i(":host {\n display: block;\n position: relative;\n width: 100%;\n height: 100%;\n contain: layout paint size style;\n box-sizing: border-box;\n font-family: inherit;\n color: inherit;\n --dock-split-gap: 0.25rem;\n}\n\n.dock-root,\n.dock-docked,\n.dock-split,\n.dock-stack,\n.dock-stack__pane {\n box-sizing: border-box;\n min-width: 0;\n min-height: 0;\n}\n\n.dock-root {\n position: relative;\n width: 100%;\n height: 100%;\n}\n\n.dock-docked {\n position: absolute;\n inset: 0;\n display: flex;\n z-index: 0;\n}\n\n.dock-floating-layer {\n position: absolute;\n inset: 0;\n pointer-events: none;\n z-index: 5;\n}\n\n.dock-intersections-layer {\n position: absolute;\n inset: 0;\n pointer-events: none;\n z-index: 120;\n}\n\n.dock-floating {\n position: absolute;\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n pointer-events: auto;\n border: 1px solid var(--bs-border-color);\n border-radius: 0.5rem;\n background: var(--bs-body-bg);\n box-shadow: var(--bs-box-shadow-lg);\n overflow: hidden;\n min-width: 12rem;\n min-height: 8rem;\n}\n\n.dock-floating[data-dragging=true] {\n pointer-events: none;\n}\n\n.dock-floating__chrome {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n padding: 0.35rem 0.75rem;\n cursor: move;\n touch-action: none;\n background: linear-gradient(to bottom, rgba(var(--bs-primary-rgb), 0.15), rgba(var(--bs-primary-rgb), 0.05));\n border-bottom: 1px solid var(--bs-primary-border-subtle);\n user-select: none;\n -webkit-user-select: none;\n}\n\n.dock-floating__title {\n flex: 1 1 auto;\n font-size: 0.875rem;\n font-weight: 500;\n color: var(--bs-body-color);\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.dock-floating__close {\n flex: 0 0 auto;\n appearance: none;\n background: transparent;\n border: 0;\n color: var(--bs-body-color);\n cursor: pointer;\n font-size: 1.25rem;\n line-height: 1;\n padding: 0 0.4rem;\n border-radius: 3px;\n margin-top: -1px;\n}\n.dock-floating__close:hover {\n background: rgba(var(--bs-primary-rgb), 0.15);\n}\n.dock-floating__close:focus-visible {\n outline: 2px solid var(--bs-primary);\n outline-offset: 1px;\n}\n\n.dock-floating > .dock-stack {\n flex: 1 1 auto;\n min-width: 12rem;\n min-height: 8rem;\n}\n\n.dock-floating__resizer {\n position: absolute;\n pointer-events: auto;\n z-index: 2;\n background: rgba(var(--bs-primary-rgb), 0.1);\n transition: background 120ms ease;\n touch-action: none;\n}\n\n.dock-floating__resizer:hover,\n.dock-floating__resizer[data-resizing=true] {\n background: rgba(var(--bs-primary-rgb), 0.3);\n}\n\n.dock-floating__resizer--top,\n.dock-floating__resizer--bottom {\n left: 0.75rem;\n right: 0.75rem;\n height: 0.5rem;\n}\n\n.dock-floating__resizer--top {\n top: 0;\n cursor: n-resize;\n}\n\n.dock-floating__resizer--bottom {\n bottom: 0;\n cursor: s-resize;\n}\n\n.dock-floating__resizer--left,\n.dock-floating__resizer--right {\n top: 1.75rem;\n bottom: 0.75rem;\n width: 0.5rem;\n}\n\n.dock-floating__resizer--left {\n left: 0;\n cursor: w-resize;\n}\n\n.dock-floating__resizer--right {\n right: 0;\n cursor: e-resize;\n}\n\n.dock-floating__resizer--top-left,\n.dock-floating__resizer--top-right,\n.dock-floating__resizer--bottom-left,\n.dock-floating__resizer--bottom-right {\n width: 0.75rem;\n height: 0.75rem;\n}\n\n.dock-floating__resizer--top-left {\n top: 0;\n left: 0;\n cursor: nw-resize;\n}\n\n.dock-floating__resizer--top-right {\n top: 0;\n right: 0;\n cursor: ne-resize;\n}\n\n.dock-floating__resizer--bottom-left {\n bottom: 0;\n left: 0;\n cursor: sw-resize;\n}\n\n.dock-floating__resizer--bottom-right {\n right: 0;\n bottom: 0;\n cursor: se-resize;\n}\n\n.dock-split {\n flex: 1 1 0;\n position: relative;\n}\n\n.dock-intersection-handle {\n position: absolute;\n width: 1rem;\n height: 1rem;\n margin-left: -0.5rem;\n margin-top: -0.5rem;\n border-radius: 0.375rem;\n background: rgba(var(--bs-primary-rgb), 0.4);\n border: 1px solid var(--bs-primary);\n box-shadow: var(--bs-box-shadow-sm);\n cursor: all-scroll;\n pointer-events: auto;\n touch-action: none;\n opacity: 0.6;\n transition: background 120ms ease, border-color 120ms ease, opacity 120ms ease;\n}\n\n.dock-intersection-handle:hover,\n.dock-intersection-handle:focus-visible,\n.dock-intersection-handle[data-visible=true],\n.dock-intersection-handle[data-resizing=true] {\n background: rgba(var(--bs-primary-rgb), 0.35);\n border-color: var(--bs-primary);\n opacity: 1;\n}\n\n.dock-intersection-handle:focus-visible {\n outline: 2px solid var(--bs-primary);\n outline-offset: 1px;\n}\n\n.dock-stack {\n flex: 1 1 0;\n border: 1px solid var(--bs-border-color);\n border-radius: 0.25rem;\n background: var(--bs-body-bg);\n backdrop-filter: blur(4px);\n}\n\n.dock-tab {\n cursor: grab;\n display: block;\n padding: 0.5rem 1rem;\n margin: -0.5rem -1rem;\n touch-action: none;\n user-select: none;\n -webkit-user-select: none;\n -webkit-touch-callout: none;\n}\n\n.dock-tab:active {\n cursor: grabbing;\n}\n\n.dock-tab[data-pressing=true] {\n background-color: var(--bs-secondary-bg-subtle, rgba(0, 0, 0, 0.05));\n transform: scale(1.02);\n transition: background-color 100ms ease-out, transform 100ms ease-out;\n}\n\n.dock-stack__pane {\n position: relative;\n display: flex;\n flex-direction: column;\n overflow: hidden;\n height: 100%;\n}\n\n.dock-drop-indicator {\n position: absolute;\n pointer-events: none;\n border: 2px solid var(--bs-primary);\n background: rgba(var(--bs-primary-rgb), 0.2);\n border-radius: 0.25rem;\n opacity: 0;\n transition: opacity 120ms ease;\n z-index: 100;\n}\n\n.dock-drop-indicator[data-visible=true] {\n opacity: 1;\n}\n\n.dock-drop-joystick {\n position: absolute;\n display: grid;\n grid-template-columns: repeat(3, min-content);\n grid-template-rows: repeat(3, min-content);\n gap: 0.125rem;\n padding: 0.125rem;\n border-radius: 999px;\n background: var(--bs-tertiary-bg);\n box-shadow: var(--bs-box-shadow);\n pointer-events: none;\n transform: translate(-50%, -50%);\n z-index: 110;\n}\n\n.dock-drop-joystick__spacer {\n width: 1.75rem;\n height: 1.75rem;\n pointer-events: none;\n}\n\n.dock-drop-joystick__button {\n width: 1.75rem;\n height: 1.75rem;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n border-radius: 0.375rem;\n border: 1px solid var(--bs-primary-border-subtle);\n background: var(--bs-body-bg);\n color: var(--bs-primary);\n font-size: 0.75rem;\n line-height: 1;\n font-weight: 600;\n pointer-events: auto;\n cursor: pointer;\n transition: background 120ms ease, color 120ms ease, border-color 120ms ease;\n}\n\n.dock-drop-joystick__button[data-active=true],\n.dock-drop-joystick__button:hover,\n.dock-drop-joystick__button:focus-visible {\n background: var(--bs-primary-bg-subtle);\n border-color: var(--bs-primary);\n color: var(--bs-primary);\n}\n\n.dock-drop-joystick__button:focus-visible {\n outline: 2px solid var(--bs-primary);\n outline-offset: 1px;\n}\n\n.dock-drop-joystick__button[data-zone=center] {\n border-radius: 0.5rem;\n}\n\n::slotted(*) {\n flex: 1 1 auto;\n display: block;\n min-width: 0;\n min-height: 0;\n}\n\n@media (prefers-reduced-motion: reduce) {\n .dock-floating,\n .dock-floating__resizer,\n .dock-floating__close,\n .dock-intersection-handle,\n .dock-drop-indicator,\n .dock-drop-joystick__button {\n transition: none !important;\n animation: none !important;\n }\n}");
58
+ //#endregion
59
+ //#region libs/mintplayer-web-components/dock/src/core/geometry.ts
60
+ function s(e, t) {
61
+ if (t.width <= 0 || t.height <= 0) return e;
62
+ let n = Math.min(e.width, t.width), r = Math.min(e.height, t.height);
63
+ return {
64
+ left: Math.min(Math.max(e.left, 0), t.width - n),
65
+ top: Math.min(Math.max(e.top, 0), t.height - r),
66
+ width: n,
67
+ height: r
68
+ };
69
+ }
70
+ function c(e, t, n) {
71
+ return t >= e.left && t <= e.right && n >= e.top && n <= e.bottom;
72
+ }
73
+ function l(e, t) {
74
+ return e && typeof e.zIndex == "number" && Number.isFinite(e.zIndex) ? e.zIndex : 10 + t;
75
+ }
76
+ //#endregion
77
+ //#region libs/mintplayer-web-components/dock/src/core/sizes.ts
78
+ function u(e, t) {
79
+ if (t <= 0) return [];
80
+ if (!Array.isArray(e) || e.length !== t) return Array.from({ length: t }, () => 1 / t);
81
+ let n = e.map((e) => Number.isFinite(e) ? Math.max(e, 0) : 0), r = n.reduce((e, t) => e + t, 0);
82
+ return r <= 0 ? Array.from({ length: t }, () => 1 / t) : n.map((e) => e / r);
83
+ }
84
+ function d(e) {
85
+ e.sizes = u(e.sizes, e.children.length);
86
+ }
87
+ function f(e, t, n) {
88
+ let r = u(e, n - 1), i = 1 / n, a = 1 - i, o = [];
89
+ for (let e = 0; e < n; e += 1) if (e === t) o.push(i);
90
+ else {
91
+ let n = e < t ? e : e - 1;
92
+ o.push(r[n] * a);
93
+ }
94
+ return o;
95
+ }
96
+ //#endregion
97
+ //#region libs/mintplayer-web-components/dock/src/core/intersection-sizing.ts
98
+ function p(e, t) {
99
+ let n = [];
100
+ if (e) try {
101
+ let t = JSON.parse(e);
102
+ Array.isArray(t) && (n = t);
103
+ } catch {
104
+ n = [];
105
+ }
106
+ if (n.length > 0) return n;
107
+ let r = (t ?? "").split("|");
108
+ if (r.length !== 2) return [];
109
+ let [i, a] = r, o = i.lastIndexOf(":"), s = a.lastIndexOf(":");
110
+ if (o <= 0 || s <= 0) return [];
111
+ let c = Number.parseInt(i.slice(o + 1), 10), l = Number.parseInt(a.slice(s + 1), 10);
112
+ return [{
113
+ h: {
114
+ pathStr: i.slice(0, o),
115
+ index: c
116
+ },
117
+ v: {
118
+ pathStr: a.slice(0, s),
119
+ index: l
120
+ }
121
+ }];
122
+ }
123
+ function m(e, t) {
124
+ let n = [...e], r = (n[t] ?? 0) + (n[t + 1] ?? 0);
125
+ if (r <= 0) return n;
126
+ n[t] = r / 2, n[t + 1] = r / 2;
127
+ let i = n.reduce((e, t) => e + t, 0);
128
+ return i > 0 ? n.map((e) => e / i) : n;
129
+ }
130
+ function h(e, t, n) {
131
+ let r = {
132
+ writes: [],
133
+ remember: [],
134
+ clearStored: !1
135
+ };
136
+ if (e.length === 0) return r;
137
+ let i = /* @__PURE__ */ new Set();
138
+ if (e.forEach((e) => {
139
+ i.add(e.h.pathStr), i.add(e.v.pathStr);
140
+ }), [...i].some((e) => t.has(e))) return t.forEach((e, t) => {
141
+ let i = n(t);
142
+ i && r.writes.push({
143
+ pathStr: t,
144
+ sizes: u(e, i.childCount)
145
+ });
146
+ }), r.clearStored = !0, r;
147
+ let a = /* @__PURE__ */ new Map(), o = (e) => {
148
+ let t = n(e);
149
+ if (!t) return null;
150
+ let r = a.get(e);
151
+ return {
152
+ childCount: t.childCount,
153
+ sizes: r ?? t.sizes
154
+ };
155
+ }, s = /* @__PURE__ */ new Set();
156
+ return e.forEach((e) => {
157
+ [e.h.pathStr, e.v.pathStr].forEach((e) => {
158
+ if (s.has(e)) return;
159
+ s.add(e);
160
+ let t = n(e);
161
+ t && Array.isArray(t.sizes) && r.remember.push({
162
+ pathStr: e,
163
+ sizes: [...t.sizes]
164
+ });
165
+ }), [e.h, e.v].forEach(({ pathStr: e, index: t }) => {
166
+ let n = o(e);
167
+ if (!n) return;
168
+ let i = m(u(n.sizes ?? [], n.childCount), t);
169
+ a.set(e, i), r.writes.push({
170
+ pathStr: e,
171
+ sizes: i
172
+ });
173
+ });
174
+ }), r;
175
+ }
176
+ //#endregion
177
+ //#region libs/mintplayer-web-components/dock/src/core/layout-tree.ts
178
+ function g(e, t) {
179
+ if (!e) return null;
180
+ let n = e;
181
+ if (t.length === 0) return n;
182
+ for (let e of t) {
183
+ if (!n || n.kind !== "split") return null;
184
+ n = n.children[e] ?? null;
185
+ }
186
+ return n;
187
+ }
188
+ function _(e, t) {
189
+ if (!e || e === t || e.kind !== "split") return null;
190
+ let n = e.children.indexOf(t);
191
+ if (n !== -1) return {
192
+ parent: e,
193
+ index: n
194
+ };
195
+ for (let n = 0; n < e.children.length; n += 1) {
196
+ let r = _(e.children[n], t);
197
+ if (r) return r;
198
+ }
199
+ return null;
200
+ }
201
+ function v(e, t, n) {
202
+ if (!e || e === t) return n;
203
+ let r = _(e, t);
204
+ return r && (r.parent.children[r.index] = n, d(r.parent)), e;
205
+ }
206
+ function y(e, t, n, r) {
207
+ let i = r === "left" || r === "right" ? "horizontal" : "vertical", a = r === "left" || r === "top", o = _(e, t);
208
+ if (o && o.parent.direction === i) {
209
+ let t = a ? o.index : o.index + 1;
210
+ return o.parent.children.splice(t, 0, n), o.parent.sizes = f(o.parent.sizes, t, o.parent.children.length), e ?? n;
211
+ }
212
+ return v(e, t, {
213
+ kind: "split",
214
+ direction: i,
215
+ children: a ? [n, t] : [t, n],
216
+ sizes: [.5, .5]
217
+ });
218
+ }
219
+ function b(e, t, n = []) {
220
+ e && (e.kind === "stack" ? t(e, n) : e.children.forEach((e, r) => b(e, t, [...n, r])));
221
+ }
222
+ function x(e) {
223
+ let t = null;
224
+ return b(e, (e) => {
225
+ t || e.panes.length === 0 || (t = e.activePane && e.panes.includes(e.activePane) ? e.activePane : e.panes[0]);
226
+ }), t;
227
+ }
228
+ function S(e) {
229
+ let t = [];
230
+ return b(e, (e) => {
231
+ e.panes.forEach((e) => t.push(e));
232
+ }), t;
233
+ }
234
+ function C(e, t) {
235
+ return e.panes = e.panes.filter((e) => e !== t), e.panes.includes(e.activePane ?? "") || (e.panes.length > 0 ? e.activePane = e.panes[0] : delete e.activePane), e.panes.length === 0;
236
+ }
237
+ function w(e) {
238
+ if (!e) return null;
239
+ if (e.kind === "stack") return e.panes.length === 0 ? null : ((!e.activePane || !e.panes.includes(e.activePane)) && (e.activePane = e.panes[0]), e);
240
+ let t = u(e.sizes, e.children.length), n = e.children.map((e, n) => ({
241
+ child: w(e),
242
+ slot: t[n]
243
+ })).filter((e) => e.child !== null).flatMap(({ child: t, slot: n }) => {
244
+ if (t.kind === "split" && t.direction === e.direction) {
245
+ let e = u(t.sizes, t.children.length);
246
+ return t.children.map((t, r) => ({
247
+ child: t,
248
+ slot: n * e[r]
249
+ }));
250
+ }
251
+ return [{
252
+ child: t,
253
+ slot: n
254
+ }];
255
+ });
256
+ return n.length === 0 ? null : n.length === 1 ? n[0].child : (e.children = n.map((e) => e.child), e.sizes = u(n.map((e) => e.slot), n.length), e);
257
+ }
258
+ function T(e) {
259
+ return e ? JSON.parse(JSON.stringify(e)) : null;
260
+ }
261
+ function E(e) {
262
+ return e ? e.kind === "stack" ? e.panes.length : e.children.reduce((e, t) => e + E(t), 0) : 0;
263
+ }
264
+ function D(e, t, n) {
265
+ let r = e.type === "docked" ? t : n[e.index]?.root ?? null;
266
+ if (!r) return null;
267
+ let i = g(r, e.segments);
268
+ return i && i.kind === "split" ? i : null;
269
+ }
270
+ function O(e) {
271
+ let t = e.bounds ?? {
272
+ left: 0,
273
+ top: 0,
274
+ width: 320,
275
+ height: 200
276
+ };
277
+ return {
278
+ id: e.id,
279
+ bounds: {
280
+ left: Number.isFinite(t.left) ? t.left : 0,
281
+ top: Number.isFinite(t.top) ? t.top : 0,
282
+ width: Number.isFinite(t.width) ? Math.max(t.width, 160) : 320,
283
+ height: Number.isFinite(t.height) ? Math.max(t.height, 120) : 200
284
+ },
285
+ zIndex: e.zIndex,
286
+ root: e.root ? T(e.root) : null,
287
+ activePane: e.activePane
288
+ };
289
+ }
290
+ function k(e, t) {
291
+ return t > 0 ? Math.min(e, t) : e;
292
+ }
293
+ function A(e, t, n, r) {
294
+ let i = k(192, r.width), a = k(128, r.height), o = e.width, s = e.height, c = e.left, l = e.top;
295
+ return t.horizontal === "right" ? (o = Math.max(i, e.width + n.x), r.width > 0 && (o = Math.min(o, r.width - e.left))) : t.horizontal === "left" && (o = Math.max(i, e.width - n.x), o = Math.min(o, e.left + e.width), c = e.left + e.width - o), t.vertical === "bottom" ? (s = Math.max(a, e.height + n.y), r.height > 0 && (s = Math.min(s, r.height - e.top))) : t.vertical === "top" && (s = Math.max(a, e.height - n.y), s = Math.min(s, e.top + e.height), l = e.top + e.height - s), {
296
+ left: c,
297
+ top: l,
298
+ width: o,
299
+ height: s
300
+ };
301
+ }
302
+ var j = [
303
+ 1 / 3,
304
+ 1 / 2,
305
+ 2 / 3
306
+ ];
307
+ function M(e, t) {
308
+ if (t <= 0) return e;
309
+ let n = e / t, r = j[0], i = Math.abs(n - r);
310
+ for (let e = 1; e < j.length; e += 1) {
311
+ let t = Math.abs(n - j[e]);
312
+ t < i && (i = t, r = j[e]);
313
+ }
314
+ return r * t;
315
+ }
316
+ function N(e, t, n) {
317
+ let r = e, i = n + 1;
318
+ for (let n of t) {
319
+ let t = Math.abs(n - e);
320
+ t < i && (i = t, r = n);
321
+ }
322
+ return i <= n ? r : e;
323
+ }
324
+ function P(e, t, n, r, i = !1) {
325
+ let a = e + t, o = Math.min(Math.max(e + n, r), a - r);
326
+ return i && (o = M(o, a)), {
327
+ before: o,
328
+ after: a - o
329
+ };
330
+ }
331
+ function F(e, t, n, r, i = !1) {
332
+ if (t < 0 || t + 1 >= e.length) return null;
333
+ let a = e.reduce((e, t) => e + t, 0);
334
+ if (!(a > 0)) return null;
335
+ let { before: o, after: s } = P(e[t], e[t + 1], n, r, i), c = e.map((e, n) => n === t ? o : n === t + 1 ? s : e);
336
+ return {
337
+ pixels: c,
338
+ weights: c.map((e) => e / a)
339
+ };
340
+ }
341
+ function I(e, t, n) {
342
+ let { x: r, y: i } = e;
343
+ return {
344
+ x: i === null ? [] : t.filter(({ direction: e, rect: t }) => e === "horizontal" && i >= t.top && i <= t.bottom).map(({ rect: e }) => e.left + e.width / 2 - n.left),
345
+ y: r === null ? [] : t.filter(({ direction: e, rect: t }) => e === "vertical" && r >= t.left && r <= t.right).map(({ rect: e }) => e.top + e.height / 2 - n.top)
346
+ };
347
+ }
348
+ function L(e, t, n, r = 12) {
349
+ for (let i = 0; i < e.length; i += 1) if (t < (n !== null && e[i] >= n ? e[i] + r : e[i])) return i;
350
+ return e.length;
351
+ }
352
+ //#endregion
353
+ //#region libs/mintplayer-web-components/dock/src/core/types.ts
354
+ function R(e) {
355
+ if (e.type === "floating") {
356
+ let t = e.segments.length > 0 ? `/${e.segments.map((e) => e.toString()).join("/")}` : "";
357
+ return `f:${e.index}${t}`;
358
+ }
359
+ let t = e.segments.join("/");
360
+ return t.length > 0 ? `d:${t}` : "d:";
361
+ }
362
+ function z(e) {
363
+ if (e == null) return null;
364
+ if (e.startsWith("f:")) {
365
+ let [t, ...n] = e.slice(2).split("/"), r = Number.parseInt(t, 10);
366
+ return Number.isFinite(r) ? {
367
+ type: "floating",
368
+ index: r,
369
+ segments: n.filter((e) => e.length > 0).map((e) => Number.parseInt(e, 10)).filter((e) => Number.isFinite(e))
370
+ } : null;
371
+ }
372
+ let t = e.startsWith("d:") ? e.slice(2) : e;
373
+ return t.length === 0 ? {
374
+ type: "docked",
375
+ segments: []
376
+ } : {
377
+ type: "docked",
378
+ segments: t.split("/").filter((e) => e.length > 0).map((e) => Number.parseInt(e, 10)).filter((e) => Number.isFinite(e))
379
+ };
380
+ }
381
+ function B(e, t) {
382
+ if (e.type !== t.type) return !1;
383
+ if (e.type === "floating") {
384
+ let n = t;
385
+ return e.index !== n.index || e.segments.length !== n.segments.length ? !1 : e.segments.every((e, t) => e === n.segments[t]);
386
+ }
387
+ let n = t;
388
+ return e.segments.length === n.segments.length && e.segments.every((e, t) => e === n.segments[t]);
389
+ }
390
+ function V(e) {
391
+ return e.type === "floating" ? {
392
+ type: "floating",
393
+ index: e.index,
394
+ segments: [...e.segments]
395
+ } : {
396
+ type: "docked",
397
+ segments: [...e.segments]
398
+ };
399
+ }
400
+ function H(e, t) {
401
+ return e.type !== t.type || e.type === "floating" && t.index !== e.index || e.segments.length > t.segments.length ? !1 : e.segments.every((e, n) => e === t.segments[n]);
402
+ }
403
+ //#endregion
404
+ //#region libs/mintplayer-web-components/dock/src/components/mint-dock-manager.element.ts
405
+ var U = class i extends n {
406
+ static {
407
+ this.styles = [o];
408
+ }
409
+ static {
410
+ this.documentRef = typeof document < "u" ? document : null;
411
+ }
412
+ static configureDocument(e) {
413
+ e && (i.documentRef = e);
414
+ }
415
+ static get observedAttributes() {
416
+ return [
417
+ ...super.observedAttributes ?? [],
418
+ "layout",
419
+ "debug-layout-integrity"
420
+ ];
421
+ }
422
+ static {
423
+ this.instanceCounter = 0;
424
+ }
425
+ static {
426
+ this.TOUCH_LONG_PRESS_MS = 600;
427
+ }
428
+ static {
429
+ this.TOUCH_LONG_PRESS_SLOP_PX = 10;
430
+ }
431
+ static {
432
+ this.TOUCH_PRESS_FEEDBACK_DELAY_MS = 150;
433
+ }
434
+ static {
435
+ this.PANE_MOVE_ZONE_ORDER = [
436
+ "top",
437
+ "right",
438
+ "bottom",
439
+ "left"
440
+ ];
441
+ }
442
+ constructor() {
443
+ super(), this.liveAnnouncer = new t(this), this.paneMoveMode = null, this.paneMoveCandidateIndex = null, this.dropJoystickTarget = null, this.rootLayout = null, this.floatingLayouts = [], this.titles = {}, this.pendingTabDragMetrics = null, this.dragState = null, this.floatingDragState = null, this.floatingResizeState = null, this.intersectionRaf = null, this.rootResizeObserver = null, this.dockedMutationObserver = null, this.cornerResizeState = null, this.pointerTrackingActive = !1, this.dragPointerTrackingActive = !1, this.lastDragPointerPosition = null, this.cornerSnapXTargets = [], this.cornerSnapYTargets = [], this.debugLayoutIntegrity = !1, this.pendingDragEndTimeout = null, this.previousSplitSizes = /* @__PURE__ */ new Map(), this.layoutFocusRestore = new e(() => this.shadowRoot, {
444
+ selector: ".dock-intersection-handle[data-key], mp-tab-control, .dock-tab[data-tab-id]",
445
+ keyOf: (e) => e.dataset.key ?? e.dataset.tabId ?? (e.id || null)
446
+ }), this.instanceId = `mint-dock-${++i.instanceCounter}`, this.windowRef = typeof window < "u" ? window : null, this.onPointerMove = this.onPointerMove.bind(this), this.onPointerUp = this.onPointerUp.bind(this), this.onPointerCancel = this.onPointerCancel.bind(this), this.onDragPointerMove = this.onDragPointerMove.bind(this), this.onDragPointerUp = this.onDragPointerUp.bind(this), this.onDragPointerCancel = this.onDragPointerCancel.bind(this), this.onSplitterResize = this.onSplitterResize.bind(this);
447
+ }
448
+ render() {
449
+ return r`${a}${this.liveAnnouncer.template()}`;
450
+ }
451
+ firstUpdated() {
452
+ let e = this.resolveDocument();
453
+ this.documentRef = e, this.windowRef = this.resolveWindow(e);
454
+ let t = this.shadowRoot, n = t.querySelector(".dock-root");
455
+ if (!n) throw Error("mint-dock-manager template is missing the root element.");
456
+ let r = t.querySelector(".dock-docked");
457
+ if (!r) throw Error("mint-dock-manager template is missing the docked surface element.");
458
+ let i = t.querySelector(".dock-floating-layer");
459
+ if (!i) throw Error("mint-dock-manager template is missing the floating layer element.");
460
+ let a = t.querySelector(".dock-drop-indicator");
461
+ if (!a) throw Error("mint-dock-manager template is missing the drop indicator element.");
462
+ let o = t.querySelector(".dock-drop-joystick");
463
+ if (!o) throw Error("mint-dock-manager template is missing the drop joystick element.");
464
+ let s = Array.from(o.querySelectorAll(".dock-drop-joystick__button[data-zone]"));
465
+ if (s.length === 0) throw Error("mint-dock-manager template is missing drop joystick buttons.");
466
+ this.rootEl = n, this.dockedEl = r, this.floatingLayerEl = i, this.dropIndicator = a, this.dropJoystick = o, this.dropJoystickButtons = s, this.dockedEl.dataset.path = R({
467
+ type: "docked",
468
+ segments: []
469
+ }), n.addEventListener("keydown", (e) => this.onRootKeyDown(e), { capture: !0 }), n.addEventListener("focusout", (e) => this.onRootFocusOut(e)), this.renderLayout(), this.rootResizeObserver = new ResizeObserver(() => {
470
+ this.scheduleRenderIntersectionHandles(), this.updateFloatingPanePositions();
471
+ }), this.rootResizeObserver.observe(this.rootEl), this.dockedMutationObserver = new MutationObserver(() => this.scheduleRenderIntersectionHandles()), this.dockedMutationObserver.observe(this.dockedEl, {
472
+ childList: !0,
473
+ subtree: !0
474
+ }), this.dockedEl.addEventListener("resizing", this.onSplitterResize), this.dockedEl.addEventListener("resize-end", this.onSplitterResize);
475
+ }
476
+ connectedCallback() {
477
+ super.connectedCallback(), this.hasAttribute("role") || this.setAttribute("role", "region"), this.hasAttribute("aria-label") || this.setAttribute("aria-label", "Dock layout");
478
+ }
479
+ disconnectedCallback() {
480
+ let e = this.windowRef;
481
+ this.stopDragPointerTracking(), e?.removeEventListener("pointermove", this.onPointerMove), e?.removeEventListener("pointerup", this.onPointerUp), e?.removeEventListener("pointercancel", this.onPointerCancel), this.pointerTrackingActive = !1, this.rootResizeObserver?.disconnect(), this.rootResizeObserver = null, this.dockedMutationObserver?.disconnect(), this.dockedMutationObserver = null, this.dockedEl?.removeEventListener("resizing", this.onSplitterResize), this.dockedEl?.removeEventListener("resize-end", this.onSplitterResize), this.intersectionRaf !== null && (this.windowRef?.clearTimeout(this.intersectionRaf), this.intersectionRaf = null), super.disconnectedCallback();
482
+ }
483
+ attributeChangedCallback(e, t, n) {
484
+ super.attributeChangedCallback(e, t, n), e === "layout" ? this.layout = n ? this.parseLayout(n) : null : e === "debug-layout-integrity" && (this.debugLayoutIntegrity = n !== null && n !== "false" && n !== "0");
485
+ }
486
+ get layout() {
487
+ return {
488
+ root: T(this.rootLayout),
489
+ floating: this.cloneFloatingArray(this.floatingLayouts),
490
+ titles: { ...this.titles }
491
+ };
492
+ }
493
+ set layout(e) {
494
+ let t = this.ensureSnapshot(e);
495
+ this.isInteracting() || JSON.stringify({
496
+ root: this.rootLayout,
497
+ floating: this.floatingLayouts,
498
+ titles: this.titles
499
+ }) !== JSON.stringify(t) && (this.rootLayout = T(t.root), this.floatingLayouts = this.cloneFloatingArray(t.floating), this.titles = t.titles ? { ...t.titles } : {}, this.normalizeAllLayouts(), this.renderLayout());
500
+ }
501
+ isInteracting() {
502
+ return !!(this.dragState || this.floatingDragState || this.floatingResizeState || this.cornerResizeState);
503
+ }
504
+ get snapshot() {
505
+ return this.layout;
506
+ }
507
+ toJSON() {
508
+ return this.snapshot;
509
+ }
510
+ resolveDocument() {
511
+ let e = i.documentRef, t = this.ownerDocument ?? null, n = e ?? t ?? (typeof document < "u" ? document : null);
512
+ if (!n) throw Error("mint-dock-manager requires a Document to initialize.");
513
+ return i.documentRef ||= n, n;
514
+ }
515
+ resolveWindow(e) {
516
+ return typeof window < "u" ? window : e.defaultView ?? null;
517
+ }
518
+ parseLayout(e) {
519
+ try {
520
+ let t = JSON.parse(e);
521
+ return this.ensureSnapshot(t);
522
+ } catch (e) {
523
+ return console.warn("mint-dock-manager: failed to parse layout attribute", e), null;
524
+ }
525
+ }
526
+ ensureSnapshot(e) {
527
+ if (!e) return {
528
+ root: null,
529
+ floating: [],
530
+ titles: {}
531
+ };
532
+ if (e.kind) return {
533
+ root: e,
534
+ floating: [],
535
+ titles: {}
536
+ };
537
+ let t = e;
538
+ return {
539
+ root: t.root ?? null,
540
+ floating: Array.isArray(t.floating) ? t.floating.map((e) => O(e)) : [],
541
+ titles: t.titles ? { ...t.titles } : {}
542
+ };
543
+ }
544
+ renderLayout() {
545
+ if (this.dockedEl) {
546
+ if (this.layoutFocusRestore.capture(), this.dockedEl.innerHTML = "", this.floatingLayerEl.innerHTML = "", this.hideDropIndicator(), this.rootLayout) {
547
+ let e = this.renderNode(this.rootLayout, []);
548
+ this.dockedEl.appendChild(e);
549
+ }
550
+ this.renderFloatingPanes(), this.layoutFocusRestore.restore(), this.verifyProjectionSlots();
551
+ }
552
+ }
553
+ renderNode(e, t, n) {
554
+ return e.kind === "split" ? this.renderSplit(e, t, n) : this.renderStack(e, t, n);
555
+ }
556
+ renderFloatingPanes() {
557
+ this.floatingLayerEl.innerHTML = "";
558
+ let e = this.getHostSize();
559
+ this.floatingLayouts.forEach((t, n) => {
560
+ let r = this.documentRef.createElement("div");
561
+ r.classList.add("dock-floating"), r.dataset.path = R({
562
+ type: "floating",
563
+ index: n,
564
+ segments: []
565
+ });
566
+ let i = this.getFloatingWindowTitle(t), a = `${this.instanceId}-floating-${n}-title`;
567
+ r.setAttribute("role", "dialog"), r.setAttribute("aria-labelledby", a), r.setAttribute("aria-modal", "false");
568
+ let { left: o, top: c, width: u, height: d } = s(t.bounds, e);
569
+ r.style.left = `${o}px`, r.style.top = `${c}px`, r.style.width = `${u}px`, r.style.height = `${d}px`, r.style.minWidth = "0", r.style.minHeight = "0";
570
+ let f = l(this.floatingLayouts[n], n);
571
+ r.style.zIndex = String(f);
572
+ let p = this.documentRef.createElement("div");
573
+ p.classList.add("dock-floating__chrome"), p.addEventListener("pointerdown", (e) => this.beginFloatingDrag(e, n, r, p));
574
+ let m = this.documentRef.createElement("div");
575
+ m.classList.add("dock-floating__title"), m.id = a, m.textContent = i, p.appendChild(m);
576
+ let h = this.documentRef.createElement("button");
577
+ if (h.type = "button", h.classList.add("dock-floating__close"), h.setAttribute("aria-label", `Close pane: ${i}`), h.textContent = "×", h.addEventListener("click", (e) => {
578
+ e.stopPropagation(), this.closeFloatingPane(n);
579
+ }), h.addEventListener("pointerdown", (e) => e.stopPropagation()), p.appendChild(h), r.appendChild(p), t.root) {
580
+ let e = this.renderNode(t.root, [], n);
581
+ e.classList.add("dock-floating__stack"), r.appendChild(e);
582
+ }
583
+ [
584
+ {
585
+ classes: ["dock-floating__resizer", "dock-floating__resizer--top-left"],
586
+ edges: {
587
+ horizontal: "left",
588
+ vertical: "top"
589
+ }
590
+ },
591
+ {
592
+ classes: ["dock-floating__resizer", "dock-floating__resizer--top"],
593
+ edges: {
594
+ horizontal: "none",
595
+ vertical: "top"
596
+ }
597
+ },
598
+ {
599
+ classes: ["dock-floating__resizer", "dock-floating__resizer--top-right"],
600
+ edges: {
601
+ horizontal: "right",
602
+ vertical: "top"
603
+ }
604
+ },
605
+ {
606
+ classes: ["dock-floating__resizer", "dock-floating__resizer--right"],
607
+ edges: {
608
+ horizontal: "right",
609
+ vertical: "none"
610
+ }
611
+ },
612
+ {
613
+ classes: ["dock-floating__resizer", "dock-floating__resizer--bottom-right"],
614
+ edges: {
615
+ horizontal: "right",
616
+ vertical: "bottom"
617
+ }
618
+ },
619
+ {
620
+ classes: ["dock-floating__resizer", "dock-floating__resizer--bottom"],
621
+ edges: {
622
+ horizontal: "none",
623
+ vertical: "bottom"
624
+ }
625
+ },
626
+ {
627
+ classes: ["dock-floating__resizer", "dock-floating__resizer--bottom-left"],
628
+ edges: {
629
+ horizontal: "left",
630
+ vertical: "bottom"
631
+ }
632
+ },
633
+ {
634
+ classes: ["dock-floating__resizer", "dock-floating__resizer--left"],
635
+ edges: {
636
+ horizontal: "left",
637
+ vertical: "none"
638
+ }
639
+ }
640
+ ].forEach(({ classes: e, edges: t }) => {
641
+ let i = this.documentRef.createElement("div");
642
+ i.classList.add(...e), i.setAttribute("role", "separator");
643
+ let a = t.horizontal === "none" && t.vertical !== "none", o = t.vertical === "none" && t.horizontal !== "none";
644
+ a ? i.setAttribute("aria-orientation", "horizontal") : o && i.setAttribute("aria-orientation", "vertical");
645
+ let s = [];
646
+ t.vertical === "top" ? s.push("top") : t.vertical === "bottom" && s.push("bottom"), t.horizontal === "left" ? s.push("left") : t.horizontal === "right" && s.push("right"), i.setAttribute("aria-label", `Resize pane ${s.length === 2 ? "corner " : "edge "}${s.join("-")}`), i.addEventListener("pointerdown", (e) => this.beginFloatingResize(e, n, r, i, t)), i.setAttribute("tabindex", "0"), i.setAttribute("aria-valuemin", "0"), i.setAttribute("aria-valuemax", "100"), this.syncFloatingResizerValue(i, n, t), i.addEventListener("keydown", (e) => this.onFloatingResizeKeydown(e, n, r, i, t)), r.appendChild(i);
647
+ }), this.floatingLayerEl.appendChild(r);
648
+ });
649
+ }
650
+ onSplitterResize() {
651
+ this.scheduleRenderIntersectionHandles();
652
+ }
653
+ scheduleRenderIntersectionHandles() {
654
+ if (this.intersectionRaf !== null) return;
655
+ let e = this.windowRef;
656
+ e && (this.intersectionRaf = e.setTimeout(() => {
657
+ this.intersectionRaf = null, this.renderIntersectionHandles();
658
+ }, 5));
659
+ }
660
+ renderIntersectionHandles() {
661
+ let e = this.shadowRoot?.querySelector(".dock-intersections-layer, .dock-intersection-layer");
662
+ if (!e) return;
663
+ let t = this.rootEl.getBoundingClientRect();
664
+ if (this.cornerResizeState) {
665
+ let n = this.cornerResizeState, r = n.hs[0], i = n.vs[0], a = r ? this.getSplitterDividers(r.container)[r.index] : null, o = i ? this.getSplitterDividers(i.container)[i.index] : null;
666
+ if (a && o) {
667
+ let r = a.getBoundingClientRect(), i = o.getBoundingClientRect(), s = i.left + i.width / 2 - t.left, c = r.top + r.height / 2 - t.top;
668
+ n.handle.style.left = `${s}px`, n.handle.style.top = `${c}px`, Array.from(e.querySelectorAll(".dock-intersection-handle")).forEach((e) => {
669
+ e !== n.handle && e.remove();
670
+ });
671
+ }
672
+ return;
673
+ }
674
+ e.replaceChildren();
675
+ let n = [], r = [];
676
+ Array.from(this.shadowRoot?.querySelectorAll(".dock-split") ?? []).forEach((e) => {
677
+ let t = e.dataset.direction, i = e.dataset.path ?? "", a = this.splitterLayerKey(e);
678
+ this.getSplitterDividers(e).forEach((e, o) => {
679
+ let s = {
680
+ rect: e.getBoundingClientRect(),
681
+ pathStr: i,
682
+ index: o,
683
+ layerKey: a
684
+ };
685
+ t === "horizontal" ? r.push(s) : t === "vertical" && n.push(s);
686
+ });
687
+ });
688
+ let i = /* @__PURE__ */ new Map();
689
+ n.forEach((e) => {
690
+ let n = e.rect.top + e.rect.height / 2;
691
+ r.forEach((r) => {
692
+ if (e.layerKey !== r.layerKey) return;
693
+ let a = r.rect.left + r.rect.width / 2, o = a < e.rect.left ? e.rect.left - a : a > e.rect.right ? a - e.rect.right : 0, s = n < r.rect.top ? r.rect.top - n : n > r.rect.bottom ? n - r.rect.bottom : 0;
694
+ if (o > 24 || s > 24) return;
695
+ let c = a - t.left, l = n - t.top, u = `${Math.round(c)}:${Math.round(l)}`, d = i.get(u) ?? {
696
+ x: c,
697
+ y: l,
698
+ pairs: []
699
+ };
700
+ d.pairs.push({
701
+ h: {
702
+ pathStr: e.pathStr,
703
+ index: e.index
704
+ },
705
+ v: {
706
+ pathStr: r.pathStr,
707
+ index: r.index
708
+ }
709
+ }), i.set(u, d);
710
+ });
711
+ }), i.forEach((n, r) => {
712
+ let i = this.documentRef.createElement("div");
713
+ i.classList.add("dock-intersection-handle", "glyph"), i.setAttribute("role", "separator"), i.setAttribute("aria-label", "Resize split intersection");
714
+ let a = t.width > 0 ? Math.round(n.x / t.width * 100) : 0;
715
+ i.setAttribute("aria-valuemin", "0"), i.setAttribute("aria-valuemax", "100"), i.setAttribute("aria-valuenow", String(Math.min(100, Math.max(0, a)))), i.setAttribute("tabindex", "0");
716
+ let o = n.pairs[0], s = `${o.h.pathStr}:${o.h.index}|${o.v.pathStr}:${o.v.index}`;
717
+ i.dataset.key = s, i.dataset.pairs = JSON.stringify(n.pairs), i.style.left = `${n.x}px`, i.style.top = `${n.y}px`, i.addEventListener("pointerdown", (e) => this.beginCornerResize(e, i)), i.addEventListener("dblclick", (e) => this.onIntersectionDoubleClick(e, i)), i.addEventListener("keydown", (e) => this.onIntersectionKeyDown(e, i)), e.appendChild(i);
718
+ });
719
+ }
720
+ onIntersectionKeyDown(e, t) {
721
+ let n = e.key === "ArrowLeft" || e.key === "ArrowRight", r = e.key === "ArrowUp" || e.key === "ArrowDown", i = e.key === "Home" || e.key === "End";
722
+ if (!n && !r && !i) return;
723
+ let a = t.dataset.pairs;
724
+ if (!a) return;
725
+ let o;
726
+ try {
727
+ o = JSON.parse(a);
728
+ } catch {
729
+ return;
730
+ }
731
+ if (o.length === 0) return;
732
+ e.preventDefault();
733
+ let s = e.shiftKey, c = n || i ? o[0].v : o[0].h;
734
+ this.findSplitterByPath(z(c.pathStr))?.resizeDividerBy?.(c.index, e.key, s);
735
+ }
736
+ beginCornerResize(e, t) {
737
+ e.preventDefault();
738
+ let n = p(t.dataset.pairs, t.dataset.key), r = ({ pathStr: e, index: t }, n) => {
739
+ let r = z(e), i = this.findSplitterByPath(r), a = i ? this.getSplitterPanels(i) : [];
740
+ return !r || !i || a.length === 0 ? null : {
741
+ path: r,
742
+ index: t,
743
+ container: i,
744
+ initialSizes: a.map((e) => e.getBoundingClientRect()[n])
745
+ };
746
+ }, i = n.map((e) => r(e.h, "height")).filter((e) => e !== null), a = n.map((e) => r(e.v, "width")).filter((e) => e !== null);
747
+ if (i.length === 0 && a.length === 0) return;
748
+ try {
749
+ t.setPointerCapture(e.pointerId);
750
+ } catch {}
751
+ t.dataset.resizing = "true", t.classList.add("hovering"), this.cornerResizeState = {
752
+ pointerId: e.pointerId,
753
+ handle: t,
754
+ hs: i.map((t) => ({
755
+ path: V(t.path),
756
+ index: t.index,
757
+ container: t.container,
758
+ initialSizes: t.initialSizes,
759
+ startY: e.clientY
760
+ })),
761
+ vs: a.map((t) => ({
762
+ path: V(t.path),
763
+ index: t.index,
764
+ container: t.container,
765
+ initialSizes: t.initialSizes,
766
+ startX: e.clientX
767
+ }))
768
+ }, this.startPointerTracking(), t.dataset.key || (t.dataset.key = t.dataset.group ?? "");
769
+ let o = (e) => e ? this.getSplitterDividers(e.container)[e.index]?.getBoundingClientRect() ?? null : null, s = o(a[0]), c = o(i[0]), l = Array.from(this.shadowRoot?.querySelectorAll(".dock-split") ?? []).flatMap((e) => {
770
+ let t = e.dataset.direction;
771
+ return this.getSplitterDividers(e).map((e) => ({
772
+ direction: t,
773
+ rect: e.getBoundingClientRect()
774
+ }));
775
+ }), u = I({
776
+ x: s ? s.left + s.width / 2 : null,
777
+ y: c ? c.top + c.height / 2 : null
778
+ }, l, this.rootEl.getBoundingClientRect());
779
+ this.cornerSnapXTargets = u.x, this.cornerSnapYTargets = u.y;
780
+ }
781
+ handleCornerResizeMove(e) {
782
+ let t = this.cornerResizeState;
783
+ if (!t || t.pointerId !== e.pointerId) return;
784
+ let n = this.rootEl.getBoundingClientRect(), r = N(e.clientX, this.cornerSnapXTargets.map((e) => n.left + e), 10), i = N(e.clientY, this.cornerSnapYTargets.map((e) => n.top + e), 10), a = (t, n) => {
785
+ let r = D(t.path, this.rootLayout, this.floatingLayouts);
786
+ if (!r) return;
787
+ let i = F(t.initialSizes, t.index, n, 48, e.shiftKey);
788
+ i && (r.sizes = i.weights, t.container.setPanelSizes?.(i.pixels));
789
+ };
790
+ t.hs.forEach((e) => a(e, i - e.startY)), t.vs.forEach((e) => a(e, r - e.startX)), this.dispatchLayoutChanged(), this.scheduleRenderIntersectionHandles();
791
+ }
792
+ endCornerResize(e) {
793
+ let t = this.cornerResizeState;
794
+ if (t && e === t.pointerId) {
795
+ try {
796
+ t.handle.releasePointerCapture(t.pointerId);
797
+ } catch {}
798
+ t.handle.dataset.resizing = "false", this.cornerResizeState = null, this.scheduleRenderIntersectionHandles(), this.cornerSnapXTargets = [], this.cornerSnapYTargets = [];
799
+ }
800
+ }
801
+ onIntersectionDoubleClick(e, t) {
802
+ e.preventDefault();
803
+ let n = p(t.dataset.pairs, t.dataset.key);
804
+ if (n.length === 0) return;
805
+ let r = h(n, this.previousSplitSizes, (e) => {
806
+ let t = z(e), n = t ? D(t, this.rootLayout, this.floatingLayouts) : null;
807
+ return n ? {
808
+ sizes: n.sizes,
809
+ childCount: n.children.length
810
+ } : null;
811
+ });
812
+ r.remember.forEach(({ pathStr: e, sizes: t }) => this.previousSplitSizes.set(e, t)), r.writes.forEach(({ pathStr: e, sizes: t }) => {
813
+ let n = z(e), r = n ? D(n, this.rootLayout, this.floatingLayouts) : null;
814
+ r && n && (r.sizes = t, this.pushSizesToSplitter(n, t));
815
+ }), r.clearStored && this.previousSplitSizes.clear(), this.dispatchLayoutChanged(), this.scheduleRenderIntersectionHandles();
816
+ }
817
+ pushSizesToSplitter(e, t) {
818
+ let n = this.findSplitterByPath(e);
819
+ if (!n) return;
820
+ let r = (n.dataset.direction ?? "horizontal") === "horizontal" ? n.getBoundingClientRect().width : n.getBoundingClientRect().height;
821
+ if (!Number.isFinite(r) || r <= 0) return;
822
+ let i = t.reduce((e, t) => e + Math.max(t, 0), 0);
823
+ if (i <= 0) return;
824
+ let a = t.map((e) => Math.max(e, 0) / i * r);
825
+ n.setPanelSizes?.(a);
826
+ }
827
+ beginFloatingDrag(e, t, n, r) {
828
+ let i = this.floatingLayouts[t];
829
+ if (!i) return;
830
+ e.preventDefault(), e.stopPropagation(), i.bounds = s(i.bounds, this.getHostSize());
831
+ let { left: a, top: o } = i.bounds;
832
+ try {
833
+ r.setPointerCapture(e.pointerId);
834
+ } catch {}
835
+ this.promoteFloatingPane(t, n), n.dataset.dragging = "true", this.floatingDragState = {
836
+ index: t,
837
+ pointerId: e.pointerId,
838
+ startX: e.clientX,
839
+ startY: e.clientY,
840
+ startLeft: a,
841
+ startTop: o,
842
+ wrapper: n,
843
+ handle: r
844
+ }, this.startPointerTracking();
845
+ }
846
+ syncFloatingResizerValue(e, t, n) {
847
+ let r = this.floatingLayouts[t], i = this.getHostSize();
848
+ if (!r || i.width <= 0 || i.height <= 0) return;
849
+ let a = n.horizontal === "none" ? r.bounds.height / i.height * 100 : r.bounds.width / i.width * 100;
850
+ e.setAttribute("aria-valuenow", String(Math.round(Math.min(100, Math.max(0, a)))));
851
+ }
852
+ onFloatingResizeKeydown(e, t, n, r, i) {
853
+ if (e.altKey || e.ctrlKey || e.metaKey) return;
854
+ let a = e.key === "ArrowLeft" ? -1 : +(e.key === "ArrowRight"), o = e.key === "ArrowUp" ? -1 : +(e.key === "ArrowDown");
855
+ if (a === 0 && o === 0 || a !== 0 && i.horizontal === "none" || o !== 0 && i.vertical === "none") return;
856
+ let s = this.floatingLayouts[t];
857
+ if (!s) return;
858
+ e.preventDefault(), e.stopPropagation();
859
+ let c = e.shiftKey ? 1 : 10, l = A(s.bounds, i, {
860
+ x: a * c,
861
+ y: o * c
862
+ }, this.getHostSize());
863
+ this.applyFloatingBounds(n, t, l), this.syncFloatingResizerValue(r, t, i), this.dispatchLayoutChanged();
864
+ }
865
+ beginFloatingResize(e, t, n, r, i) {
866
+ let a = this.floatingLayouts[t];
867
+ if (a) {
868
+ e.preventDefault(), e.stopPropagation();
869
+ try {
870
+ r.setPointerCapture(e.pointerId);
871
+ } catch {}
872
+ r.dataset.resizing = "true", this.promoteFloatingPane(t, n), a.bounds = s(a.bounds, this.getHostSize()), this.floatingResizeState = {
873
+ index: t,
874
+ pointerId: e.pointerId,
875
+ startX: e.clientX,
876
+ startY: e.clientY,
877
+ startWidth: a.bounds.width,
878
+ startHeight: a.bounds.height,
879
+ startLeft: a.bounds.left,
880
+ startTop: a.bounds.top,
881
+ wrapper: n,
882
+ handle: r,
883
+ edges: i
884
+ }, this.startPointerTracking();
885
+ }
886
+ }
887
+ handleFloatingDragMove(e) {
888
+ let t = this.floatingDragState;
889
+ if (!t || e.pointerId !== t.pointerId) return;
890
+ let n = this.floatingLayouts[t.index];
891
+ if (!n) return;
892
+ let r = e.clientX - t.startX, i = e.clientY - t.startY, a = s({
893
+ left: t.startLeft + r,
894
+ top: t.startTop + i,
895
+ width: n.bounds.width,
896
+ height: n.bounds.height
897
+ }, this.getHostSize());
898
+ t.wrapper.style.left = `${a.left}px`, t.wrapper.style.top = `${a.top}px`, n.bounds = a, this.updateFloatingDragDropTarget(e);
899
+ }
900
+ endFloatingDrag(e) {
901
+ let t = this.floatingDragState;
902
+ if (!t || e !== t.pointerId) return;
903
+ try {
904
+ t.handle.releasePointerCapture(t.pointerId);
905
+ } catch {}
906
+ delete t.handle.dataset.resizing, delete t.wrapper.dataset.dragging;
907
+ let n = t.dropTarget ? this.handleFloatingStackDrop(t.index, t.dropTarget.path, t.dropTarget.zone) : !1;
908
+ this.floatingDragState = null, this.hideDropIndicator(), n || this.dispatchLayoutChanged();
909
+ }
910
+ updateFloatingDragDropTarget(e) {
911
+ let t = this.floatingDragState;
912
+ if (!t) return;
913
+ let n = this.findStackAtPoint(e.clientX, e.clientY);
914
+ if (!n) {
915
+ t.dropTarget && (delete t.dropTarget, this.hideDropIndicator());
916
+ return;
917
+ }
918
+ let r = z(n.dataset.path);
919
+ if (!r || r.type === "floating" && r.index === t.index) {
920
+ t.dropTarget && (delete t.dropTarget, this.hideDropIndicator());
921
+ return;
922
+ }
923
+ this.dropJoystickTarget && this.dropJoystickTarget !== n && (delete this.dropJoystick.dataset.zone, this.updateDropJoystickActiveZone(null));
924
+ let i = this.computeDropZone(n, e, this.extractDropZoneFromEvent(e));
925
+ i ? t.dropTarget = {
926
+ path: r,
927
+ zone: i
928
+ } : t.dropTarget && delete t.dropTarget, this.showDropIndicator(n, i);
929
+ }
930
+ handleFloatingResizeMove(e) {
931
+ let t = this.floatingResizeState;
932
+ if (!t || e.pointerId !== t.pointerId) return;
933
+ let n = A({
934
+ left: t.startLeft,
935
+ top: t.startTop,
936
+ width: t.startWidth,
937
+ height: t.startHeight
938
+ }, t.edges, {
939
+ x: e.clientX - t.startX,
940
+ y: e.clientY - t.startY
941
+ }, this.getHostSize());
942
+ this.applyFloatingBounds(t.wrapper, t.index, n);
943
+ }
944
+ applyFloatingBounds(e, t, n) {
945
+ e.style.left = `${n.left}px`, e.style.top = `${n.top}px`, e.style.width = `${n.width}px`, e.style.height = `${n.height}px`;
946
+ let r = this.floatingLayouts[t];
947
+ r && (r.bounds = n);
948
+ }
949
+ endFloatingResize(e) {
950
+ let t = this.floatingResizeState;
951
+ if (t && e === t.pointerId) {
952
+ try {
953
+ t.handle.releasePointerCapture(t.pointerId);
954
+ } catch {}
955
+ delete t.handle.dataset.resizing, this.syncFloatingResizerValue(t.handle, t.index, t.edges), this.floatingResizeState = null, this.dispatchLayoutChanged();
956
+ }
957
+ }
958
+ getHostSize() {
959
+ return {
960
+ width: this.rootEl.clientWidth,
961
+ height: this.rootEl.clientHeight
962
+ };
963
+ }
964
+ updateFloatingPanePositions() {
965
+ if (!this.floatingLayerEl) return;
966
+ let e = this.getHostSize();
967
+ this.floatingLayouts.forEach((t, n) => {
968
+ let r = this.floatingLayerEl.children[n];
969
+ if (!r) return;
970
+ let { left: i, top: a, width: o, height: c } = s(t.bounds, e);
971
+ r.style.left = `${i}px`, r.style.top = `${a}px`, r.style.width = `${o}px`, r.style.height = `${c}px`, r.style.minWidth = "0", r.style.minHeight = "0";
972
+ });
973
+ }
974
+ promoteFloatingPane(e, t) {
975
+ let n = this.floatingLayouts[e];
976
+ if (!n) return;
977
+ let r = this.floatingLayouts.reduce((t, n, r) => {
978
+ if (!n) return t;
979
+ let i = r === e ? -Infinity : l(this.floatingLayouts[r], r);
980
+ return Math.max(t, i);
981
+ }, 0), i = Math.max(r + 2, 12);
982
+ n.zIndex = i, t.style.zIndex = String(i);
983
+ }
984
+ getFloatingWrapper(e) {
985
+ let t = `.dock-floating[data-path="${R({
986
+ type: "floating",
987
+ index: e,
988
+ segments: []
989
+ })}"]`;
990
+ return this.floatingLayerEl.querySelector(t);
991
+ }
992
+ startPointerTracking() {
993
+ if (this.pointerTrackingActive) return;
994
+ let e = this.windowRef;
995
+ e?.addEventListener("pointermove", this.onPointerMove), e?.addEventListener("pointerup", this.onPointerUp), e?.addEventListener("pointercancel", this.onPointerCancel), this.pointerTrackingActive = !0;
996
+ }
997
+ stopPointerTrackingIfIdle() {
998
+ if (this.pointerTrackingActive && !this.floatingDragState && !this.floatingResizeState && !this.cornerResizeState) {
999
+ let e = this.windowRef;
1000
+ e?.removeEventListener("pointermove", this.onPointerMove), e?.removeEventListener("pointerup", this.onPointerUp), e?.removeEventListener("pointercancel", this.onPointerCancel), this.pointerTrackingActive = !1;
1001
+ }
1002
+ }
1003
+ getFloatingWindowTitle(e) {
1004
+ let t = "Floating Pane";
1005
+ if (!e || !e.root) return t;
1006
+ let n = e.activePane ?? x(e.root);
1007
+ return n ? this.titles[n] ?? n ?? t : t;
1008
+ }
1009
+ updateFloatingWindowTitle(e) {
1010
+ let t = this.floatingLayouts[e];
1011
+ if (!t) return;
1012
+ let n = `.dock-floating[data-path="${R({
1013
+ type: "floating",
1014
+ index: e,
1015
+ segments: []
1016
+ })}"]`, r = this.floatingLayerEl.querySelector(n);
1017
+ if (!r) return;
1018
+ let i = r.querySelector(".dock-floating__title");
1019
+ i && (i.textContent = this.getFloatingWindowTitle(t));
1020
+ }
1021
+ renderSplit(e, t, n) {
1022
+ let r = this.documentRef.createElement("mp-splitter");
1023
+ r.classList.add("dock-split"), r.dataset.direction = e.direction, r.setAttribute("orientation", e.direction);
1024
+ let i = typeof n == "number" ? {
1025
+ type: "floating",
1026
+ index: n,
1027
+ segments: [...t]
1028
+ } : {
1029
+ type: "docked",
1030
+ segments: [...t]
1031
+ };
1032
+ r.dataset.path = R(i), e.children.forEach((e, i) => {
1033
+ r.appendChild(this.renderNode(e, [...t, i], n));
1034
+ });
1035
+ let a = Array.isArray(e.sizes) ? e.sizes : [];
1036
+ return a.length > 0 && requestAnimationFrame(() => {
1037
+ let t = a.reduce((e, t) => e + Math.max(t, 0), 0);
1038
+ if (t <= 0) return;
1039
+ let n = e.direction === "horizontal" ? r.getBoundingClientRect().width : r.getBoundingClientRect().height;
1040
+ if (!Number.isFinite(n) || n <= 0) return;
1041
+ let i = a.map((e) => Math.max(e, 0) / t * n);
1042
+ r.setPanelSizes?.(i), requestAnimationFrame(() => this.scheduleRenderIntersectionHandles());
1043
+ }), r.addEventListener("resize-end", (e) => {
1044
+ if (e.target !== r) return;
1045
+ let t = e.detail;
1046
+ if (!Array.isArray(t?.sizes) || t.sizes.length === 0) return;
1047
+ let n = D(i, this.rootLayout, this.floatingLayouts);
1048
+ if (!n) return;
1049
+ let a = (n.sizes ?? []).reduce((e, t) => e + Math.max(t, 0), 0), o = t.sizes.reduce((e, t) => e + Math.max(t, 0), 0), s = a > 0 ? a : t.sizes.length;
1050
+ o > 0 && (n.sizes = t.sizes.map((e) => Math.max(e, 0) / o * s), this.dispatchLayoutChanged());
1051
+ }), r;
1052
+ }
1053
+ renderStack(e, t, n) {
1054
+ let r = this.documentRef.createElement("mp-tab-control");
1055
+ r.classList.add("dock-stack"), r.setAttribute("select-first-tab", "false"), r.setAttribute("border", "top");
1056
+ let i = typeof n == "number" ? {
1057
+ type: "floating",
1058
+ index: n,
1059
+ segments: [...t]
1060
+ } : {
1061
+ type: "docked",
1062
+ segments: [...t]
1063
+ };
1064
+ r.dataset.path = R(i);
1065
+ let a = Array.from(new Set(e.panes));
1066
+ if (a.length === 0) {
1067
+ let e = this.documentRef.createElement("span");
1068
+ e.setAttribute("slot", "__empty__-header"), e.textContent = "(empty)";
1069
+ let t = this.documentRef.createElement("div");
1070
+ return t.setAttribute("slot", "__empty__-content"), t.classList.add("dock-stack__pane"), t.textContent = "No panes configured", r.append(e, t), r.setAttribute("active-tab", "__empty__"), r;
1071
+ }
1072
+ let o = a.includes(e.activePane ?? "") ? e.activePane : a[0], s = t.length ? t.join("-") : "root", c = typeof n == "number" ? `f${n}-${s}` : s;
1073
+ return a.forEach((e) => {
1074
+ let t = e.replace(/[^a-zA-Z0-9_-]/g, "-"), n = t.length > 0 ? t : "pane", a = `${this.instanceId}-tab-${c}-${n}`, s = `${this.instanceId}-panel-${c}-${n}`, l = this.documentRef.createElement("span");
1075
+ l.setAttribute("slot", `${a}-header`), l.classList.add("dock-tab"), l.dataset.pane = e, l.dataset.tabId = a, l.textContent = this.titles[e] ?? e, l.addEventListener("pointerdown", (t) => {
1076
+ this.captureTabDragMetrics(t, r), this.armPaneDragGesture(t, V(i), e, r), t.stopPropagation();
1077
+ });
1078
+ let u = this.documentRef.createElement("div");
1079
+ u.setAttribute("slot", `${a}-content`), u.classList.add("dock-stack__pane"), u.dataset.pane = e, u.dataset.tabId = a, u.id = s;
1080
+ let d = this.documentRef.createElement("slot");
1081
+ d.name = e, u.appendChild(d), r.append(l, u), e === o && r.setAttribute("active-tab", a);
1082
+ }), r.dataset.activePane = o, r.addEventListener("tab-activate", (e) => {
1083
+ let t = e.detail, n = this.stackChildren(r).find((e) => e.dataset.tabId === t.tabId)?.dataset.pane;
1084
+ n && (this.activatePane(r, n, V(i)), this.dispatchEvent(new CustomEvent("dock-pane-activated", {
1085
+ detail: { pane: n },
1086
+ bubbles: !0,
1087
+ composed: !0
1088
+ })));
1089
+ }), r;
1090
+ }
1091
+ getStackStripEl(e) {
1092
+ return e.tagName === "MP-TAB-CONTROL" ? e.shadowRoot?.querySelector(".tsc") ?? null : null;
1093
+ }
1094
+ getStackTabButtons(e) {
1095
+ return e.tagName === "MP-TAB-CONTROL" ? Array.from(e.shadowRoot?.querySelectorAll("button.nav-link") ?? []) : [];
1096
+ }
1097
+ getSplitterDividers(e) {
1098
+ return e.tagName === "MP-SPLITTER" ? Array.from(e.shadowRoot?.querySelectorAll(".divider") ?? []) : [];
1099
+ }
1100
+ getSplitterPanels(e) {
1101
+ return e.tagName === "MP-SPLITTER" ? Array.from(e.shadowRoot?.querySelectorAll(".panel-wrapper") ?? []) : [];
1102
+ }
1103
+ findSplitterByPath(e) {
1104
+ return e ? this.shadowRoot?.querySelector(`.dock-split[data-path="${R(e)}"]`) ?? null : null;
1105
+ }
1106
+ onPointerMove(e) {
1107
+ this.cornerResizeState && e.pointerId === this.cornerResizeState.pointerId && this.handleCornerResizeMove(e), this.floatingResizeState && e.pointerId === this.floatingResizeState.pointerId && this.handleFloatingResizeMove(e), this.floatingDragState && e.pointerId === this.floatingDragState.pointerId && this.handleFloatingDragMove(e);
1108
+ }
1109
+ onPointerUp(e) {
1110
+ this.cornerResizeState && e.pointerId === this.cornerResizeState.pointerId && this.endCornerResize(e.pointerId), this.floatingDragState && e.pointerId === this.floatingDragState.pointerId && this.endFloatingDrag(e.pointerId), this.floatingResizeState && e.pointerId === this.floatingResizeState.pointerId && this.endFloatingResize(e.pointerId), this.stopPointerTrackingIfIdle();
1111
+ }
1112
+ onPointerCancel(e) {
1113
+ this.floatingDragState && e.pointerId === this.floatingDragState.pointerId && (delete this.floatingDragState.dropTarget, this.endFloatingDrag(e.pointerId)), this.floatingResizeState && e.pointerId === this.floatingResizeState.pointerId && this.endFloatingResize(e.pointerId), this.cornerResizeState && e.pointerId === this.cornerResizeState.pointerId && this.endCornerResize(e.pointerId), this.stopPointerTrackingIfIdle();
1114
+ }
1115
+ captureTabDragMetrics(e, t) {
1116
+ if (!t || !Number.isFinite(e.clientX) || !Number.isFinite(e.clientY)) {
1117
+ this.pendingTabDragMetrics = null;
1118
+ return;
1119
+ }
1120
+ let n = this.getBoundingClientRect(), r = t.getBoundingClientRect(), i = e.clientX - r.left, a = e.clientY - r.top, o = r.left - n.left, s = r.top - n.top, c = Number.isFinite(r.width) ? r.width : 0, l = Number.isFinite(r.height) ? r.height : 0;
1121
+ this.pendingTabDragMetrics = {
1122
+ pointerOffsetX: i,
1123
+ pointerOffsetY: a,
1124
+ left: o,
1125
+ top: s,
1126
+ width: c,
1127
+ height: l,
1128
+ startClientX: e.clientX,
1129
+ startClientY: e.clientY
1130
+ };
1131
+ }
1132
+ clearPendingTabDragMetrics() {
1133
+ this.pendingTabDragMetrics = null;
1134
+ }
1135
+ armPaneDragGesture(e, t, n, r) {
1136
+ if (e.pointerType === "touch") {
1137
+ this.armPaneDragGestureTouch(e, t, n, r);
1138
+ return;
1139
+ }
1140
+ if (e.pointerType === "mouse" && e.button !== 0) return;
1141
+ let i = this.windowRef;
1142
+ if (!i) return;
1143
+ let a = e.clientX, o = e.clientY, s = e.pointerId, c = !1, l = () => {
1144
+ c = !0, i.removeEventListener("pointermove", u, !0), i.removeEventListener("pointerup", d, !0), i.removeEventListener("pointercancel", d, !0);
1145
+ }, u = (e) => {
1146
+ if (c || e.pointerId !== s) return;
1147
+ let i = e.clientX - a, u = e.clientY - o;
1148
+ Math.hypot(i, u) < 5 || (l(), this.beginPaneDrag(e, t, n, r));
1149
+ }, d = (e) => {
1150
+ c || e.pointerId !== s || (l(), this.clearPendingTabDragMetrics());
1151
+ };
1152
+ i.addEventListener("pointermove", u, !0), i.addEventListener("pointerup", d, !0), i.addEventListener("pointercancel", d, !0);
1153
+ }
1154
+ armPaneDragGestureTouch(e, t, n, r) {
1155
+ let a = this.windowRef;
1156
+ if (!a) return;
1157
+ let o = e.clientX, s = e.clientY, c = e.pointerId, l = o, u = s, d = o, f = !1, p = !1, m = !1, h = e.currentTarget instanceof HTMLElement ? e.currentTarget : e.target instanceof HTMLElement ? e.target.closest(".dock-tab") : null, g = r ? this.getStackStripEl(r)?.querySelector("ul.nav.nav-tabs") ?? null : null, _ = () => {
1158
+ f || (f = !0, a.clearTimeout(x), a.clearTimeout(S), a.removeEventListener("pointermove", v, !0), a.removeEventListener("pointerup", y, !0), a.removeEventListener("pointercancel", b, !0), m && h && h.removeAttribute("data-pressing"));
1159
+ }, v = (e) => {
1160
+ if (f || e.pointerId !== c) return;
1161
+ if (p) {
1162
+ let t = e.clientX - d;
1163
+ d = e.clientX, g && (g.scrollLeft -= t);
1164
+ return;
1165
+ }
1166
+ l = e.clientX, u = e.clientY;
1167
+ let t = e.clientX - o, n = e.clientY - s;
1168
+ if (Math.hypot(t, n) <= i.TOUCH_LONG_PRESS_SLOP_PX) return;
1169
+ let r = !!g && g.scrollWidth > g.clientWidth;
1170
+ Math.abs(t) > Math.abs(n) && r ? (a.clearTimeout(x), a.clearTimeout(S), m && h && (h.removeAttribute("data-pressing"), m = !1), p = !0, d = e.clientX, g.scrollLeft -= t, this.clearPendingTabDragMetrics()) : (_(), this.clearPendingTabDragMetrics());
1171
+ }, y = (e) => {
1172
+ f || e.pointerId !== c || (_(), this.clearPendingTabDragMetrics());
1173
+ }, b = (e) => {
1174
+ f || e.pointerId !== c || (_(), this.clearPendingTabDragMetrics());
1175
+ }, x = a.setTimeout(() => {
1176
+ if (f) return;
1177
+ _();
1178
+ try {
1179
+ this.setPointerCapture(c);
1180
+ } catch {}
1181
+ if (typeof navigator < "u" && typeof navigator.vibrate == "function") try {
1182
+ navigator.vibrate(10);
1183
+ } catch {}
1184
+ let e = new PointerEvent("pointermove", {
1185
+ pointerId: c,
1186
+ pointerType: "touch",
1187
+ isPrimary: !0,
1188
+ clientX: l,
1189
+ clientY: u,
1190
+ bubbles: !1,
1191
+ cancelable: !1
1192
+ });
1193
+ this.beginPaneDrag(e, t, n, r);
1194
+ }, i.TOUCH_LONG_PRESS_MS), S = a.setTimeout(() => {
1195
+ !f && h && (m = !0, h.setAttribute("data-pressing", "true"));
1196
+ }, i.TOUCH_PRESS_FEEDBACK_DELAY_MS);
1197
+ a.addEventListener("pointermove", v, !0), a.addEventListener("pointerup", y, !0), a.addEventListener("pointercancel", b, !0);
1198
+ }
1199
+ beginPaneDrag(e, t, n, r) {
1200
+ let { path: i, floatingIndex: a, pointerOffsetX: o, pointerOffsetY: s } = this.preparePaneDragSource(t, n, r, e), c = r ? this.getStackStripEl(r) : null, l = c ? c.getBoundingClientRect() : null, u = l ? {
1201
+ left: l.left,
1202
+ top: l.top,
1203
+ right: l.right,
1204
+ bottom: l.bottom
1205
+ } : null, d = this.pendingTabDragMetrics;
1206
+ if (this.dragState = {
1207
+ pane: n,
1208
+ sourcePath: V(i),
1209
+ floatingIndex: a,
1210
+ pointerOffsetX: o,
1211
+ pointerOffsetY: s,
1212
+ dropHandled: !1,
1213
+ sourceStackEl: r,
1214
+ sourceHeaderBounds: u,
1215
+ startClientX: d && Number.isFinite(d.startClientX) ? d.startClientX : e.clientX,
1216
+ startClientY: d && Number.isFinite(d.startClientY) ? d.startClientY : e.clientY
1217
+ }, this.lastDragPointerPosition = {
1218
+ x: this.dragState.startClientX,
1219
+ y: this.dragState.startClientY
1220
+ }, this.updateDraggedFloatingPositionFromPoint(e.clientX, e.clientY), this.startDragPointerTracking(), this.markDraggedFloatingWrapper(), this.dragState && this.dragState.floatingIndex !== null && this.dragState.floatingIndex < 0) {
1221
+ let t = this.resolveStackLocation(this.dragState.sourcePath);
1222
+ if (t && Array.isArray(t.node.panes) && t.node.panes.length === 1) {
1223
+ let n = !1;
1224
+ if (t.context === "docked") n = !0;
1225
+ else if (t.context === "floating") {
1226
+ let e = this.floatingLayouts[t.index];
1227
+ n = (e && e.root ? E(e.root) : 0) > 1;
1228
+ }
1229
+ n && this.convertPendingTabDragToFloating(e.clientX, e.clientY);
1230
+ }
1231
+ }
1232
+ }
1233
+ preparePaneDragSource(e, t, n, r) {
1234
+ let i = this.resolveStackLocation(e);
1235
+ if (!i || !i.node.panes.includes(t)) return {
1236
+ path: e,
1237
+ floatingIndex: null,
1238
+ pointerOffsetX: 0,
1239
+ pointerOffsetY: 0
1240
+ };
1241
+ let a = this.pendingTabDragMetrics, o = !!n && Array.from(n.querySelectorAll(".dock-tab")).some((e) => e.dataset.pane && e.dataset.pane !== t), s = i.node.panes.some((e) => e !== t), c = i.context === "floating" ? this.floatingLayouts[i.index] : null, l = c && c.root ? E(c.root) : s ? 2 : 1;
1242
+ if (i.context === "floating" && c && !s && !o && l <= 1) {
1243
+ if (c) {
1244
+ c.activePane = t, this.updateFloatingWindowTitle(i.index);
1245
+ let n = this.getFloatingWrapper(i.index);
1246
+ n && this.promoteFloatingPane(i.index, n);
1247
+ let o = this.getBoundingClientRect(), s = a && Number.isFinite(a.pointerOffsetX) && Number.isFinite(a.left) && Number.isFinite(c.bounds.left) ? a.pointerOffsetX + (a.left - c.bounds.left) : Number.isFinite(r.clientX) && Number.isFinite(c.bounds.left) ? r.clientX - o.left - c.bounds.left : c.bounds.width / 2, l = a && Number.isFinite(a.pointerOffsetY) && Number.isFinite(a.top) && Number.isFinite(c.bounds.top) ? a.pointerOffsetY + (a.top - c.bounds.top) : Number.isFinite(r.clientY) && Number.isFinite(c.bounds.top) ? r.clientY - o.top - c.bounds.top : c.bounds.height / 2;
1248
+ return {
1249
+ path: e,
1250
+ floatingIndex: i.index,
1251
+ pointerOffsetX: s,
1252
+ pointerOffsetY: l
1253
+ };
1254
+ }
1255
+ return {
1256
+ path: e,
1257
+ floatingIndex: null,
1258
+ pointerOffsetX: 0,
1259
+ pointerOffsetY: 0
1260
+ };
1261
+ }
1262
+ return {
1263
+ path: e,
1264
+ floatingIndex: -1,
1265
+ pointerOffsetX: a && Number.isFinite(a.pointerOffsetX) ? a.pointerOffsetX : 0,
1266
+ pointerOffsetY: a && Number.isFinite(a.pointerOffsetY) ? a.pointerOffsetY : 0
1267
+ };
1268
+ }
1269
+ endPaneDrag() {
1270
+ this.clearPendingDragEndTimeout(), this.clearHeaderDragPlaceholder(), this.clearDraggedFloatingWrapperMarkers();
1271
+ let e = this.dragState;
1272
+ this.dragState = null, this.hideDropIndicator(), this.stopDragPointerTracking(), this.lastDragPointerPosition = null, e && e.floatingIndex !== null && !e.dropHandled && this.dispatchLayoutChanged();
1273
+ }
1274
+ updateDraggedFloatingPositionFromPoint(e, t) {
1275
+ if (!this.dragState || !Number.isFinite(e) || !Number.isFinite(t)) return;
1276
+ if (this.dragState.floatingIndex !== null && this.dragState.floatingIndex < 0) {
1277
+ let n = this.dragState.sourceHeaderBounds, r = this.dragState.startClientX ?? e, i = this.dragState.startClientY ?? t, a = Math.hypot(e - r, t - i), o = !0, s = !n || c(n, e, t), l = this.isPointerOverSourceHeader(e, t);
1278
+ o = s || l, !o && a > 8 && this.convertPendingTabDragToFloating(e, t);
1279
+ }
1280
+ this.updatePaneDragDropTargetFromPoint(e, t);
1281
+ let { floatingIndex: n, pointerOffsetX: r, pointerOffsetY: i } = this.dragState;
1282
+ if (n === null || n < 0) return;
1283
+ let a = this.floatingLayouts[n];
1284
+ if (!a) return;
1285
+ let o = this.getBoundingClientRect(), s = e - o.left - r, l = t - o.top - i;
1286
+ a.bounds.left = s, a.bounds.top = l;
1287
+ let u = this.getFloatingWrapper(n);
1288
+ u && (u.style.left = `${s}px`, u.style.top = `${l}px`);
1289
+ }
1290
+ updatePaneDragDropTargetFromPoint(e, t) {
1291
+ if (!this.dragState) return;
1292
+ let n = this.findStackAtPoint(e, t), r = n ? z(n.dataset.path) : null;
1293
+ if (!n || !r) {
1294
+ this.dropJoystick.dataset.visible !== "true" && this.hideDropIndicator(), this.clearHeaderDragPlaceholder();
1295
+ return;
1296
+ }
1297
+ if (this.dropJoystickTarget && this.dropJoystickTarget !== n && (delete this.dropJoystick.dataset.zone, this.updateDropJoystickActiveZone(null)), this.dragState && this.dragState.floatingIndex !== null && this.dragState.floatingIndex < 0 && r && B(r, this.dragState.sourcePath)) {
1298
+ let r = !!this.dragState.sourceHeaderBounds && c(this.dragState.sourceHeaderBounds, e, t), i = this.isPointerOverSourceHeader(e, t);
1299
+ if (r || i) {
1300
+ this.ensureHeaderDragPlaceholder(n, this.dragState.pane);
1301
+ let t = this.computeHeaderInsertIndex(n, e);
1302
+ this.dragState.liveReorderIndex !== t && (this.updateHeaderDragPlaceholderPosition(n, t), this.dragState.liveReorderIndex = t), this.hideDropIndicator();
1303
+ return;
1304
+ }
1305
+ }
1306
+ this.clearHeaderDragPlaceholder();
1307
+ let i = this.findDropZoneByPoint(e, t), a = this.computeDropZone(n, {
1308
+ clientX: e,
1309
+ clientY: t
1310
+ }, i);
1311
+ this.showDropIndicator(n, a);
1312
+ }
1313
+ isPointerOverSourceHeader(e, t) {
1314
+ let n = this.dragState;
1315
+ if (!n) return !1;
1316
+ let r = n.sourceStackEl ?? null, i = r ? this.getStackStripEl(r) : null;
1317
+ if (!i) return !0;
1318
+ let a = i.getBoundingClientRect();
1319
+ return e >= a.left && e <= a.right && t >= a.top && t <= a.bottom;
1320
+ }
1321
+ ensureHeaderDragPlaceholder(e, t) {
1322
+ if (e.tagName !== "MP-TAB-CONTROL" || this.dragState?.placeholderHeader === e && this.dragState.placeholderEl) return;
1323
+ let n = this.stackChildForPane(e, "dock-tab", t), r = this.stackChildForPane(e, "dock-stack__pane", t);
1324
+ if (!n || !r) return;
1325
+ let i = this.windowRef ? this.windowRef.getComputedStyle(n) : globalThis.getComputedStyle(n), a = parseFloat(i.paddingLeft) + parseFloat(i.paddingRight), o = Math.max(0, n.offsetWidth - a);
1326
+ r.setAttribute("data-hidden", "");
1327
+ let s = "__dock-placeholder__", c = this.documentRef.createElement("span");
1328
+ c.setAttribute("slot", `${s}-header`), c.classList.add("dock-tab"), c.dataset.placeholder = "true", c.dataset.tabId = s, c.setAttribute("aria-hidden", "true"), c.textContent = n.textContent, c.style.display = "inline-block", c.style.minWidth = `${o}px`, c.style.opacity = "0.5";
1329
+ let l = this.documentRef.createElement("div");
1330
+ l.setAttribute("slot", `${s}-content`), l.classList.add("dock-stack__pane"), l.dataset.placeholder = "true", e.insertBefore(c, n), e.insertBefore(l, r), this.dragState && (this.dragState.placeholderHeader = e, this.dragState.placeholderEl = c);
1331
+ }
1332
+ stackChildren(e) {
1333
+ return Array.from(e.children).filter((e) => e instanceof HTMLElement);
1334
+ }
1335
+ stackChildForPane(e, t, n) {
1336
+ return this.stackChildren(e).find((e) => e.classList.contains(t) && e.dataset.pane === n) ?? null;
1337
+ }
1338
+ stackPlaceholder(e, t) {
1339
+ return this.stackChildren(e).find((e) => e.classList.contains(t) && e.dataset.placeholder === "true") ?? null;
1340
+ }
1341
+ updateHeaderDragPlaceholderPosition(e, t) {
1342
+ if (e.tagName !== "MP-TAB-CONTROL") return;
1343
+ let n = this.dragState?.placeholderEl ?? null;
1344
+ if (!n) return;
1345
+ let r = this.dragState?.pane ?? null, i = this.stackChildren(e).filter((e) => e.classList.contains("dock-tab") && e !== n && (!r || e.dataset.pane !== r)), a = i[Math.max(0, Math.min(t, i.length))] ?? null;
1346
+ e.insertBefore(n, a);
1347
+ let o = this.stackPlaceholder(e, "dock-stack__pane");
1348
+ o && n.nextElementSibling !== o && e.insertBefore(o, n.nextElementSibling);
1349
+ }
1350
+ clearHeaderDragPlaceholder() {
1351
+ let e = this.dragState?.placeholderEl ?? null, t = this.dragState?.placeholderHeader ?? null;
1352
+ t && (this.dragState?.pane && this.stackChildForPane(t, "dock-stack__pane", this.dragState.pane)?.removeAttribute("data-hidden"), this.stackPlaceholder(t, "dock-stack__pane")?.remove()), e && e.parentElement && e.parentElement.removeChild(e), this.dragState && (this.dragState.placeholderEl = null, this.dragState.placeholderHeader = null);
1353
+ }
1354
+ startDragPointerTracking() {
1355
+ if (this.dragPointerTrackingActive) return;
1356
+ this.lastDragPointerPosition = null;
1357
+ let e = this.windowRef;
1358
+ e?.addEventListener("pointermove", this.onDragPointerMove, !0), e?.addEventListener("pointerup", this.onDragPointerUp, !0), e?.addEventListener("pointercancel", this.onDragPointerCancel, !0), this.dragPointerTrackingActive = !0;
1359
+ }
1360
+ stopDragPointerTracking() {
1361
+ if (!this.dragPointerTrackingActive) return;
1362
+ let e = this.windowRef;
1363
+ e?.removeEventListener("pointermove", this.onDragPointerMove, !0), e?.removeEventListener("pointerup", this.onDragPointerUp, !0), e?.removeEventListener("pointercancel", this.onDragPointerCancel, !0), this.dragPointerTrackingActive = !1, this.lastDragPointerPosition = null, this.clearPendingDragEndTimeout();
1364
+ }
1365
+ onDragPointerMove(e) {
1366
+ this.dragState ? (this.lastDragPointerPosition = {
1367
+ x: e.clientX,
1368
+ y: e.clientY
1369
+ }, this.updateDraggedFloatingPositionFromPoint(e.clientX, e.clientY)) : this.stopDragPointerTracking();
1370
+ }
1371
+ onDragPointerUp(e) {
1372
+ if (this.dragState) {
1373
+ let t = Number.isFinite(e.clientX) ? e.clientX : this.lastDragPointerPosition?.x, n = Number.isFinite(e.clientY) ? e.clientY : this.lastDragPointerPosition?.y;
1374
+ t !== void 0 && n !== void 0 && this.finalizeDropFromPoint(t, n);
1375
+ }
1376
+ this.handleDragPointerUpCommon();
1377
+ }
1378
+ onDragPointerCancel() {
1379
+ this.handleDragPointerUpCommon();
1380
+ }
1381
+ convertPendingTabDragToFloating(e, t) {
1382
+ if (!this.dragState) return;
1383
+ let n = this.dragState;
1384
+ if (n.floatingIndex !== null && n.floatingIndex >= 0) return;
1385
+ this.clearHeaderDragPlaceholder();
1386
+ let r = this.resolveStackLocation(n.sourcePath);
1387
+ if (!r) return;
1388
+ let i = n.pane, a = n.sourceStackEl ?? null, o = this.getBoundingClientRect(), c = a?.getBoundingClientRect() ?? null, l = this.pendingTabDragMetrics, u = l && Number.isFinite(l.width) && l.width > 0 ? l.width : c && Number.isFinite(c.width) ? c.width : 320, d = l && Number.isFinite(l.height) && l.height > 0 ? l.height : c && Number.isFinite(c.height) ? c.height : 240, f = s({
1389
+ left: l && Number.isFinite(l.left) ? l.left - 1 : Number.isFinite(e) ? e - o.left - u / 2 : 0,
1390
+ top: l && Number.isFinite(l.top) ? l.top - 1 : Number.isFinite(t) ? t - o.top - d / 2 : 0,
1391
+ width: u,
1392
+ height: d
1393
+ }, this.getHostSize()), p = Number.isFinite(e) ? e - o.left - f.left : f.width / 2, m = Number.isFinite(t) ? t - o.top - f.top : f.height / 2;
1394
+ this.removePaneFromLocation(r, i);
1395
+ let h = {
1396
+ bounds: f,
1397
+ root: {
1398
+ kind: "stack",
1399
+ panes: [i],
1400
+ activePane: i
1401
+ },
1402
+ activePane: i
1403
+ };
1404
+ this.floatingLayouts.push(h);
1405
+ let g = this.floatingLayouts.length - 1;
1406
+ this.renderLayout();
1407
+ let _ = this.getFloatingWrapper(g);
1408
+ _ && this.promoteFloatingPane(g, _), this.liveAnnouncer.announce(`Pane ${this.titles[i] ?? i} torn off into a floating window.`), n.sourcePath = {
1409
+ type: "floating",
1410
+ index: g,
1411
+ segments: []
1412
+ }, n.floatingIndex = g, n.pointerOffsetX = p, n.pointerOffsetY = m, this.markDraggedFloatingWrapper(), this.dispatchLayoutChanged();
1413
+ }
1414
+ markDraggedFloatingWrapper() {
1415
+ let e = this.dragState?.floatingIndex;
1416
+ if (e == null || e < 0) return;
1417
+ let t = this.getFloatingWrapper(e);
1418
+ t && (t.dataset.dragging = "true");
1419
+ }
1420
+ clearDraggedFloatingWrapperMarkers() {
1421
+ let e = this.floatingLayerEl;
1422
+ e && e.querySelectorAll(".dock-floating[data-dragging=\"true\"]").forEach((e) => {
1423
+ delete e.dataset.dragging;
1424
+ });
1425
+ }
1426
+ computeHeaderInsertIndex(e, t) {
1427
+ if (e.tagName !== "MP-TAB-CONTROL") return 0;
1428
+ let n = this.getStackTabButtons(e);
1429
+ if (n.length === 0) return 0;
1430
+ let r = this.stackPlaceholder(e, "dock-tab")?.dataset.tabId, i = r ? n.find((e) => e.id === `${r}-header-button`) ?? null : null, a = this.dragState?.pane ?? null, o = a ? this.stackChildForPane(e, "dock-tab", a)?.dataset.tabId ?? null : null, s = o ? n.find((e) => e.id === `${o}-header-button`) ?? null : null, c = n.filter((e) => e !== i && e !== s);
1431
+ if (c.length === 0) return 0;
1432
+ let l = i ? i.getBoundingClientRect() : null, u = l && Number.isFinite(l.width) && l.width > 0 && l ? l.left + l.width / 2 : null;
1433
+ return L(c.map((e) => {
1434
+ let t = e.getBoundingClientRect();
1435
+ return t.left + t.width / 2;
1436
+ }), t, u);
1437
+ }
1438
+ reorderPaneInLocationAtIndex(e, t, n) {
1439
+ let r = e.node.panes, i = r.indexOf(t);
1440
+ if (i === -1) return;
1441
+ let a = Math.max(0, Math.min(n, r.length - 1));
1442
+ if (a !== i && (r.splice(i, 1), r.splice(a, 0, t), e.node.activePane = t, e.context === "floating")) {
1443
+ let n = this.floatingLayouts[e.index];
1444
+ n && (n.activePane = t);
1445
+ }
1446
+ }
1447
+ finalizeDropFromPoint(e, t) {
1448
+ if (!this.dragState) return;
1449
+ let n = this.findStackAtPoint(e, t), r = n ? z(n.dataset.path) : null, i = this.dropJoystick.dataset.visible === "true", a = z(this.dropJoystick.dataset.path), o = this.dropJoystickTarget, s = o ? z(o.dataset.path) : null, c = (i ? a ?? s : null) ?? r, l = this.dropJoystick.dataset.zone, u = this.isDropZone(l) ? l : n ? this.computeDropZone(n, {
1450
+ clientX: e,
1451
+ clientY: t
1452
+ }, null) : null;
1453
+ if (this.dragState && this.dragState.floatingIndex !== null && this.dragState.floatingIndex < 0 && n && c && r && B(r, this.dragState.sourcePath) && (!u || u === "center")) {
1454
+ let t = this.resolveStackLocation(c);
1455
+ if (t) {
1456
+ let r = this.computeHeaderInsertIndex(n, e);
1457
+ this.reorderPaneInLocationAtIndex(t, this.dragState.pane, r), this.renderLayout(), this.dispatchLayoutChanged(), this.dragState.dropHandled = !0;
1458
+ return;
1459
+ }
1460
+ }
1461
+ c && this.isDropZone(u) && (this.handleDrop(c, u), this.dragState.dropHandled = !0);
1462
+ }
1463
+ clearPendingDragEndTimeout() {
1464
+ if (this.pendingDragEndTimeout !== null) {
1465
+ let e = this.windowRef;
1466
+ e && typeof this.pendingDragEndTimeout == "number" ? e.clearTimeout(this.pendingDragEndTimeout) : globalThis.clearTimeout(this.pendingDragEndTimeout), this.pendingDragEndTimeout = null;
1467
+ }
1468
+ }
1469
+ scheduleDeferredDragEnd() {
1470
+ if (this.pendingDragEndTimeout !== null) return;
1471
+ let e = () => {
1472
+ this.pendingDragEndTimeout = null, this.hideDropIndicator(), this.dragState && this.endPaneDrag(), this.clearPendingTabDragMetrics();
1473
+ }, t = this.windowRef;
1474
+ this.pendingDragEndTimeout = t ? t.setTimeout(e, 0) : setTimeout(e, 0);
1475
+ }
1476
+ handleDrop(e, t) {
1477
+ if (!this.dragState || !e) return;
1478
+ let { pane: n, sourcePath: r } = this.dragState, i = this.resolveStackLocation(r), a = this.resolveStackLocation(e);
1479
+ if (!a && e.type === "docked" && !this.rootLayout) {
1480
+ if (!i) return;
1481
+ this.removePaneFromLocation(i, n, !0);
1482
+ let e = {
1483
+ kind: "stack",
1484
+ panes: [n],
1485
+ activePane: n
1486
+ };
1487
+ this.rootLayout = e, this.normalizeAllLayouts(), this.renderLayout(), this.dispatchLayoutChanged(), this.dragState && (this.dragState.dropHandled = !0);
1488
+ return;
1489
+ }
1490
+ if (!i || !a) return;
1491
+ if (t === "center" && B(r, e)) {
1492
+ if (!i.node.panes.includes(n)) return;
1493
+ this.reorderPaneInLocation(i, n), this.normalizeAllLayouts(), this.renderLayout(), this.dispatchLayoutChanged(), this.dragState && (this.dragState.dropHandled = !0);
1494
+ return;
1495
+ }
1496
+ if (this.removePaneFromLocation(i, n, !0), t === "center") {
1497
+ this.addPaneToLocation(a, n), this.setActivePaneForLocation(a, n), this.normalizeAllLayouts(), this.renderLayout(), this.dispatchLayoutChanged(), this.dragState && (this.dragState.dropHandled = !0);
1498
+ return;
1499
+ }
1500
+ let o = {
1501
+ kind: "stack",
1502
+ panes: [n],
1503
+ activePane: n
1504
+ };
1505
+ if (a.context === "docked") this.rootLayout = y(this.rootLayout, a.node, o, t);
1506
+ else {
1507
+ let e = this.floatingLayouts[a.index];
1508
+ if (!e) {
1509
+ this.normalizeAllLayouts(), this.renderLayout(), this.dispatchLayoutChanged();
1510
+ return;
1511
+ }
1512
+ e.root = y(e.root, a.node, o, t), e.activePane = n;
1513
+ }
1514
+ this.normalizeAllLayouts(), this.renderLayout(), this.dispatchLayoutChanged(), this.dragState && (this.dragState.dropHandled = !0);
1515
+ }
1516
+ handleFloatingStackDrop(e, t, n) {
1517
+ let r = this.floatingLayouts[e];
1518
+ if (!r || !r.root) return !1;
1519
+ let i = this.resolveStackLocation(t);
1520
+ if (!i && t.type === "docked" && !this.rootLayout) return this.rootLayout = T(r.root), this.removeFloatingAt(e), this.normalizeAllLayouts(), this.renderLayout(), this.dispatchLayoutChanged(), !0;
1521
+ if (!i || i.context === "floating" && i.index === e) return !1;
1522
+ if (n === "center") {
1523
+ let t = S(r.root);
1524
+ if (t.length === 0) return !1;
1525
+ t.forEach((e) => {
1526
+ this.addPaneToLocation(i, e);
1527
+ });
1528
+ let n = r.activePane && t.includes(r.activePane) ? r.activePane : x(r.root) ?? t[0];
1529
+ return n && this.setActivePaneForLocation(i, n), this.removeFloatingAt(e), this.normalizeAllLayouts(), this.renderLayout(), this.dispatchLayoutChanged(), !0;
1530
+ }
1531
+ if (i.context === "floating") {
1532
+ let t = this.floatingLayouts[i.index];
1533
+ return t ? (t.root = y(t.root, i.node, r.root, n), t.activePane = r.activePane ?? x(r.root) ?? void 0, this.removeFloatingAt(e), this.normalizeAllLayouts(), this.renderLayout(), this.dispatchLayoutChanged(), !0) : !1;
1534
+ }
1535
+ return this.rootLayout = y(this.rootLayout, i.node, r.root, n), this.removeFloatingAt(e), this.normalizeAllLayouts(), this.renderLayout(), this.dispatchLayoutChanged(), !0;
1536
+ }
1537
+ computeDropZone(e, t, n) {
1538
+ let r = this.isDropZone(n) ? n : null;
1539
+ if (r) return this.updateDropJoystickActiveZone(r), r;
1540
+ let i = t && Number.isFinite(t.clientX) && Number.isFinite(t.clientY) ? this.findDropZoneByPoint(t.clientX, t.clientY) : null;
1541
+ if (i) return this.updateDropJoystickActiveZone(i), i;
1542
+ if (this.dropJoystickTarget === e) {
1543
+ let e = this.dropJoystick.dataset.zone;
1544
+ if (this.isDropZone(e)) return this.updateDropJoystickActiveZone(e), e;
1545
+ this.updateDropJoystickActiveZone(null);
1546
+ }
1547
+ return null;
1548
+ }
1549
+ extractDropZoneFromEvent(e) {
1550
+ if (!e) return null;
1551
+ if (typeof e.composedPath == "function") {
1552
+ let t = e.composedPath(), n = this.findDropZoneInTargets(t);
1553
+ if (n) return n;
1554
+ }
1555
+ if ("clientX" in e && "clientY" in e) {
1556
+ let t = e, n = this.findDropZoneByPoint(t.clientX, t.clientY);
1557
+ if (n) return n;
1558
+ }
1559
+ return null;
1560
+ }
1561
+ handleDragPointerUpCommon() {
1562
+ this.dragState ? this.scheduleDeferredDragEnd() : this.stopDragPointerTracking();
1563
+ }
1564
+ findDropZoneInTargets(e) {
1565
+ for (let t of e) if (t instanceof HTMLElement && t.classList.contains("dock-drop-joystick__button")) {
1566
+ let e = t.dataset?.zone;
1567
+ if (this.isDropZone(e)) return e;
1568
+ }
1569
+ return null;
1570
+ }
1571
+ findDropZoneByPoint(e, t) {
1572
+ if (!this.dropJoystickButtons || this.dropJoystick.dataset.visible !== "true" || !this.dropJoystickTarget) return null;
1573
+ let n = this.elementsAt(e, t).filter((e) => e instanceof HTMLElement && this.dropJoystickButtons.includes(e) && e.dataset.hidden !== "true");
1574
+ return this.findDropZoneInTargets(n);
1575
+ }
1576
+ updateDropJoystickActiveZone(e) {
1577
+ let t = this.dropJoystick.dataset.visible === "true" ? this.dropJoystick.dataset.zone : void 0, n = e ?? (this.isDropZone(t) ? t : null);
1578
+ this.dropJoystickButtons.forEach((e) => {
1579
+ n !== null && e.dataset.zone === n ? e.dataset.active = "true" : delete e.dataset.active;
1580
+ }), n ? this.dropJoystick.dataset.zone = n : delete this.dropJoystick.dataset.zone;
1581
+ }
1582
+ isDropZone(e) {
1583
+ return e === "left" || e === "right" || e === "top" || e === "bottom" || e === "center";
1584
+ }
1585
+ showDropIndicator(e, t) {
1586
+ let n = z(e.dataset.path), r = this.dragState?.sourcePath ?? null;
1587
+ if (n && r && H(n, r)) return;
1588
+ let i = e.getBoundingClientRect(), a = this.getBoundingClientRect(), o = this.dropIndicator, s = this.dropJoystick;
1589
+ s.hidden = !1;
1590
+ let c = z(e.dataset.path), u = 100;
1591
+ c && c.type === "floating" && (u = l(this.floatingLayouts[c.index], c.index) + 100), o.style.zIndex = String(u), s.style.zIndex = String(u + 1);
1592
+ let d = i.left - a.left, f = i.top - a.top, p = i.width, m = i.height, h = .5;
1593
+ if (t) {
1594
+ switch (t) {
1595
+ case "left":
1596
+ p = i.width * h;
1597
+ break;
1598
+ case "right":
1599
+ p = i.width * h, d += i.width * .5;
1600
+ break;
1601
+ case "top":
1602
+ m = i.height * h;
1603
+ break;
1604
+ case "bottom": m = i.height * h, f += i.height * .5;
1605
+ }
1606
+ o.style.left = `${d}px`, o.style.top = `${f}px`, o.style.width = `${p}px`, o.style.height = `${m}px`, o.dataset.visible = "true";
1607
+ } else o.dataset.visible = "false";
1608
+ s.style.left = `${i.left - a.left + i.width / 2}px`, s.style.top = `${i.top - a.top + i.height / 2}px`, s.dataset.visible = "true", this.dropJoystick.style.display = "grid", s.dataset.path = e.dataset.path ?? "";
1609
+ let g = this.dropJoystickTarget && this.dropJoystickTarget !== e;
1610
+ this.dropJoystickTarget = e, g && delete this.dropJoystick.dataset.zone;
1611
+ let _ = !this.rootLayout && (e === this.dockedEl || n && n.type === "docked" && n.segments.length === 0), v = Array.from(this.dropJoystick.querySelectorAll(".dock-drop-joystick__spacer"));
1612
+ _ ? (v.forEach((e) => {
1613
+ e.style.display = "";
1614
+ }), this.dropJoystickButtons.forEach((e) => {
1615
+ e.dataset.zone === "center" ? (e.style.visibility = "", e.style.pointerEvents = "", delete e.dataset.hidden, e.style.display = "") : (e.style.visibility = "hidden", e.style.pointerEvents = "none", e.dataset.hidden = "true", e.style.display = "");
1616
+ }), this.dropJoystick.style.gridTemplateColumns = "", this.dropJoystick.style.gridTemplateRows = "") : (this.dropJoystickButtons.forEach((e) => {
1617
+ e.style.visibility = "", e.style.pointerEvents = "", delete e.dataset.hidden, e.style.display = "";
1618
+ }), v.forEach((e) => e.style.display = ""), this.dropJoystick.style.gridTemplateColumns = "", this.dropJoystick.style.gridTemplateRows = ""), this.updateDropJoystickActiveZone(t);
1619
+ }
1620
+ hideDropIndicator() {
1621
+ this.dropIndicator.dataset.visible = "false", this.dropJoystick.dataset.visible = "false", this.dropJoystick.style.display = "none", delete this.dropJoystick.dataset.path, this.dropJoystickTarget = null, this.updateDropJoystickActiveZone(null), this.dropJoystickButtons.forEach((e) => {
1622
+ e.style.display = "", e.style.visibility = "", e.style.pointerEvents = "", delete e.dataset.hidden;
1623
+ }), Array.from(this.dropJoystick.querySelectorAll(".dock-drop-joystick__spacer")).forEach((e) => e.style.display = ""), this.dropJoystick.style.gridTemplateColumns = "", this.dropJoystick.style.gridTemplateRows = "";
1624
+ }
1625
+ elementsAt(e, t) {
1626
+ return this.shadowRoot?.elementsFromPoint(e, t) ?? [];
1627
+ }
1628
+ findStackAtPoint(e, t) {
1629
+ let n = this.elementsAt(e, t);
1630
+ return this.findStackInTargets(n) || (!this.rootLayout && n.includes(this.dockedEl) ? this.dockedEl : null);
1631
+ }
1632
+ findStackInTargets(e) {
1633
+ for (let t of e) if (t instanceof HTMLElement) {
1634
+ if (t.classList.contains("dock-stack")) return t;
1635
+ if (this.dropJoystickTarget && (t.classList.contains("dock-drop-joystick") || t.classList.contains("dock-drop-joystick__button") || t.classList.contains("dock-drop-joystick__spacer"))) return this.dropJoystickTarget;
1636
+ }
1637
+ return null;
1638
+ }
1639
+ activatePane(e, t, n) {
1640
+ if (e.dataset.activePane = t, e.tagName === "MP-TAB-CONTROL") {
1641
+ let n = this.stackChildForPane(e, "dock-tab", t)?.dataset.tabId;
1642
+ n && e.setAttribute("active-tab", n);
1643
+ }
1644
+ let r = this.resolveStackLocation(n);
1645
+ if (r) {
1646
+ if (r.node.activePane = t, n.type === "floating") {
1647
+ let e = this.floatingLayouts[n.index];
1648
+ e && (e.activePane = t), this.updateFloatingWindowTitle(n.index);
1649
+ }
1650
+ this.dispatchLayoutChanged();
1651
+ }
1652
+ }
1653
+ splitterLayerKey(e) {
1654
+ let t = e.closest(".dock-floating");
1655
+ return t ? t.dataset.path ?? "f:?" : "d";
1656
+ }
1657
+ resolveStackLocation(e) {
1658
+ if (e.type === "floating") {
1659
+ let t = this.floatingLayouts[e.index];
1660
+ if (!t || !t.root) return null;
1661
+ let n = g(t.root, e.segments);
1662
+ return !n || n.kind !== "stack" ? null : {
1663
+ context: "floating",
1664
+ index: e.index,
1665
+ path: [...e.segments],
1666
+ node: n
1667
+ };
1668
+ }
1669
+ let t = g(this.rootLayout, e.segments);
1670
+ return !t || t.kind !== "stack" ? null : {
1671
+ context: "docked",
1672
+ path: [...e.segments],
1673
+ node: t
1674
+ };
1675
+ }
1676
+ removePaneFromLocation(e, t, n = !1) {
1677
+ if (e.context === "docked") {
1678
+ let r = C(e.node, t);
1679
+ return r && !n && this.normalizeAllLayouts(), r;
1680
+ }
1681
+ return this.removePaneFromFloating(e.index, e.path, t, n);
1682
+ }
1683
+ addPaneToLocation(e, t) {
1684
+ let n = e.node.panes, r = n.indexOf(t);
1685
+ r !== -1 && n.splice(r, 1), n.push(t);
1686
+ }
1687
+ setActivePaneForLocation(e, t) {
1688
+ if (e.node.activePane = t, e.context === "floating") {
1689
+ let n = this.floatingLayouts[e.index];
1690
+ n && (n.activePane = t);
1691
+ }
1692
+ }
1693
+ reorderPaneInLocation(e, t) {
1694
+ let n = e.node.panes, r = n.indexOf(t);
1695
+ if (r !== -1 && (n.splice(r, 1), n.push(t), e.node.activePane = t, e.context === "floating")) {
1696
+ let n = this.floatingLayouts[e.index];
1697
+ n && (n.activePane = t);
1698
+ }
1699
+ }
1700
+ removeFloatingAt(e) {
1701
+ e < 0 || e >= this.floatingLayouts.length || this.floatingLayouts.splice(e, 1);
1702
+ }
1703
+ onRootKeyDown(e) {
1704
+ if (this.paneMoveMode) {
1705
+ this.handlePaneMoveModeKey(e);
1706
+ return;
1707
+ }
1708
+ if (e.altKey || e.ctrlKey || e.metaKey || e.key !== "m" && e.key !== "M") return;
1709
+ let t = this.findFocusedPaneOrigin();
1710
+ if (!t) return;
1711
+ e.preventDefault(), e.stopPropagation(), this.paneMoveMode = t, this.paneMoveCandidateIndex = null;
1712
+ let n = this.titles[t.paneName] ?? t.paneName;
1713
+ this.liveAnnouncer.announce(`Move mode for pane ${n}. Press T, R, B, or L to dock to top, right, bottom, or left of the current stack, F to float, arrow keys to cycle drop targets, Enter to commit, Escape to cancel.`);
1714
+ }
1715
+ onRootFocusOut(e) {
1716
+ if (!this.paneMoveMode) return;
1717
+ let t = e.relatedTarget instanceof Node ? e.relatedTarget : null;
1718
+ t && this.isWithinDock(t) || (this.clearPaneMoveState(), this.liveAnnouncer.announce("Move cancelled."));
1719
+ }
1720
+ isWithinDock(e) {
1721
+ for (let t = e; t;) {
1722
+ if (t === this) return !0;
1723
+ t = t instanceof ShadowRoot ? t.host : t.parentNode;
1724
+ }
1725
+ return !1;
1726
+ }
1727
+ handlePaneMoveModeKey(e) {
1728
+ if (e.key === "Escape") {
1729
+ e.preventDefault(), e.stopPropagation(), this.clearPaneMoveState(), this.liveAnnouncer.announce("Move cancelled.");
1730
+ return;
1731
+ }
1732
+ let t = e.composedPath()[0];
1733
+ if (t instanceof HTMLElement && (t.isContentEditable || [
1734
+ "INPUT",
1735
+ "TEXTAREA",
1736
+ "SELECT"
1737
+ ].includes(t.tagName))) return;
1738
+ let n = {
1739
+ ArrowRight: 1,
1740
+ ArrowDown: 1,
1741
+ ArrowLeft: -1,
1742
+ ArrowUp: -1
1743
+ }[e.key];
1744
+ if (n) {
1745
+ e.preventDefault(), e.stopPropagation(), this.cyclePaneMoveCandidate(n);
1746
+ return;
1747
+ }
1748
+ if (e.key === "Enter") {
1749
+ if (this.paneMoveCandidateIndex === null) return;
1750
+ e.preventDefault(), e.stopPropagation(), this.commitHighlightedPaneMoveCandidate();
1751
+ return;
1752
+ }
1753
+ let r = {
1754
+ t: "top",
1755
+ r: "right",
1756
+ b: "bottom",
1757
+ l: "left",
1758
+ f: "float"
1759
+ }[e.key.toLowerCase()];
1760
+ r && (e.preventDefault(), e.stopPropagation(), r === "float" ? this.commitPaneMoveAsFloat() : this.commitPaneMoveToZone(r));
1761
+ }
1762
+ buildPaneMoveCandidates() {
1763
+ let e = this.paneMoveMode ? R(this.paneMoveMode.sourcePath) : null, t = [];
1764
+ return b(this.rootLayout, (n, r) => {
1765
+ let i = R({
1766
+ type: "docked",
1767
+ segments: r
1768
+ });
1769
+ i !== e && t.push({
1770
+ pathStr: i,
1771
+ targetTitles: n.panes.map((e) => this.titles[e] ?? e).join(", ")
1772
+ });
1773
+ }), [...t.flatMap(({ pathStr: e, targetTitles: t }) => i.PANE_MOVE_ZONE_ORDER.map((n) => ({
1774
+ pathStr: e,
1775
+ zone: n,
1776
+ targetTitles: t
1777
+ }))), {
1778
+ pathStr: null,
1779
+ zone: "float",
1780
+ targetTitles: ""
1781
+ }];
1782
+ }
1783
+ cyclePaneMoveCandidate(e) {
1784
+ let t = this.buildPaneMoveCandidates();
1785
+ if (t.length === 0) return;
1786
+ let n = this.paneMoveCandidateIndex, r = n === null ? e > 0 ? 0 : t.length - 1 : (n + e + t.length) % t.length;
1787
+ this.paneMoveCandidateIndex = r;
1788
+ let i = t[r];
1789
+ this.highlightPaneMoveCandidate(i);
1790
+ let a = i.zone === "float" ? "Float" : `${i.zone[0].toUpperCase()}${i.zone.slice(1)} of ${i.targetTitles}`;
1791
+ this.liveAnnouncer.announce(`${a}, option ${r + 1} of ${t.length}.`);
1792
+ }
1793
+ highlightPaneMoveCandidate(e) {
1794
+ if (this.hideDropIndicator(), e.zone === "float" || !e.pathStr) return;
1795
+ let t = this.shadowRoot?.querySelector(`.dock-stack[data-path="${e.pathStr}"]`);
1796
+ if (!t) return;
1797
+ let n = t.getBoundingClientRect();
1798
+ n.width !== 0 && n.height !== 0 && this.showDropIndicator(t, e.zone);
1799
+ }
1800
+ commitHighlightedPaneMoveCandidate() {
1801
+ let e = this.paneMoveCandidateIndex;
1802
+ if (e === null) return;
1803
+ let t = this.buildPaneMoveCandidates()[e];
1804
+ t ? t.zone === "float" ? this.commitPaneMoveAsFloat() : this.commitPaneMoveToZone(t.zone, z(t.pathStr)) : this.clearPaneMoveState();
1805
+ }
1806
+ clearPaneMoveState() {
1807
+ this.paneMoveMode = null, this.paneMoveCandidateIndex !== null && (this.paneMoveCandidateIndex = null, this.hideDropIndicator());
1808
+ }
1809
+ findFocusedPaneOrigin() {
1810
+ if (!this.shadowRoot) return null;
1811
+ let e = this.shadowRoot.activeElement;
1812
+ for (; e && e.shadowRoot && e.shadowRoot.activeElement;) e = e.shadowRoot.activeElement;
1813
+ if (!e || e.getAttribute("role") !== "tab") return null;
1814
+ let t = e.id.replace(/-header-button$/, ""), n = this.shadowRoot.querySelector(`.dock-tab[data-tab-id="${t}"]`);
1815
+ if (!n) return null;
1816
+ let r = n.closest(".dock-stack");
1817
+ if (!r) return null;
1818
+ let i = z(r.dataset.path);
1819
+ return i ? {
1820
+ paneName: n.dataset.pane,
1821
+ sourcePath: i
1822
+ } : null;
1823
+ }
1824
+ synthesiseDragStateForKeyboardMove() {
1825
+ this.paneMoveMode && (this.dragState = {
1826
+ pane: this.paneMoveMode.paneName,
1827
+ sourcePath: V(this.paneMoveMode.sourcePath),
1828
+ floatingIndex: this.paneMoveMode.sourcePath.type === "floating" ? this.paneMoveMode.sourcePath.index : null,
1829
+ pointerOffsetX: 0,
1830
+ pointerOffsetY: 0,
1831
+ dropHandled: !1,
1832
+ sourceStackEl: null,
1833
+ sourceHeaderBounds: null,
1834
+ startClientX: 0,
1835
+ startClientY: 0
1836
+ });
1837
+ }
1838
+ commitPaneMoveToZone(e, t) {
1839
+ if (!this.paneMoveMode) return;
1840
+ let n = this.paneMoveMode;
1841
+ this.synthesiseDragStateForKeyboardMove(), this.handleDrop(t ?? n.sourcePath, e);
1842
+ let r = this.dragState?.dropHandled === !0;
1843
+ this.dragState = null, this.clearPaneMoveState();
1844
+ let i = this.titles[n.paneName] ?? n.paneName;
1845
+ this.liveAnnouncer.announce(r ? `Pane ${i} docked to ${e}.` : `Move failed. Pane ${i} was not moved.`);
1846
+ }
1847
+ commitPaneMoveAsFloat() {
1848
+ if (!this.paneMoveMode) return;
1849
+ let e = this.paneMoveMode, t = this.resolveStackLocation(e.sourcePath);
1850
+ if (!t) {
1851
+ this.clearPaneMoveState();
1852
+ return;
1853
+ }
1854
+ this.removePaneFromLocation(t, e.paneName, !0);
1855
+ let n = {
1856
+ bounds: {
1857
+ left: 100 + this.floatingLayouts.length * 24,
1858
+ top: 100 + this.floatingLayouts.length * 24,
1859
+ width: 320,
1860
+ height: 200
1861
+ },
1862
+ root: {
1863
+ kind: "stack",
1864
+ panes: [e.paneName],
1865
+ activePane: e.paneName
1866
+ },
1867
+ activePane: e.paneName
1868
+ };
1869
+ this.floatingLayouts.push(n), this.normalizeAllLayouts(), this.renderLayout(), this.dispatchLayoutChanged(), this.clearPaneMoveState();
1870
+ let r = this.titles[e.paneName] ?? e.paneName;
1871
+ this.liveAnnouncer.announce(`Pane ${r} torn off into a floating window.`);
1872
+ }
1873
+ closeFloatingPane(e) {
1874
+ let t = this.floatingLayouts[e];
1875
+ if (!t) return;
1876
+ let n = this.getFloatingWindowTitle(t);
1877
+ this.removeFloatingAt(e), this.renderLayout(), this.dispatchLayoutChanged(), this.liveAnnouncer.announce(`Closed floating pane ${n}.`);
1878
+ }
1879
+ removePaneFromFloating(e, t, n, r = !1) {
1880
+ let i = this.floatingLayouts[e];
1881
+ if (!i || !i.root) return !1;
1882
+ let a = g(i.root, t);
1883
+ if (!a || a.kind !== "stack") return !1;
1884
+ if (a.panes = a.panes.filter((e) => e !== n), a.panes.includes(a.activePane ?? "") || (a.panes.length > 0 ? a.activePane = a.panes[0] : delete a.activePane), i.activePane === n) {
1885
+ let e = x(i.root);
1886
+ e ? i.activePane = e : delete i.activePane;
1887
+ }
1888
+ return a.panes.length > 0 ? !1 : (r || this.normalizeAllLayouts(), !0);
1889
+ }
1890
+ normalizeAllLayouts() {
1891
+ this.rootLayout = w(this.rootLayout), this.floatingLayouts = this.floatingLayouts.map((e) => {
1892
+ if (e.root = w(e.root), !e.root) return null;
1893
+ let t = S(e.root);
1894
+ if (!e.activePane || !t.includes(e.activePane)) {
1895
+ let t = x(e.root);
1896
+ t ? e.activePane = t : delete e.activePane;
1897
+ }
1898
+ return e;
1899
+ }).filter((e) => e !== null);
1900
+ }
1901
+ verifyProjectionSlots() {
1902
+ if (!this.debugLayoutIntegrity) return;
1903
+ let e = this.shadowRoot;
1904
+ if (!e) return;
1905
+ let t = new Set(Array.from(e.querySelectorAll("slot")).map((e) => e.getAttribute("name")).filter((e) => !!e)), n = [...S(this.rootLayout), ...this.floatingLayouts.flatMap((e) => S(e.root))].find((e) => !t.has(e));
1906
+ if (n) throw Error(`mint-dock-manager: pane "${n}" has no projection slot in the shadow DOM. The layout tree got into a state the renderer can't display — likely a missing normalize() call or a render bug.`);
1907
+ }
1908
+ dispatchLayoutChanged() {
1909
+ this.dispatchEvent(new CustomEvent("dock-layout-changed", {
1910
+ detail: this.snapshot,
1911
+ bubbles: !0,
1912
+ composed: !0
1913
+ }));
1914
+ }
1915
+ cloneFloatingArray(e) {
1916
+ return JSON.parse(JSON.stringify(e));
1917
+ }
1918
+ }, W = "mint-dock-manager";
1919
+ typeof customElements < "u" && !customElements.get(W) && customElements.define(W, U);
1920
+ //#endregion
1921
+ export { U as MintDockManagerElement };