@mhmo91/schmancy 0.10.4 → 0.10.6

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 (478) hide show
  1. package/custom-elements.json +43 -949
  2. package/dist/agent/{flow-CaPi2G8y.js.map → flow-3RrZM-e7.js.map} +1 -1
  3. package/dist/agent/schmancy.agent.js +3817 -6527
  4. package/dist/agent/schmancy.agent.js.map +1 -1
  5. package/dist/agent/schmancy.manifest.json +10 -680
  6. package/dist/agent/{vendor-jsqr-r7GNh4P3.js.map → vendor-jsqr-BUVwyoGC.js.map} +1 -1
  7. package/dist/agent/{vendor-material-color-Be96dpGE.js.map → vendor-material-color-33Mj762T.js.map} +1 -1
  8. package/dist/{area-DHVANBbr.js → area-CIZZ5tbB.js} +1 -1
  9. package/dist/{area-DHVANBbr.js.map → area-CIZZ5tbB.js.map} +1 -1
  10. package/dist/{area-ZupIezvU.cjs → area-oZjYJlUy.cjs} +1 -1
  11. package/dist/{area-ZupIezvU.cjs.map → area-oZjYJlUy.cjs.map} +1 -1
  12. package/dist/area.cjs +1 -1
  13. package/dist/area.js +1 -1
  14. package/dist/{autocomplete-pHvsyfbH.js → autocomplete-C1oDLuol.js} +2 -2
  15. package/dist/{autocomplete-pHvsyfbH.js.map → autocomplete-C1oDLuol.js.map} +1 -1
  16. package/dist/{autocomplete-Bn525CTp.cjs → autocomplete-X20i6D62.cjs} +1 -1
  17. package/dist/{autocomplete-Bn525CTp.cjs.map → autocomplete-X20i6D62.cjs.map} +1 -1
  18. package/dist/autocomplete.cjs +1 -1
  19. package/dist/autocomplete.js +1 -1
  20. package/dist/avatar.cjs +1 -1
  21. package/dist/avatar.js +2 -2
  22. package/dist/badge.cjs +1 -1
  23. package/dist/badge.js +1 -1
  24. package/dist/{boat-IyEtsNI4.cjs → boat-CUx58Gwe.cjs} +1 -1
  25. package/dist/{boat-IyEtsNI4.cjs.map → boat-CUx58Gwe.cjs.map} +1 -1
  26. package/dist/{boat-_Yv3M6YM.js → boat-CpE0yAlK.js} +2 -2
  27. package/dist/{boat-_Yv3M6YM.js.map → boat-CpE0yAlK.js.map} +1 -1
  28. package/dist/boat.cjs +1 -1
  29. package/dist/boat.js +1 -1
  30. package/dist/breadcrumb.cjs +1 -1
  31. package/dist/breadcrumb.js +1 -1
  32. package/dist/{busy-Ck2IXJ4r.js → busy-C9n-DUY4.js} +1 -1
  33. package/dist/{busy-Ck2IXJ4r.js.map → busy-C9n-DUY4.js.map} +1 -1
  34. package/dist/{busy-CjM39APN.cjs → busy-D1DKZhgV.cjs} +1 -1
  35. package/dist/{busy-CjM39APN.cjs.map → busy-D1DKZhgV.cjs.map} +1 -1
  36. package/dist/busy.cjs +1 -1
  37. package/dist/busy.js +1 -1
  38. package/dist/button.cjs +1 -1
  39. package/dist/button.js +3 -3
  40. package/dist/{card-DUWZmMHc.js → card-B3hN-qzk.js} +1 -1
  41. package/dist/{card-DUWZmMHc.js.map → card-B3hN-qzk.js.map} +1 -1
  42. package/dist/{card-DIxDuuth.cjs → card-DZJ7qjf2.cjs} +1 -1
  43. package/dist/{card-DIxDuuth.cjs.map → card-DZJ7qjf2.cjs.map} +1 -1
  44. package/dist/card.cjs +1 -1
  45. package/dist/card.js +1 -1
  46. package/dist/charts.cjs +1 -1
  47. package/dist/charts.js +1 -1
  48. package/dist/{checkbox-DPS1mWG-.js → checkbox-CvmB1ev9.js} +1 -1
  49. package/dist/{checkbox-DPS1mWG-.js.map → checkbox-CvmB1ev9.js.map} +1 -1
  50. package/dist/{checkbox-CGdFXuWQ.cjs → checkbox-DapdzDow.cjs} +1 -1
  51. package/dist/{checkbox-CGdFXuWQ.cjs.map → checkbox-DapdzDow.cjs.map} +1 -1
  52. package/dist/checkbox.cjs +1 -1
  53. package/dist/checkbox.js +1 -1
  54. package/dist/{chips-UoFbwmlG.cjs → chips-7g6mWRuh.cjs} +1 -1
  55. package/dist/{chips-UoFbwmlG.cjs.map → chips-7g6mWRuh.cjs.map} +1 -1
  56. package/dist/{chips-BnnXQSA-.js → chips-C8Y3_3ke.js} +4 -4
  57. package/dist/{chips-BnnXQSA-.js.map → chips-C8Y3_3ke.js.map} +1 -1
  58. package/dist/chips.cjs +1 -1
  59. package/dist/chips.js +2 -2
  60. package/dist/connectivity.cjs +1 -1
  61. package/dist/connectivity.js +1 -1
  62. package/dist/content-drawer.cjs +1 -1
  63. package/dist/content-drawer.js +1 -1
  64. package/dist/{context-daN5G6HS.cjs.map → context-BpCETidA.cjs.map} +1 -1
  65. package/dist/{context-Bdu1xt0W.js.map → context-DJTJnSK4.js.map} +1 -1
  66. package/dist/{date-range-DOstCIg8.js → date-range-DdcaPX7C.js} +99 -113
  67. package/dist/date-range-DdcaPX7C.js.map +1 -0
  68. package/dist/date-range-ZfUl4duV.cjs +131 -0
  69. package/dist/date-range-ZfUl4duV.cjs.map +1 -0
  70. package/dist/{date-range-inline-4P7zqeVe.cjs → date-range-inline-D-d7N6bh.cjs} +1 -1
  71. package/dist/{date-range-inline-4P7zqeVe.cjs.map → date-range-inline-D-d7N6bh.cjs.map} +1 -1
  72. package/dist/{date-range-inline-BVycTWLb.js → date-range-inline-QQmIWhZ4.js} +1 -1
  73. package/dist/{date-range-inline-BVycTWLb.js.map → date-range-inline-QQmIWhZ4.js.map} +1 -1
  74. package/dist/date-range-inline.cjs +1 -1
  75. package/dist/date-range-inline.js +1 -1
  76. package/dist/date-range.cjs +1 -1
  77. package/dist/date-range.js +1 -1
  78. package/dist/delay.cjs +1 -1
  79. package/dist/delay.js +2 -2
  80. package/dist/{details-BJBbZOO6.cjs → details-3rL6UQU8.cjs} +1 -1
  81. package/dist/{details-BJBbZOO6.cjs.map → details-3rL6UQU8.cjs.map} +1 -1
  82. package/dist/{details-DPc5GxPa.js → details-Dpjh-XnJ.js} +2 -2
  83. package/dist/{details-DPc5GxPa.js.map → details-Dpjh-XnJ.js.map} +1 -1
  84. package/dist/details.cjs +1 -1
  85. package/dist/details.js +1 -1
  86. package/dist/directives.cjs +1 -1
  87. package/dist/directives.js +2 -2
  88. package/dist/{divider-BvJsmSPH.js → divider-BdfEKQsH.js} +1 -1
  89. package/dist/{divider-BvJsmSPH.js.map → divider-BdfEKQsH.js.map} +1 -1
  90. package/dist/{divider-DPT3XnG5.cjs → divider-CutXDz3F.cjs} +1 -1
  91. package/dist/{divider-DPT3XnG5.cjs.map → divider-CutXDz3F.cjs.map} +1 -1
  92. package/dist/divider.cjs +1 -1
  93. package/dist/divider.js +1 -1
  94. package/dist/dropdown.cjs +1 -1
  95. package/dist/dropdown.js +1 -1
  96. package/dist/{expand-CTqBWVXo.cjs → expand-DM6zfZf7.cjs} +1 -1
  97. package/dist/{expand-CTqBWVXo.cjs.map → expand-DM6zfZf7.cjs.map} +1 -1
  98. package/dist/{expand-BMzocdtj.js → expand-DrgMPJbu.js} +2 -2
  99. package/dist/{expand-BMzocdtj.js.map → expand-DrgMPJbu.js.map} +1 -1
  100. package/dist/expand.cjs +1 -1
  101. package/dist/expand.js +1 -1
  102. package/dist/{extra-BeHlUhzv.js → extra-B6gFu4_1.js} +1 -1
  103. package/dist/{extra-BeHlUhzv.js.map → extra-B6gFu4_1.js.map} +1 -1
  104. package/dist/{extra-h_cuxRII.cjs → extra-DJRYaOXe.cjs} +1 -1
  105. package/dist/{extra-h_cuxRII.cjs.map → extra-DJRYaOXe.cjs.map} +1 -1
  106. package/dist/extra.cjs +1 -1
  107. package/dist/extra.js +1 -1
  108. package/dist/{float-CTc1xxqH.js → float-1iihPek5.js} +1 -1
  109. package/dist/{float-CTc1xxqH.js.map → float-1iihPek5.js.map} +1 -1
  110. package/dist/{float-CwVBs11k.cjs → float-Ckyk85XG.cjs} +1 -1
  111. package/dist/{float-CwVBs11k.cjs.map → float-Ckyk85XG.cjs.map} +1 -1
  112. package/dist/float.cjs +1 -1
  113. package/dist/float.js +1 -1
  114. package/dist/{form-BtwOBMZ9.js.map → form-BF1c3Dk1.js.map} +1 -1
  115. package/dist/{form-CSJp687X.cjs.map → form-DeO5XX3b.cjs.map} +1 -1
  116. package/dist/form.cjs +1 -1
  117. package/dist/form.js +1 -1
  118. package/dist/handover/agent-runtime-followups.md +1 -1
  119. package/dist/handover/agent-runtime-v1.md +3 -3
  120. package/dist/{hashContent-1ARKIsx9.js.map → hashContent-BU6jl5ih.js.map} +1 -1
  121. package/dist/{hashContent-Bp5S6T4U.cjs.map → hashContent-Bobsobip.cjs.map} +1 -1
  122. package/dist/{icons-qEQW4pjM.cjs → icons-CV-fiGcW.cjs} +1 -1
  123. package/dist/{icons-qEQW4pjM.cjs.map → icons-CV-fiGcW.cjs.map} +1 -1
  124. package/dist/{icons-BbCVrcas.js → icons-DUkcTZAY.js} +2 -2
  125. package/dist/{icons-BbCVrcas.js.map → icons-DUkcTZAY.js.map} +1 -1
  126. package/dist/icons.cjs +1 -1
  127. package/dist/icons.js +1 -1
  128. package/dist/{iframe-BJfDIEJf.js → iframe-C9tj7F6Y.js} +1 -1
  129. package/dist/{iframe-BJfDIEJf.js.map → iframe-C9tj7F6Y.js.map} +1 -1
  130. package/dist/{iframe-D6HTruav.cjs → iframe-DF97oGtZ.cjs} +1 -1
  131. package/dist/{iframe-D6HTruav.cjs.map → iframe-DF97oGtZ.cjs.map} +1 -1
  132. package/dist/iframe.cjs +1 -1
  133. package/dist/iframe.js +1 -1
  134. package/dist/index.cjs +1 -1
  135. package/dist/index.js +70 -76
  136. package/dist/{input-LTK3cctF.js → input-DE7x223Y.js} +1 -1
  137. package/dist/{input-LTK3cctF.js.map → input-DE7x223Y.js.map} +1 -1
  138. package/dist/{input-U26axtcs.cjs → input-TW9G3n7X.cjs} +1 -1
  139. package/dist/{input-U26axtcs.cjs.map → input-TW9G3n7X.cjs.map} +1 -1
  140. package/dist/{input-chip-Ch-aCs3c.js → input-chip-BdoaVw_D.js} +1 -1
  141. package/dist/{input-chip-Ch-aCs3c.js.map → input-chip-BdoaVw_D.js.map} +1 -1
  142. package/dist/{input-chip-CADXt0X5.cjs → input-chip-Do48eI5r.cjs} +1 -1
  143. package/dist/{input-chip-CADXt0X5.cjs.map → input-chip-Do48eI5r.cjs.map} +1 -1
  144. package/dist/input.cjs +1 -1
  145. package/dist/input.js +1 -1
  146. package/dist/json.cjs +1 -1
  147. package/dist/json.js +2 -2
  148. package/dist/kbd.cjs +1 -1
  149. package/dist/kbd.js +1 -1
  150. package/dist/{layout-C4xmnU4n.js → layout-CXPNsUIo.js} +1 -1
  151. package/dist/{layout-C4xmnU4n.js.map → layout-CXPNsUIo.js.map} +1 -1
  152. package/dist/{layout-Dmh6fxh0.cjs → layout-Zhe7wSZ_.cjs} +1 -1
  153. package/dist/{layout-Dmh6fxh0.cjs.map → layout-Zhe7wSZ_.cjs.map} +1 -1
  154. package/dist/layout.cjs +1 -1
  155. package/dist/layout.js +1 -1
  156. package/dist/{lightbox-DqG2z3Cn.js → lightbox-DcutIyjx.js} +2 -2
  157. package/dist/{lightbox-DqG2z3Cn.js.map → lightbox-DcutIyjx.js.map} +1 -1
  158. package/dist/{lightbox-DbYUSfVl.cjs → lightbox-sPfnYzjJ.cjs} +1 -1
  159. package/dist/{lightbox-DbYUSfVl.cjs.map → lightbox-sPfnYzjJ.cjs.map} +1 -1
  160. package/dist/lightbox.cjs +1 -1
  161. package/dist/lightbox.js +1 -1
  162. package/dist/{list-D6-_E5ZD.js → list-BWrtrdgs.js} +1 -1
  163. package/dist/{list-D6-_E5ZD.js.map → list-BWrtrdgs.js.map} +1 -1
  164. package/dist/{list-CLX4sSAw.cjs → list-C4vasUly.cjs} +1 -1
  165. package/dist/{list-CLX4sSAw.cjs.map → list-C4vasUly.cjs.map} +1 -1
  166. package/dist/list.cjs +1 -1
  167. package/dist/list.js +1 -1
  168. package/dist/{magnetic-BH0TsofV.cjs.map → magnetic-BJgB1dVi.cjs.map} +1 -1
  169. package/dist/{magnetic-BZGFxAWG.js.map → magnetic-YwCNvtbB.js.map} +1 -1
  170. package/dist/{map-WXeVkx2K.cjs → map-BAQ9FEB6.cjs} +1 -1
  171. package/dist/{map-WXeVkx2K.cjs.map → map-BAQ9FEB6.cjs.map} +1 -1
  172. package/dist/{map-Dhy3ta9v.js → map-CEreveeI.js} +1 -1
  173. package/dist/{map-Dhy3ta9v.js.map → map-CEreveeI.js.map} +1 -1
  174. package/dist/map.cjs +1 -1
  175. package/dist/map.js +1 -1
  176. package/dist/menu-3yXDZusj.cjs +23 -0
  177. package/dist/menu-3yXDZusj.cjs.map +1 -0
  178. package/dist/menu-CxChOxWT.js +62 -0
  179. package/dist/menu-CxChOxWT.js.map +1 -0
  180. package/dist/menu.cjs +1 -1
  181. package/dist/menu.js +1 -1
  182. package/dist/mixins-Db7gjDah.cjs +298 -0
  183. package/dist/{mixins-De3xfjrm.cjs.map → mixins-Db7gjDah.cjs.map} +1 -1
  184. package/dist/mixins-Dw6hVfy-.js +627 -0
  185. package/dist/{mixins-CcIWET41.js.map → mixins-Dw6hVfy-.js.map} +1 -1
  186. package/dist/mixins.cjs +1 -1
  187. package/dist/mixins.js +1 -1
  188. package/dist/nav-drawer.cjs +1 -1
  189. package/dist/nav-drawer.js +1 -1
  190. package/dist/navigation-bar.cjs +1 -1
  191. package/dist/navigation-bar.js +1 -1
  192. package/dist/navigation-rail.cjs +1 -1
  193. package/dist/navigation-rail.js +1 -1
  194. package/dist/{notification-D_PQjBSf.cjs → notification-DKYy9qVe.cjs} +1 -1
  195. package/dist/{notification-D_PQjBSf.cjs.map → notification-DKYy9qVe.cjs.map} +1 -1
  196. package/dist/{notification-CVLqQ8c_.js → notification-ycbUBbOu.js} +2 -2
  197. package/dist/{notification-CVLqQ8c_.js.map → notification-ycbUBbOu.js.map} +1 -1
  198. package/dist/notification.cjs +1 -1
  199. package/dist/notification.js +1 -1
  200. package/dist/{option-rm4HebVs.js → option-DtOhMd3k.js} +1 -1
  201. package/dist/{option-rm4HebVs.js.map → option-DtOhMd3k.js.map} +1 -1
  202. package/dist/{option-DDU_goh1.cjs → option-zgVge3BH.cjs} +1 -1
  203. package/dist/{option-DDU_goh1.cjs.map → option-zgVge3BH.cjs.map} +1 -1
  204. package/dist/option.cjs +1 -1
  205. package/dist/option.js +1 -1
  206. package/dist/{overlay-stack-CAQno0CK.js.map → overlay-stack-DCDS17uj.js.map} +1 -1
  207. package/dist/{overlay-stack-BprhAE9a.cjs.map → overlay-stack-DPIe_aYv.cjs.map} +1 -1
  208. package/dist/overlay.cjs +5 -53
  209. package/dist/overlay.cjs.map +1 -1
  210. package/dist/overlay.confirm-body-AFqYBqrI.js +104 -0
  211. package/dist/overlay.confirm-body-AFqYBqrI.js.map +1 -0
  212. package/dist/overlay.confirm-body-DctQLDao.cjs +49 -0
  213. package/dist/overlay.confirm-body-DctQLDao.cjs.map +1 -0
  214. package/dist/overlay.js +120 -360
  215. package/dist/overlay.js.map +1 -1
  216. package/dist/overlay.service-B9On2-Aa.js +146 -0
  217. package/dist/overlay.service-B9On2-Aa.js.map +1 -0
  218. package/dist/overlay.service-k2nCE4pi.cjs +1 -0
  219. package/dist/overlay.service-k2nCE4pi.cjs.map +1 -0
  220. package/dist/page.cjs +1 -1
  221. package/dist/page.js +4 -4
  222. package/dist/{payment-card-form-C0dHYZIv.js → payment-card-form-Be1-OVlL.js} +1 -1
  223. package/dist/{payment-card-form-C0dHYZIv.js.map → payment-card-form-Be1-OVlL.js.map} +1 -1
  224. package/dist/{payment-card-form-DNvmZxs4.cjs → payment-card-form-CNnGePG4.cjs} +1 -1
  225. package/dist/{payment-card-form-DNvmZxs4.cjs.map → payment-card-form-CNnGePG4.cjs.map} +1 -1
  226. package/dist/payment-card-form.cjs +1 -1
  227. package/dist/payment-card-form.js +1 -1
  228. package/dist/{progress-BRerM5Bn.js → progress-BFWzmTlz.js} +1 -1
  229. package/dist/{progress-BRerM5Bn.js.map → progress-BFWzmTlz.js.map} +1 -1
  230. package/dist/{progress-U3LQkpM2.cjs → progress-C4TGG2eN.cjs} +1 -1
  231. package/dist/{progress-U3LQkpM2.cjs.map → progress-C4TGG2eN.cjs.map} +1 -1
  232. package/dist/progress.cjs +1 -1
  233. package/dist/progress.js +1 -1
  234. package/dist/qr-scanner.cjs +1 -1
  235. package/dist/qr-scanner.js +1 -1
  236. package/dist/{radio-group-BZ2WoOXJ.js → radio-group-DTNAW5dd.js} +1 -1
  237. package/dist/{radio-group-BZ2WoOXJ.js.map → radio-group-DTNAW5dd.js.map} +1 -1
  238. package/dist/{radio-group-D7mm-yvJ.cjs → radio-group-xLRp1g57.cjs} +1 -1
  239. package/dist/{radio-group-D7mm-yvJ.cjs.map → radio-group-xLRp1g57.cjs.map} +1 -1
  240. package/dist/radio-group.cjs +1 -1
  241. package/dist/radio-group.js +1 -1
  242. package/dist/range.cjs +1 -1
  243. package/dist/range.js +1 -1
  244. package/dist/{rxjs-utils-d-ivVN84.js.map → rxjs-utils-BK8VMe3K.js.map} +1 -1
  245. package/dist/{rxjs-utils-Csnks202.cjs.map → rxjs-utils-DhOKenkS.cjs.map} +1 -1
  246. package/dist/rxjs-utils.cjs +1 -1
  247. package/dist/rxjs-utils.js +1 -1
  248. package/dist/{scroll-qL-HkMdP.js → scroll-BCmdqSQU.js} +1 -1
  249. package/dist/{scroll-qL-HkMdP.js.map → scroll-BCmdqSQU.js.map} +1 -1
  250. package/dist/{scroll-DJTjNIT_.cjs → scroll-Bdgb-vRy.cjs} +1 -1
  251. package/dist/{scroll-DJTjNIT_.cjs.map → scroll-Bdgb-vRy.cjs.map} +1 -1
  252. package/dist/{select-CnPXUeSf.js → select-COGARE0b.js} +2 -2
  253. package/dist/{select-CnPXUeSf.js.map → select-COGARE0b.js.map} +1 -1
  254. package/dist/{select-BvA7v-gL.cjs → select-Cv5t_PT3.cjs} +1 -1
  255. package/dist/{select-BvA7v-gL.cjs.map → select-Cv5t_PT3.cjs.map} +1 -1
  256. package/dist/select.cjs +1 -1
  257. package/dist/select.js +1 -1
  258. package/dist/skeleton.cjs +1 -1
  259. package/dist/skeleton.js +1 -1
  260. package/dist/skills/INDEX.md +3 -6
  261. package/dist/skills/SKILL.md +13 -9
  262. package/dist/skills/schmancy/INDEX.md +3 -6
  263. package/dist/skills/schmancy/SKILL.md +13 -9
  264. package/dist/slider.cjs +1 -1
  265. package/dist/slider.js +1 -1
  266. package/dist/{splash-screen-BDt4PInk.cjs → splash-screen-B8rFbjqT.cjs} +1 -1
  267. package/dist/{splash-screen-BDt4PInk.cjs.map → splash-screen-B8rFbjqT.cjs.map} +1 -1
  268. package/dist/{splash-screen-C8JCqX5L.js → splash-screen-DbGbGttg.js} +1 -1
  269. package/dist/{splash-screen-C8JCqX5L.js.map → splash-screen-DbGbGttg.js.map} +1 -1
  270. package/dist/splash-screen.cjs +1 -1
  271. package/dist/splash-screen.js +1 -1
  272. package/dist/{src-CqdnWGgr.js → src-YRir9pOP.js} +162 -162
  273. package/dist/src-YRir9pOP.js.map +1 -0
  274. package/dist/{src-CpRNClhg.cjs → src-b8D-Ec-Q.cjs} +13 -13
  275. package/dist/src-b8D-Ec-Q.cjs.map +1 -0
  276. package/dist/steps.cjs +1 -1
  277. package/dist/steps.js +1 -1
  278. package/dist/{surface-C8jQy8Ym.js → surface-BE7sGTBt.js} +1 -1
  279. package/dist/{surface-C8jQy8Ym.js.map → surface-BE7sGTBt.js.map} +1 -1
  280. package/dist/{surface-Du2Y4vXd.cjs → surface-BvudRtf5.cjs} +1 -1
  281. package/dist/{surface-Du2Y4vXd.cjs.map → surface-BvudRtf5.cjs.map} +1 -1
  282. package/dist/surface.cjs +1 -1
  283. package/dist/surface.js +1 -1
  284. package/dist/switch.cjs +1 -1
  285. package/dist/switch.js +1 -1
  286. package/dist/table.cjs +1 -1
  287. package/dist/table.js +1 -1
  288. package/dist/{tabs-0RfeCa00.cjs → tabs-C0XKld1Z.cjs} +1 -1
  289. package/dist/{tabs-0RfeCa00.cjs.map → tabs-C0XKld1Z.cjs.map} +1 -1
  290. package/dist/{tabs-Cyahh9Q6.js → tabs-DIzCRsA3.js} +1 -1
  291. package/dist/{tabs-Cyahh9Q6.js.map → tabs-DIzCRsA3.js.map} +1 -1
  292. package/dist/tabs.cjs +1 -1
  293. package/dist/tabs.js +1 -1
  294. package/dist/teleport.cjs +1 -1
  295. package/dist/teleport.js +1 -1
  296. package/dist/{textarea-jqRrLxmo.cjs → textarea-BCDCGCJd.cjs} +1 -1
  297. package/dist/{textarea-jqRrLxmo.cjs.map → textarea-BCDCGCJd.cjs.map} +1 -1
  298. package/dist/{textarea-CXCcTVnf.js → textarea-UbZzBwqm.js} +1 -1
  299. package/dist/{textarea-CXCcTVnf.js.map → textarea-UbZzBwqm.js.map} +1 -1
  300. package/dist/textarea.cjs +1 -1
  301. package/dist/textarea.js +1 -1
  302. package/dist/theme-CIsI-sFj.cjs +181 -0
  303. package/dist/{theme-Hjz9sCN-.cjs.map → theme-CIsI-sFj.cjs.map} +1 -1
  304. package/dist/{theme-2KZW2Rfs.js → theme-Qh-yPEPL.js} +3 -4
  305. package/dist/{theme-2KZW2Rfs.js.map → theme-Qh-yPEPL.js.map} +1 -1
  306. package/dist/{theme-button-9uF1eoHz.js → theme-button-CjTnfs9x.js} +1 -1
  307. package/dist/{theme-button-9uF1eoHz.js.map → theme-button-CjTnfs9x.js.map} +1 -1
  308. package/dist/{theme-button-C7QIbke1.cjs → theme-button-Dv1D_Vil.cjs} +1 -1
  309. package/dist/{theme-button-C7QIbke1.cjs.map → theme-button-Dv1D_Vil.cjs.map} +1 -1
  310. package/dist/theme-button.cjs +1 -1
  311. package/dist/theme-button.js +1 -1
  312. package/dist/theme.cjs +1 -1
  313. package/dist/{theme.interface-D9l33b-M.cjs.map → theme.interface-BeW-sz_g.cjs.map} +1 -1
  314. package/dist/{theme.interface-DnVNre4O.js.map → theme.interface-v7SkAnDH.js.map} +1 -1
  315. package/dist/theme.js +5 -6
  316. package/dist/theme.service-Cfk88qHK.cjs +1 -0
  317. package/dist/theme.service-Cfk88qHK.cjs.map +1 -0
  318. package/dist/{theme.service-CmbOGMA8.js → theme.service-DIUo1mBP.js} +13 -14
  319. package/dist/theme.service-DIUo1mBP.js.map +1 -0
  320. package/dist/timeline.cjs +1 -1
  321. package/dist/timeline.js +1 -1
  322. package/dist/tree.cjs +1 -1
  323. package/dist/tree.js +1 -1
  324. package/dist/typography.cjs +1 -1
  325. package/dist/typography.js +1 -1
  326. package/dist/{utils-hp-DnFf5.js → utils-BfOze6Tk.js} +1 -1
  327. package/dist/{utils-hp-DnFf5.js.map → utils-BfOze6Tk.js.map} +1 -1
  328. package/dist/{utils-Cr-YO4Np.cjs → utils-CJ9y2Jz9.cjs} +1 -1
  329. package/dist/{utils-Cr-YO4Np.cjs.map → utils-CJ9y2Jz9.cjs.map} +1 -1
  330. package/dist/utils.cjs +1 -1
  331. package/dist/utils.js +2 -2
  332. package/dist/visually-hidden.cjs +1 -1
  333. package/dist/visually-hidden.js +1 -1
  334. package/dist/{window-DtUOWiAj.cjs → window-9HOUXrTU.cjs} +1 -1
  335. package/dist/{window-DtUOWiAj.cjs.map → window-9HOUXrTU.cjs.map} +1 -1
  336. package/dist/{window-C7yY9yp5.js → window-B_55dzk0.js} +3 -3
  337. package/dist/{window-C7yY9yp5.js.map → window-B_55dzk0.js.map} +1 -1
  338. package/dist/window.cjs +1 -1
  339. package/dist/window.js +1 -1
  340. package/package.json +1 -2
  341. package/skills/schmancy/INDEX.md +3 -6
  342. package/skills/schmancy/SKILL.md +13 -9
  343. package/src/content-drawer/drawer.ts +24 -7
  344. package/src/content-drawer/events.ts +6 -0
  345. package/src/content-drawer/sheet.ts +13 -12
  346. package/src/date-range/date-range-dialog.ts +4 -4
  347. package/src/date-range/date-range.ts +35 -53
  348. package/src/index.ts +0 -4
  349. package/src/menu/menu-item.ts +7 -2
  350. package/src/menu/menu.ts +24 -20
  351. package/types/src/content-drawer/drawer.d.ts +2 -0
  352. package/types/src/content-drawer/events.d.ts +6 -0
  353. package/types/src/content-drawer/sheet.d.ts +6 -5
  354. package/types/src/date-range/date-range.d.ts +1 -5
  355. package/types/src/index.d.ts +0 -4
  356. package/types/src/menu/menu-item.d.ts +1 -0
  357. package/types/src/menu/menu.d.ts +9 -7
  358. package/dist/agent/vendor-highlight-CHJZQQB7.js +0 -2178
  359. package/dist/agent/vendor-highlight-CHJZQQB7.js.map +0 -1
  360. package/dist/code-highlight-CMilN0B8.cjs +0 -190
  361. package/dist/code-highlight-CMilN0B8.cjs.map +0 -1
  362. package/dist/code-highlight-kFUJ1Eet.js +0 -296
  363. package/dist/code-highlight-kFUJ1Eet.js.map +0 -1
  364. package/dist/code-highlight.cjs +0 -1
  365. package/dist/code-highlight.js +0 -2
  366. package/dist/date-range-BIyrzTRZ.cjs +0 -131
  367. package/dist/date-range-BIyrzTRZ.cjs.map +0 -1
  368. package/dist/date-range-DOstCIg8.js.map +0 -1
  369. package/dist/dialog-service-DI9PPy4H.js +0 -193
  370. package/dist/dialog-service-DI9PPy4H.js.map +0 -1
  371. package/dist/dialog-service-DJd5L0f5.cjs +0 -1
  372. package/dist/dialog-service-DJd5L0f5.cjs.map +0 -1
  373. package/dist/dialog.cjs +0 -89
  374. package/dist/dialog.cjs.map +0 -1
  375. package/dist/dialog.js +0 -419
  376. package/dist/dialog.js.map +0 -1
  377. package/dist/mailbox-Ct6iYe-4.cjs +0 -1140
  378. package/dist/mailbox-Ct6iYe-4.cjs.map +0 -1
  379. package/dist/mailbox-DsPII8HR.js +0 -1596
  380. package/dist/mailbox-DsPII8HR.js.map +0 -1
  381. package/dist/mailbox.cjs +0 -1
  382. package/dist/mailbox.js +0 -2
  383. package/dist/menu-Bhd3EapX.js +0 -56
  384. package/dist/menu-Bhd3EapX.js.map +0 -1
  385. package/dist/menu-Cg2aaDjs.cjs +0 -23
  386. package/dist/menu-Cg2aaDjs.cjs.map +0 -1
  387. package/dist/mixins-CcIWET41.js +0 -627
  388. package/dist/mixins-De3xfjrm.cjs +0 -298
  389. package/dist/sheet-BRL07BB4.js +0 -170
  390. package/dist/sheet-BRL07BB4.js.map +0 -1
  391. package/dist/sheet-BYQJAHQn.cjs +0 -35
  392. package/dist/sheet-BYQJAHQn.cjs.map +0 -1
  393. package/dist/sheet.cjs +0 -1
  394. package/dist/sheet.js +0 -3
  395. package/dist/sheet.service-B25bsrYG.cjs +0 -1
  396. package/dist/sheet.service-B25bsrYG.cjs.map +0 -1
  397. package/dist/sheet.service-SPQ8oLCi.js +0 -86
  398. package/dist/sheet.service-SPQ8oLCi.js.map +0 -1
  399. package/dist/skills/code-highlight.md +0 -47
  400. package/dist/skills/dialog.md +0 -69
  401. package/dist/skills/mailbox.md +0 -102
  402. package/dist/skills/schmancy/code-highlight.md +0 -47
  403. package/dist/skills/schmancy/dialog.md +0 -69
  404. package/dist/skills/schmancy/mailbox.md +0 -102
  405. package/dist/skills/schmancy/sheet.md +0 -76
  406. package/dist/skills/sheet.md +0 -76
  407. package/dist/src-CpRNClhg.cjs.map +0 -1
  408. package/dist/src-CqdnWGgr.js.map +0 -1
  409. package/dist/theme-Hjz9sCN-.cjs +0 -181
  410. package/dist/theme.events-Cv7N4Toe.js +0 -2
  411. package/dist/theme.events-Cv7N4Toe.js.map +0 -1
  412. package/dist/theme.events-DM4H5F2d.cjs +0 -1
  413. package/dist/theme.events-DM4H5F2d.cjs.map +0 -1
  414. package/dist/theme.service-BrUbGoeQ.cjs +0 -1
  415. package/dist/theme.service-BrUbGoeQ.cjs.map +0 -1
  416. package/dist/theme.service-CmbOGMA8.js.map +0 -1
  417. package/skills/schmancy/code-highlight.md +0 -47
  418. package/skills/schmancy/dialog.md +0 -69
  419. package/skills/schmancy/mailbox.md +0 -102
  420. package/skills/schmancy/sheet.md +0 -76
  421. package/src/code-highlight/code-highlight.ts +0 -345
  422. package/src/code-highlight/code-preview.ts +0 -125
  423. package/src/code-highlight/index.ts +0 -3
  424. package/src/dialog/dialog-base.mixin.ts +0 -576
  425. package/src/dialog/dialog-events.ts +0 -17
  426. package/src/dialog/dialog-service.ts +0 -494
  427. package/src/dialog/dialog.component.ts +0 -414
  428. package/src/dialog/index.ts +0 -3
  429. package/src/mailbox/README.md +0 -128
  430. package/src/mailbox/email-editor.ts +0 -1077
  431. package/src/mailbox/email-layout-selector.ts +0 -58
  432. package/src/mailbox/email-recipients.ts +0 -599
  433. package/src/mailbox/email-template-picker.ts +0 -297
  434. package/src/mailbox/email-viewer.ts +0 -717
  435. package/src/mailbox/index.ts +0 -31
  436. package/src/mailbox/mailbox.ts +0 -364
  437. package/src/mailbox/types.ts +0 -180
  438. package/src/sheet/hook.ts +0 -40
  439. package/src/sheet/index.ts +0 -2
  440. package/src/sheet/sheet.service.ts +0 -245
  441. package/src/sheet/sheet.ts +0 -238
  442. package/types/src/code-highlight/code-highlight.d.ts +0 -49
  443. package/types/src/code-highlight/code-preview.d.ts +0 -30
  444. package/types/src/code-highlight/index.d.ts +0 -3
  445. package/types/src/dialog/dialog-base.mixin.d.ts +0 -30
  446. package/types/src/dialog/dialog-events.d.ts +0 -13
  447. package/types/src/dialog/dialog-service.d.ts +0 -91
  448. package/types/src/dialog/dialog.component.d.ts +0 -150
  449. package/types/src/dialog/index.d.ts +0 -3
  450. package/types/src/mailbox/email-editor.d.ts +0 -101
  451. package/types/src/mailbox/email-layout-selector.d.ts +0 -18
  452. package/types/src/mailbox/email-recipients.d.ts +0 -122
  453. package/types/src/mailbox/email-template-picker.d.ts +0 -54
  454. package/types/src/mailbox/email-viewer.d.ts +0 -86
  455. package/types/src/mailbox/index.d.ts +0 -12
  456. package/types/src/mailbox/mailbox.d.ts +0 -82
  457. package/types/src/mailbox/types.d.ts +0 -176
  458. package/types/src/sheet/hook.d.ts +0 -5
  459. package/types/src/sheet/index.d.ts +0 -2
  460. package/types/src/sheet/sheet.d.ts +0 -29
  461. package/types/src/sheet/sheet.service.d.ts +0 -65
  462. /package/dist/agent/{flow-CaPi2G8y.js → flow-3RrZM-e7.js} +0 -0
  463. /package/dist/agent/{vendor-jsqr-r7GNh4P3.js → vendor-jsqr-BUVwyoGC.js} +0 -0
  464. /package/dist/agent/{vendor-material-color-Be96dpGE.js → vendor-material-color-33Mj762T.js} +0 -0
  465. /package/dist/{context-daN5G6HS.cjs → context-BpCETidA.cjs} +0 -0
  466. /package/dist/{context-Bdu1xt0W.js → context-DJTJnSK4.js} +0 -0
  467. /package/dist/{form-BtwOBMZ9.js → form-BF1c3Dk1.js} +0 -0
  468. /package/dist/{form-CSJp687X.cjs → form-DeO5XX3b.cjs} +0 -0
  469. /package/dist/{hashContent-1ARKIsx9.js → hashContent-BU6jl5ih.js} +0 -0
  470. /package/dist/{hashContent-Bp5S6T4U.cjs → hashContent-Bobsobip.cjs} +0 -0
  471. /package/dist/{magnetic-BH0TsofV.cjs → magnetic-BJgB1dVi.cjs} +0 -0
  472. /package/dist/{magnetic-BZGFxAWG.js → magnetic-YwCNvtbB.js} +0 -0
  473. /package/dist/{overlay-stack-CAQno0CK.js → overlay-stack-DCDS17uj.js} +0 -0
  474. /package/dist/{overlay-stack-BprhAE9a.cjs → overlay-stack-DPIe_aYv.cjs} +0 -0
  475. /package/dist/{rxjs-utils-d-ivVN84.js → rxjs-utils-BK8VMe3K.js} +0 -0
  476. /package/dist/{rxjs-utils-Csnks202.cjs → rxjs-utils-DhOKenkS.cjs} +0 -0
  477. /package/dist/{theme.interface-D9l33b-M.cjs → theme.interface-BeW-sz_g.cjs} +0 -0
  478. /package/dist/{theme.interface-DnVNre4O.js → theme.interface-v7SkAnDH.js} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"window-C7yY9yp5.js","names":[],"sources":["../src/window/window-manager.ts","../src/window/window-position.ts","../src/window/window.ts"],"sourcesContent":["/**\n * Window Manager — singleton service for multi-window coordination.\n *\n * Tracks all schmancy-window instances: positions, z-indices, focus, visual states.\n * Components register on connectedCallback, unregister on disconnectedCallback.\n * Focus changes, position updates, and overlap queries all flow through here.\n *\n * Follows the ThemeService singleton pattern (theme/theme.service.ts).\n *\n * Example:\n * windowManager.register('chat-1', bounds, 'bottom-right')\n * windowManager.focus('chat-1') // bumps z-index, updates focusedId\n * const overlaps = windowManager.findOverlaps(projectedBounds, 'chat-1')\n */\n\nimport { BehaviorSubject, Observable, distinctUntilChanged, map } from 'rxjs'\nimport { overlayStack } from '../utils/overlay-stack.js'\nimport type { WindowBounds, WindowRecord, WindowRegistryState, SnapTarget } from './window-registry.js'\n\nconst STORAGE_PREFIX = 'schmancy-window-'\nconst LEGACY_STORAGE_PREFIX = 'schmancy-float-'\n\nclass WindowManagerService {\n\tprivate static instance: WindowManagerService\n\n\tprivate readonly _state$ = new BehaviorSubject<WindowRegistryState>({\n\t\twindows: new Map(),\n\t\tfocusedId: null,\n\t\tstackOrder: [],\n\t})\n\n\treadonly state$ = this._state$.asObservable()\n\n\tprivate constructor() {}\n\n\tstatic getInstance(): WindowManagerService {\n\t\tif (!WindowManagerService.instance) {\n\t\t\tWindowManagerService.instance = new WindowManagerService()\n\t\t}\n\t\treturn WindowManagerService.instance\n\t}\n\n\t// ── Synchronous accessors ──────────────────────────────────────────\n\n\tget windows(): Map<string, WindowRecord> {\n\t\treturn this._state$.value.windows\n\t}\n\n\tget focusedId(): string | null {\n\t\treturn this._state$.value.focusedId\n\t}\n\n\t// ── Registration ───────────────────────────────────────────────────\n\n\tregister(id: string, initialBounds: WindowBounds, snapTarget: SnapTarget): void {\n\t\tconst state = this._state$.value\n\t\tif (state.windows.has(id)) return\n\n\t\tconst zIndex = overlayStack.assignZIndex(id)\n\t\tconst record: WindowRecord = {\n\t\t\tid,\n\t\t\tbounds: initialBounds,\n\t\t\tvisualState: 'normal',\n\t\t\tzIndex,\n\t\t\topen: false,\n\t\t\tsnapTarget,\n\t\t}\n\n\t\tconst windows = new Map(state.windows)\n\t\twindows.set(id, record)\n\t\tconst stackOrder = overlayStack.getStackOrder()\n\n\t\tthis._state$.next({ ...state, windows, stackOrder })\n\t}\n\n\tunregister(id: string): void {\n\t\tconst state = this._state$.value\n\t\tif (!state.windows.has(id)) return\n\n\t\toverlayStack.releaseId(id)\n\t\tconst windows = new Map(state.windows)\n\t\twindows.delete(id)\n\t\tconst stackOrder = overlayStack.getStackOrder()\n\t\tconst focusedId = state.focusedId === id ? null : state.focusedId\n\n\t\tthis._state$.next({ ...state, windows, stackOrder, focusedId })\n\t}\n\n\t// ── State mutations ────────────────────────────────────────────────\n\n\tupdateBounds(id: string, bounds: WindowBounds): void {\n\t\tthis._updateRecord(id, { bounds })\n\t}\n\n\tupdateVisualState(id: string, visualState: WindowRecord['visualState']): void {\n\t\tthis._updateRecord(id, { visualState })\n\t}\n\n\tupdateOpen(id: string, open: boolean): void {\n\t\tthis._updateRecord(id, { open })\n\t}\n\n\tfocus(id: string): void {\n\t\tconst state = this._state$.value\n\t\tif (!state.windows.has(id)) return\n\t\tif (state.focusedId === id) return\n\n\t\tconst zIndex = overlayStack.bringToFront(id)\n\t\tconst windows = new Map(state.windows)\n\t\tconst record = windows.get(id)\n\t\tif (record) {\n\t\t\twindows.set(id, { ...record, zIndex })\n\t\t}\n\t\tconst stackOrder = overlayStack.getStackOrder()\n\n\t\tthis._state$.next({ ...state, windows, stackOrder, focusedId: id })\n\t}\n\n\t// ── Queries ────────────────────────────────────────────────────────\n\n\tfindOverlaps(bounds: WindowBounds, excludeId: string): WindowRecord[] {\n\t\tconst result: WindowRecord[] = []\n\t\tfor (const [id, record] of this._state$.value.windows) {\n\t\t\tif (id === excludeId) continue\n\t\t\tif (rectsOverlap(bounds, record.bounds)) {\n\t\t\t\tresult.push(record)\n\t\t\t}\n\t\t}\n\t\treturn result\n\t}\n\n\tgetNeighbors(id: string): WindowRecord[] {\n\t\tconst result: WindowRecord[] = []\n\t\tfor (const [otherId, record] of this._state$.value.windows) {\n\t\t\tif (otherId !== id) result.push(record)\n\t\t}\n\t\treturn result\n\t}\n\n\t// ── Selectors ──────────────────────────────────────────────────────\n\n\tselectWindow(id: string): Observable<WindowRecord | undefined> {\n\t\treturn this._state$.pipe(\n\t\t\tmap(state => state.windows.get(id)),\n\t\t\tdistinctUntilChanged(),\n\t\t)\n\t}\n\n\tselectFocused(): Observable<string | null> {\n\t\treturn this._state$.pipe(\n\t\t\tmap(state => state.focusedId),\n\t\t\tdistinctUntilChanged(),\n\t\t)\n\t}\n\n\t// ── Persistence ────────────────────────────────────────────────────\n\n\tloadPosition(id: string): { x: number; y: number; anchor: string } | null {\n\t\ttry {\n\t\t\t// Try new key first, fall back to legacy\n\t\t\tconst raw = localStorage.getItem(STORAGE_PREFIX + id) ?? localStorage.getItem(LEGACY_STORAGE_PREFIX + id)\n\t\t\tif (!raw) return null\n\t\t\treturn JSON.parse(raw) as { x: number; y: number; anchor: string }\n\t\t} catch {\n\t\t\treturn null\n\t\t}\n\t}\n\n\tsavePosition(id: string, data: { x: number; y: number; anchor: string }): void {\n\t\ttry {\n\t\t\tlocalStorage.setItem(STORAGE_PREFIX + id, JSON.stringify(data))\n\t\t} catch {\n\t\t\t// ignore\n\t\t}\n\t}\n\n\tclearPosition(id: string): void {\n\t\ttry {\n\t\t\tlocalStorage.removeItem(STORAGE_PREFIX + id)\n\t\t\tlocalStorage.removeItem(LEGACY_STORAGE_PREFIX + id)\n\t\t} catch {\n\t\t\t// ignore\n\t\t}\n\t}\n\n\t// ── Internal ───────────────────────────────────────────────────────\n\n\tprivate _updateRecord(id: string, updates: Partial<WindowRecord>): void {\n\t\tconst state = this._state$.value\n\t\tconst record = state.windows.get(id)\n\t\tif (!record) return\n\n\t\tconst windows = new Map(state.windows)\n\t\twindows.set(id, { ...record, ...updates })\n\t\tthis._state$.next({ ...state, windows })\n\t}\n}\n\n/** Simple rect overlap check (inline — no circular import with window-position) */\nfunction rectsOverlap(a: WindowBounds, b: WindowBounds): boolean {\n\treturn !(a.left >= b.left + b.width || a.left + a.width <= b.left || a.top >= b.top + b.height || a.top + a.height <= b.top)\n}\n\nexport const windowManager = WindowManagerService.getInstance()\n","/**\n * Window Position — pure functions for overlap resolution, cascade, and snapping.\n *\n * All functions are stateless: they take window bounds and viewport dimensions,\n * return new bounds. No side effects, no DOM access, no subscriptions.\n *\n * Example:\n * const projected = { left: 100, top: 400, width: 360, height: 500 }\n * const neighbors = windowManager.findOverlaps(projected, 'my-id')\n * const resolved = resolveOverlap(projected, neighbors, { width: 1440, height: 900 })\n * // → { left: 144, top: 444, width: 360, height: 500 } (cascaded away from conflict)\n */\n\nimport type { WindowBounds, WindowRecord } from './window-registry.js'\n\nconst HEAD_HEIGHT = 44\nconst CASCADE_OFFSET = HEAD_HEIGHT\nconst MAX_CASCADE_ATTEMPTS = 10\n\n/** Check if two rectangles overlap (edges touching does NOT count as overlap) */\nexport function rectsOverlap(a: WindowBounds, b: WindowBounds): boolean {\n\treturn !(a.left >= b.left + b.width || a.left + a.width <= b.left || a.top >= b.top + b.height || a.top + a.height <= b.top)\n}\n\n/**\n * Resolve overlap by cascading diagonally until no conflict.\n * Shifts by (HEAD_HEIGHT, HEAD_HEIGHT) per attempt, clamped to viewport.\n */\nexport function resolveOverlap(\n\tcandidate: WindowBounds,\n\texisting: WindowRecord[],\n\tviewport: { width: number; height: number },\n): WindowBounds {\n\tconst bounds = { ...candidate }\n\n\tfor (let attempt = 0; attempt < MAX_CASCADE_ATTEMPTS; attempt++) {\n\t\tconst hasOverlap = existing.some(w => rectsOverlap(bounds, w.bounds))\n\t\tif (!hasOverlap) break\n\n\t\tbounds.left += CASCADE_OFFSET\n\t\tbounds.top += CASCADE_OFFSET\n\t}\n\n\treturn clampToViewport(bounds, viewport)\n}\n\n/**\n * Clamp bounds so the window stays fully within the viewport.\n */\nexport function clampToViewport(\n\tbounds: WindowBounds,\n\tviewport: { width: number; height: number },\n): WindowBounds {\n\treturn {\n\t\twidth: bounds.width,\n\t\theight: bounds.height,\n\t\tleft: Math.max(0, Math.min(bounds.left, viewport.width - bounds.width)),\n\t\ttop: Math.max(0, Math.min(bounds.top, viewport.height - bounds.height)),\n\t}\n}\n","import { SchmancyElement } from '@mixins/index'\nimport { css, html, nothing } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\nimport { classMap } from 'lit/directives/class-map.js'\nimport { createRef, ref } from 'lit/directives/ref.js'\nimport { styleMap } from 'lit/directives/style-map.js'\nimport {\n\tanimationFrameScheduler,\n\tauditTime,\n\tcatchError,\n\tEMPTY,\n\tfilter,\n\tfinalize,\n\tfrom,\n\tfromEvent,\n\tmap,\n\tmerge,\n\tObservable,\n\tswitchMap,\n\ttake,\n\ttakeUntil,\n\ttap,\n} from 'rxjs'\nimport { SPRING_SMOOTH, SPRING_SNAPPY } from '../utils/animation.js'\nimport { cursorGlow } from '../directives/cursor-glow'\nimport { reducedMotion$ } from '../directives/reduced-motion'\nimport { theme } from '../theme/theme.service.js'\nimport type { SnapCorner, WindowBounds, WindowVisualState } from './window-registry.js'\nimport { windowManager } from './window-manager.js'\nimport { resolveOverlap } from './window-position.js'\n\nconst HEAD_HEIGHT = 48\nconst DRAG_THRESHOLD = 5\n\ninterface Position {\n\tx: number\n\ty: number\n}\n\n@customElement('schmancy-window')\nexport default class SchmancyWindow extends SchmancyElement {\n\tstatic styles = [css`\n\t:host {\n\t\tdisplay: contents;\n\t\tposition: relative;\n\t\tz-index: 1000;\n\t}\n\t:host([hidden]) {\n\t\tdisplay: none !important;\n\t}\n`]\n\n\t@property({ type: String }) id: string = 'default'\n\t/** Override the expanded panel width (e.g. '320px', '24rem'). Defaults to responsive sizing. */\n\t@property({ type: String }) expandedWidth?: string\n\t/** Override the expanded panel height (e.g. '400px', '50vh'). */\n\t@property({ type: String }) expandedHeight?: string\n\t/** When true, uses a lower elevation shadow in the collapsed state. */\n\t@property({ type: Boolean, reflect: true }) lowered: boolean = false\n\t/** Corner the window is anchored to. */\n\t@property({ type: String }) corner: SnapCorner = 'bottom-right'\n\t/** When true, window can be resized by the user. */\n\t@property({ type: Boolean }) resizable = false\n\t/** When true, window stays at its dragged position instead of snapping to a corner. */\n\t@property({ type: Boolean }) freePosition = false\n\t/** Visual state of the window (minimized, normal, maximized). */\n\t@property({ type: String, reflect: true }) visualState: WindowVisualState = 'normal'\n\t/** Minimum width in pixels. */\n\t@property({ type: Number }) minWidth = 280\n\t/** Minimum height in pixels. */\n\t@property({ type: Number }) minHeight = 200\n\n\t/** Whether the body is expanded. */\n\t@property({ type: Boolean, reflect: true }) open = false\n\n\tprivate _currentAnimation?: Animation\n\n\t/** Lazy rendering: body content not in DOM until first expand. */\n\t@state() private _hasOpened = false\n\t/** Whether this window is the focused window in the manager — drives visual ring */\n\t@state() private _focused = false\n\n\t// Internal position -- plain fields, updated directly during drag\n\tprivate _position: Position = { x: 16, y: 16 }\n\t@state() private _currentCorner: SnapCorner = 'bottom-right'\n\n\t// Track applied corner to avoid unnecessary style.removeProperty calls during drag\n\tprivate _appliedCorner: string = ''\n\n\t// Refs\n\tprivate _containerRef = createRef<HTMLElement>()\n\tprivate _bodyRef = createRef<HTMLElement>()\n\tprivate _headRef = createRef<HTMLElement>()\n\n\t// ============================================\n\t// COMPUTED\n\t// ============================================\n\n\tprivate get panelWidth(): string {\n\t\treturn this.expandedWidth ?? 'min(360px, calc(100vw - 32px))'\n\t}\n\n\tprivate get isBottomCorner(): boolean {\n\t\treturn this._currentCorner.startsWith('bottom')\n\t}\n\n\tprivate get closedClipPath(): string {\n\t\treturn this.isBottomCorner\n\t\t\t? `inset(calc(100% - ${HEAD_HEIGHT}px) 0px 0px 0px round 22px)`\n\t\t\t: `inset(0px 0px calc(100% - ${HEAD_HEIGHT}px) 0px round 22px)`\n\t}\n\n\tprivate get openClipPath(): string {\n\t\treturn 'inset(0px 0px 0px 0px round 12px)'\n\t}\n\n\tprivate get elevation(): 0 | 1 | 2 | 3 | 4 | 5 {\n\t\tif (this.open) return 4\n\t\treturn this.lowered ? 1 : 3\n\t}\n\n\t// ============================================\n\t// POSITION MANAGEMENT\n\t// ============================================\n\n\tprivate _applyContainerPosition() {\n\t\tconst container = this._containerRef.value\n\t\tif (!container) return\n\t\t// Only clear position properties when corner changes (avoids 4 style invalidations per drag frame)\n\t\tif (this._appliedCorner !== this._currentCorner) {\n\t\t\tcontainer.style.removeProperty('left')\n\t\t\tcontainer.style.removeProperty('right')\n\t\t\tcontainer.style.removeProperty('top')\n\t\t\tcontainer.style.removeProperty('bottom')\n\t\t\tthis._appliedCorner = this._currentCorner\n\t\t}\n\t\tconst { x, y } = this._position\n\t\tif (this._currentCorner.includes('right')) {\n\t\t\tcontainer.style.right = `${x}px`\n\t\t} else {\n\t\t\tcontainer.style.left = `${x}px`\n\t\t}\n\t\tif (this._currentCorner.includes('bottom')) {\n\t\t\tcontainer.style.bottom = `${y + theme.bottomOffset}px`\n\t\t} else {\n\t\t\tcontainer.style.top = `${y}px`\n\t\t}\n\t}\n\n\tprivate static readonly VALID_CORNERS = new Set<string>(['top-left', 'top-right', 'bottom-left', 'bottom-right'])\n\n\tprivate _loadPosition() {\n\t\tconst saved = windowManager.loadPosition(this.id)\n\t\tif (saved) {\n\t\t\tthis._position = { x: saved.x, y: saved.y }\n\t\t\tif (SchmancyWindow.VALID_CORNERS.has(saved.anchor)) {\n\t\t\t\tthis._currentCorner = saved.anchor as SnapCorner\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate _savePosition() {\n\t\twindowManager.savePosition(this.id, { ...this._position, anchor: this._currentCorner })\n\t}\n\n\tprivate _validateBounds() {\n\t\tconst container = this._containerRef.value\n\t\tif (!container) return\n\t\tconst rect = container.getBoundingClientRect()\n\t\tif (rect.width === 0) return\n\t\tconst vw = window.innerWidth\n\t\tconst vh = window.innerHeight\n\t\tconst isRight = this._currentCorner.includes('right')\n\t\tconst isBottom = this._currentCorner.includes('bottom')\n\t\tconst actualLeft = isRight ? vw - this._position.x - rect.width : this._position.x\n\t\tconst actualTop = isBottom ? vh - this._position.y - rect.height : this._position.y\n\t\tconst newLeft = Math.max(0, Math.min(actualLeft, vw - rect.width))\n\t\tconst newTop = Math.max(0, Math.min(actualTop, vh - rect.height))\n\t\tthis._position = {\n\t\t\tx: isRight ? vw - newLeft - rect.width : newLeft,\n\t\t\ty: isBottom ? vh - newTop - rect.height : newTop,\n\t\t}\n\t\tthis._applyContainerPosition()\n\t}\n\n\t// ============================================\n\t// CORNER SNAPPING\n\t// ============================================\n\n\tprivate _reorientToNearestCorner(skipAnimation = false): void {\n\t\t// Free position mode: skip corner snapping\n\t\tif (this.freePosition) {\n\t\t\tthis._savePosition()\n\t\t\tconst rect = this._containerRef.value?.getBoundingClientRect()\n\t\t\tif (rect) {\n\t\t\t\twindowManager.updateBounds(this.id, { left: rect.left, top: rect.top, width: rect.width, height: rect.height })\n\t\t\t}\n\t\t\treturn\n\t\t}\n\n\t\tconst container = this._containerRef.value\n\t\tif (!container) return\n\n\t\t// F -- record current screen position before DOM mutation\n\t\tconst rect = container.getBoundingClientRect()\n\n\t\t// L -- calculate nearest corner using head visual center\n\t\tconst currentIsBottom = this._currentCorner.includes('bottom')\n\t\tconst headCenterX = rect.left + rect.width / 2\n\t\tconst headCenterY = currentIsBottom\n\t\t\t? rect.bottom - HEAD_HEIGHT / 2\n\t\t\t: rect.top + HEAD_HEIGHT / 2\n\t\tconst side = headCenterX > window.innerWidth / 2 ? 'right' : 'left'\n\t\tconst vert = headCenterY > window.innerHeight / 2 ? 'bottom' : 'top'\n\t\tconst newCorner: SnapCorner = `${vert}-${side}` as SnapCorner\n\n\t\t// Snap corner and reset offset to standard edge gap\n\t\tthis._currentCorner = newCorner\n\t\tthis._position = { x: 16, y: 16 }\n\t\tthis._applyContainerPosition()\n\t\t// Sync clip-path to new corner\n\t\tif (!this.open) {\n\t\t\tcontainer.style.clipPath = this.closedClipPath\n\t\t}\n\n\t\tif (skipAnimation || reducedMotion$.value) {\n\t\t\tthis._savePosition()\n\t\t\tconst snapRect = container.getBoundingClientRect()\n\t\t\twindowManager.updateBounds(this.id, { left: snapRect.left, top: snapRect.top, width: snapRect.width, height: snapRect.height })\n\t\t\treturn\n\t\t}\n\n\t\t// I -- invert: shift element back to its original visual position\n\t\tconst newRect = container.getBoundingClientRect()\n\t\tconst dx = rect.left - newRect.left\n\t\tconst dy = rect.top - newRect.top\n\t\tcontainer.style.translate = `${dx}px ${dy}px`\n\n\t\t// P -- play: animate from the inverse offset to natural resting position\n\t\tconst flipKeyframes: Keyframe[] = [{ translate: `${dx}px ${dy}px` }, { translate: '0px 0px' }]\n\t\tconst anim = container.animate(\n\t\t\tflipKeyframes,\n\t\t\t{\n\t\t\t\tduration: SPRING_SMOOTH.duration,\n\t\t\t\teasing: SPRING_SMOOTH.easingFallback,\n\t\t\t\tfill: 'forwards',\n\t\t\t},\n\t\t)\n\t\tfrom(anim.finished).pipe(\n\t\t\ttake(1),\n\t\t\ttap(() => {\n\t\t\t\tif (container.isConnected) container.style.translate = ''\n\t\t\t\t// Report final resting bounds after animation completes\n\t\t\t\tconst finalRect = container.getBoundingClientRect()\n\t\t\t\twindowManager.updateBounds(this.id, { left: finalRect.left, top: finalRect.top, width: finalRect.width, height: finalRect.height })\n\t\t\t}),\n\t\t\tcatchError(() => EMPTY),\n\t\t\ttakeUntil(this.disconnecting),\n\t\t).subscribe()\n\n\t\tthis._savePosition()\n\t}\n\n\t// ============================================\n\t// DRAG PIPELINE\n\t// ============================================\n\n\tprivate _drag$(): Observable<never> {\n\t\treturn new Observable(() => {\n\t\t\tconst head = this._headRef.value\n\t\t\tconst container = this._containerRef.value\n\t\t\tif (!head || !container) return\n\n\t\t\tlet didDrag = false\n\n\t\t\tconst sub = fromEvent<PointerEvent>(head, 'pointerdown').pipe(\n\t\t\t\tfilter(e => e.button === 0),\n\t\t\t\tfilter(e => {\n\t\t\t\t\tconst tag = (e.target as HTMLElement).tagName?.toLowerCase()\n\t\t\t\t\treturn !['input', 'textarea', 'select', 'button'].includes(tag)\n\t\t\t\t\t\t&& !(e.target as HTMLElement).closest('schmancy-input, schmancy-icon-button, button, a')\n\t\t\t\t}),\n\t\t\t\ttap(e => {\n\t\t\t\t\te.preventDefault()\n\t\t\t\t\te.stopPropagation()\n\t\t\t\t}),\n\t\t\t)\n\t\t\t\t.pipe(\n\t\t\t\t\tmap(e => {\n\t\t\t\t\t\tconst rect = container.getBoundingClientRect()\n\t\t\t\t\t\tconst isBottom = this._currentCorner.includes('bottom')\n\t\t\t\t\t\tconst wasOpen = this.open\n\t\t\t\t\t\tdidDrag = false\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tstartX: e.clientX,\n\t\t\t\t\t\t\tstartY: e.clientY,\n\t\t\t\t\t\t\toffsetX: e.clientX - rect.left,\n\t\t\t\t\t\t\toffsetY: e.clientY - rect.top,\n\t\t\t\t\t\t\trect,\n\t\t\t\t\t\t\tvw: window.innerWidth,\n\t\t\t\t\t\t\tvh: window.innerHeight,\n\t\t\t\t\t\t\tisBottom,\n\t\t\t\t\t\t\twasOpen,\n\t\t\t\t\t\t\tpointerId: e.pointerId,\n\t\t\t\t\t\t}\n\t\t\t\t\t}),\n\t\t\t\t\tswitchMap(({ startX, startY, offsetX, offsetY, rect, vw, vh, isBottom, wasOpen, pointerId }) => {\n\t\t\t\t\t\tconst move$ = fromEvent<PointerEvent>(window, 'pointermove').pipe(\n\t\t\t\t\t\t\tfilter(e => e.pointerId === pointerId),\n\t\t\t\t\t\t\tauditTime(0, animationFrameScheduler),\n\t\t\t\t\t\t\tmap(e => ({ clientX: e.clientX, clientY: e.clientY })),\n\t\t\t\t\t\t)\n\t\t\t\t\t\tconst end$ = fromEvent<PointerEvent>(window, 'pointerup').pipe(\n\t\t\t\t\t\t\tfilter(e => e.pointerId === pointerId),\n\t\t\t\t\t\t)\n\n\t\t\t\t\t\treturn move$.pipe(\n\t\t\t\t\t\t\ttap(({ clientX, clientY }) => {\n\t\t\t\t\t\t\t\tconst dx = clientX - startX\n\t\t\t\t\t\t\t\tconst dy = clientY - startY\n\t\t\t\t\t\t\t\tif (Math.sqrt(dx * dx + dy * dy) > DRAG_THRESHOLD && !didDrag) {\n\t\t\t\t\t\t\t\t\tdidDrag = true\n\t\t\t\t\t\t\t\t\tthis._applyDragVisuals(true)\n\t\t\t\t\t\t\t\t\t// Collapse on first confirmed drag move\n\t\t\t\t\t\t\t\t\tif (wasOpen) {\n\t\t\t\t\t\t\t\t\t\tthis.open = false\n\t\t\t\t\t\t\t\t\t\tcontainer.style.clipPath = this.closedClipPath\n\t\t\t\t\t\t\t\t\t\tcontainer.style.overflow = 'hidden'\n\t\t\t\t\t\t\t\t\t\tconst body = this._bodyRef.value\n\t\t\t\t\t\t\t\t\t\tif (body) {\n\t\t\t\t\t\t\t\t\t\t\tbody.inert = true\n\t\t\t\t\t\t\t\t\t\t\tbody.style.visibility = 'hidden'\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (!didDrag) return\n\n\t\t\t\t\t\t\t\tconst left = Math.max(0, Math.min(clientX - offsetX, vw - rect.width))\n\t\t\t\t\t\t\t\tconst minTop = isBottom ? HEAD_HEIGHT - rect.height : 0\n\t\t\t\t\t\t\t\tconst maxTop = isBottom ? vh - rect.height : vh - HEAD_HEIGHT\n\t\t\t\t\t\t\t\tconst top = Math.max(minTop, Math.min(clientY - offsetY, maxTop))\n\n\t\t\t\t\t\t\t\tthis._position = {\n\t\t\t\t\t\t\t\t\tx: this._currentCorner.includes('right') ? vw - left - rect.width : left,\n\t\t\t\t\t\t\t\t\ty: isBottom ? vh - top - rect.height : top,\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tthis._applyContainerPosition()\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\ttakeUntil(end$),\n\t\t\t\t\t\t\tfinalize(() => {\n\t\t\t\t\t\t\t\tif (didDrag) {\n\t\t\t\t\t\t\t\t\tthis._reorientToNearestCorner()\n\t\t\t\t\t\t\t\t\tthis._applyDragVisuals(false)\n\t\t\t\t\t\t\t\t\tdidDrag = false\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tdidDrag = false\n\t\t\t\t\t\t\t\t\tthis.toggle()\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t)\n\t\t\t\t\t}),\n\t\t\t\t)\n\t\t\t\t.subscribe()\n\n\t\t\treturn () => sub.unsubscribe()\n\t\t})\n\t}\n\n\t// ============================================\n\t// LIFECYCLE\n\t// ============================================\n\n\tconnectedCallback() {\n\t\tsuper.connectedCallback()\n\n\t\t// Pipeline 1: DOM setup + manager registration + drag + z-index sync\n\t\tfrom(this.updateComplete).pipe(\n\t\t\ttake(1),\n\t\t\ttap(() => {\n\t\t\t\tthis._currentCorner = this.corner\n\t\t\t\tthis._loadPosition()\n\t\t\t\tthis._applyContainerPosition()\n\t\t\t\tthis._initDOMState()\n\t\t\t\t// Register with window manager\n\t\t\t\tconst container = this._containerRef.value\n\t\t\t\tif (container) {\n\t\t\t\t\tconst rect = container.getBoundingClientRect()\n\t\t\t\t\tconst bounds: WindowBounds = { left: rect.left, top: rect.top, width: rect.width, height: rect.height }\n\t\t\t\t\twindowManager.register(this.id, bounds, this.freePosition ? 'free' : this._currentCorner)\n\t\t\t\t}\n\t\t\t}),\n\t\t\tswitchMap(() => merge(\n\t\t\t\tthis._drag$(),\n\t\t\t\twindowManager.selectWindow(this.id).pipe(\n\t\t\t\t\ttap(record => {\n\t\t\t\t\t\tif (!record) return\n\t\t\t\t\t\tconst container = this._containerRef.value\n\t\t\t\t\t\tif (container) container.style.zIndex = String(record.zIndex)\n\t\t\t\t\t}),\n\t\t\t\t),\n\t\t\t\twindowManager.selectFocused().pipe(\n\t\t\t\t\ttap(focusedId => {\n\t\t\t\t\t\tthis._focused = focusedId === this.id\n\t\t\t\t\t}),\n\t\t\t\t),\n\t\t\t)),\n\t\t\ttakeUntil(this.disconnecting),\n\t\t).subscribe()\n\n\n\t\t// Pipeline 3: Environment -- one subscription\n\t\tmerge(\n\t\t\tfromEvent(window, 'resize').pipe(\n\t\t\t\tauditTime(0, animationFrameScheduler),\n\t\t\t\ttap(() => this._validateBounds()),\n\t\t\t),\n\t\t\ttheme.bottomOffset$.pipe(\n\t\t\t\ttap(() => this._applyContainerPosition()),\n\t\t\t),\n\t\t).pipe(takeUntil(this.disconnecting)).subscribe()\n\t}\n\n\tdisconnectedCallback() {\n\t\tsuper.disconnectedCallback()\n\t\twindowManager.unregister(this.id)\n\t}\n\n\tprivate _initDOMState() {\n\t\tconst container = this._containerRef.value\n\t\tconst body = this._bodyRef.value\n\t\tif (!container) return\n\n\t\tthis._applyContainerPosition()\n\n\t\tif (this.open) {\n\t\t\tthis._hasOpened = true\n\t\t\tcontainer.style.overflow = ''\n\t\t\tif (body) {\n\t\t\t\tbody.inert = false\n\t\t\t\tbody.style.visibility = 'visible'\n\t\t\t}\n\t\t} else {\n\t\t\tcontainer.style.clipPath = this.closedClipPath\n\t\t\tcontainer.style.overflow = 'hidden'\n\t\t\tif (body) {\n\t\t\t\tbody.inert = true\n\t\t\t\tbody.style.visibility = 'hidden'\n\t\t\t}\n\t\t}\n\t}\n\n\t// ============================================\n\t// ANIMATION\n\t// ============================================\n\n\tprivate _animateOpen() {\n\t\tconst container = this._containerRef.value\n\t\tconst body = this._bodyRef.value\n\t\tif (!container) return\n\n\t\tthis._hasOpened = true\n\t\tthis.open = true\n\n\t\t// Overlap avoidance\n\t\tconst rect = container.getBoundingClientRect()\n\t\tconst projectedBounds: WindowBounds = {\n\t\t\tleft: rect.left,\n\t\t\ttop: this.isBottomCorner ? rect.top - 400 : rect.top,\n\t\t\twidth: rect.width,\n\t\t\theight: 400 + HEAD_HEIGHT,\n\t\t}\n\t\tconst overlaps = windowManager.findOverlaps(projectedBounds, this.id)\n\t\tif (overlaps.length > 0) {\n\t\t\tconst resolved = resolveOverlap(projectedBounds, overlaps, { width: window.innerWidth, height: window.innerHeight })\n\t\t\tif (Math.abs(resolved.left - projectedBounds.left) > 10 || Math.abs(resolved.top - projectedBounds.top) > 10) {\n\t\t\t\tconst isRight = this._currentCorner.includes('right')\n\t\t\t\tconst isBottom = this._currentCorner.includes('bottom')\n\t\t\t\tthis._position = {\n\t\t\t\t\tx: isRight ? window.innerWidth - resolved.left - resolved.width : resolved.left,\n\t\t\t\t\ty: isBottom ? window.innerHeight - resolved.top - resolved.height : resolved.top,\n\t\t\t\t}\n\t\t\t\tthis._applyContainerPosition()\n\t\t\t}\n\t\t}\n\n\t\tif (body) {\n\t\t\tbody.style.visibility = 'visible'\n\t\t\tbody.inert = false\n\t\t}\n\n\t\tif (reducedMotion$.value) {\n\t\t\tcontainer.style.clipPath = ''\n\t\t\tcontainer.style.overflow = ''\n\t\t\tthis.dispatchScopedEvent('window-toggle', { state: 'expanded' })\n\t\t\treturn\n\t\t}\n\n\t\tthis._currentAnimation?.cancel()\n\t\tcontainer.style.overflow = 'hidden'\n\t\tcontainer.style.willChange = 'opacity'\n\t\tconst openKeyframes: Keyframe[] = [\n\t\t\t{ clipPath: this.closedClipPath, opacity: 0.95 },\n\t\t\t{ clipPath: this.openClipPath, opacity: 1 },\n\t\t]\n\t\tconst anim = container.animate(openKeyframes, {\n\t\t\tduration: SPRING_SNAPPY.duration,\n\t\t\teasing: SPRING_SNAPPY.easingFallback,\n\t\t\tfill: 'forwards',\n\t\t})\n\t\tthis._currentAnimation = anim\n\n\t\tfrom(anim.finished).pipe(\n\t\t\ttake(1),\n\t\t\ttap(() => {\n\t\t\t\tif (container.isConnected) {\n\t\t\t\t\tcontainer.style.clipPath = ''\n\t\t\t\t\tcontainer.style.overflow = ''\n\t\t\t\t\tcontainer.style.willChange = ''\n\t\t\t\t}\n\t\t\t}),\n\t\t\tcatchError(() => EMPTY),\n\t\t\ttakeUntil(this.disconnecting),\n\t\t).subscribe()\n\n\t\tthis.dispatchScopedEvent('window-toggle', { state: 'expanded' })\n\t}\n\n\tprivate _animateClose() {\n\t\tconst container = this._containerRef.value\n\t\tif (!container) return\n\n\t\tif (reducedMotion$.value) {\n\t\t\tcontainer.style.clipPath = this.closedClipPath\n\t\t\tcontainer.style.overflow = 'hidden'\n\t\t\tthis.open = false\n\t\t\tconst body = this._bodyRef.value\n\t\t\tif (body) { body.inert = true; body.style.visibility = 'hidden' }\n\t\t\tthis.dispatchScopedEvent('window-toggle', { state: 'collapsed' })\n\t\t\treturn\n\t\t}\n\n\t\tthis._currentAnimation?.cancel()\n\t\tcontainer.style.overflow = 'hidden'\n\t\tcontainer.style.willChange = 'opacity'\n\t\tconst closeKeyframes: Keyframe[] = [\n\t\t\t{ clipPath: this.openClipPath, opacity: 1 },\n\t\t\t{ clipPath: this.closedClipPath, opacity: 0.95 },\n\t\t]\n\t\tconst anim = container.animate(closeKeyframes, {\n\t\t\tduration: Math.round(SPRING_SNAPPY.duration * 0.7),\n\t\t\teasing: 'cubic-bezier(0.4, 0, 0.8, 0.15)',\n\t\t\tfill: 'forwards',\n\t\t})\n\t\tthis._currentAnimation = anim\n\n\t\tfrom(anim.finished).pipe(\n\t\t\ttake(1),\n\t\t\ttap(() => {\n\t\t\t\tthis.open = false\n\t\t\t\tcontainer.style.willChange = ''\n\t\t\t\tconst body = this._bodyRef.value\n\t\t\t\tif (body) { body.inert = true; body.style.visibility = 'hidden' }\n\t\t\t}),\n\t\t\tcatchError(() => EMPTY),\n\t\t\ttakeUntil(this.disconnecting),\n\t\t).subscribe()\n\n\t\tthis.dispatchScopedEvent('window-toggle', { state: 'collapsed' })\n\t}\n\n\t// ============================================\n\t// VISUAL STATE HELPERS\n\t// ============================================\n\n\t/** Apply drag visuals directly on DOM refs — avoids full Lit re-render for cursor + opacity */\n\tprivate _applyDragVisuals(dragging: boolean) {\n\t\tconst head = this._headRef.value\n\t\tconst container = this._containerRef.value\n\t\tif (head) {\n\t\t\thead.classList.toggle('cursor-grabbing', dragging)\n\t\t\thead.classList.toggle('cursor-move', !dragging)\n\t\t}\n\t\tif (container) {\n\t\t\tcontainer.style.opacity = dragging ? '0.95' : ''\n\t\t}\n\t}\n\n\tprivate _handleFocus = () => windowManager.focus(this.id)\n\n\tprivate _handleHeadKeydown = (e: KeyboardEvent) => {\n\t\tif (e.key === 'Enter' || e.key === ' ') {\n\t\t\te.preventDefault()\n\t\t\tthis.toggle()\n\t\t\treturn\n\t\t}\n\t\tif (e.key === 'ArrowUp' || e.key === 'ArrowDown' || e.key === 'ArrowLeft' || e.key === 'ArrowRight') {\n\t\t\te.preventDefault()\n\t\t\tconst step = e.shiftKey ? 20 : 5\n\t\t\tconst dx = e.key === 'ArrowRight' ? step : e.key === 'ArrowLeft' ? -step : 0\n\t\t\tconst dy = e.key === 'ArrowDown' ? step : e.key === 'ArrowUp' ? -step : 0\n\t\t\tthis._position = { x: this._position.x + dx, y: this._position.y + dy }\n\t\t\tthis._applyContainerPosition()\n\t\t\tthis._savePosition()\n\t\t}\n\t}\n\n\t// ============================================\n\t// PUBLIC API\n\t// ============================================\n\n\ttoggle() {\n\t\tif (this.open) this._animateClose()\n\t\telse this._animateOpen()\n\t}\n\n\texpand() {\n\t\tif (this.open) return\n\t\tthis._animateOpen()\n\t}\n\n\tclose() {\n\t\tif (!this.open) return\n\t\tthis._animateClose()\n\t}\n\n\t// ============================================\n\t// RENDER\n\t// ============================================\n\n\tprotected render(): unknown {\n\t\tconst isBottom = this._currentCorner.startsWith('bottom')\n\n\t\tconst containerClasses = classMap({\n\t\t\tfixed: true,\n\t\t\tflex: true,\n\t\t\t'flex-col': isBottom,\n\t\t\t'flex-col-reverse': !isBottom,\n\t\t\t'z-1000': true,\n\t\t\t'ring-1': !this._focused,\n\t\t\t'ring-2': this._focused,\n\t\t\t'ring-primary-default/30': this._focused,\n\t\t\t'ring-primary-default/15': this.open && !this._focused,\n\t\t\t'rounded-2xl': this.open,\n\t\t\t'ring-outline-variant/40': !this.open && !this._focused,\n\t\t\t'rounded-[22px]': !this.open,\n\t\t\t'overflow-hidden': true,\n\t\t})\n\n\t\tconst containerStyles = styleMap({\n\t\t\twidth: this.panelWidth,\n\t\t\t'max-height': 'calc(100vh - 32px)',\n\t\t\t'pointer-events': 'none',\n\t\t})\n\n\t\tconst bodyStyles = styleMap({\n\t\t\t'pointer-events': this.open ? 'auto' : 'none',\n\t\t})\n\n\t\tconst headClasses = classMap({\n\t\t\t'h-full': true,\n\t\t\t'px-3': true,\n\t\t\tflex: true,\n\t\t\t'items-center': true,\n\t\t\t'gap-2': true,\n\t\t\t'select-none': true,\n\t\t\t'cursor-move': true,\n\t\t})\n\n\t\treturn html`\n\t\t\t<schmancy-surface\n\t\t\t\t${ref(this._containerRef)}\n\t\t\t\ttype=\"glass\"\n\t\t\t\t.elevation=${this.elevation}\n\t\t\t\tclass=${containerClasses}\n\t\t\t\tstyle=${containerStyles}\n\t\t\t\taria-expanded=${this.open}\n\t\t\t\t@pointerdown=${this._handleFocus}\n\t\t\t>\n\t\t\t\t<!-- Details section (visually above summary for bottom corners) -->\n\t\t\t\t<section\n\t\t\t\t\t${ref(this._bodyRef)}\n\t\t\t\t\tclass=\"flex-1 min-h-0 overflow-hidden flex flex-col\"\n\t\t\t\t\tstyle=${bodyStyles}\n\t\t\t\t\trole=\"region\"\n\t\t\t\t\taria-label=\"Expandable content\"\n\t\t\t\t>\n\t\t\t\t\t${this._hasOpened ? html`<slot name=\"details\"></slot>` : nothing}\n\t\t\t\t</section>\n\n\t\t\t\t<!-- Summary section -- always interactive, always visible -->\n\t\t\t\t<section\n\t\t\t\t\tclass=\"shrink-0 bg-surface-lowest\"\n\t\t\t\t\tstyle=${styleMap({ 'pointer-events': 'auto', height: `${HEAD_HEIGHT}px` })}\n\t\t\t\t>\n\t\t\t\t\t<div\n\t\t\t\t\t\t${ref(this._headRef)}\n\t\t\t\t\t\t${cursorGlow({ radius: 200, intensity: 0.10 })}\n\t\t\t\t\t\tclass=${headClasses}\n\t\t\t\t\t\trole=\"button\"\n\t\t\t\t\t\ttabindex=\"0\"\n\t\t\t\t\t\ttitle=\"Drag to move, click to expand\"\n\t\t\t\t\t\taria-label=\"${this.open ? 'Collapse window' : 'Expand window'}\"\n\t\t\t\t\t\t@keydown=${this._handleHeadKeydown}\n\t\t\t\t\t>\n\t\t\t\t\t\t<div class=\"flex-1 min-w-0\">\n\t\t\t\t\t\t\t<slot></slot>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<svg\n\t\t\t\t\t\t\twidth=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\"\n\t\t\t\t\t\t\tclass=\"shrink-0 text-surface-on/40 transition-transform duration-200 ${this.open ? 'rotate-180' : ''}\"\n\t\t\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<path d=\"M6 9L12 15L18 9\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" />\n\t\t\t\t\t\t</svg>\n\t\t\t\t\t</div>\n\t\t\t\t</section>\n\t\t\t</schmancy-surface>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-window': SchmancyWindow\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;AAmBA,IAAM,IAAiB,oBACjB,IAAwB;AAmL9B,SAAS,EAAa,GAAiB,GAAA;AACtC,QAAA,EAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE;;AAGzH,IAAA,GAAa,IArLb,MAAM,EAAA;CAWL,cAAA;AAAA,OAAA,UAR2B,IAAI,EAAqC;GACnE,yBAAS,IAAI,KAAA;GACb,WAAW;GACX,YAAY,EAAA;GAAA,CAAA,EAAA,KAAA,SAGK,KAAK,QAAQ,cAAA;;CAI/B,OAAA,cAAO;AAIN,SAHK,AACJ,EAAqB,aAAW,IAAI,GAAA,EAE9B,EAAqB;;CAK7B,IAAA,UAAI;AACH,SAAO,KAAK,QAAQ,MAAM;;CAG3B,IAAA,YAAI;AACH,SAAO,KAAK,QAAQ,MAAM;;CAK3B,SAAS,GAAY,GAA6B,GAAA;EACjD,IAAM,IAAQ,KAAK,QAAQ;AAC3B,MAAI,EAAM,QAAQ,IAAI,EAAA,CAAK;EAG3B,IAAM,IAAuB;GAC5B,IAAA;GACA,QAAQ;GACR,aAAa;GACb,QALc,EAAa,aAAa,EAAA;GAMxC,MAAA,CAAM;GACN,YAA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E,MAAM,QAAA,CAAA,CAAA,EAAS,EAAA,WAAA,aAAA,KAAA,EAAA,EAAA,EAAA,CAG1B,EAAS;CAAE,MAAM;CAAS,SAAA,CAAS;CAAA,CAAA,CAAA,EAAO,EAAA,WAAA,QAAA,KAAA,EAAA,EAAA,EAAA,CAK1C,GAAA,CAAA,EAAO,EAAA,WAAA,cAAA,KAAA,EAAA,EAAA,EAAA,CAEP,GAAA,CAAA,EAAO,EAAA,WAAA,YAAA,KAAA,EAAA,EAAA,EAAA,CAIP,GAAA,CAAA,EAAO,EAAA,WAAA,kBAAA,KAAA,EAAA;AAAA,IAAA,IAAA,IAAA,IAAA,EAAA,CA7CR,EAAc,kBAAA,CAAA,EAAkB,EAAA;AAAA,SAAA,KAAA,GAAA,KAAA"}
1
+ {"version":3,"file":"window-B_55dzk0.js","names":[],"sources":["../src/window/window-manager.ts","../src/window/window-position.ts","../src/window/window.ts"],"sourcesContent":["/**\n * Window Manager — singleton service for multi-window coordination.\n *\n * Tracks all schmancy-window instances: positions, z-indices, focus, visual states.\n * Components register on connectedCallback, unregister on disconnectedCallback.\n * Focus changes, position updates, and overlap queries all flow through here.\n *\n * Follows the ThemeService singleton pattern (theme/theme.service.ts).\n *\n * Example:\n * windowManager.register('chat-1', bounds, 'bottom-right')\n * windowManager.focus('chat-1') // bumps z-index, updates focusedId\n * const overlaps = windowManager.findOverlaps(projectedBounds, 'chat-1')\n */\n\nimport { BehaviorSubject, Observable, distinctUntilChanged, map } from 'rxjs'\nimport { overlayStack } from '../utils/overlay-stack.js'\nimport type { WindowBounds, WindowRecord, WindowRegistryState, SnapTarget } from './window-registry.js'\n\nconst STORAGE_PREFIX = 'schmancy-window-'\nconst LEGACY_STORAGE_PREFIX = 'schmancy-float-'\n\nclass WindowManagerService {\n\tprivate static instance: WindowManagerService\n\n\tprivate readonly _state$ = new BehaviorSubject<WindowRegistryState>({\n\t\twindows: new Map(),\n\t\tfocusedId: null,\n\t\tstackOrder: [],\n\t})\n\n\treadonly state$ = this._state$.asObservable()\n\n\tprivate constructor() {}\n\n\tstatic getInstance(): WindowManagerService {\n\t\tif (!WindowManagerService.instance) {\n\t\t\tWindowManagerService.instance = new WindowManagerService()\n\t\t}\n\t\treturn WindowManagerService.instance\n\t}\n\n\t// ── Synchronous accessors ──────────────────────────────────────────\n\n\tget windows(): Map<string, WindowRecord> {\n\t\treturn this._state$.value.windows\n\t}\n\n\tget focusedId(): string | null {\n\t\treturn this._state$.value.focusedId\n\t}\n\n\t// ── Registration ───────────────────────────────────────────────────\n\n\tregister(id: string, initialBounds: WindowBounds, snapTarget: SnapTarget): void {\n\t\tconst state = this._state$.value\n\t\tif (state.windows.has(id)) return\n\n\t\tconst zIndex = overlayStack.assignZIndex(id)\n\t\tconst record: WindowRecord = {\n\t\t\tid,\n\t\t\tbounds: initialBounds,\n\t\t\tvisualState: 'normal',\n\t\t\tzIndex,\n\t\t\topen: false,\n\t\t\tsnapTarget,\n\t\t}\n\n\t\tconst windows = new Map(state.windows)\n\t\twindows.set(id, record)\n\t\tconst stackOrder = overlayStack.getStackOrder()\n\n\t\tthis._state$.next({ ...state, windows, stackOrder })\n\t}\n\n\tunregister(id: string): void {\n\t\tconst state = this._state$.value\n\t\tif (!state.windows.has(id)) return\n\n\t\toverlayStack.releaseId(id)\n\t\tconst windows = new Map(state.windows)\n\t\twindows.delete(id)\n\t\tconst stackOrder = overlayStack.getStackOrder()\n\t\tconst focusedId = state.focusedId === id ? null : state.focusedId\n\n\t\tthis._state$.next({ ...state, windows, stackOrder, focusedId })\n\t}\n\n\t// ── State mutations ────────────────────────────────────────────────\n\n\tupdateBounds(id: string, bounds: WindowBounds): void {\n\t\tthis._updateRecord(id, { bounds })\n\t}\n\n\tupdateVisualState(id: string, visualState: WindowRecord['visualState']): void {\n\t\tthis._updateRecord(id, { visualState })\n\t}\n\n\tupdateOpen(id: string, open: boolean): void {\n\t\tthis._updateRecord(id, { open })\n\t}\n\n\tfocus(id: string): void {\n\t\tconst state = this._state$.value\n\t\tif (!state.windows.has(id)) return\n\t\tif (state.focusedId === id) return\n\n\t\tconst zIndex = overlayStack.bringToFront(id)\n\t\tconst windows = new Map(state.windows)\n\t\tconst record = windows.get(id)\n\t\tif (record) {\n\t\t\twindows.set(id, { ...record, zIndex })\n\t\t}\n\t\tconst stackOrder = overlayStack.getStackOrder()\n\n\t\tthis._state$.next({ ...state, windows, stackOrder, focusedId: id })\n\t}\n\n\t// ── Queries ────────────────────────────────────────────────────────\n\n\tfindOverlaps(bounds: WindowBounds, excludeId: string): WindowRecord[] {\n\t\tconst result: WindowRecord[] = []\n\t\tfor (const [id, record] of this._state$.value.windows) {\n\t\t\tif (id === excludeId) continue\n\t\t\tif (rectsOverlap(bounds, record.bounds)) {\n\t\t\t\tresult.push(record)\n\t\t\t}\n\t\t}\n\t\treturn result\n\t}\n\n\tgetNeighbors(id: string): WindowRecord[] {\n\t\tconst result: WindowRecord[] = []\n\t\tfor (const [otherId, record] of this._state$.value.windows) {\n\t\t\tif (otherId !== id) result.push(record)\n\t\t}\n\t\treturn result\n\t}\n\n\t// ── Selectors ──────────────────────────────────────────────────────\n\n\tselectWindow(id: string): Observable<WindowRecord | undefined> {\n\t\treturn this._state$.pipe(\n\t\t\tmap(state => state.windows.get(id)),\n\t\t\tdistinctUntilChanged(),\n\t\t)\n\t}\n\n\tselectFocused(): Observable<string | null> {\n\t\treturn this._state$.pipe(\n\t\t\tmap(state => state.focusedId),\n\t\t\tdistinctUntilChanged(),\n\t\t)\n\t}\n\n\t// ── Persistence ────────────────────────────────────────────────────\n\n\tloadPosition(id: string): { x: number; y: number; anchor: string } | null {\n\t\ttry {\n\t\t\t// Try new key first, fall back to legacy\n\t\t\tconst raw = localStorage.getItem(STORAGE_PREFIX + id) ?? localStorage.getItem(LEGACY_STORAGE_PREFIX + id)\n\t\t\tif (!raw) return null\n\t\t\treturn JSON.parse(raw) as { x: number; y: number; anchor: string }\n\t\t} catch {\n\t\t\treturn null\n\t\t}\n\t}\n\n\tsavePosition(id: string, data: { x: number; y: number; anchor: string }): void {\n\t\ttry {\n\t\t\tlocalStorage.setItem(STORAGE_PREFIX + id, JSON.stringify(data))\n\t\t} catch {\n\t\t\t// ignore\n\t\t}\n\t}\n\n\tclearPosition(id: string): void {\n\t\ttry {\n\t\t\tlocalStorage.removeItem(STORAGE_PREFIX + id)\n\t\t\tlocalStorage.removeItem(LEGACY_STORAGE_PREFIX + id)\n\t\t} catch {\n\t\t\t// ignore\n\t\t}\n\t}\n\n\t// ── Internal ───────────────────────────────────────────────────────\n\n\tprivate _updateRecord(id: string, updates: Partial<WindowRecord>): void {\n\t\tconst state = this._state$.value\n\t\tconst record = state.windows.get(id)\n\t\tif (!record) return\n\n\t\tconst windows = new Map(state.windows)\n\t\twindows.set(id, { ...record, ...updates })\n\t\tthis._state$.next({ ...state, windows })\n\t}\n}\n\n/** Simple rect overlap check (inline — no circular import with window-position) */\nfunction rectsOverlap(a: WindowBounds, b: WindowBounds): boolean {\n\treturn !(a.left >= b.left + b.width || a.left + a.width <= b.left || a.top >= b.top + b.height || a.top + a.height <= b.top)\n}\n\nexport const windowManager = WindowManagerService.getInstance()\n","/**\n * Window Position — pure functions for overlap resolution, cascade, and snapping.\n *\n * All functions are stateless: they take window bounds and viewport dimensions,\n * return new bounds. No side effects, no DOM access, no subscriptions.\n *\n * Example:\n * const projected = { left: 100, top: 400, width: 360, height: 500 }\n * const neighbors = windowManager.findOverlaps(projected, 'my-id')\n * const resolved = resolveOverlap(projected, neighbors, { width: 1440, height: 900 })\n * // → { left: 144, top: 444, width: 360, height: 500 } (cascaded away from conflict)\n */\n\nimport type { WindowBounds, WindowRecord } from './window-registry.js'\n\nconst HEAD_HEIGHT = 44\nconst CASCADE_OFFSET = HEAD_HEIGHT\nconst MAX_CASCADE_ATTEMPTS = 10\n\n/** Check if two rectangles overlap (edges touching does NOT count as overlap) */\nexport function rectsOverlap(a: WindowBounds, b: WindowBounds): boolean {\n\treturn !(a.left >= b.left + b.width || a.left + a.width <= b.left || a.top >= b.top + b.height || a.top + a.height <= b.top)\n}\n\n/**\n * Resolve overlap by cascading diagonally until no conflict.\n * Shifts by (HEAD_HEIGHT, HEAD_HEIGHT) per attempt, clamped to viewport.\n */\nexport function resolveOverlap(\n\tcandidate: WindowBounds,\n\texisting: WindowRecord[],\n\tviewport: { width: number; height: number },\n): WindowBounds {\n\tconst bounds = { ...candidate }\n\n\tfor (let attempt = 0; attempt < MAX_CASCADE_ATTEMPTS; attempt++) {\n\t\tconst hasOverlap = existing.some(w => rectsOverlap(bounds, w.bounds))\n\t\tif (!hasOverlap) break\n\n\t\tbounds.left += CASCADE_OFFSET\n\t\tbounds.top += CASCADE_OFFSET\n\t}\n\n\treturn clampToViewport(bounds, viewport)\n}\n\n/**\n * Clamp bounds so the window stays fully within the viewport.\n */\nexport function clampToViewport(\n\tbounds: WindowBounds,\n\tviewport: { width: number; height: number },\n): WindowBounds {\n\treturn {\n\t\twidth: bounds.width,\n\t\theight: bounds.height,\n\t\tleft: Math.max(0, Math.min(bounds.left, viewport.width - bounds.width)),\n\t\ttop: Math.max(0, Math.min(bounds.top, viewport.height - bounds.height)),\n\t}\n}\n","import { SchmancyElement } from '@mixins/index'\nimport { css, html, nothing } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\nimport { classMap } from 'lit/directives/class-map.js'\nimport { createRef, ref } from 'lit/directives/ref.js'\nimport { styleMap } from 'lit/directives/style-map.js'\nimport {\n\tanimationFrameScheduler,\n\tauditTime,\n\tcatchError,\n\tEMPTY,\n\tfilter,\n\tfinalize,\n\tfrom,\n\tfromEvent,\n\tmap,\n\tmerge,\n\tObservable,\n\tswitchMap,\n\ttake,\n\ttakeUntil,\n\ttap,\n} from 'rxjs'\nimport { SPRING_SMOOTH, SPRING_SNAPPY } from '../utils/animation.js'\nimport { cursorGlow } from '../directives/cursor-glow'\nimport { reducedMotion$ } from '../directives/reduced-motion'\nimport { theme } from '../theme/theme.service.js'\nimport type { SnapCorner, WindowBounds, WindowVisualState } from './window-registry.js'\nimport { windowManager } from './window-manager.js'\nimport { resolveOverlap } from './window-position.js'\n\nconst HEAD_HEIGHT = 48\nconst DRAG_THRESHOLD = 5\n\ninterface Position {\n\tx: number\n\ty: number\n}\n\n@customElement('schmancy-window')\nexport default class SchmancyWindow extends SchmancyElement {\n\tstatic styles = [css`\n\t:host {\n\t\tdisplay: contents;\n\t\tposition: relative;\n\t\tz-index: 1000;\n\t}\n\t:host([hidden]) {\n\t\tdisplay: none !important;\n\t}\n`]\n\n\t@property({ type: String }) id: string = 'default'\n\t/** Override the expanded panel width (e.g. '320px', '24rem'). Defaults to responsive sizing. */\n\t@property({ type: String }) expandedWidth?: string\n\t/** Override the expanded panel height (e.g. '400px', '50vh'). */\n\t@property({ type: String }) expandedHeight?: string\n\t/** When true, uses a lower elevation shadow in the collapsed state. */\n\t@property({ type: Boolean, reflect: true }) lowered: boolean = false\n\t/** Corner the window is anchored to. */\n\t@property({ type: String }) corner: SnapCorner = 'bottom-right'\n\t/** When true, window can be resized by the user. */\n\t@property({ type: Boolean }) resizable = false\n\t/** When true, window stays at its dragged position instead of snapping to a corner. */\n\t@property({ type: Boolean }) freePosition = false\n\t/** Visual state of the window (minimized, normal, maximized). */\n\t@property({ type: String, reflect: true }) visualState: WindowVisualState = 'normal'\n\t/** Minimum width in pixels. */\n\t@property({ type: Number }) minWidth = 280\n\t/** Minimum height in pixels. */\n\t@property({ type: Number }) minHeight = 200\n\n\t/** Whether the body is expanded. */\n\t@property({ type: Boolean, reflect: true }) open = false\n\n\tprivate _currentAnimation?: Animation\n\n\t/** Lazy rendering: body content not in DOM until first expand. */\n\t@state() private _hasOpened = false\n\t/** Whether this window is the focused window in the manager — drives visual ring */\n\t@state() private _focused = false\n\n\t// Internal position -- plain fields, updated directly during drag\n\tprivate _position: Position = { x: 16, y: 16 }\n\t@state() private _currentCorner: SnapCorner = 'bottom-right'\n\n\t// Track applied corner to avoid unnecessary style.removeProperty calls during drag\n\tprivate _appliedCorner: string = ''\n\n\t// Refs\n\tprivate _containerRef = createRef<HTMLElement>()\n\tprivate _bodyRef = createRef<HTMLElement>()\n\tprivate _headRef = createRef<HTMLElement>()\n\n\t// ============================================\n\t// COMPUTED\n\t// ============================================\n\n\tprivate get panelWidth(): string {\n\t\treturn this.expandedWidth ?? 'min(360px, calc(100vw - 32px))'\n\t}\n\n\tprivate get isBottomCorner(): boolean {\n\t\treturn this._currentCorner.startsWith('bottom')\n\t}\n\n\tprivate get closedClipPath(): string {\n\t\treturn this.isBottomCorner\n\t\t\t? `inset(calc(100% - ${HEAD_HEIGHT}px) 0px 0px 0px round 22px)`\n\t\t\t: `inset(0px 0px calc(100% - ${HEAD_HEIGHT}px) 0px round 22px)`\n\t}\n\n\tprivate get openClipPath(): string {\n\t\treturn 'inset(0px 0px 0px 0px round 12px)'\n\t}\n\n\tprivate get elevation(): 0 | 1 | 2 | 3 | 4 | 5 {\n\t\tif (this.open) return 4\n\t\treturn this.lowered ? 1 : 3\n\t}\n\n\t// ============================================\n\t// POSITION MANAGEMENT\n\t// ============================================\n\n\tprivate _applyContainerPosition() {\n\t\tconst container = this._containerRef.value\n\t\tif (!container) return\n\t\t// Only clear position properties when corner changes (avoids 4 style invalidations per drag frame)\n\t\tif (this._appliedCorner !== this._currentCorner) {\n\t\t\tcontainer.style.removeProperty('left')\n\t\t\tcontainer.style.removeProperty('right')\n\t\t\tcontainer.style.removeProperty('top')\n\t\t\tcontainer.style.removeProperty('bottom')\n\t\t\tthis._appliedCorner = this._currentCorner\n\t\t}\n\t\tconst { x, y } = this._position\n\t\tif (this._currentCorner.includes('right')) {\n\t\t\tcontainer.style.right = `${x}px`\n\t\t} else {\n\t\t\tcontainer.style.left = `${x}px`\n\t\t}\n\t\tif (this._currentCorner.includes('bottom')) {\n\t\t\tcontainer.style.bottom = `${y + theme.bottomOffset}px`\n\t\t} else {\n\t\t\tcontainer.style.top = `${y}px`\n\t\t}\n\t}\n\n\tprivate static readonly VALID_CORNERS = new Set<string>(['top-left', 'top-right', 'bottom-left', 'bottom-right'])\n\n\tprivate _loadPosition() {\n\t\tconst saved = windowManager.loadPosition(this.id)\n\t\tif (saved) {\n\t\t\tthis._position = { x: saved.x, y: saved.y }\n\t\t\tif (SchmancyWindow.VALID_CORNERS.has(saved.anchor)) {\n\t\t\t\tthis._currentCorner = saved.anchor as SnapCorner\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate _savePosition() {\n\t\twindowManager.savePosition(this.id, { ...this._position, anchor: this._currentCorner })\n\t}\n\n\tprivate _validateBounds() {\n\t\tconst container = this._containerRef.value\n\t\tif (!container) return\n\t\tconst rect = container.getBoundingClientRect()\n\t\tif (rect.width === 0) return\n\t\tconst vw = window.innerWidth\n\t\tconst vh = window.innerHeight\n\t\tconst isRight = this._currentCorner.includes('right')\n\t\tconst isBottom = this._currentCorner.includes('bottom')\n\t\tconst actualLeft = isRight ? vw - this._position.x - rect.width : this._position.x\n\t\tconst actualTop = isBottom ? vh - this._position.y - rect.height : this._position.y\n\t\tconst newLeft = Math.max(0, Math.min(actualLeft, vw - rect.width))\n\t\tconst newTop = Math.max(0, Math.min(actualTop, vh - rect.height))\n\t\tthis._position = {\n\t\t\tx: isRight ? vw - newLeft - rect.width : newLeft,\n\t\t\ty: isBottom ? vh - newTop - rect.height : newTop,\n\t\t}\n\t\tthis._applyContainerPosition()\n\t}\n\n\t// ============================================\n\t// CORNER SNAPPING\n\t// ============================================\n\n\tprivate _reorientToNearestCorner(skipAnimation = false): void {\n\t\t// Free position mode: skip corner snapping\n\t\tif (this.freePosition) {\n\t\t\tthis._savePosition()\n\t\t\tconst rect = this._containerRef.value?.getBoundingClientRect()\n\t\t\tif (rect) {\n\t\t\t\twindowManager.updateBounds(this.id, { left: rect.left, top: rect.top, width: rect.width, height: rect.height })\n\t\t\t}\n\t\t\treturn\n\t\t}\n\n\t\tconst container = this._containerRef.value\n\t\tif (!container) return\n\n\t\t// F -- record current screen position before DOM mutation\n\t\tconst rect = container.getBoundingClientRect()\n\n\t\t// L -- calculate nearest corner using head visual center\n\t\tconst currentIsBottom = this._currentCorner.includes('bottom')\n\t\tconst headCenterX = rect.left + rect.width / 2\n\t\tconst headCenterY = currentIsBottom\n\t\t\t? rect.bottom - HEAD_HEIGHT / 2\n\t\t\t: rect.top + HEAD_HEIGHT / 2\n\t\tconst side = headCenterX > window.innerWidth / 2 ? 'right' : 'left'\n\t\tconst vert = headCenterY > window.innerHeight / 2 ? 'bottom' : 'top'\n\t\tconst newCorner: SnapCorner = `${vert}-${side}` as SnapCorner\n\n\t\t// Snap corner and reset offset to standard edge gap\n\t\tthis._currentCorner = newCorner\n\t\tthis._position = { x: 16, y: 16 }\n\t\tthis._applyContainerPosition()\n\t\t// Sync clip-path to new corner\n\t\tif (!this.open) {\n\t\t\tcontainer.style.clipPath = this.closedClipPath\n\t\t}\n\n\t\tif (skipAnimation || reducedMotion$.value) {\n\t\t\tthis._savePosition()\n\t\t\tconst snapRect = container.getBoundingClientRect()\n\t\t\twindowManager.updateBounds(this.id, { left: snapRect.left, top: snapRect.top, width: snapRect.width, height: snapRect.height })\n\t\t\treturn\n\t\t}\n\n\t\t// I -- invert: shift element back to its original visual position\n\t\tconst newRect = container.getBoundingClientRect()\n\t\tconst dx = rect.left - newRect.left\n\t\tconst dy = rect.top - newRect.top\n\t\tcontainer.style.translate = `${dx}px ${dy}px`\n\n\t\t// P -- play: animate from the inverse offset to natural resting position\n\t\tconst flipKeyframes: Keyframe[] = [{ translate: `${dx}px ${dy}px` }, { translate: '0px 0px' }]\n\t\tconst anim = container.animate(\n\t\t\tflipKeyframes,\n\t\t\t{\n\t\t\t\tduration: SPRING_SMOOTH.duration,\n\t\t\t\teasing: SPRING_SMOOTH.easingFallback,\n\t\t\t\tfill: 'forwards',\n\t\t\t},\n\t\t)\n\t\tfrom(anim.finished).pipe(\n\t\t\ttake(1),\n\t\t\ttap(() => {\n\t\t\t\tif (container.isConnected) container.style.translate = ''\n\t\t\t\t// Report final resting bounds after animation completes\n\t\t\t\tconst finalRect = container.getBoundingClientRect()\n\t\t\t\twindowManager.updateBounds(this.id, { left: finalRect.left, top: finalRect.top, width: finalRect.width, height: finalRect.height })\n\t\t\t}),\n\t\t\tcatchError(() => EMPTY),\n\t\t\ttakeUntil(this.disconnecting),\n\t\t).subscribe()\n\n\t\tthis._savePosition()\n\t}\n\n\t// ============================================\n\t// DRAG PIPELINE\n\t// ============================================\n\n\tprivate _drag$(): Observable<never> {\n\t\treturn new Observable(() => {\n\t\t\tconst head = this._headRef.value\n\t\t\tconst container = this._containerRef.value\n\t\t\tif (!head || !container) return\n\n\t\t\tlet didDrag = false\n\n\t\t\tconst sub = fromEvent<PointerEvent>(head, 'pointerdown').pipe(\n\t\t\t\tfilter(e => e.button === 0),\n\t\t\t\tfilter(e => {\n\t\t\t\t\tconst tag = (e.target as HTMLElement).tagName?.toLowerCase()\n\t\t\t\t\treturn !['input', 'textarea', 'select', 'button'].includes(tag)\n\t\t\t\t\t\t&& !(e.target as HTMLElement).closest('schmancy-input, schmancy-icon-button, button, a')\n\t\t\t\t}),\n\t\t\t\ttap(e => {\n\t\t\t\t\te.preventDefault()\n\t\t\t\t\te.stopPropagation()\n\t\t\t\t}),\n\t\t\t)\n\t\t\t\t.pipe(\n\t\t\t\t\tmap(e => {\n\t\t\t\t\t\tconst rect = container.getBoundingClientRect()\n\t\t\t\t\t\tconst isBottom = this._currentCorner.includes('bottom')\n\t\t\t\t\t\tconst wasOpen = this.open\n\t\t\t\t\t\tdidDrag = false\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tstartX: e.clientX,\n\t\t\t\t\t\t\tstartY: e.clientY,\n\t\t\t\t\t\t\toffsetX: e.clientX - rect.left,\n\t\t\t\t\t\t\toffsetY: e.clientY - rect.top,\n\t\t\t\t\t\t\trect,\n\t\t\t\t\t\t\tvw: window.innerWidth,\n\t\t\t\t\t\t\tvh: window.innerHeight,\n\t\t\t\t\t\t\tisBottom,\n\t\t\t\t\t\t\twasOpen,\n\t\t\t\t\t\t\tpointerId: e.pointerId,\n\t\t\t\t\t\t}\n\t\t\t\t\t}),\n\t\t\t\t\tswitchMap(({ startX, startY, offsetX, offsetY, rect, vw, vh, isBottom, wasOpen, pointerId }) => {\n\t\t\t\t\t\tconst move$ = fromEvent<PointerEvent>(window, 'pointermove').pipe(\n\t\t\t\t\t\t\tfilter(e => e.pointerId === pointerId),\n\t\t\t\t\t\t\tauditTime(0, animationFrameScheduler),\n\t\t\t\t\t\t\tmap(e => ({ clientX: e.clientX, clientY: e.clientY })),\n\t\t\t\t\t\t)\n\t\t\t\t\t\tconst end$ = fromEvent<PointerEvent>(window, 'pointerup').pipe(\n\t\t\t\t\t\t\tfilter(e => e.pointerId === pointerId),\n\t\t\t\t\t\t)\n\n\t\t\t\t\t\treturn move$.pipe(\n\t\t\t\t\t\t\ttap(({ clientX, clientY }) => {\n\t\t\t\t\t\t\t\tconst dx = clientX - startX\n\t\t\t\t\t\t\t\tconst dy = clientY - startY\n\t\t\t\t\t\t\t\tif (Math.sqrt(dx * dx + dy * dy) > DRAG_THRESHOLD && !didDrag) {\n\t\t\t\t\t\t\t\t\tdidDrag = true\n\t\t\t\t\t\t\t\t\tthis._applyDragVisuals(true)\n\t\t\t\t\t\t\t\t\t// Collapse on first confirmed drag move\n\t\t\t\t\t\t\t\t\tif (wasOpen) {\n\t\t\t\t\t\t\t\t\t\tthis.open = false\n\t\t\t\t\t\t\t\t\t\tcontainer.style.clipPath = this.closedClipPath\n\t\t\t\t\t\t\t\t\t\tcontainer.style.overflow = 'hidden'\n\t\t\t\t\t\t\t\t\t\tconst body = this._bodyRef.value\n\t\t\t\t\t\t\t\t\t\tif (body) {\n\t\t\t\t\t\t\t\t\t\t\tbody.inert = true\n\t\t\t\t\t\t\t\t\t\t\tbody.style.visibility = 'hidden'\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (!didDrag) return\n\n\t\t\t\t\t\t\t\tconst left = Math.max(0, Math.min(clientX - offsetX, vw - rect.width))\n\t\t\t\t\t\t\t\tconst minTop = isBottom ? HEAD_HEIGHT - rect.height : 0\n\t\t\t\t\t\t\t\tconst maxTop = isBottom ? vh - rect.height : vh - HEAD_HEIGHT\n\t\t\t\t\t\t\t\tconst top = Math.max(minTop, Math.min(clientY - offsetY, maxTop))\n\n\t\t\t\t\t\t\t\tthis._position = {\n\t\t\t\t\t\t\t\t\tx: this._currentCorner.includes('right') ? vw - left - rect.width : left,\n\t\t\t\t\t\t\t\t\ty: isBottom ? vh - top - rect.height : top,\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tthis._applyContainerPosition()\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\ttakeUntil(end$),\n\t\t\t\t\t\t\tfinalize(() => {\n\t\t\t\t\t\t\t\tif (didDrag) {\n\t\t\t\t\t\t\t\t\tthis._reorientToNearestCorner()\n\t\t\t\t\t\t\t\t\tthis._applyDragVisuals(false)\n\t\t\t\t\t\t\t\t\tdidDrag = false\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tdidDrag = false\n\t\t\t\t\t\t\t\t\tthis.toggle()\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t)\n\t\t\t\t\t}),\n\t\t\t\t)\n\t\t\t\t.subscribe()\n\n\t\t\treturn () => sub.unsubscribe()\n\t\t})\n\t}\n\n\t// ============================================\n\t// LIFECYCLE\n\t// ============================================\n\n\tconnectedCallback() {\n\t\tsuper.connectedCallback()\n\n\t\t// Pipeline 1: DOM setup + manager registration + drag + z-index sync\n\t\tfrom(this.updateComplete).pipe(\n\t\t\ttake(1),\n\t\t\ttap(() => {\n\t\t\t\tthis._currentCorner = this.corner\n\t\t\t\tthis._loadPosition()\n\t\t\t\tthis._applyContainerPosition()\n\t\t\t\tthis._initDOMState()\n\t\t\t\t// Register with window manager\n\t\t\t\tconst container = this._containerRef.value\n\t\t\t\tif (container) {\n\t\t\t\t\tconst rect = container.getBoundingClientRect()\n\t\t\t\t\tconst bounds: WindowBounds = { left: rect.left, top: rect.top, width: rect.width, height: rect.height }\n\t\t\t\t\twindowManager.register(this.id, bounds, this.freePosition ? 'free' : this._currentCorner)\n\t\t\t\t}\n\t\t\t}),\n\t\t\tswitchMap(() => merge(\n\t\t\t\tthis._drag$(),\n\t\t\t\twindowManager.selectWindow(this.id).pipe(\n\t\t\t\t\ttap(record => {\n\t\t\t\t\t\tif (!record) return\n\t\t\t\t\t\tconst container = this._containerRef.value\n\t\t\t\t\t\tif (container) container.style.zIndex = String(record.zIndex)\n\t\t\t\t\t}),\n\t\t\t\t),\n\t\t\t\twindowManager.selectFocused().pipe(\n\t\t\t\t\ttap(focusedId => {\n\t\t\t\t\t\tthis._focused = focusedId === this.id\n\t\t\t\t\t}),\n\t\t\t\t),\n\t\t\t)),\n\t\t\ttakeUntil(this.disconnecting),\n\t\t).subscribe()\n\n\n\t\t// Pipeline 3: Environment -- one subscription\n\t\tmerge(\n\t\t\tfromEvent(window, 'resize').pipe(\n\t\t\t\tauditTime(0, animationFrameScheduler),\n\t\t\t\ttap(() => this._validateBounds()),\n\t\t\t),\n\t\t\ttheme.bottomOffset$.pipe(\n\t\t\t\ttap(() => this._applyContainerPosition()),\n\t\t\t),\n\t\t).pipe(takeUntil(this.disconnecting)).subscribe()\n\t}\n\n\tdisconnectedCallback() {\n\t\tsuper.disconnectedCallback()\n\t\twindowManager.unregister(this.id)\n\t}\n\n\tprivate _initDOMState() {\n\t\tconst container = this._containerRef.value\n\t\tconst body = this._bodyRef.value\n\t\tif (!container) return\n\n\t\tthis._applyContainerPosition()\n\n\t\tif (this.open) {\n\t\t\tthis._hasOpened = true\n\t\t\tcontainer.style.overflow = ''\n\t\t\tif (body) {\n\t\t\t\tbody.inert = false\n\t\t\t\tbody.style.visibility = 'visible'\n\t\t\t}\n\t\t} else {\n\t\t\tcontainer.style.clipPath = this.closedClipPath\n\t\t\tcontainer.style.overflow = 'hidden'\n\t\t\tif (body) {\n\t\t\t\tbody.inert = true\n\t\t\t\tbody.style.visibility = 'hidden'\n\t\t\t}\n\t\t}\n\t}\n\n\t// ============================================\n\t// ANIMATION\n\t// ============================================\n\n\tprivate _animateOpen() {\n\t\tconst container = this._containerRef.value\n\t\tconst body = this._bodyRef.value\n\t\tif (!container) return\n\n\t\tthis._hasOpened = true\n\t\tthis.open = true\n\n\t\t// Overlap avoidance\n\t\tconst rect = container.getBoundingClientRect()\n\t\tconst projectedBounds: WindowBounds = {\n\t\t\tleft: rect.left,\n\t\t\ttop: this.isBottomCorner ? rect.top - 400 : rect.top,\n\t\t\twidth: rect.width,\n\t\t\theight: 400 + HEAD_HEIGHT,\n\t\t}\n\t\tconst overlaps = windowManager.findOverlaps(projectedBounds, this.id)\n\t\tif (overlaps.length > 0) {\n\t\t\tconst resolved = resolveOverlap(projectedBounds, overlaps, { width: window.innerWidth, height: window.innerHeight })\n\t\t\tif (Math.abs(resolved.left - projectedBounds.left) > 10 || Math.abs(resolved.top - projectedBounds.top) > 10) {\n\t\t\t\tconst isRight = this._currentCorner.includes('right')\n\t\t\t\tconst isBottom = this._currentCorner.includes('bottom')\n\t\t\t\tthis._position = {\n\t\t\t\t\tx: isRight ? window.innerWidth - resolved.left - resolved.width : resolved.left,\n\t\t\t\t\ty: isBottom ? window.innerHeight - resolved.top - resolved.height : resolved.top,\n\t\t\t\t}\n\t\t\t\tthis._applyContainerPosition()\n\t\t\t}\n\t\t}\n\n\t\tif (body) {\n\t\t\tbody.style.visibility = 'visible'\n\t\t\tbody.inert = false\n\t\t}\n\n\t\tif (reducedMotion$.value) {\n\t\t\tcontainer.style.clipPath = ''\n\t\t\tcontainer.style.overflow = ''\n\t\t\tthis.dispatchScopedEvent('window-toggle', { state: 'expanded' })\n\t\t\treturn\n\t\t}\n\n\t\tthis._currentAnimation?.cancel()\n\t\tcontainer.style.overflow = 'hidden'\n\t\tcontainer.style.willChange = 'opacity'\n\t\tconst openKeyframes: Keyframe[] = [\n\t\t\t{ clipPath: this.closedClipPath, opacity: 0.95 },\n\t\t\t{ clipPath: this.openClipPath, opacity: 1 },\n\t\t]\n\t\tconst anim = container.animate(openKeyframes, {\n\t\t\tduration: SPRING_SNAPPY.duration,\n\t\t\teasing: SPRING_SNAPPY.easingFallback,\n\t\t\tfill: 'forwards',\n\t\t})\n\t\tthis._currentAnimation = anim\n\n\t\tfrom(anim.finished).pipe(\n\t\t\ttake(1),\n\t\t\ttap(() => {\n\t\t\t\tif (container.isConnected) {\n\t\t\t\t\tcontainer.style.clipPath = ''\n\t\t\t\t\tcontainer.style.overflow = ''\n\t\t\t\t\tcontainer.style.willChange = ''\n\t\t\t\t}\n\t\t\t}),\n\t\t\tcatchError(() => EMPTY),\n\t\t\ttakeUntil(this.disconnecting),\n\t\t).subscribe()\n\n\t\tthis.dispatchScopedEvent('window-toggle', { state: 'expanded' })\n\t}\n\n\tprivate _animateClose() {\n\t\tconst container = this._containerRef.value\n\t\tif (!container) return\n\n\t\tif (reducedMotion$.value) {\n\t\t\tcontainer.style.clipPath = this.closedClipPath\n\t\t\tcontainer.style.overflow = 'hidden'\n\t\t\tthis.open = false\n\t\t\tconst body = this._bodyRef.value\n\t\t\tif (body) { body.inert = true; body.style.visibility = 'hidden' }\n\t\t\tthis.dispatchScopedEvent('window-toggle', { state: 'collapsed' })\n\t\t\treturn\n\t\t}\n\n\t\tthis._currentAnimation?.cancel()\n\t\tcontainer.style.overflow = 'hidden'\n\t\tcontainer.style.willChange = 'opacity'\n\t\tconst closeKeyframes: Keyframe[] = [\n\t\t\t{ clipPath: this.openClipPath, opacity: 1 },\n\t\t\t{ clipPath: this.closedClipPath, opacity: 0.95 },\n\t\t]\n\t\tconst anim = container.animate(closeKeyframes, {\n\t\t\tduration: Math.round(SPRING_SNAPPY.duration * 0.7),\n\t\t\teasing: 'cubic-bezier(0.4, 0, 0.8, 0.15)',\n\t\t\tfill: 'forwards',\n\t\t})\n\t\tthis._currentAnimation = anim\n\n\t\tfrom(anim.finished).pipe(\n\t\t\ttake(1),\n\t\t\ttap(() => {\n\t\t\t\tthis.open = false\n\t\t\t\tcontainer.style.willChange = ''\n\t\t\t\tconst body = this._bodyRef.value\n\t\t\t\tif (body) { body.inert = true; body.style.visibility = 'hidden' }\n\t\t\t}),\n\t\t\tcatchError(() => EMPTY),\n\t\t\ttakeUntil(this.disconnecting),\n\t\t).subscribe()\n\n\t\tthis.dispatchScopedEvent('window-toggle', { state: 'collapsed' })\n\t}\n\n\t// ============================================\n\t// VISUAL STATE HELPERS\n\t// ============================================\n\n\t/** Apply drag visuals directly on DOM refs — avoids full Lit re-render for cursor + opacity */\n\tprivate _applyDragVisuals(dragging: boolean) {\n\t\tconst head = this._headRef.value\n\t\tconst container = this._containerRef.value\n\t\tif (head) {\n\t\t\thead.classList.toggle('cursor-grabbing', dragging)\n\t\t\thead.classList.toggle('cursor-move', !dragging)\n\t\t}\n\t\tif (container) {\n\t\t\tcontainer.style.opacity = dragging ? '0.95' : ''\n\t\t}\n\t}\n\n\tprivate _handleFocus = () => windowManager.focus(this.id)\n\n\tprivate _handleHeadKeydown = (e: KeyboardEvent) => {\n\t\tif (e.key === 'Enter' || e.key === ' ') {\n\t\t\te.preventDefault()\n\t\t\tthis.toggle()\n\t\t\treturn\n\t\t}\n\t\tif (e.key === 'ArrowUp' || e.key === 'ArrowDown' || e.key === 'ArrowLeft' || e.key === 'ArrowRight') {\n\t\t\te.preventDefault()\n\t\t\tconst step = e.shiftKey ? 20 : 5\n\t\t\tconst dx = e.key === 'ArrowRight' ? step : e.key === 'ArrowLeft' ? -step : 0\n\t\t\tconst dy = e.key === 'ArrowDown' ? step : e.key === 'ArrowUp' ? -step : 0\n\t\t\tthis._position = { x: this._position.x + dx, y: this._position.y + dy }\n\t\t\tthis._applyContainerPosition()\n\t\t\tthis._savePosition()\n\t\t}\n\t}\n\n\t// ============================================\n\t// PUBLIC API\n\t// ============================================\n\n\ttoggle() {\n\t\tif (this.open) this._animateClose()\n\t\telse this._animateOpen()\n\t}\n\n\texpand() {\n\t\tif (this.open) return\n\t\tthis._animateOpen()\n\t}\n\n\tclose() {\n\t\tif (!this.open) return\n\t\tthis._animateClose()\n\t}\n\n\t// ============================================\n\t// RENDER\n\t// ============================================\n\n\tprotected render(): unknown {\n\t\tconst isBottom = this._currentCorner.startsWith('bottom')\n\n\t\tconst containerClasses = classMap({\n\t\t\tfixed: true,\n\t\t\tflex: true,\n\t\t\t'flex-col': isBottom,\n\t\t\t'flex-col-reverse': !isBottom,\n\t\t\t'z-1000': true,\n\t\t\t'ring-1': !this._focused,\n\t\t\t'ring-2': this._focused,\n\t\t\t'ring-primary-default/30': this._focused,\n\t\t\t'ring-primary-default/15': this.open && !this._focused,\n\t\t\t'rounded-2xl': this.open,\n\t\t\t'ring-outline-variant/40': !this.open && !this._focused,\n\t\t\t'rounded-[22px]': !this.open,\n\t\t\t'overflow-hidden': true,\n\t\t})\n\n\t\tconst containerStyles = styleMap({\n\t\t\twidth: this.panelWidth,\n\t\t\t'max-height': 'calc(100vh - 32px)',\n\t\t\t'pointer-events': 'none',\n\t\t})\n\n\t\tconst bodyStyles = styleMap({\n\t\t\t'pointer-events': this.open ? 'auto' : 'none',\n\t\t})\n\n\t\tconst headClasses = classMap({\n\t\t\t'h-full': true,\n\t\t\t'px-3': true,\n\t\t\tflex: true,\n\t\t\t'items-center': true,\n\t\t\t'gap-2': true,\n\t\t\t'select-none': true,\n\t\t\t'cursor-move': true,\n\t\t})\n\n\t\treturn html`\n\t\t\t<schmancy-surface\n\t\t\t\t${ref(this._containerRef)}\n\t\t\t\ttype=\"glass\"\n\t\t\t\t.elevation=${this.elevation}\n\t\t\t\tclass=${containerClasses}\n\t\t\t\tstyle=${containerStyles}\n\t\t\t\taria-expanded=${this.open}\n\t\t\t\t@pointerdown=${this._handleFocus}\n\t\t\t>\n\t\t\t\t<!-- Details section (visually above summary for bottom corners) -->\n\t\t\t\t<section\n\t\t\t\t\t${ref(this._bodyRef)}\n\t\t\t\t\tclass=\"flex-1 min-h-0 overflow-hidden flex flex-col\"\n\t\t\t\t\tstyle=${bodyStyles}\n\t\t\t\t\trole=\"region\"\n\t\t\t\t\taria-label=\"Expandable content\"\n\t\t\t\t>\n\t\t\t\t\t${this._hasOpened ? html`<slot name=\"details\"></slot>` : nothing}\n\t\t\t\t</section>\n\n\t\t\t\t<!-- Summary section -- always interactive, always visible -->\n\t\t\t\t<section\n\t\t\t\t\tclass=\"shrink-0 bg-surface-lowest\"\n\t\t\t\t\tstyle=${styleMap({ 'pointer-events': 'auto', height: `${HEAD_HEIGHT}px` })}\n\t\t\t\t>\n\t\t\t\t\t<div\n\t\t\t\t\t\t${ref(this._headRef)}\n\t\t\t\t\t\t${cursorGlow({ radius: 200, intensity: 0.10 })}\n\t\t\t\t\t\tclass=${headClasses}\n\t\t\t\t\t\trole=\"button\"\n\t\t\t\t\t\ttabindex=\"0\"\n\t\t\t\t\t\ttitle=\"Drag to move, click to expand\"\n\t\t\t\t\t\taria-label=\"${this.open ? 'Collapse window' : 'Expand window'}\"\n\t\t\t\t\t\t@keydown=${this._handleHeadKeydown}\n\t\t\t\t\t>\n\t\t\t\t\t\t<div class=\"flex-1 min-w-0\">\n\t\t\t\t\t\t\t<slot></slot>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<svg\n\t\t\t\t\t\t\twidth=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\"\n\t\t\t\t\t\t\tclass=\"shrink-0 text-surface-on/40 transition-transform duration-200 ${this.open ? 'rotate-180' : ''}\"\n\t\t\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<path d=\"M6 9L12 15L18 9\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" />\n\t\t\t\t\t\t</svg>\n\t\t\t\t\t</div>\n\t\t\t\t</section>\n\t\t\t</schmancy-surface>\n\t\t`\n\t}\n}\n\ndeclare global {\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AA,EAAO,EAAA,WAAA,kBAAA,KAAA,EAAA;AAAA,IAAA,IAAA,IAAA,IAAA,EAAA,CA7CR,EAAc,kBAAA,CAAA,EAAkB,EAAA;AAAA,SAAA,KAAA,GAAA,KAAA"}
package/dist/window.cjs CHANGED
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./window-DtUOWiAj.cjs`);exports.SchmancyWindow=e.t,exports.windowManager=e.n;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./window-9HOUXrTU.cjs`);exports.SchmancyWindow=e.t,exports.windowManager=e.n;
package/dist/window.js CHANGED
@@ -1,2 +1,2 @@
1
- import { n as e, t } from "./window-C7yY9yp5.js";
1
+ import { n as e, t } from "./window-B_55dzk0.js";
2
2
  export { t as SchmancyWindow, e as windowManager };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mhmo91/schmancy",
3
- "version": "0.10.4",
3
+ "version": "0.10.6",
4
4
  "description": "UI library build with web components",
5
5
  "main": "./dist/index.js",
6
6
  "customElements": "custom-elements.json",
@@ -93,7 +93,6 @@
93
93
  "@material/web": "^2.4.1",
94
94
  "cleave.js": "^1.6.0",
95
95
  "dayjs": "^1.11.20",
96
- "highlight.js": "^11.11.1",
97
96
  "immer": "^11.1.4",
98
97
  "jsqr": "^1.4.0",
99
98
  "lit": "^3.3.2",
@@ -16,7 +16,7 @@ The framework pieces — touch before components.
16
16
  ## Components by job
17
17
 
18
18
  ### Display
19
- [Typography](./typography.md) · [Icons](./icons.md) · [Avatar](./avatar.md) · [Divider](./divider.md) · [Badge](./badge.md) · [Kbd](./kbd.md) · [Code Highlight](./code-highlight.md) · [Typewriter](./typewriter.md) · [JSON](./json.md) · [Iframe](./iframe.md) · [Map](./map.md) · [Charts](./charts.md)
19
+ [Typography](./typography.md) · [Icons](./icons.md) · [Avatar](./avatar.md) · [Divider](./divider.md) · [Badge](./badge.md) · [Kbd](./kbd.md) · [Typewriter](./typewriter.md) · [JSON](./json.md) · [Iframe](./iframe.md) · [Map](./map.md) · [Charts](./charts.md)
20
20
 
21
21
  ### Surfaces & layout
22
22
  [Surface](./surface.md) · [Card](./card.md) · [Scroll / Grid / Flex](./layout.md) · [Page](./page.md) · [Content Drawer](./content-drawer.md) · [Window](./window.md) · [Boat](./boat.md) · [Float](./float.md) · [Splash Screen](./splash-screen.md)
@@ -28,7 +28,7 @@ The framework pieces — touch before components.
28
28
  [Breadcrumb](./breadcrumb.md) · [Nav Drawer](./nav-drawer.md) · [Tabs](./tabs.md) · [Navigation Bar](./navigation-bar.md) · [Navigation Rail](./navigation-rail.md) · [Steps](./steps.md) · [Teleport](./teleport.md) · [Theme Button](./theme-button.md)
29
29
 
30
30
  ### Overlays
31
- [Overlay](./overlay.md) — canonical · [Dialog](./dialog.md) / [Sheet](./sheet.md) — *deprecated, use Overlay* · [Notification](./notification.md) · [Menu](./menu.md) · [Dropdown](./dropdown.md) · [Tooltip (directive)](./tooltip.md) · [Lightbox](./lightbox.md) · [Expand](./expand.md)
31
+ [Overlay](./overlay.md) · [Notification](./notification.md) · [Menu](./menu.md) · [Dropdown](./dropdown.md) · [Tooltip (directive)](./tooltip.md) · [Lightbox](./lightbox.md) · [Expand](./expand.md)
32
32
 
33
33
  ### Interactive
34
34
  [Button](./button.md) · [List](./list.md) · [Details](./details.md) · [Table](./table.md) · [Tree](./tree.md) · [Slider](./slider.md) · [QR Scanner](./qr-scanner.md)
@@ -36,15 +36,12 @@ The framework pieces — touch before components.
36
36
  ### Feedback
37
37
  [Progress](./progress.md) · [Busy](./busy.md) · [Skeleton](./skeleton.md) · [Connectivity](./connectivity.md) · [Delay](./delay.md)
38
38
 
39
- ### Domain
40
- [Mailbox](./mailbox.md)
41
-
42
39
  ## Services (imperative APIs)
43
40
 
44
41
  | Service | Purpose |
45
42
  |---------|---------|
46
43
  | `area` | Route navigation (see [area](./area.md)) |
47
- | `$dialog` | Open dialogs (see [dialog](./dialog.md)) |
44
+ | `show` | Open overlays (see [overlay](./overlay.md)) |
48
45
  | `$notify` | Toast notifications (see [notification](./notification.md)) |
49
46
  | `schmancyContentDrawer` | Side panel (see [content-drawer](./content-drawer.md)) |
50
47
  | `theme` | Theme state, `fullscreen$` (see [theme](./theme.md)) |
@@ -29,19 +29,23 @@ All reference files live in this directory. Read by filename.
29
29
 
30
30
  ## Overlay services (prefer over tags)
31
31
 
32
- For modals, toasts, sheets, side drawers — reach for the **imperative service API** first:
32
+ For modals, toasts, side drawers — reach for the **imperative service API** first.
33
+ `show()` is the single overlay primitive: layout (centered / anchored / sheet)
34
+ is chosen by the system based on viewport + anchor presence. There is no
35
+ `$dialog` or `sheet` service.
33
36
 
34
37
  ```typescript
35
- import { $dialog, $notify, schmancyContentDrawer, sheet, SchmancySheetPosition } from '@mhmo91/schmancy'
38
+ import { show, confirm, prompt } from '@mhmo91/schmancy/overlay'
39
+ import { $notify, schmancyContentDrawer } from '@mhmo91/schmancy'
36
40
 
37
- $dialog.component(new EditForm()) // modal
38
- $dialog.component(new QuickPicker(), { position: e }) // anchored modal
41
+ show(new EditForm()) // centered fallback
42
+ show(new QuickPicker(), { anchor: ev }) // anchored at click
43
+ show(new Picker()) // narrow viewport → sheet (auto)
39
44
  $notify.success('Saved'); $notify.error('Failed') // toast
40
- schmancyContentDrawer.open({ component: new Detail() }) // side panel
41
- sheet.open({ component: new Picker(), position: SchmancySheetPosition.BOTTOM }) // bottom sheet
45
+ schmancyContentDrawer.push({ component: new Detail() }) // side panel
42
46
  ```
43
47
 
44
- References: `dialog.md`, `notification.md`, `content-drawer.md`, `sheet.md`.
48
+ References: `overlay.md`, `notification.md`, `content-drawer.md`.
45
49
 
46
50
  Use component tags (`<schmancy-menu>`, `<schmancy-dropdown>`, `<schmancy-tooltip>`, `<schmancy-lightbox>`, `<schmancy-expand>`) only when the tag is the natural fit (anchored panels, tooltips, galleries).
47
51
 
@@ -51,8 +55,8 @@ Use component tags (`<schmancy-menu>`, `<schmancy-dropdown>`, `<schmancy-tooltip
51
55
  Sources: each rule above names its forbidden patterns explicitly — `TOKEN_FIRST_NO_ARBITRARY` forbids `[...]` arbitrary-value Tailwind utilities; `PRIMITIVE_FIRST` forbids raw HTML elements whose class attribute carries design-system styling (typography/color/surface/spacing-as-design); `NO_LOCAL_CLASS_CSS` forbids class/id/attribute selectors inside the `css` template; `NO_TERNARY_NOTHING_DISPATCH` forbids `${cond ? html\`...\` : nothing}` and `${cond && html\`...\`}` patterns.
52
56
  Remediation: before reporting any file compliant, run a grep against each forbidden pattern named by the rule under audit (e.g. `grep -nE '\[(?:[^]]+)\]' <file>` for `TOKEN_FIRST_NO_ARBITRARY`; `grep -nE 'class="[^"]*\b(text-|bg-|border-|rounded-|shadow-|tracking-|leading-|p[xy]?-)' <file>` plus a manual scan for raw `<div>`/`<span>` carrying those classes for `PRIMITIVE_FIRST`). The compliance report's body is the concatenation of those grep outputs annotated with their rule name; an empty body across every pattern under every rule is the only form of "compliant". A claim of compliance unaccompanied by the grep evidence is not a compliance report and is treated as an unverified assertion that the audit loop rejects.
53
57
  - **Schmancy primitive first** (`PRIMITIVE_FIRST`). Within `web/**`, every visible UI element is a custom element exported from `packages/schmancy/src/**`, and an element absent from that export set is added there before being imported into `web/**`. The rule sits above the styling rules: a `<div class="text-xs text-surface-on-variant">…</div>` whose role is typography is a violation even when every utility resolves to a registered token, because `<schmancy-typography>` already covers that role; the styling rules apply only to whatever class strings remain after the right primitive has been selected.
54
- Sources: [packages/schmancy/skills/schmancy/INDEX.md](../INDEX.md) catalogues the export set by job (foundations / atoms / forms / navigation / overlays / interaction / feedback / display); each role's reference file (`typography.md`, `surface.md`, `button.md`, `dialog.md`, `sheet.md`, …) names the props, slots, and events that displace the equivalent `<div>` + utility-class pattern. The export set is the single source — a primitive that is not exported from `packages/schmancy/src/**` does not satisfy this rule even if it lives in a private file inside the schmancy tree.
55
- Remediation: walk every `.ts` and `.html` file under `web/**` and list every raw HTML element whose class string carries design-system styling (typography, color, spacing-as-design-decision, surface, layout-as-design-decision, motion, overlay) — those are the violations. For each, look up the matching schmancy primitive in `INDEX.md` and rewrite the element through that primitive (`<schmancy-typography type=… token=…>` for type-scale text, `<schmancy-surface type=… fill=…>` for elevated/bounded surfaces, `<schmancy-grid>`/`<schmancy-flex>` for layout primitives with design intent, the imperative `$dialog`/`$notify`/`sheet.open`/`schmancyContentDrawer.open` services for overlays, `<schmancy-scroll>` for scroll containers). When a needed primitive is absent from the export set, design and implement it as a new component under `packages/schmancy/src/<role>/` — extending `$LitElement(style?)`, registered in `HTMLElementTagNameMap`, exported through the package barrel, and documented with a sibling `.md` in the skill's reference set — and only then introduce the first call site in `web/**`. The audit subagent iterates the whole `web/**` tree, surfaces the violation list, applies the rewrites, runs `yarn workspace @momo/web tsc --noEmit` plus the colocated `*-view.test.ts` suites, and reports pre-existing violations that require a new schmancy primitive as a separate punch list for designer/architect approval before the implementation lands. The loop exits when every `web/**` file's visible UI elements are schmancy primitives and the typecheck plus the test suites pass.
58
+ Sources: [packages/schmancy/skills/schmancy/INDEX.md](../INDEX.md) catalogues the export set by job (foundations / atoms / forms / navigation / overlays / interaction / feedback / display); each role's reference file (`typography.md`, `surface.md`, `button.md`, `overlay.md`, …) names the props, slots, and events that displace the equivalent `<div>` + utility-class pattern. The export set is the single source — a primitive that is not exported from `packages/schmancy/src/**` does not satisfy this rule even if it lives in a private file inside the schmancy tree.
59
+ Remediation: walk every `.ts` and `.html` file under `web/**` and list every raw HTML element whose class string carries design-system styling (typography, color, spacing-as-design-decision, surface, layout-as-design-decision, motion, overlay) — those are the violations. For each, look up the matching schmancy primitive in `INDEX.md` and rewrite the element through that primitive (`<schmancy-typography type=… token=…>` for type-scale text, `<schmancy-surface type=… fill=…>` for elevated/bounded surfaces, `<schmancy-grid>`/`<schmancy-flex>` for layout primitives with design intent, the imperative `show`/`$notify`/`schmancyContentDrawer.push` services for overlays, `<schmancy-scroll>` for scroll containers). When a needed primitive is absent from the export set, design and implement it as a new component under `packages/schmancy/src/<role>/` — extending `$LitElement(style?)`, registered in `HTMLElementTagNameMap`, exported through the package barrel, and documented with a sibling `.md` in the skill's reference set — and only then introduce the first call site in `web/**`. The audit subagent iterates the whole `web/**` tree, surfaces the violation list, applies the rewrites, runs `yarn workspace @momo/web tsc --noEmit` plus the colocated `*-view.test.ts` suites, and reports pre-existing violations that require a new schmancy primitive as a separate punch list for designer/architect approval before the implementation lands. The loop exits when every `web/**` file's visible UI elements are schmancy primitives and the typecheck plus the test suites pass.
56
60
 
57
61
  ## Non-negotiable conventions
58
62
 
@@ -2,8 +2,10 @@ import { provide } from '@lit/context'
2
2
  import { SchmancyElement } from '@mixins/index'
3
3
  import { css, html, nothing } from 'lit'
4
4
  import { customElement, property, queryAssignedElements, state } from 'lit/decorators.js'
5
- import { debounceTime, distinctUntilChanged, fromEvent, map, merge, startWith, takeUntil, tap } from 'rxjs'
6
- import { SchmancyEvents, TRenderCustomEvent, area, sheet } from '..'
5
+ import { debounceTime, distinctUntilChanged, fromEvent, map, merge, startWith, Subscription, takeUntil, tap } from 'rxjs'
6
+ import { SchmancyEvents, TRenderCustomEvent, area } from '..'
7
+ import { show } from '../overlay/overlay.service'
8
+ import { OVERLAY_DISMISS_EVENT } from './events'
7
9
  import {
8
10
  SchmancyContentDrawerID,
9
11
  SchmancyContentDrawerMaxHeight,
@@ -114,6 +116,12 @@ export class SchmancyContentDrawer extends SchmancyElement {
114
116
  takeUntil(this.disconnecting)
115
117
  )
116
118
  .subscribe(detail => this.handleRender(detail))
119
+
120
+ // Child `<schmancy-content-drawer-sheet>` requests overlay dismissal
121
+ // via a bubbling event; the drawer owns the subscription.
122
+ fromEvent<CustomEvent>(this, OVERLAY_DISMISS_EVENT)
123
+ .pipe(takeUntil(this.disconnecting))
124
+ .subscribe(() => this.dismissOverlay())
117
125
  }
118
126
 
119
127
  private updateMaxHeight() {
@@ -131,6 +139,8 @@ export class SchmancyContentDrawer extends SchmancyElement {
131
139
  }
132
140
  }
133
141
 
142
+ private _overlaySubscription: Subscription | null = null
143
+
134
144
  private handleRender(detail: TRenderCustomEvent['detail']) {
135
145
  if (this.mode === 'push') {
136
146
  area.push({
@@ -142,14 +152,21 @@ export class SchmancyContentDrawer extends SchmancyElement {
142
152
  props: detail.props,
143
153
  })
144
154
  } else if (this.mode === 'overlay') {
145
- sheet.open({
146
- component: detail.component,
147
- uid: this.schmancyContentDrawerID,
148
- props: detail.props,
149
- })
155
+ // `show()` mounts the same component as a modal overlay; subscription
156
+ // = lifecycle, so dropping the previous one closes any prior modal
157
+ // before opening the next.
158
+ this._overlaySubscription?.unsubscribe()
159
+ this._overlaySubscription = show(detail.component, { props: detail.props })
160
+ .pipe(takeUntil(this.disconnecting))
161
+ .subscribe({ complete: () => { this._overlaySubscription = null } })
150
162
  }
151
163
  }
152
164
 
165
+ private dismissOverlay() {
166
+ this._overlaySubscription?.unsubscribe()
167
+ this._overlaySubscription = null
168
+ }
169
+
153
170
  getOffsetTop(element: HTMLElement | null) {
154
171
  let offsetTop = 0
155
172
  while (element) {
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Internal event protocol between `<schmancy-content-drawer>` and its child
3
+ * `<schmancy-content-drawer-sheet>`. Bubbling + composed so the parent can
4
+ * listen on itself even when the child is in a deeper shadow tree.
5
+ */
6
+ export const OVERLAY_DISMISS_EVENT = 'schmancy-content-drawer-overlay-dismiss'
@@ -2,8 +2,9 @@ import { consume } from '@lit/context'
2
2
  import { SchmancyElement } from '@mixins/index'
3
3
  import { css, html } from 'lit'
4
4
  import { customElement, property, query, queryAssignedElements, state } from 'lit/decorators.js'
5
- import { from, merge, Observable, of, takeUntil, tap } from 'rxjs'
6
- import { SchmancyEvents, sheet } from '..'
5
+ import { Observable, takeUntil } from 'rxjs'
6
+ import { SchmancyEvents } from '..'
7
+ import { OVERLAY_DISMISS_EVENT } from './events'
7
8
  import {
8
9
  SchmancyContentDrawerID,
9
10
  SchmancyContentDrawerMaxHeight,
@@ -73,7 +74,7 @@ export class SchmancyContentDrawerSheet extends SchmancyElement {
73
74
  // this.open()
74
75
  }
75
76
  } else if (this.mode === 'push') {
76
- sheet.dismiss(this.schmancyContentDrawerID)
77
+ this.requestOverlayDismiss()
77
78
  if (this.state === 'close') {
78
79
  this.closeAll()
79
80
  } else if (this.state === 'open') {
@@ -110,20 +111,20 @@ export class SchmancyContentDrawerSheet extends SchmancyElement {
110
111
  }
111
112
 
112
113
  /**
113
- * Close everything (modal sheet + the sheet itself).
114
+ * Ask the parent `<schmancy-content-drawer>` to dismiss any modal overlay
115
+ * it currently owns. Bubbling so the parent catches it on itself.
114
116
  */
115
- closeAll() {
116
- // Merge them into a single subscription,
117
- // so that everything closes in parallel.
118
- merge(from(this.closeModalSheet()), from(this.closeSheet())).pipe(takeUntil(this.disconnecting)).subscribe()
117
+ private requestOverlayDismiss() {
118
+ this.dispatchEvent(new CustomEvent(OVERLAY_DISMISS_EVENT, { bubbles: true, composed: true }))
119
119
  }
120
120
 
121
121
  /**
122
- * Dismiss the "modal sheet."
123
- * This just returns an Observable that completes immediately.
122
+ * Close everything (parent's modal overlay + the sheet itself, in
123
+ * parallel).
124
124
  */
125
- closeModalSheet() {
126
- return of(true).pipe(tap(() => sheet.dismiss(this.schmancyContentDrawerID)))
125
+ closeAll() {
126
+ this.requestOverlayDismiss()
127
+ this.closeSheet().pipe(takeUntil(this.disconnecting)).subscribe()
127
128
  }
128
129
 
129
130
  /**
@@ -4,7 +4,6 @@ import { html } from 'lit'
4
4
  import { customElement, property } from 'lit/decorators.js'
5
5
  import { ifDefined } from 'lit/directives/if-defined.js'
6
6
  import { repeat } from 'lit/directives/repeat.js'
7
- import { $dialog } from '../dialog/dialog-service'
8
7
  import { DateRangePreset, PresetCategory } from './date-range-presets'
9
8
 
10
9
  interface PresetGroup {
@@ -111,12 +110,13 @@ export class SchmancyDateRangeDialog extends SchmancyElement {
111
110
 
112
111
  private handlePresetSelection(preset: DateRangePreset, e: Event) {
113
112
  e.stopPropagation()
113
+ // Parent <schmancy-date-range> listens for `preset-select`, applies
114
+ // the range, and dispatches 'close' on us — `show()` tears down.
114
115
  this.dispatchEvent(new CustomEvent('preset-select', {
115
116
  detail: { preset },
116
117
  bubbles: true,
117
118
  composed: true
118
119
  }))
119
- $dialog.dismiss()
120
120
  }
121
121
 
122
122
  private applyManualDateSelection(e: Event) {
@@ -134,6 +134,8 @@ export class SchmancyDateRangeDialog extends SchmancyElement {
134
134
  return
135
135
  }
136
136
 
137
+ // Parent <schmancy-date-range> listens for `apply-dates`, applies the
138
+ // range, and dispatches 'close' on us — `show()` tears down.
137
139
  this.dispatchEvent(new CustomEvent('apply-dates', {
138
140
  detail: {
139
141
  dateFrom: this.dateFrom.value,
@@ -143,8 +145,6 @@ export class SchmancyDateRangeDialog extends SchmancyElement {
143
145
  bubbles: true,
144
146
  composed: true
145
147
  }))
146
-
147
- $dialog.dismiss()
148
148
  }
149
149
 
150
150
  render() {