@pubinfo/module-rbac 2.0.8 → 2.0.9

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 (339) hide show
  1. package/dist/ComponentSelect-ZLey_5w7.js +4 -0
  2. package/dist/ComponentSelect.vue_vue_type_style_index_0_lang-CMEO08Uz.js +3981 -0
  3. package/dist/DynamicRoutesForm-DzOGoyf3.js +4 -0
  4. package/dist/DynamicRoutesForm.vue_vue_type_script_setup_true_lang-lpCaLpPL.js +179 -0
  5. package/dist/HCheckList-Dkxhu1br.js +4 -0
  6. package/dist/HCheckList.vue_vue_type_script_setup_true_lang-n_QczT28.js +41 -0
  7. package/dist/HoverCard-DASfDgI1.js +4 -0
  8. package/dist/HoverCard.vue_vue_type_script_setup_true_lang-BqEarhzP.js +62 -0
  9. package/dist/IconSelect-CkqLR5Dg.js +4 -0
  10. package/dist/IconSelect.css +1 -1
  11. package/dist/IconSelect.vue_vue_type_script_setup_true_lang-BoGxAoNd.js +703 -0
  12. package/dist/ImportExport-BD8o7IvB.js +4 -0
  13. package/dist/ImportExport.vue_vue_type_script_setup_true_lang-BzdP0ADd.js +456 -0
  14. package/dist/MetaForm-DtlyvzoM.js +364 -0
  15. package/dist/OrgAndPosition-DjF_gcp6.js +4 -0
  16. package/dist/OrgAndPosition.vue_vue_type_script_setup_true_lang-CFSDHn40.js +195 -0
  17. package/dist/ResourceEdit-WpEdbzaw.js +4 -0
  18. package/dist/ResourceEdit.vue_vue_type_script_setup_true_lang-id6jZAko.js +392 -0
  19. package/dist/ResourceRelation-26FnHEfU.js +112 -0
  20. package/dist/ResourceRelation-DGiGYy6V.js +91 -0
  21. package/dist/ResourceRelation.css +1 -1
  22. package/dist/ResourceRelation2.css +1 -1
  23. package/dist/RoleRelation-BuqK0cnl.js +4 -0
  24. package/dist/RoleRelation.vue_vue_type_script_setup_true_lang-BjEOlM2g.js +93 -0
  25. package/dist/RoleSelector.vue_vue_type_script_setup_true_lang-ZwsINUBu.js +352 -0
  26. package/dist/TenantEdit-B24X5nND.js +4 -0
  27. package/dist/TenantEdit.vue_vue_type_script_setup_true_lang-Bu5HcJJv.js +307 -0
  28. package/dist/UserAuthorization-Co6JV0py.js +274 -0
  29. package/dist/UserEdit-DkNVPVA4.js +4 -0
  30. package/dist/UserEdit.vue_vue_type_script_setup_true_lang-CFs0SxVJ.js +330 -0
  31. package/dist/_commonjsHelpers-DaMA6jEr.js +8 -0
  32. package/dist/_plugin-vue_export-helper-CHgC5LLL.js +9 -0
  33. package/dist/add-child-B9gDBQjZ.js +4 -0
  34. package/dist/animation_item-BZ1HNA6o.js +4 -0
  35. package/dist/animation_item.vue_vue_type_script_setup_true_lang-CmwThjHB.js +4858 -0
  36. package/dist/authority-B-0S66Fv.js +4 -0
  37. package/dist/authorize-DnyYvAo3.js +4 -0
  38. package/dist/blacklist-disable-DzVU8JLV.js +4 -0
  39. package/dist/blacklist-enable-BmWQR1i4.js +4 -0
  40. package/dist/browser-chrome-O9MASusF.js +4 -0
  41. package/dist/browser-edge-Dk6N_uRy.js +4 -0
  42. package/dist/browser-ie-Dtz7hQTC.js +4 -0
  43. package/dist/browser-other-Crzi8vov.js +4 -0
  44. package/dist/browser-safari-DF0pVlrn.js +4 -0
  45. package/dist/browserType-DQySszjD.js +4 -0
  46. package/dist/browserType.vue_vue_type_script_setup_true_lang-od1-AmrS.js +32 -0
  47. package/dist/cloneDeep-BOLZdR62.js +8 -0
  48. package/dist/createAndEditDataPermission-BhOLGGna.js +4 -0
  49. package/dist/createAndEditDataPermission.css +1 -1
  50. package/dist/createAndEditDataPermission.vue_vue_type_script_setup_true_lang-D5wInKwO.js +531 -0
  51. package/dist/dayjs.min-B2Yn1Frg.js +284 -0
  52. package/dist/drawerBlackWhiteList-Cr16yNs8.js +4 -0
  53. package/dist/drawerBlackWhiteList.vue_vue_type_script_setup_true_lang-BR6Yeiie.js +172 -0
  54. package/dist/drawerDictionary-BRGmcIFT.js +4 -0
  55. package/dist/drawerDictionary.vue_vue_type_script_setup_true_lang-0zsptmrP.js +146 -0
  56. package/dist/drawerDictionaryItem-CFBfyhEw.js +4 -0
  57. package/dist/drawerDictionaryItem.vue_vue_type_script_setup_true_lang-DeJblyyZ.js +158 -0
  58. package/dist/drawerGroup-Bs1Z8XPo.js +4 -0
  59. package/dist/drawerGroup.vue_vue_type_script_setup_true_lang-ClG-M0Ru.js +202 -0
  60. package/dist/drawerOrganization-Bs0YtPuo.js +4 -0
  61. package/dist/drawerOrganization.vue_vue_type_script_setup_true_lang-5YJaULAh.js +250 -0
  62. package/dist/drawerPosition-BYypSGoF.js +4 -0
  63. package/dist/drawerPosition.vue_vue_type_script_setup_true_lang-DcZ48XJV.js +181 -0
  64. package/dist/drawerRegion-BiIlYQ0Z.js +4 -0
  65. package/dist/drawerRegion.vue_vue_type_script_setup_true_lang-BwAj_RKw.js +233 -0
  66. package/dist/drawerRole-DHLv47_z.js +4 -0
  67. package/dist/drawerRole-DUWRM43j.js +4 -0
  68. package/dist/drawerRole-nmMTIQYS.js +4 -0
  69. package/dist/drawerRole.vue_vue_type_script_setup_true_lang-BET5ukoo.js +244 -0
  70. package/dist/drawerRole.vue_vue_type_script_setup_true_lang-BK3zjhop.js +197 -0
  71. package/dist/drawerRole.vue_vue_type_script_setup_true_lang-Surpf3ov.js +191 -0
  72. package/dist/edit-B69fMWPH.js +4 -0
  73. package/dist/enum-C9ihxJe7.js +4 -0
  74. package/dist/enum-CTUzwCYG.js +4 -0
  75. package/dist/enum-CjyX3J0o.js +18 -0
  76. package/dist/enum-DDKThkSw.js +24 -0
  77. package/dist/enum-DkSNwGbC.js +74 -0
  78. package/dist/gangweijiekou-Cs016LjQ.js +46 -0
  79. package/dist/icard-C4FaIC0V.js +4 -0
  80. package/dist/icon_animation-CfRxn8ne.js +4 -0
  81. package/dist/icon_breadcrumb-CAPCH16K.js +4 -0
  82. package/dist/icon_copyright-T9HuRtib.js +4 -0
  83. package/dist/icon_jt-BZgxEG_D.js +4 -0
  84. package/dist/icon_layout-BynQzkfn.js +4 -0
  85. package/dist/icon_mainpage-Bu_lyj_6.js +4 -0
  86. package/dist/icon_menu-D41hl_4p.js +4 -0
  87. package/dist/icon_page_size-Bioi61il.js +4 -0
  88. package/dist/icon_position_type-QpezzPDJ.js +4 -0
  89. package/dist/icon_safe_manage-ByWMOnwf.js +4 -0
  90. package/dist/icon_screen_scale-CuPyb7Ni.js +4 -0
  91. package/dist/icon_system_manage-BxRLv7Nw.js +4 -0
  92. package/dist/icon_tabbar-CetwmJHN.js +4 -0
  93. package/dist/icon_toolbar-DXt_LXp8.js +4 -0
  94. package/dist/icon_topbar-C186yIiC.js +4 -0
  95. package/dist/icon_watermark-DhaloO3m.js +4 -0
  96. package/dist/index-53oBz1jp.js +299 -0
  97. package/dist/index-B2tTTlBE.js +17698 -0
  98. package/dist/{toolbar_setting-rv8EGChc.js → index-BFx8F5lO.js} +144 -144
  99. package/dist/index-BIpmC999.js +169 -0
  100. package/dist/index-BUmMaC21.js +227 -0
  101. package/dist/index-BwWrE3dY.js +89 -0
  102. package/dist/index-C9hHp4Iw.js +197 -0
  103. package/dist/{watermark_setting-B_jC4rjv.js → index-CCw3ZJgQ.js} +254 -199
  104. package/dist/index-CJQB8KAz.js +186 -0
  105. package/dist/index-CLnFLvHy.js +193 -0
  106. package/dist/index-COWUocfL.js +119 -0
  107. package/dist/index-Cqkr8Rvk.js +189 -0
  108. package/dist/index-Csfu3kAr.js +171 -0
  109. package/dist/index-DECno0gv.js +196 -0
  110. package/dist/index-DVt5k9xh.js +145 -0
  111. package/dist/index-DdoOaWs-.js +269 -0
  112. package/dist/index-DfuGXjYh.js +169 -0
  113. package/dist/index-DoFuRlsc.js +181 -0
  114. package/dist/index-DwpOyfRe.js +152 -0
  115. package/dist/index-ZQuRR9fG.js +257 -0
  116. package/dist/index-ioZh8Qom.js +98 -0
  117. package/dist/index-rNYtJ7Om.js +195 -0
  118. package/dist/index-x9Iim2eD.js +247 -0
  119. package/dist/index-y9CQTo95.js +351 -0
  120. package/dist/index.css +1 -1
  121. package/dist/index.d.ts +1 -0
  122. package/dist/index.js +7193 -7042
  123. package/dist/index10.css +1 -0
  124. package/dist/index11.css +1 -0
  125. package/dist/index14.css +1 -0
  126. package/dist/index17.css +1 -0
  127. package/dist/index18.css +1 -0
  128. package/dist/index4.css +1 -0
  129. package/dist/index5.css +1 -0
  130. package/dist/index6.css +1 -0
  131. package/dist/index8.css +1 -0
  132. package/dist/index9.css +1 -0
  133. package/dist/itemlist-zTYJtoSs.js +172 -0
  134. package/dist/jiaosejiekou-p42Hm9h3.js +58 -0
  135. package/dist/log-center-Bw9UlmOq.js +4 -0
  136. package/dist/loginHistoryDetail-B6eI-TmJ.js +105 -0
  137. package/dist/login_history-B4Q1NCJn.js +222 -0
  138. package/dist/login_history.css +1 -1
  139. package/dist/not-data-BDuvYboz.js +4 -0
  140. package/dist/operateHistoryDetail-CLZ9lyua.js +123 -0
  141. package/dist/operate_history-KASZ7_JO.js +218 -0
  142. package/dist/operate_history.css +1 -1
  143. package/dist/org-main-DfWpX8Wv.js +4 -0
  144. package/dist/org-unmain-DrX63NH5.js +4 -0
  145. package/dist/remove-D2ES5tEr.js +4 -0
  146. package/dist/resource-app-1lqF6C6F.js +4 -0
  147. package/dist/resource-btn-Cfo6ddAY.js +4 -0
  148. package/dist/resource-dynamic-BAwkCWS4.js +4 -0
  149. package/dist/resource-index-BS4V5uy8.js +4 -0
  150. package/dist/resource-menu-CEWU8Iis.js +4 -0
  151. package/dist/resource-micro-9S0h5AlK.js +4 -0
  152. package/dist/resource-nonmenu-BZ9e4ynT.js +4 -0
  153. package/dist/setItem-BwMHXOUm.js +87 -0
  154. package/dist/setItem.css +1 -1
  155. package/dist/setting-manage-Xj_s0OoK.js +4 -0
  156. package/dist/shujuquanxianzhubiaokongzhiqi-SpN37fyO.js +65 -0
  157. package/dist/theme-check-mark-D58efagJ.js +4 -0
  158. package/dist/theme-title-CYUX2SBW.js +4 -0
  159. package/dist/useAppAndResource-38HCqYKa.js +55 -0
  160. package/dist/utils/dict.d.ts +6 -0
  161. package/dist/view-BCWU0JWM.js +4 -0
  162. package/dist/views/tenant/components/TenantEdit.vue.d.ts +1 -37
  163. package/dist/views/tenant/index.vue.d.ts +1 -37
  164. package/dist/xitongpeizhifuwu-BoCbGEk7.js +23 -0
  165. package/dist/zddata-DQP5Kx3c.js +4 -0
  166. package/dist/ziyuanjiekou-BC65-bFK.js +69 -0
  167. package/dist/zuzhijiaosebiaokongzhiqi-Cj4ZjkfZ.js +28 -0
  168. package/dist/zy_checked-Bb6zRsYe.js +4 -0
  169. package/dist/zy_default-BGjhoury.js +4 -0
  170. package/package.json +3 -3
  171. package/src/index.ts +1 -0
  172. package/src/utils/dict.ts +21 -0
  173. package/dist/ComponentSelect-HWE3OTC2.js +0 -2
  174. package/dist/ComponentSelect-lvLZA7v3.js +0 -3686
  175. package/dist/DynamicRoutesForm--yCRC-TS.js +0 -4
  176. package/dist/DynamicRoutesForm-CjrPnJvX.js +0 -169
  177. package/dist/HCheckList-CmS0Zgjk.js +0 -37
  178. package/dist/HCheckList-Cze_TkQp.js +0 -2
  179. package/dist/HoverCard-B79q5sly.js +0 -43
  180. package/dist/HoverCard-U5WTpvFy.js +0 -2
  181. package/dist/IconSelect-B0CeuV_a.js +0 -4
  182. package/dist/IconSelect-BRVj6gBy.js +0 -681
  183. package/dist/ImportExport-BNLVq0fU.js +0 -4
  184. package/dist/ImportExport-HsLm0AJH.js +0 -354
  185. package/dist/MetaForm-BSGuZXgj.js +0 -5
  186. package/dist/MetaForm-DErrpELP.js +0 -300
  187. package/dist/OrgAndPosition-CF7ZJtNB.js +0 -2
  188. package/dist/OrgAndPosition-vnBrq-fn.js +0 -188
  189. package/dist/ResourceEdit-DGiYedP0.js +0 -349
  190. package/dist/ResourceEdit-DZP72kyb.js +0 -11
  191. package/dist/ResourceRelation-BxGFnyVc.js +0 -78
  192. package/dist/ResourceRelation-DCjMjLpg.js +0 -3
  193. package/dist/ResourceRelation-DhML3AFe.js +0 -93
  194. package/dist/ResourceSelector-BAZ-oIRV.js +0 -247
  195. package/dist/ResourceSelector.css +0 -1
  196. package/dist/RoleRelation-Bxyd5aMn.js +0 -2
  197. package/dist/RoleRelation-CcgE6TEG.js +0 -79
  198. package/dist/RoleSelector-QpcO4KoV.js +0 -279
  199. package/dist/TenantEdit-CRhsWhhw.js +0 -253
  200. package/dist/TenantEdit-egH6GbbS.js +0 -6
  201. package/dist/UserAuthorization-B0lHeayD.js +0 -4
  202. package/dist/UserAuthorization-D-LcHhsj.js +0 -238
  203. package/dist/UserEdit-6MPOr7VK.js +0 -336
  204. package/dist/UserEdit-DGefh7mk.js +0 -4
  205. package/dist/_plugin-vue_export-helper-DziIhCOI.js +0 -6
  206. package/dist/add-child-BqjLtFNF.js +0 -2
  207. package/dist/animation_item-C3pkH-cB.js +0 -2
  208. package/dist/animation_item-Cg-CB3zX.js +0 -4536
  209. package/dist/authority-BCFCPQkb.js +0 -2
  210. package/dist/authorize-BykMzt1r.js +0 -2
  211. package/dist/blackWhiteList-CFnWvnIK.js +0 -213
  212. package/dist/blackWhiteList.css +0 -1
  213. package/dist/blacklist-disable-COoLZMSA.js +0 -2
  214. package/dist/blacklist-enable-LZep1trj.js +0 -2
  215. package/dist/breadcrumb_setting-BbdvbC4M.js +0 -111
  216. package/dist/browser-chrome-D0rex7Ir.js +0 -2
  217. package/dist/browser-edge-KCb_AIL5.js +0 -2
  218. package/dist/browser-ie-C1znjJM-.js +0 -2
  219. package/dist/browser-other-C4er8PkV.js +0 -2
  220. package/dist/browser-safari-BPRC1TV-.js +0 -2
  221. package/dist/browserType-BGl2j5RW.js +0 -2
  222. package/dist/browserType-E4RCiZfN.js +0 -26
  223. package/dist/chunk-B3eAFu3c.js +0 -11
  224. package/dist/cloneDeep-BnvyNhik.js +0 -7
  225. package/dist/components/OrgTree/index.vue.d.ts +0 -5
  226. package/dist/configData-DQOHeFW2.js +0 -86
  227. package/dist/createAndEditDataPermission-39GKHtzB.js +0 -443
  228. package/dist/createAndEditDataPermission-BBSBwjG4.js +0 -8
  229. package/dist/data-permission-35wTSMh2.js +0 -156
  230. package/dist/dayjs.min-CdDcH50N.js +0 -297
  231. package/dist/dictionary-BOuYUlfU.js +0 -180
  232. package/dist/drawerBlackWhiteList-BZccd_CZ.js +0 -125
  233. package/dist/drawerBlackWhiteList-Bz2trn-w.js +0 -3
  234. package/dist/drawerDictionary-C2tWu1lt.js +0 -130
  235. package/dist/drawerDictionary-Cx-QoHn4.js +0 -4
  236. package/dist/drawerDictionaryItem-C4mPbQEA.js +0 -142
  237. package/dist/drawerDictionaryItem-DhwinX1a.js +0 -4
  238. package/dist/drawerGroup-BUx0cx6i.js +0 -3
  239. package/dist/drawerGroup-DFeiJOBA.js +0 -188
  240. package/dist/drawerOrganization-BEdhq7Z2.js +0 -251
  241. package/dist/drawerOrganization-ijhmuc8a.js +0 -3
  242. package/dist/drawerPosition-shL7hfwJ.js +0 -3
  243. package/dist/drawerPosition-xI2PyE2x.js +0 -170
  244. package/dist/drawerRegion-BwWGUHaY.js +0 -187
  245. package/dist/drawerRegion-Dl1qXPXz.js +0 -3
  246. package/dist/drawerRole-C1I6-hhT.js +0 -159
  247. package/dist/drawerRole-CZpTYFS3.js +0 -172
  248. package/dist/drawerRole-CgTIHRCA.js +0 -3
  249. package/dist/drawerRole-Cmrob1UJ.js +0 -5
  250. package/dist/drawerRole-D2UxgYXQ.js +0 -215
  251. package/dist/drawerRole-DynkfVMp.js +0 -6
  252. package/dist/edit-C9HH0bNg.js +0 -2
  253. package/dist/enum-B1DCzyaW.js +0 -4
  254. package/dist/enum-BMY6bmPA.js +0 -54
  255. package/dist/enum-BWzxzuim.js +0 -23
  256. package/dist/enum-CYW8g64p.js +0 -61
  257. package/dist/enum-VH4_jOj5.js +0 -4
  258. package/dist/group-DOmpCW1J.js +0 -174
  259. package/dist/group.css +0 -1
  260. package/dist/icard-FW0Ro50-.js +0 -2
  261. package/dist/icon_animation-DuNUKCIP.js +0 -2
  262. package/dist/icon_breadcrumb-DrPNYW5B.js +0 -2
  263. package/dist/icon_copyright-Di3Yr0PZ.js +0 -2
  264. package/dist/icon_jt-C4rQLl9Y.js +0 -2
  265. package/dist/icon_layout-5L9E7uN2.js +0 -2
  266. package/dist/icon_mainpage-DMKqRgmE.js +0 -2
  267. package/dist/icon_menu-Cp7-Zght.js +0 -2
  268. package/dist/icon_page_size-Dc0zqT2W.js +0 -2
  269. package/dist/icon_position_type-DH2qxQQE.js +0 -2
  270. package/dist/icon_safe_manage-DXYWl1y-.js +0 -2
  271. package/dist/icon_screen_scale-DwC6qqx2.js +0 -2
  272. package/dist/icon_system_manage-BYTldLly.js +0 -2
  273. package/dist/icon_tabbar-CxffARwI.js +0 -2
  274. package/dist/icon_toolbar-CsxnTrNJ.js +0 -2
  275. package/dist/icon_topbar-DS-oEZFA.js +0 -2
  276. package/dist/icon_watermark-DDXsHlfQ.js +0 -2
  277. package/dist/itemlist-QBWRLjTd.js +0 -157
  278. package/dist/layout_setting-BZt_X9vU.js +0 -74
  279. package/dist/layout_setting.css +0 -1
  280. package/dist/log-center-BFjZ4IE1.js +0 -2
  281. package/dist/log-hgUXTuhy.js +0 -14
  282. package/dist/loginHistoryDetail-BAYuSqvw.js +0 -78
  283. package/dist/loginHistoryDetail-DiuNa6Sv.js +0 -4
  284. package/dist/login_history-NTSjr6e5.js +0 -196
  285. package/dist/menu_setting-CkoDAYJD.js +0 -158
  286. package/dist/not-data-Bw8FlpyB.js +0 -2
  287. package/dist/not-data-OpiacaSk.js +0 -2
  288. package/dist/operateHistoryDetail-DiuqMTkN.js +0 -90
  289. package/dist/operateHistoryDetail-r30ZBNqw.js +0 -4
  290. package/dist/operate_history-CXoZlYaT.js +0 -191
  291. package/dist/org-main-D5Isevbc.js +0 -2
  292. package/dist/org-unmain-BHBqSuCz.js +0 -2
  293. package/dist/organization-DmGbwqHI.js +0 -15605
  294. package/dist/organization.css +0 -1
  295. package/dist/other_setting-BqWwlJ2u.js +0 -220
  296. package/dist/other_setting.css +0 -1
  297. package/dist/page_animation_setting-g3bkn7vf.js +0 -117
  298. package/dist/page_animation_setting.css +0 -1
  299. package/dist/page_w_setting-Db9pP86g.js +0 -69
  300. package/dist/page_w_setting.css +0 -1
  301. package/dist/position-Bq4B3_PK.js +0 -168
  302. package/dist/region-DfxAE8eK.js +0 -185
  303. package/dist/remove-DKMMsJNq.js +0 -2
  304. package/dist/resource-app-DZwdNG6F.js +0 -2
  305. package/dist/resource-btn-DPX0oM2L.js +0 -2
  306. package/dist/resource-dynamic-Cb_vjMjt.js +0 -2
  307. package/dist/resource-index-ah4NpEob.js +0 -2
  308. package/dist/resource-menu-CzWI03EU.js +0 -2
  309. package/dist/resource-micro-Ca0NS7j_.js +0 -2
  310. package/dist/resource-nonmenu-Deitjo_5.js +0 -2
  311. package/dist/resource-rP8m6eP_.js +0 -273
  312. package/dist/role-DfWw95NS.js +0 -196
  313. package/dist/role_group-B4J4RWQt.js +0 -172
  314. package/dist/routeSystem-Dg0b6mAl.js +0 -2
  315. package/dist/safe_setting-uj9p_wW0.js +0 -232
  316. package/dist/setItem-C_jx_5fd.js +0 -5
  317. package/dist/setItem-DnJuD3C0.js +0 -77
  318. package/dist/setting-manage-B3vaM0w1.js +0 -2
  319. package/dist/stores-D6JJmBEU.js +0 -2
  320. package/dist/tabbar_setting-DBPggZ6Q.js +0 -142
  321. package/dist/tenant-Dbydqvrz.js +0 -183
  322. package/dist/theme-check-mark-BK7E8lqd.js +0 -2
  323. package/dist/theme-title-aqbHq846.js +0 -2
  324. package/dist/theme_setting-3l5L7tXt.js +0 -117
  325. package/dist/theme_setting.css +0 -1
  326. package/dist/useAppAndResource-CeMCjg2v.js +0 -57
  327. package/dist/user-DQE6N5EP.js +0 -345
  328. package/dist/view-C6Eo1zRL.js +0 -2
  329. package/dist/watermark_setting.css +0 -1
  330. package/dist/zddata-fjEtQ3lZ.js +0 -2
  331. package/dist/zy_checked-DTsDCC94.js +0 -2
  332. package/dist/zy_default-BaIuMKw-.js +0 -2
  333. /package/dist/{safe_setting.css → index12.css} +0 -0
  334. /package/dist/{tabbar_setting.css → index13.css} +0 -0
  335. /package/dist/{toolbar_setting.css → index15.css} +0 -0
  336. /package/dist/{user.css → index16.css} +0 -0
  337. /package/dist/{breadcrumb_setting.css → index2.css} +0 -0
  338. /package/dist/{data-permission.css → index3.css} +0 -0
  339. /package/dist/{menu_setting.css → index7.css} +0 -0
@@ -1,3686 +0,0 @@
1
- import { useViewStore as e } from "./index.js";
2
- import { Fragment as t, Teleport as n, computed as r, createBlock as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, createVNode as c, defineComponent as l, guardReactiveProps as u, isRef as d, mergeProps as f, normalizeClass as p, normalizeProps as m, onBeforeUnmount as h, onMounted as g, onUnmounted as _, openBlock as v, ref as y, resolveComponent as b, shallowRef as x, unref as S, useId as C, useModel as w, useTemplateRef as T, watch as E, watchEffect as ee, withCtx as D } from "vue";
3
- import { CaretDownOutlined as te } from "@ant-design/icons-vue";
4
- import { Empty as O } from "ant-design-vue";
5
- import { DirectoryTree as ne, Empty as re, FormItemRest as ie, Input as ae } from "ant-design-vue/es";
6
- import './ComponentSelect.css';const oe = [
7
- "top",
8
- "right",
9
- "bottom",
10
- "left"
11
- ], k = Math.min, A = Math.max, j = Math.round, se = Math.floor, M = (e) => ({
12
- x: e,
13
- y: e
14
- }), ce = {
15
- left: "right",
16
- right: "left",
17
- bottom: "top",
18
- top: "bottom"
19
- }, le = {
20
- start: "end",
21
- end: "start"
22
- };
23
- function ue(e, t, n) {
24
- return A(e, k(t, n));
25
- }
26
- function N(e, t) {
27
- return typeof e == "function" ? e(t) : e;
28
- }
29
- function P(e) {
30
- return e.split("-")[0];
31
- }
32
- function F(e) {
33
- return e.split("-")[1];
34
- }
35
- function de(e) {
36
- return e === "x" ? "y" : "x";
37
- }
38
- function fe(e) {
39
- return e === "y" ? "height" : "width";
40
- }
41
- const pe = /* @__PURE__ */ new Set(["top", "bottom"]);
42
- function I(e) {
43
- return pe.has(P(e)) ? "y" : "x";
44
- }
45
- function me(e) {
46
- return de(I(e));
47
- }
48
- function he(e, t, n) {
49
- n === void 0 && (n = !1);
50
- let r = F(e), i = me(e), a = fe(i), o = i === "x" ? r === (n ? "end" : "start") ? "right" : "left" : r === "start" ? "bottom" : "top";
51
- return t.reference[a] > t.floating[a] && (o = we(o)), [o, we(o)];
52
- }
53
- function ge(e) {
54
- let t = we(e);
55
- return [
56
- _e(e),
57
- t,
58
- _e(t)
59
- ];
60
- }
61
- function _e(e) {
62
- return e.replace(/start|end/g, (e) => le[e]);
63
- }
64
- const ve = ["left", "right"], ye = ["right", "left"], be = ["top", "bottom"], xe = ["bottom", "top"];
65
- function Se(e, t, n) {
66
- switch (e) {
67
- case "top":
68
- case "bottom": return n ? t ? ye : ve : t ? ve : ye;
69
- case "left":
70
- case "right": return t ? be : xe;
71
- default: return [];
72
- }
73
- }
74
- function Ce(e, t, n, r) {
75
- let i = F(e), a = Se(P(e), n === "start", r);
76
- return i && (a = a.map((e) => e + "-" + i), t && (a = a.concat(a.map(_e)))), a;
77
- }
78
- function we(e) {
79
- return e.replace(/left|right|bottom|top/g, (e) => ce[e]);
80
- }
81
- function Te(e) {
82
- return {
83
- top: 0,
84
- right: 0,
85
- bottom: 0,
86
- left: 0,
87
- ...e
88
- };
89
- }
90
- function Ee(e) {
91
- return typeof e == "number" ? {
92
- top: e,
93
- right: e,
94
- bottom: e,
95
- left: e
96
- } : Te(e);
97
- }
98
- function De(e) {
99
- let { x: t, y: n, width: r, height: i } = e;
100
- return {
101
- width: r,
102
- height: i,
103
- top: n,
104
- left: t,
105
- right: t + r,
106
- bottom: n + i,
107
- x: t,
108
- y: n
109
- };
110
- }
111
- function Oe(e, t, n) {
112
- let { reference: r, floating: i } = e, a = I(t), o = me(t), s = fe(o), c = P(t), l = a === "y", u = r.x + r.width / 2 - i.width / 2, d = r.y + r.height / 2 - i.height / 2, f = r[s] / 2 - i[s] / 2, p;
113
- switch (c) {
114
- case "top":
115
- p = {
116
- x: u,
117
- y: r.y - i.height
118
- };
119
- break;
120
- case "bottom":
121
- p = {
122
- x: u,
123
- y: r.y + r.height
124
- };
125
- break;
126
- case "right":
127
- p = {
128
- x: r.x + r.width,
129
- y: d
130
- };
131
- break;
132
- case "left":
133
- p = {
134
- x: r.x - i.width,
135
- y: d
136
- };
137
- break;
138
- default: p = {
139
- x: r.x,
140
- y: r.y
141
- };
142
- }
143
- switch (F(t)) {
144
- case "start":
145
- p[o] -= f * (n && l ? -1 : 1);
146
- break;
147
- case "end":
148
- p[o] += f * (n && l ? -1 : 1);
149
- break;
150
- }
151
- return p;
152
- }
153
- const ke = async (e, t, n) => {
154
- let { placement: r = "bottom", strategy: i = "absolute", middleware: a = [], platform: o } = n, s = a.filter(Boolean), c = await (o.isRTL == null ? void 0 : o.isRTL(t)), l = await o.getElementRects({
155
- reference: e,
156
- floating: t,
157
- strategy: i
158
- }), { x: u, y: d } = Oe(l, r, c), f = r, p = {}, m = 0;
159
- for (let n = 0; n < s.length; n++) {
160
- let { name: a, fn: h } = s[n], { x: g, y: _, data: v, reset: y } = await h({
161
- x: u,
162
- y: d,
163
- initialPlacement: r,
164
- placement: f,
165
- strategy: i,
166
- middlewareData: p,
167
- rects: l,
168
- platform: o,
169
- elements: {
170
- reference: e,
171
- floating: t
172
- }
173
- });
174
- u = g ?? u, d = _ ?? d, p = {
175
- ...p,
176
- [a]: {
177
- ...p[a],
178
- ...v
179
- }
180
- }, y && m <= 50 && (m++, typeof y == "object" && (y.placement && (f = y.placement), y.rects && (l = y.rects === !0 ? await o.getElementRects({
181
- reference: e,
182
- floating: t,
183
- strategy: i
184
- }) : y.rects), {x: u, y: d} = Oe(l, f, c)), n = -1);
185
- }
186
- return {
187
- x: u,
188
- y: d,
189
- placement: f,
190
- strategy: i,
191
- middlewareData: p
192
- };
193
- };
194
- async function Ae(e, t) {
195
- var n;
196
- t === void 0 && (t = {});
197
- let { x: r, y: i, platform: a, rects: o, elements: s, strategy: c } = e, { boundary: l = "clippingAncestors", rootBoundary: u = "viewport", elementContext: d = "floating", altBoundary: f = !1, padding: p = 0 } = N(t, e), m = Ee(p), h = d === "floating" ? "reference" : "floating", g = s[f ? h : d], _ = De(await a.getClippingRect({
198
- element: (n = await (a.isElement == null ? void 0 : a.isElement(g))) ?? !0 ? g : g.contextElement || await (a.getDocumentElement == null ? void 0 : a.getDocumentElement(s.floating)),
199
- boundary: l,
200
- rootBoundary: u,
201
- strategy: c
202
- })), v = d === "floating" ? {
203
- x: r,
204
- y: i,
205
- width: o.floating.width,
206
- height: o.floating.height
207
- } : o.reference, y = await (a.getOffsetParent == null ? void 0 : a.getOffsetParent(s.floating)), b = await (a.isElement == null ? void 0 : a.isElement(y)) && await (a.getScale == null ? void 0 : a.getScale(y)) || {
208
- x: 1,
209
- y: 1
210
- }, x = De(a.convertOffsetParentRelativeRectToViewportRelativeRect ? await a.convertOffsetParentRelativeRectToViewportRelativeRect({
211
- elements: s,
212
- rect: v,
213
- offsetParent: y,
214
- strategy: c
215
- }) : v);
216
- return {
217
- top: (_.top - x.top + m.top) / b.y,
218
- bottom: (x.bottom - _.bottom + m.bottom) / b.y,
219
- left: (_.left - x.left + m.left) / b.x,
220
- right: (x.right - _.right + m.right) / b.x
221
- };
222
- }
223
- const je = (e) => ({
224
- name: "arrow",
225
- options: e,
226
- async fn(t) {
227
- let { x: n, y: r, placement: i, rects: a, platform: o, elements: s, middlewareData: c } = t, { element: l, padding: u = 0 } = N(e, t) || {};
228
- if (l == null) return {};
229
- let d = Ee(u), f = {
230
- x: n,
231
- y: r
232
- }, p = me(i), m = fe(p), h = await o.getDimensions(l), g = p === "y", _ = g ? "top" : "left", v = g ? "bottom" : "right", y = g ? "clientHeight" : "clientWidth", b = a.reference[m] + a.reference[p] - f[p] - a.floating[m], x = f[p] - a.reference[p], S = await (o.getOffsetParent == null ? void 0 : o.getOffsetParent(l)), C = S ? S[y] : 0;
233
- (!C || !await (o.isElement == null ? void 0 : o.isElement(S))) && (C = s.floating[y] || a.floating[m]);
234
- let w = b / 2 - x / 2, T = C / 2 - h[m] / 2 - 1, E = k(d[_], T), ee = k(d[v], T), D = E, te = C - h[m] - ee, O = C / 2 - h[m] / 2 + w, ne = ue(D, O, te), re = !c.arrow && F(i) != null && O !== ne && a.reference[m] / 2 - (O < D ? E : ee) - h[m] / 2 < 0, ie = re ? O < D ? O - D : O - te : 0;
235
- return {
236
- [p]: f[p] + ie,
237
- data: {
238
- [p]: ne,
239
- centerOffset: O - ne - ie,
240
- ...re && { alignmentOffset: ie }
241
- },
242
- reset: re
243
- };
244
- }
245
- }), Me = function(e) {
246
- return e === void 0 && (e = {}), {
247
- name: "flip",
248
- options: e,
249
- async fn(t) {
250
- var n, r;
251
- let { placement: i, middlewareData: a, rects: o, initialPlacement: s, platform: c, elements: l } = t, { mainAxis: u = !0, crossAxis: d = !0, fallbackPlacements: f, fallbackStrategy: p = "bestFit", fallbackAxisSideDirection: m = "none", flipAlignment: h = !0,...g } = N(e, t);
252
- if ((n = a.arrow) != null && n.alignmentOffset) return {};
253
- let _ = P(i), v = I(s), y = P(s) === s, b = await (c.isRTL == null ? void 0 : c.isRTL(l.floating)), x = f || (y || !h ? [we(s)] : ge(s)), S = m !== "none";
254
- !f && S && x.push(...Ce(s, h, m, b));
255
- let C = [s, ...x], w = await Ae(t, g), T = [], E = (r = a.flip)?.overflows || [];
256
- if (u && T.push(w[_]), d) {
257
- let e = he(i, o, b);
258
- T.push(w[e[0]], w[e[1]]);
259
- }
260
- if (E = [...E, {
261
- placement: i,
262
- overflows: T
263
- }], !T.every((e) => e <= 0)) {
264
- var ee, D;
265
- let e = ((ee = a.flip)?.index || 0) + 1, t = C[e];
266
- if (t) {
267
- let n = d === "alignment" ? v !== I(t) : !1;
268
- if (!n || E.every((e) => e.overflows[0] > 0 && I(e.placement) === v)) return {
269
- data: {
270
- index: e,
271
- overflows: E
272
- },
273
- reset: { placement: t }
274
- };
275
- }
276
- let n = (D = E.filter((e) => e.overflows[0] <= 0).sort((e, t) => e.overflows[1] - t.overflows[1])[0])?.placement;
277
- if (!n) switch (p) {
278
- case "bestFit": {
279
- var te;
280
- let e = (te = E.filter((e) => {
281
- if (S) {
282
- let t = I(e.placement);
283
- return t === v || t === "y";
284
- }
285
- return !0;
286
- }).map((e) => [e.placement, e.overflows.filter((e) => e > 0).reduce((e, t) => e + t, 0)]).sort((e, t) => e[1] - t[1])[0])?.[0];
287
- e && (n = e);
288
- break;
289
- }
290
- case "initialPlacement":
291
- n = s;
292
- break;
293
- }
294
- if (i !== n) return { reset: { placement: n } };
295
- }
296
- return {};
297
- }
298
- };
299
- };
300
- function Ne(e, t) {
301
- return {
302
- top: e.top - t.height,
303
- right: e.right - t.width,
304
- bottom: e.bottom - t.height,
305
- left: e.left - t.width
306
- };
307
- }
308
- function Pe(e) {
309
- return oe.some((t) => e[t] >= 0);
310
- }
311
- const Fe = function(e) {
312
- return e === void 0 && (e = {}), {
313
- name: "hide",
314
- options: e,
315
- async fn(t) {
316
- let { rects: n } = t, { strategy: r = "referenceHidden",...i } = N(e, t);
317
- switch (r) {
318
- case "referenceHidden": {
319
- let e = await Ae(t, {
320
- ...i,
321
- elementContext: "reference"
322
- }), r = Ne(e, n.reference);
323
- return { data: {
324
- referenceHiddenOffsets: r,
325
- referenceHidden: Pe(r)
326
- } };
327
- }
328
- case "escaped": {
329
- let e = await Ae(t, {
330
- ...i,
331
- altBoundary: !0
332
- }), r = Ne(e, n.floating);
333
- return { data: {
334
- escapedOffsets: r,
335
- escaped: Pe(r)
336
- } };
337
- }
338
- default: return {};
339
- }
340
- }
341
- };
342
- }, Ie = /* @__PURE__ */ new Set(["left", "top"]);
343
- async function Le(e, t) {
344
- let { placement: n, platform: r, elements: i } = e, a = await (r.isRTL == null ? void 0 : r.isRTL(i.floating)), o = P(n), s = F(n), c = I(n) === "y", l = Ie.has(o) ? -1 : 1, u = a && c ? -1 : 1, d = N(t, e), { mainAxis: f, crossAxis: p, alignmentAxis: m } = typeof d == "number" ? {
345
- mainAxis: d,
346
- crossAxis: 0,
347
- alignmentAxis: null
348
- } : {
349
- mainAxis: d.mainAxis || 0,
350
- crossAxis: d.crossAxis || 0,
351
- alignmentAxis: d.alignmentAxis
352
- };
353
- return s && typeof m == "number" && (p = s === "end" ? m * -1 : m), c ? {
354
- x: p * u,
355
- y: f * l
356
- } : {
357
- x: f * l,
358
- y: p * u
359
- };
360
- }
361
- const Re = function(e) {
362
- return e === void 0 && (e = 0), {
363
- name: "offset",
364
- options: e,
365
- async fn(t) {
366
- var n, r;
367
- let { x: i, y: a, placement: o, middlewareData: s } = t, c = await Le(t, e);
368
- return o === (n = s.offset)?.placement && (r = s.arrow) != null && r.alignmentOffset ? {} : {
369
- x: i + c.x,
370
- y: a + c.y,
371
- data: {
372
- ...c,
373
- placement: o
374
- }
375
- };
376
- }
377
- };
378
- }, ze = function(e) {
379
- return e === void 0 && (e = {}), {
380
- name: "shift",
381
- options: e,
382
- async fn(t) {
383
- let { x: n, y: r, placement: i } = t, { mainAxis: a = !0, crossAxis: o = !1, limiter: s = { fn: (e) => {
384
- let { x: t, y: n } = e;
385
- return {
386
- x: t,
387
- y: n
388
- };
389
- } },...c } = N(e, t), l = {
390
- x: n,
391
- y: r
392
- }, u = await Ae(t, c), d = I(P(i)), f = de(d), p = l[f], m = l[d];
393
- if (a) {
394
- let e = f === "y" ? "top" : "left", t = f === "y" ? "bottom" : "right", n = p + u[e], r = p - u[t];
395
- p = ue(n, p, r);
396
- }
397
- if (o) {
398
- let e = d === "y" ? "top" : "left", t = d === "y" ? "bottom" : "right", n = m + u[e], r = m - u[t];
399
- m = ue(n, m, r);
400
- }
401
- let h = s.fn({
402
- ...t,
403
- [f]: p,
404
- [d]: m
405
- });
406
- return {
407
- ...h,
408
- data: {
409
- x: h.x - n,
410
- y: h.y - r,
411
- enabled: {
412
- [f]: a,
413
- [d]: o
414
- }
415
- }
416
- };
417
- }
418
- };
419
- }, Be = function(e) {
420
- return e === void 0 && (e = {}), {
421
- options: e,
422
- fn(t) {
423
- let { x: n, y: r, placement: i, rects: a, middlewareData: o } = t, { offset: s = 0, mainAxis: c = !0, crossAxis: l = !0 } = N(e, t), u = {
424
- x: n,
425
- y: r
426
- }, d = I(i), f = de(d), p = u[f], m = u[d], h = N(s, t), g = typeof h == "number" ? {
427
- mainAxis: h,
428
- crossAxis: 0
429
- } : {
430
- mainAxis: 0,
431
- crossAxis: 0,
432
- ...h
433
- };
434
- if (c) {
435
- let e = f === "y" ? "height" : "width", t = a.reference[f] - a.floating[e] + g.mainAxis, n = a.reference[f] + a.reference[e] - g.mainAxis;
436
- p < t ? p = t : p > n && (p = n);
437
- }
438
- if (l) {
439
- var _, v;
440
- let e = f === "y" ? "width" : "height", t = Ie.has(P(i)), n = a.reference[d] - a.floating[e] + (t && (_ = o.offset)?.[d] || 0) + (t ? 0 : g.crossAxis), r = a.reference[d] + a.reference[e] + (t ? 0 : (v = o.offset)?.[d] || 0) - (t ? g.crossAxis : 0);
441
- m < n ? m = n : m > r && (m = r);
442
- }
443
- return {
444
- [f]: p,
445
- [d]: m
446
- };
447
- }
448
- };
449
- }, Ve = function(e) {
450
- return e === void 0 && (e = {}), {
451
- name: "size",
452
- options: e,
453
- async fn(t) {
454
- var n, r;
455
- let { placement: i, rects: a, platform: o, elements: s } = t, { apply: c = () => {},...l } = N(e, t), u = await Ae(t, l), d = P(i), f = F(i), p = I(i) === "y", { width: m, height: h } = a.floating, g, _;
456
- d === "top" || d === "bottom" ? (g = d, _ = f === (await (o.isRTL == null ? void 0 : o.isRTL(s.floating)) ? "start" : "end") ? "left" : "right") : (_ = d, g = f === "end" ? "top" : "bottom");
457
- let v = h - u.top - u.bottom, y = m - u.left - u.right, b = k(h - u[g], v), x = k(m - u[_], y), S = !t.middlewareData.shift, C = b, w = x;
458
- if ((n = t.middlewareData.shift) != null && n.enabled.x && (w = y), (r = t.middlewareData.shift) != null && r.enabled.y && (C = v), S && !f) {
459
- let e = A(u.left, 0), t = A(u.right, 0), n = A(u.top, 0), r = A(u.bottom, 0);
460
- p ? w = m - 2 * (e !== 0 || t !== 0 ? e + t : A(u.left, u.right)) : C = h - 2 * (n !== 0 || r !== 0 ? n + r : A(u.top, u.bottom));
461
- }
462
- await c({
463
- ...t,
464
- availableWidth: w,
465
- availableHeight: C
466
- });
467
- let T = await o.getDimensions(s.floating);
468
- return m !== T.width || h !== T.height ? { reset: { rects: !0 } } : {};
469
- }
470
- };
471
- };
472
- function He() {
473
- return typeof window < "u";
474
- }
475
- function Ue(e) {
476
- return We(e) ? (e.nodeName || "").toLowerCase() : "#document";
477
- }
478
- function L(e) {
479
- var t;
480
- return (e == null || (t = e.ownerDocument) == null ? void 0 : t.defaultView) || window;
481
- }
482
- function R(e) {
483
- var t;
484
- return (t = (We(e) ? e.ownerDocument : e.document) || window.document)?.documentElement;
485
- }
486
- function We(e) {
487
- return He() ? e instanceof Node || e instanceof L(e).Node : !1;
488
- }
489
- function z(e) {
490
- return He() ? e instanceof Element || e instanceof L(e).Element : !1;
491
- }
492
- function B(e) {
493
- return He() ? e instanceof HTMLElement || e instanceof L(e).HTMLElement : !1;
494
- }
495
- function Ge(e) {
496
- return !He() || typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof L(e).ShadowRoot;
497
- }
498
- const Ke = /* @__PURE__ */ new Set(["inline", "contents"]);
499
- function qe(e) {
500
- let { overflow: t, overflowX: n, overflowY: r, display: i } = V(e);
501
- return /auto|scroll|overlay|hidden|clip/.test(t + r + n) && !Ke.has(i);
502
- }
503
- const Je = /* @__PURE__ */ new Set([
504
- "table",
505
- "td",
506
- "th"
507
- ]);
508
- function Ye(e) {
509
- return Je.has(Ue(e));
510
- }
511
- const Xe = [":popover-open", ":modal"];
512
- function Ze(e) {
513
- return Xe.some((t) => {
514
- try {
515
- return e.matches(t);
516
- } catch {
517
- return !1;
518
- }
519
- });
520
- }
521
- const Qe = [
522
- "transform",
523
- "translate",
524
- "scale",
525
- "rotate",
526
- "perspective"
527
- ], $e = [
528
- "transform",
529
- "translate",
530
- "scale",
531
- "rotate",
532
- "perspective",
533
- "filter"
534
- ], et = [
535
- "paint",
536
- "layout",
537
- "strict",
538
- "content"
539
- ];
540
- function tt(e) {
541
- let t = rt(), n = z(e) ? V(e) : e;
542
- return Qe.some((e) => n[e] ? n[e] !== "none" : !1) || (n.containerType ? n.containerType !== "normal" : !1) || !t && (n.backdropFilter ? n.backdropFilter !== "none" : !1) || !t && (n.filter ? n.filter !== "none" : !1) || $e.some((e) => (n.willChange || "").includes(e)) || et.some((e) => (n.contain || "").includes(e));
543
- }
544
- function nt(e) {
545
- let t = H(e);
546
- for (; B(t) && !at(t);) {
547
- if (tt(t)) return t;
548
- if (Ze(t)) return null;
549
- t = H(t);
550
- }
551
- return null;
552
- }
553
- function rt() {
554
- return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
555
- }
556
- const it = /* @__PURE__ */ new Set([
557
- "html",
558
- "body",
559
- "#document"
560
- ]);
561
- function at(e) {
562
- return it.has(Ue(e));
563
- }
564
- function V(e) {
565
- return L(e).getComputedStyle(e);
566
- }
567
- function ot(e) {
568
- return z(e) ? {
569
- scrollLeft: e.scrollLeft,
570
- scrollTop: e.scrollTop
571
- } : {
572
- scrollLeft: e.scrollX,
573
- scrollTop: e.scrollY
574
- };
575
- }
576
- function H(e) {
577
- if (Ue(e) === "html") return e;
578
- let t = e.assignedSlot || e.parentNode || Ge(e) && e.host || R(e);
579
- return Ge(t) ? t.host : t;
580
- }
581
- function st(e) {
582
- let t = H(e);
583
- return at(t) ? e.ownerDocument ? e.ownerDocument.body : e.body : B(t) && qe(t) ? t : st(t);
584
- }
585
- function ct(e, t, n) {
586
- var r;
587
- t === void 0 && (t = []), n === void 0 && (n = !0);
588
- let i = st(e), a = i === (r = e.ownerDocument)?.body, o = L(i);
589
- if (a) {
590
- let e = lt(o);
591
- return t.concat(o, o.visualViewport || [], qe(i) ? i : [], e && n ? ct(e) : []);
592
- }
593
- return t.concat(i, ct(i, [], n));
594
- }
595
- function lt(e) {
596
- return e.parent && Object.getPrototypeOf(e.parent) ? e.frameElement : null;
597
- }
598
- const ut = (e) => e.length === 0;
599
- function dt(e) {
600
- return e.replace(/([a-z\d])([A-Z])/g, "$1-$2").replace(/([A-Z])([A-Z][a-z])/g, "$1-$2").replace(/[\s_]+/g, "-").toLowerCase();
601
- }
602
- function ft(e, t = []) {
603
- return {
604
- parts: (...n) => {
605
- if (ut(t)) return ft(e, n);
606
- throw Error("createAnatomy().parts(...) should only be called once. Did you mean to use .extendWith(...) ?");
607
- },
608
- extendWith: (...n) => ft(e, [...t, ...n]),
609
- rename: (e) => ft(e, t),
610
- keys: () => t,
611
- build: () => [...new Set(t)].reduce((t, n) => Object.assign(t, { [n]: {
612
- selector: [`&[data-scope="${dt(e)}"][data-part="${dt(n)}"]`, `& [data-scope="${dt(e)}"][data-part="${dt(n)}"]`].join(", "),
613
- attrs: {
614
- "data-scope": dt(e),
615
- "data-part": dt(n)
616
- }
617
- } }), {})
618
- };
619
- }
620
- const pt = (e) => typeof e == "object" && !!e, mt = (e) => e ? "" : void 0;
621
- function U(e) {
622
- return pt(e) && e.nodeType === 1 && typeof e.nodeName == "string";
623
- }
624
- const ht = (e) => pt(e) && e.nodeType === 9, gt = (e) => pt(e) && e === e.window;
625
- function _t(e) {
626
- return U(e) ? e.localName || "" : "#document";
627
- }
628
- function vt(e) {
629
- return [
630
- "html",
631
- "body",
632
- "#document"
633
- ].includes(_t(e));
634
- }
635
- const yt = (e) => pt(e) && e.nodeType !== void 0;
636
- function bt(e) {
637
- return yt(e) && e.nodeType === 11 && "host" in e;
638
- }
639
- const xt = (e) => U(e) && e.localName === "input";
640
- function St(e) {
641
- return U(e) ? e.offsetWidth > 0 || e.offsetHeight > 0 || e.getClientRects().length > 0 : !1;
642
- }
643
- const Ct = /(textarea|select)/;
644
- function wt(e) {
645
- if (e == null || !U(e)) return !1;
646
- try {
647
- return xt(e) && e.selectionStart != null || Ct.test(e.localName) || e.isContentEditable || e.getAttribute("contenteditable") === "true" || e.getAttribute("contenteditable") === "";
648
- } catch {
649
- return !1;
650
- }
651
- }
652
- function Tt(e, t) {
653
- if (!e || !t || !U(e) || !U(t)) return !1;
654
- let n = t.getRootNode?.();
655
- if (e === t || e.contains(t)) return !0;
656
- if (n && bt(n)) {
657
- let n = t;
658
- for (; n;) {
659
- if (e === n) return !0;
660
- n = n.parentNode || n.host;
661
- }
662
- }
663
- return !1;
664
- }
665
- function Et(e) {
666
- return ht(e) ? e : gt(e) ? e.document : e?.ownerDocument ?? document;
667
- }
668
- function Dt(e) {
669
- return Et(e).documentElement;
670
- }
671
- function Ot(e) {
672
- return bt(e) ? Ot(e.host) : ht(e) ? e.defaultView ?? window : U(e) ? e.ownerDocument?.defaultView ?? window : window;
673
- }
674
- function kt(e) {
675
- let t = e.activeElement;
676
- for (; t?.shadowRoot;) {
677
- let e = t.shadowRoot.activeElement;
678
- if (e === t) break;
679
- t = e;
680
- }
681
- return t;
682
- }
683
- function At(e) {
684
- if (_t(e) === "html") return e;
685
- let t = e.assignedSlot || e.parentNode || bt(e) && e.host || Dt(e);
686
- return bt(t) ? t.host : t;
687
- }
688
- const jt = /* @__PURE__ */ new WeakMap();
689
- function Mt(e) {
690
- return jt.has(e) || jt.set(e, Ot(e).getComputedStyle(e)), jt.get(e);
691
- }
692
- const Nt = () => typeof document < "u";
693
- function Pt() {
694
- let e = navigator.userAgentData;
695
- return e?.platform ?? navigator.platform;
696
- }
697
- const Ft = (e) => Nt() && e.test(Pt()), It = (e) => Nt() && e.test(navigator.vendor), Lt = () => Ft(/^Mac/), Rt = () => Ft(/mac|iphone|ipad|ipod/i), zt = () => Rt() && It(/apple/i), Bt = () => Ft(/iP(hone|ad|od)|iOS/);
698
- function Vt(e) {
699
- return e.composedPath?.() ?? e.nativeEvent?.composedPath?.();
700
- }
701
- function Ht(e) {
702
- let t = Vt(e);
703
- return t?.[0] ?? e.target;
704
- }
705
- function Ut(e) {
706
- return e.button === 2 || Lt() && e.ctrlKey && e.button === 0;
707
- }
708
- function W(e, t, n, r) {
709
- let i = typeof e == "function" ? e() : e;
710
- return i?.addEventListener(t, n, r), () => {
711
- i?.removeEventListener(t, n, r);
712
- };
713
- }
714
- function Wt(e, t) {
715
- let { type: n = "HTMLInputElement", property: r = "value" } = t, i = Ot(e)[n].prototype;
716
- return Object.getOwnPropertyDescriptor(i, r) ?? {};
717
- }
718
- function Gt(e) {
719
- if (e.localName === "input") return "HTMLInputElement";
720
- if (e.localName === "textarea") return "HTMLTextAreaElement";
721
- if (e.localName === "select") return "HTMLSelectElement";
722
- }
723
- function Kt(e, t, n = "value") {
724
- let r = Gt(e);
725
- if (r) {
726
- let i = Wt(e, {
727
- type: r,
728
- property: n
729
- });
730
- i.set?.call(e, t);
731
- }
732
- e.setAttribute(n, t);
733
- }
734
- const qt = (e) => U(e) && e.tagName === "IFRAME", Jt = (e) => !Number.isNaN(Number.parseInt(e.getAttribute("tabindex") || "0", 10)), Yt = (e) => Number.parseInt(e.getAttribute("tabindex") || "0", 10) < 0, Xt = "input:not([type='hidden']):not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], button:not([disabled]), [tabindex], iframe, object, embed, area[href], audio[controls], video[controls], [contenteditable]:not([contenteditable='false']), details > summary:first-of-type";
735
- function Zt(e, t = !1) {
736
- if (!e) return [];
737
- let n = Array.from(e.querySelectorAll(Xt)), r = t === !0 || t === "if-empty" && n.length === 0;
738
- r && U(e) && Qt(e) && n.unshift(e);
739
- let i = n.filter(Qt);
740
- return i.forEach((e, t) => {
741
- if (qt(e) && e.contentDocument) {
742
- let n = e.contentDocument.body;
743
- i.splice(t, 1, ...Zt(n));
744
- }
745
- }), i;
746
- }
747
- function Qt(e) {
748
- return !e || e.closest("[inert]") ? !1 : e.matches(Xt) && St(e);
749
- }
750
- function $t(e, t) {
751
- if (!e) return [];
752
- let n = Array.from(e.querySelectorAll(Xt)), r = n.filter(en);
753
- return t && en(e) && r.unshift(e), r.forEach((e, t) => {
754
- if (qt(e) && e.contentDocument) {
755
- let n = e.contentDocument.body, i = $t(n);
756
- r.splice(t, 1, ...i);
757
- }
758
- }), !r.length && t ? n : r;
759
- }
760
- function en(e) {
761
- return e != null && e.tabIndex > 0 ? !0 : Qt(e) && !Yt(e);
762
- }
763
- function tn(e, t) {
764
- let n = $t(e, t), r = n[0] || null, i = n[n.length - 1] || null;
765
- return [r, i];
766
- }
767
- function nn(e, t) {
768
- let n = $t(e), r = e?.ownerDocument || document, i = t ?? r.activeElement;
769
- if (!i) return null;
770
- let a = n.indexOf(i);
771
- return n[a + 1] || null;
772
- }
773
- function rn(e) {
774
- return e.tabIndex < 0 && (/^(audio|video|details)$/.test(e.localName) || wt(e)) && !Jt(e) ? 0 : e.tabIndex;
775
- }
776
- function an(e) {
777
- let { root: t, getInitialEl: n, filter: r, enabled: i = !0 } = e;
778
- if (!i) return;
779
- let a = null;
780
- if (a ||= typeof n == "function" ? n() : n, a ||= t?.querySelector("[data-autofocus],[autofocus]"), !a) {
781
- let e = $t(t);
782
- a = r ? e.filter(r)[0] : e[0];
783
- }
784
- return a || t || void 0;
785
- }
786
- function G(e) {
787
- let t = globalThis.requestAnimationFrame(e);
788
- return () => {
789
- globalThis.cancelAnimationFrame(t);
790
- };
791
- }
792
- function on(e) {
793
- let t = At(e);
794
- return vt(t) ? Et(t).body : U(t) && cn(t) ? t : on(t);
795
- }
796
- const sn = /auto|scroll|overlay|hidden|clip/;
797
- function cn(e) {
798
- let t = Ot(e), { overflow: n, overflowX: r, overflowY: i, display: a } = t.getComputedStyle(e);
799
- return sn.test(n + i + r) && !["inline", "contents"].includes(a);
800
- }
801
- function ln(e, t = {}) {
802
- let { triggerElement: n, onFocus: r } = t, i = e?.ownerDocument || document, a = i.body;
803
- function o(t) {
804
- if (t.key !== "Tab") return;
805
- let o = null, [s, c] = tn(e, !0), l = !s && !c;
806
- t.shiftKey && (i.activeElement === s || l) ? o = n : !t.shiftKey && i.activeElement === n ? o = s : !t.shiftKey && (i.activeElement === c || l) && (o = nn(a, n)), o && (t.preventDefault(), typeof r == "function" ? r(o) : o.focus());
807
- }
808
- return W(i, "keydown", o, !0);
809
- }
810
- function un(e, t) {
811
- let { defer: n, triggerElement: r,...i } = t, a = n ? G : (e) => e(), o = [];
812
- return o.push(a(() => {
813
- let t = typeof e == "function" ? e() : e, n = typeof r == "function" ? r() : r;
814
- o.push(ln(t, {
815
- triggerElement: n,
816
- ...i
817
- }));
818
- })), () => {
819
- o.forEach((e) => e?.());
820
- };
821
- }
822
- function dn(e) {
823
- let t = {
824
- getRootNode: (e) => e.getRootNode?.() ?? document,
825
- getDoc: (e) => Et(t.getRootNode(e)),
826
- getWin: (e) => t.getDoc(e).defaultView ?? window,
827
- getActiveElement: (e) => kt(t.getRootNode(e)),
828
- isActiveElement: (e, n) => n === t.getActiveElement(e),
829
- getById: (e, n) => t.getRootNode(e).getElementById(n),
830
- setValue: (e, t) => {
831
- e == null || t == null || Kt(e, t.toString());
832
- }
833
- };
834
- return {
835
- ...t,
836
- ...e
837
- };
838
- }
839
- const fn = /* @__PURE__ */ new WeakMap();
840
- function pn(e, t, n) {
841
- fn.has(e) || fn.set(e, /* @__PURE__ */ new Map());
842
- let r = fn.get(e), i = r.get(t);
843
- if (!i) return r.set(t, n()), () => {
844
- r.get(t)?.(), r.delete(t);
845
- };
846
- let a = n(), o = () => {
847
- a(), i(), r.delete(t);
848
- };
849
- return r.set(t, o), () => {
850
- let e = r.get(t) === o;
851
- e && (a(), r.set(t, i));
852
- };
853
- }
854
- function mn(e, t) {
855
- if (!e) return () => {};
856
- let n = () => {
857
- let n = e.style.cssText;
858
- return Object.assign(e.style, t), () => {
859
- e.style.cssText = n;
860
- };
861
- };
862
- return pn(e, "style", n);
863
- }
864
- function hn(e, t) {
865
- let n = e();
866
- if (U(n) && n.isConnected) return t(n), () => void 0;
867
- {
868
- let n = setInterval(() => {
869
- let r = e();
870
- U(r) && r.isConnected && (t(r), clearInterval(n));
871
- }, 16.666666666666668);
872
- return () => clearInterval(n);
873
- }
874
- }
875
- function gn(e, t) {
876
- let n = [];
877
- return e?.forEach((e) => {
878
- let r = hn(e, t);
879
- n.push(r);
880
- }), () => {
881
- n.forEach((e) => e());
882
- };
883
- }
884
- function _n(e) {
885
- for (; e.length > 0;) e.pop();
886
- return e;
887
- }
888
- function vn(e, ...t) {
889
- let n = typeof e == "function" ? e(...t) : e;
890
- return n ?? void 0;
891
- }
892
- const K = (e) => e;
893
- function yn() {}
894
- function bn(...e) {
895
- return (...t) => {
896
- e.forEach((e) => {
897
- e?.(...t);
898
- });
899
- };
900
- }
901
- const xn = /* @__PURE__ */ (() => {
902
- let e = 0;
903
- return () => (e++, e.toString(36));
904
- })(), Sn = (e) => Array.isArray(e), Cn = (e) => typeof e == "object" && !!e, wn = (e) => Cn(e) && !Sn(e), Tn = (e) => typeof e == "number" && !Number.isNaN(e), q = (e) => typeof e == "string", En = (e) => typeof e == "function", Dn = (e) => e == null;
905
- function On(e, t) {
906
- return Object.prototype.hasOwnProperty.call(e, t);
907
- }
908
- const kn = (e) => Object.prototype.toString.call(e), An = Function.prototype.toString, jn = An.call(Object);
909
- function Mn(e) {
910
- if (!Cn(e) || kn(e) !== "[object Object]") return !1;
911
- let t = Object.getPrototypeOf(e);
912
- if (t === null) return !0;
913
- let n = On(t, "constructor") && t.constructor;
914
- return typeof n == "function" && n instanceof n && An.call(n) === jn;
915
- }
916
- const { floor: Nn, abs: Pn, round: Fn, min: In, max: Ln, sign: Rn } = Math;
917
- function zn(e) {
918
- if (!Bn(e) || e === void 0) return e;
919
- let t = Reflect.ownKeys(e).filter((e) => typeof e == "string"), n = {};
920
- for (let r of t) {
921
- let t = e[r];
922
- t !== void 0 && (n[r] = zn(t));
923
- }
924
- return n;
925
- }
926
- function Bn(e) {
927
- return e && typeof e == "object" && e.constructor === Object;
928
- }
929
- function Vn(e, t) {
930
- let n = {}, r = {}, i = new Set(t);
931
- for (let t in e) i.has(t) ? r[t] = e[t] : n[t] = e[t];
932
- return [r, n];
933
- }
934
- function Hn(e) {
935
- return function(t) {
936
- return Vn(t, e);
937
- };
938
- }
939
- function Un(e) {
940
- let t = V(e), n = parseFloat(t.width) || 0, r = parseFloat(t.height) || 0, i = B(e), a = i ? e.offsetWidth : n, o = i ? e.offsetHeight : r, s = j(n) !== a || j(r) !== o;
941
- return s && (n = a, r = o), {
942
- width: n,
943
- height: r,
944
- $: s
945
- };
946
- }
947
- function Wn(e) {
948
- return z(e) ? e : e.contextElement;
949
- }
950
- function Gn(e) {
951
- let t = Wn(e);
952
- if (!B(t)) return M(1);
953
- let n = t.getBoundingClientRect(), { width: r, height: i, $: a } = Un(t), o = (a ? j(n.width) : n.width) / r, s = (a ? j(n.height) : n.height) / i;
954
- return (!o || !Number.isFinite(o)) && (o = 1), (!s || !Number.isFinite(s)) && (s = 1), {
955
- x: o,
956
- y: s
957
- };
958
- }
959
- const Kn = /* @__PURE__ */ M(0);
960
- function qn(e) {
961
- let t = L(e);
962
- return !rt() || !t.visualViewport ? Kn : {
963
- x: t.visualViewport.offsetLeft,
964
- y: t.visualViewport.offsetTop
965
- };
966
- }
967
- function Jn(e, t, n) {
968
- return t === void 0 && (t = !1), !n || t && n !== L(e) ? !1 : t;
969
- }
970
- function Yn(e, t, n, r) {
971
- t === void 0 && (t = !1), n === void 0 && (n = !1);
972
- let i = e.getBoundingClientRect(), a = Wn(e), o = M(1);
973
- t && (r ? z(r) && (o = Gn(r)) : o = Gn(e));
974
- let s = Jn(a, n, r) ? qn(a) : M(0), c = (i.left + s.x) / o.x, l = (i.top + s.y) / o.y, u = i.width / o.x, d = i.height / o.y;
975
- if (a) {
976
- let e = L(a), t = r && z(r) ? L(r) : r, n = e, i = lt(n);
977
- for (; i && r && t !== n;) {
978
- let e = Gn(i), t = i.getBoundingClientRect(), r = V(i), a = t.left + (i.clientLeft + parseFloat(r.paddingLeft)) * e.x, o = t.top + (i.clientTop + parseFloat(r.paddingTop)) * e.y;
979
- c *= e.x, l *= e.y, u *= e.x, d *= e.y, c += a, l += o, n = L(i), i = lt(n);
980
- }
981
- }
982
- return De({
983
- width: u,
984
- height: d,
985
- x: c,
986
- y: l
987
- });
988
- }
989
- function Xn(e, t) {
990
- let n = ot(e).scrollLeft;
991
- return t ? t.left + n : Yn(R(e)).left + n;
992
- }
993
- function Zn(e, t, n) {
994
- n === void 0 && (n = !1);
995
- let r = e.getBoundingClientRect(), i = r.left + t.scrollLeft - (n ? 0 : Xn(e, r)), a = r.top + t.scrollTop;
996
- return {
997
- x: i,
998
- y: a
999
- };
1000
- }
1001
- function Qn(e) {
1002
- let { elements: t, rect: n, offsetParent: r, strategy: i } = e, a = i === "fixed", o = R(r), s = t ? Ze(t.floating) : !1;
1003
- if (r === o || s && a) return n;
1004
- let c = {
1005
- scrollLeft: 0,
1006
- scrollTop: 0
1007
- }, l = M(1), u = M(0), d = B(r);
1008
- if ((d || !d && !a) && ((Ue(r) !== "body" || qe(o)) && (c = ot(r)), B(r))) {
1009
- let e = Yn(r);
1010
- l = Gn(r), u.x = e.x + r.clientLeft, u.y = e.y + r.clientTop;
1011
- }
1012
- let f = o && !d && !a ? Zn(o, c, !0) : M(0);
1013
- return {
1014
- width: n.width * l.x,
1015
- height: n.height * l.y,
1016
- x: n.x * l.x - c.scrollLeft * l.x + u.x + f.x,
1017
- y: n.y * l.y - c.scrollTop * l.y + u.y + f.y
1018
- };
1019
- }
1020
- function $n(e) {
1021
- return Array.from(e.getClientRects());
1022
- }
1023
- function er(e) {
1024
- let t = R(e), n = ot(e), r = e.ownerDocument.body, i = A(t.scrollWidth, t.clientWidth, r.scrollWidth, r.clientWidth), a = A(t.scrollHeight, t.clientHeight, r.scrollHeight, r.clientHeight), o = -n.scrollLeft + Xn(e), s = -n.scrollTop;
1025
- return V(r).direction === "rtl" && (o += A(t.clientWidth, r.clientWidth) - i), {
1026
- width: i,
1027
- height: a,
1028
- x: o,
1029
- y: s
1030
- };
1031
- }
1032
- function tr(e, t) {
1033
- let n = L(e), r = R(e), i = n.visualViewport, a = r.clientWidth, o = r.clientHeight, s = 0, c = 0;
1034
- if (i) {
1035
- a = i.width, o = i.height;
1036
- let e = rt();
1037
- (!e || e && t === "fixed") && (s = i.offsetLeft, c = i.offsetTop);
1038
- }
1039
- return {
1040
- width: a,
1041
- height: o,
1042
- x: s,
1043
- y: c
1044
- };
1045
- }
1046
- function nr(e, t) {
1047
- let n = Yn(e, !0, t === "fixed"), r = n.top + e.clientTop, i = n.left + e.clientLeft, a = B(e) ? Gn(e) : M(1), o = e.clientWidth * a.x, s = e.clientHeight * a.y, c = i * a.x, l = r * a.y;
1048
- return {
1049
- width: o,
1050
- height: s,
1051
- x: c,
1052
- y: l
1053
- };
1054
- }
1055
- function rr(e, t, n) {
1056
- let r;
1057
- if (t === "viewport") r = tr(e, n);
1058
- else if (t === "document") r = er(R(e));
1059
- else if (z(t)) r = nr(t, n);
1060
- else {
1061
- let n = qn(e);
1062
- r = {
1063
- x: t.x - n.x,
1064
- y: t.y - n.y,
1065
- width: t.width,
1066
- height: t.height
1067
- };
1068
- }
1069
- return De(r);
1070
- }
1071
- function ir(e, t) {
1072
- let n = H(e);
1073
- return n === t || !z(n) || at(n) ? !1 : V(n).position === "fixed" || ir(n, t);
1074
- }
1075
- function ar(e, t) {
1076
- let n = t.get(e);
1077
- if (n) return n;
1078
- let r = ct(e, [], !1).filter((e) => z(e) && Ue(e) !== "body"), i = null, a = V(e).position === "fixed", o = a ? H(e) : e;
1079
- for (; z(o) && !at(o);) {
1080
- let t = V(o), n = tt(o);
1081
- !n && t.position === "fixed" && (i = null);
1082
- let s = a ? !n && !i : !n && t.position === "static" && !!i && ["absolute", "fixed"].includes(i.position) || qe(o) && !n && ir(e, o);
1083
- s ? r = r.filter((e) => e !== o) : i = t, o = H(o);
1084
- }
1085
- return t.set(e, r), r;
1086
- }
1087
- function or(e) {
1088
- let { element: t, boundary: n, rootBoundary: r, strategy: i } = e, a = n === "clippingAncestors" ? Ze(t) ? [] : ar(t, this._c) : [].concat(n), o = [...a, r], s = o[0], c = o.reduce((e, n) => {
1089
- let r = rr(t, n, i);
1090
- return e.top = A(r.top, e.top), e.right = k(r.right, e.right), e.bottom = k(r.bottom, e.bottom), e.left = A(r.left, e.left), e;
1091
- }, rr(t, s, i));
1092
- return {
1093
- width: c.right - c.left,
1094
- height: c.bottom - c.top,
1095
- x: c.left,
1096
- y: c.top
1097
- };
1098
- }
1099
- function sr(e) {
1100
- let { width: t, height: n } = Un(e);
1101
- return {
1102
- width: t,
1103
- height: n
1104
- };
1105
- }
1106
- function cr(e, t, n) {
1107
- let r = B(t), i = R(t), a = n === "fixed", o = Yn(e, !0, a, t), s = {
1108
- scrollLeft: 0,
1109
- scrollTop: 0
1110
- }, c = M(0);
1111
- function l() {
1112
- c.x = Xn(i);
1113
- }
1114
- if (r || !r && !a) if ((Ue(t) !== "body" || qe(i)) && (s = ot(t)), r) {
1115
- let e = Yn(t, !0, a, t);
1116
- c.x = e.x + t.clientLeft, c.y = e.y + t.clientTop;
1117
- } else i && l();
1118
- a && !r && i && l();
1119
- let u = i && !r && !a ? Zn(i, s) : M(0), d = o.left + s.scrollLeft - c.x - u.x, f = o.top + s.scrollTop - c.y - u.y;
1120
- return {
1121
- x: d,
1122
- y: f,
1123
- width: o.width,
1124
- height: o.height
1125
- };
1126
- }
1127
- function lr(e) {
1128
- return V(e).position === "static";
1129
- }
1130
- function ur(e, t) {
1131
- if (!B(e) || V(e).position === "fixed") return null;
1132
- if (t) return t(e);
1133
- let n = e.offsetParent;
1134
- return R(e) === n && (n = n.ownerDocument.body), n;
1135
- }
1136
- function dr(e, t) {
1137
- let n = L(e);
1138
- if (Ze(e)) return n;
1139
- if (!B(e)) {
1140
- let t = H(e);
1141
- for (; t && !at(t);) {
1142
- if (z(t) && !lr(t)) return t;
1143
- t = H(t);
1144
- }
1145
- return n;
1146
- }
1147
- let r = ur(e, t);
1148
- for (; r && Ye(r) && lr(r);) r = ur(r, t);
1149
- return r && at(r) && lr(r) && !tt(r) ? n : r || nt(e) || n;
1150
- }
1151
- const fr = async function(e) {
1152
- let t = this.getOffsetParent || dr, n = this.getDimensions, r = await n(e.floating);
1153
- return {
1154
- reference: cr(e.reference, await t(e.floating), e.strategy),
1155
- floating: {
1156
- x: 0,
1157
- y: 0,
1158
- width: r.width,
1159
- height: r.height
1160
- }
1161
- };
1162
- };
1163
- function pr(e) {
1164
- return V(e).direction === "rtl";
1165
- }
1166
- const mr = {
1167
- convertOffsetParentRelativeRectToViewportRelativeRect: Qn,
1168
- getDocumentElement: R,
1169
- getClippingRect: or,
1170
- getOffsetParent: dr,
1171
- getElementRects: fr,
1172
- getClientRects: $n,
1173
- getDimensions: sr,
1174
- getScale: Gn,
1175
- isElement: z,
1176
- isRTL: pr
1177
- };
1178
- function hr(e, t) {
1179
- return e.x === t.x && e.y === t.y && e.width === t.width && e.height === t.height;
1180
- }
1181
- function gr(e, t) {
1182
- let n = null, r, i = R(e);
1183
- function a() {
1184
- var e;
1185
- clearTimeout(r), (e = n) == null || e.disconnect(), n = null;
1186
- }
1187
- function o(s, c) {
1188
- s === void 0 && (s = !1), c === void 0 && (c = 1), a();
1189
- let l = e.getBoundingClientRect(), { left: u, top: d, width: f, height: p } = l;
1190
- if (s || t(), !f || !p) return;
1191
- let m = se(d), h = se(i.clientWidth - (u + f)), g = se(i.clientHeight - (d + p)), _ = se(u), v = -m + "px " + -h + "px " + -g + "px " + -_ + "px", y = {
1192
- rootMargin: v,
1193
- threshold: A(0, k(1, c)) || 1
1194
- }, b = !0;
1195
- function x(t) {
1196
- let n = t[0].intersectionRatio;
1197
- if (n !== c) {
1198
- if (!b) return o();
1199
- n ? o(!1, n) : r = setTimeout(() => {
1200
- o(!1, 1e-7);
1201
- }, 1e3);
1202
- }
1203
- n === 1 && !hr(l, e.getBoundingClientRect()) && o(), b = !1;
1204
- }
1205
- try {
1206
- n = new IntersectionObserver(x, {
1207
- ...y,
1208
- root: i.ownerDocument
1209
- });
1210
- } catch {
1211
- n = new IntersectionObserver(x, y);
1212
- }
1213
- n.observe(e);
1214
- }
1215
- return o(!0), a;
1216
- }
1217
- function _r(e, t, n, r) {
1218
- r === void 0 && (r = {});
1219
- let { ancestorScroll: i = !0, ancestorResize: a = !0, elementResize: o = typeof ResizeObserver == "function", layoutShift: s = typeof IntersectionObserver == "function", animationFrame: c = !1 } = r, l = Wn(e), u = i || a ? [...l ? ct(l) : [], ...ct(t)] : [];
1220
- u.forEach((e) => {
1221
- i && e.addEventListener("scroll", n, { passive: !0 }), a && e.addEventListener("resize", n);
1222
- });
1223
- let d = l && s ? gr(l, n) : null, f = -1, p = null;
1224
- o && (p = new ResizeObserver((e) => {
1225
- let [r] = e;
1226
- r && r.target === l && p && (p.unobserve(t), cancelAnimationFrame(f), f = requestAnimationFrame(() => {
1227
- var e;
1228
- (e = p) == null || e.observe(t);
1229
- })), n();
1230
- }), l && !c && p.observe(l), p.observe(t));
1231
- let m, h = c ? Yn(e) : null;
1232
- c && g();
1233
- function g() {
1234
- let t = Yn(e);
1235
- h && !hr(h, t) && n(), h = t, m = requestAnimationFrame(g);
1236
- }
1237
- return n(), () => {
1238
- var e;
1239
- u.forEach((e) => {
1240
- i && e.removeEventListener("scroll", n), a && e.removeEventListener("resize", n);
1241
- }), d?.(), (e = p) == null || e.disconnect(), p = null, c && cancelAnimationFrame(m);
1242
- };
1243
- }
1244
- const vr = Re, yr = ze, br = Me, xr = Ve, Sr = Fe, Cr = je, wr = Be, Tr = (e, t, n) => {
1245
- let r = /* @__PURE__ */ new Map(), i = {
1246
- platform: mr,
1247
- ...n
1248
- }, a = {
1249
- ...i.platform,
1250
- _c: r
1251
- };
1252
- return ke(e, t, {
1253
- ...i,
1254
- platform: a
1255
- });
1256
- };
1257
- function Er(e = 0, t = 0, n = 0, r = 0) {
1258
- if (typeof DOMRect == "function") return new DOMRect(e, t, n, r);
1259
- let i = {
1260
- x: e,
1261
- y: t,
1262
- width: n,
1263
- height: r,
1264
- top: t,
1265
- right: e + n,
1266
- bottom: t + r,
1267
- left: e
1268
- };
1269
- return {
1270
- ...i,
1271
- toJSON: () => i
1272
- };
1273
- }
1274
- function Dr(e) {
1275
- if (!e) return Er();
1276
- let { x: t, y: n, width: r, height: i } = e;
1277
- return Er(t, n, r, i);
1278
- }
1279
- function Or(e, t) {
1280
- return {
1281
- contextElement: U(e) ? e : void 0,
1282
- getBoundingClientRect: () => {
1283
- let n = e, r = t?.(n);
1284
- return r || !n ? Dr(r) : n.getBoundingClientRect();
1285
- }
1286
- };
1287
- }
1288
- const kr = (e) => ({
1289
- variable: e,
1290
- reference: `var(${e})`
1291
- }), J = {
1292
- arrowSize: kr("--arrow-size"),
1293
- arrowSizeHalf: kr("--arrow-size-half"),
1294
- arrowBg: kr("--arrow-background"),
1295
- transformOrigin: kr("--transform-origin"),
1296
- arrowOffset: kr("--arrow-offset")
1297
- };
1298
- function Ar(e) {
1299
- return {
1300
- top: "bottom center",
1301
- "top-start": e ? `${e.x}px bottom` : "left bottom",
1302
- "top-end": e ? `${e.x}px bottom` : "right bottom",
1303
- bottom: "top center",
1304
- "bottom-start": e ? `${e.x}px top` : "top left",
1305
- "bottom-end": e ? `${e.x}px top` : "top right",
1306
- left: "right center",
1307
- "left-start": e ? `right ${e.y}px` : "right top",
1308
- "left-end": e ? `right ${e.y}px` : "right bottom",
1309
- right: "left center",
1310
- "right-start": e ? `left ${e.y}px` : "left top",
1311
- "right-end": e ? `left ${e.y}px` : "left bottom"
1312
- };
1313
- }
1314
- const jr = {
1315
- name: "transformOrigin",
1316
- fn({ placement: e, elements: t, middlewareData: n }) {
1317
- let { arrow: r } = n, i = Ar(r)[e], { floating: a } = t;
1318
- return a.style.setProperty(J.transformOrigin.variable, i), { data: { transformOrigin: i } };
1319
- }
1320
- }, Mr = {
1321
- name: "rects",
1322
- fn({ rects: e }) {
1323
- return { data: e };
1324
- }
1325
- };
1326
- function Nr(e) {
1327
- if (e) return {
1328
- name: "shiftArrow",
1329
- fn({ placement: t, middlewareData: n }) {
1330
- if (!n.arrow) return {};
1331
- let { x: r, y: i } = n.arrow, a = t.split("-")[0];
1332
- return Object.assign(e.style, {
1333
- left: r == null ? "" : `${r}px`,
1334
- top: i == null ? "" : `${i}px`,
1335
- [a]: `calc(100% + ${J.arrowOffset.reference})`
1336
- }), {};
1337
- }
1338
- };
1339
- }
1340
- function Pr(e) {
1341
- let [t, n] = e.split("-");
1342
- return {
1343
- side: t,
1344
- align: n,
1345
- hasAlign: n != null
1346
- };
1347
- }
1348
- const Fr = {
1349
- strategy: "absolute",
1350
- placement: "bottom",
1351
- listeners: !0,
1352
- gutter: 8,
1353
- flip: !0,
1354
- slide: !0,
1355
- overlap: !1,
1356
- sameWidth: !1,
1357
- fitViewport: !1,
1358
- overflowPadding: 8,
1359
- arrowPadding: 4
1360
- };
1361
- function Ir(e, t) {
1362
- let n = e.devicePixelRatio || 1;
1363
- return Math.round(t * n) / n;
1364
- }
1365
- function Lr(e) {
1366
- return vn(e.boundary);
1367
- }
1368
- function Rr(e, t) {
1369
- if (e) return Cr({
1370
- element: e,
1371
- padding: t.arrowPadding
1372
- });
1373
- }
1374
- function zr(e, t) {
1375
- if (!Dn(t.offset ?? t.gutter)) return vr(({ placement: n }) => {
1376
- let r = (e?.clientHeight || 0) / 2, i = t.offset?.mainAxis ?? t.gutter, a = typeof i == "number" ? i + r : i ?? r, { hasAlign: o } = Pr(n), s = o ? void 0 : t.shift, c = t.offset?.crossAxis ?? s;
1377
- return zn({
1378
- crossAxis: c,
1379
- mainAxis: a,
1380
- alignmentAxis: t.shift
1381
- });
1382
- });
1383
- }
1384
- function Br(e) {
1385
- if (e.flip) return br({
1386
- boundary: Lr(e),
1387
- padding: e.overflowPadding,
1388
- fallbackPlacements: e.flip === !0 ? void 0 : e.flip
1389
- });
1390
- }
1391
- function Vr(e) {
1392
- if (!(!e.slide && !e.overlap)) return yr({
1393
- boundary: Lr(e),
1394
- mainAxis: e.slide,
1395
- crossAxis: e.overlap,
1396
- padding: e.overflowPadding,
1397
- limiter: wr()
1398
- });
1399
- }
1400
- function Hr(e) {
1401
- return xr({
1402
- padding: e.overflowPadding,
1403
- apply({ elements: e, rects: t, availableHeight: n, availableWidth: r }) {
1404
- let i = e.floating, a = Math.round(t.reference.width);
1405
- r = Math.floor(r), n = Math.floor(n), i.style.setProperty("--reference-width", `${a}px`), i.style.setProperty("--available-width", `${r}px`), i.style.setProperty("--available-height", `${n}px`);
1406
- }
1407
- });
1408
- }
1409
- function Ur(e) {
1410
- if (e.hideWhenDetached) return Sr({
1411
- strategy: "referenceHidden",
1412
- boundary: e.boundary?.() ?? "clippingAncestors"
1413
- });
1414
- }
1415
- function Wr(e) {
1416
- return e ? e === !0 ? {
1417
- ancestorResize: !0,
1418
- ancestorScroll: !0,
1419
- elementResize: !0,
1420
- layoutShift: !0
1421
- } : e : {};
1422
- }
1423
- function Gr(e, t, n = {}) {
1424
- let r = Or(e, n.getAnchorRect);
1425
- if (!t || !r) return;
1426
- let i = Object.assign({}, Fr, n), a = t.querySelector("[data-part=arrow]"), o = [
1427
- zr(a, i),
1428
- Br(i),
1429
- Vr(i),
1430
- Rr(a, i),
1431
- Nr(a),
1432
- jr,
1433
- Hr(i),
1434
- Ur(i),
1435
- Mr
1436
- ], { placement: s, strategy: c, onComplete: l, onPositioned: u } = i, d = async () => {
1437
- if (!r || !t) return;
1438
- let e = await Tr(r, t, {
1439
- placement: s,
1440
- middleware: o,
1441
- strategy: c
1442
- });
1443
- l?.(e), u?.({ placed: !0 });
1444
- let n = Ot(t), a = Ir(n, e.x), d = Ir(n, e.y);
1445
- if (t.style.setProperty("--x", `${a}px`), t.style.setProperty("--y", `${d}px`), i.hideWhenDetached) {
1446
- let n = e.middlewareData.hide?.referenceHidden;
1447
- n ? (t.style.setProperty("visibility", "hidden"), t.style.setProperty("pointer-events", "none")) : (t.style.removeProperty("visibility"), t.style.removeProperty("pointer-events"));
1448
- }
1449
- let f = t.firstElementChild;
1450
- if (f) {
1451
- let e = Mt(f);
1452
- t.style.setProperty("--z-index", e.zIndex);
1453
- }
1454
- }, f = async () => {
1455
- n.updatePosition ? (await n.updatePosition({ updatePosition: d }), u?.({ placed: !0 })) : await d();
1456
- }, p = Wr(i.listeners), m = i.listeners ? _r(r, t, f, p) : yn;
1457
- return f(), () => {
1458
- m?.(), u?.({ placed: !1 });
1459
- };
1460
- }
1461
- function Kr(e, t, n = {}) {
1462
- let { defer: r,...i } = n, a = r ? G : (e) => e(), o = [];
1463
- return o.push(a(() => {
1464
- let n = typeof e == "function" ? e() : e, r = typeof t == "function" ? t() : t;
1465
- o.push(Gr(n, r, i));
1466
- })), () => {
1467
- o.forEach((e) => e?.());
1468
- };
1469
- }
1470
- const qr = {
1471
- bottom: "rotate(45deg)",
1472
- left: "rotate(135deg)",
1473
- top: "rotate(225deg)",
1474
- right: "rotate(315deg)"
1475
- };
1476
- function Jr(e = {}) {
1477
- let { placement: t, sameWidth: n, fitViewport: r, strategy: i = "absolute" } = e;
1478
- return {
1479
- arrow: {
1480
- position: "absolute",
1481
- width: J.arrowSize.reference,
1482
- height: J.arrowSize.reference,
1483
- [J.arrowSizeHalf.variable]: `calc(${J.arrowSize.reference} / 2)`,
1484
- [J.arrowOffset.variable]: `calc(${J.arrowSizeHalf.reference} * -1)`
1485
- },
1486
- arrowTip: {
1487
- transform: t ? qr[t.split("-")[0]] : void 0,
1488
- background: J.arrowBg.reference,
1489
- top: "0",
1490
- left: "0",
1491
- width: "100%",
1492
- height: "100%",
1493
- position: "absolute",
1494
- zIndex: "inherit"
1495
- },
1496
- floating: {
1497
- position: i,
1498
- isolation: "isolate",
1499
- minWidth: n ? void 0 : "max-content",
1500
- width: n ? "var(--reference-width)" : void 0,
1501
- maxWidth: r ? "var(--available-width)" : void 0,
1502
- maxHeight: r ? "var(--available-height)" : void 0,
1503
- top: "0px",
1504
- left: "0px",
1505
- transform: t ? "translate3d(var(--x), var(--y), 0)" : "translate3d(0, -100vh, 0)",
1506
- zIndex: "var(--z-index)"
1507
- }
1508
- };
1509
- }
1510
- let Yr = /* @__PURE__ */ new WeakMap(), Xr = /* @__PURE__ */ new WeakMap(), Zr = {}, Qr = 0;
1511
- function $r(e) {
1512
- return e && (e.host || $r(e.parentNode));
1513
- }
1514
- function ei(e, t) {
1515
- return t.map((t) => {
1516
- if (e.contains(t)) return t;
1517
- let n = $r(t);
1518
- return n && e.contains(n) ? n : (console.error("[@destyler/aria-hidden] target", t, "in not contained inside", e, ". Doing nothing"), null);
1519
- }).filter((e) => !!e);
1520
- }
1521
- function ti(e) {
1522
- return e.localName === "next-route-announcer" || e.localName === "script" || e.hasAttribute("aria-live") ? !0 : e.matches("[data-live-announcer]");
1523
- }
1524
- function ni(e, t) {
1525
- let { parentNode: n, markerName: r, controlAttribute: i, explicitBooleanValue: a } = t, o = ei(n, Array.isArray(e) ? e : [e]);
1526
- Zr[r] ||= /* @__PURE__ */ new WeakMap();
1527
- let s = Zr[r], c = [], l = /* @__PURE__ */ new Set(), u = new Set(o), d = (e) => {
1528
- !e || l.has(e) || (l.add(e), d(e.parentNode));
1529
- };
1530
- o.forEach(d);
1531
- let f = (e) => {
1532
- !e || u.has(e) || Array.prototype.forEach.call(e.children, (e) => {
1533
- if (l.has(e)) f(e);
1534
- else try {
1535
- if (ti(e)) return;
1536
- let t = e.getAttribute(i), n = a ? t === "true" : t !== null && t !== "false", o = (Yr.get(e) || 0) + 1, l = (s.get(e) || 0) + 1;
1537
- Yr.set(e, o), s.set(e, l), c.push(e), o === 1 && n && Xr.set(e, !0), l === 1 && e.setAttribute(r, ""), n || e.setAttribute(i, a ? "true" : "");
1538
- } catch (t) {
1539
- console.error("[@destyler/aria-hidden] cannot operate on ", e, t);
1540
- }
1541
- });
1542
- };
1543
- return f(n), l.clear(), Qr++, () => {
1544
- c.forEach((e) => {
1545
- let t = Yr.get(e) - 1, n = s.get(e) - 1;
1546
- Yr.set(e, t), s.set(e, n), t || (Xr.has(e) || e.removeAttribute(i), Xr.delete(e)), n || e.removeAttribute(r);
1547
- }), Qr--, Qr || (Yr = /* @__PURE__ */ new WeakMap(), Yr = /* @__PURE__ */ new WeakMap(), Xr = /* @__PURE__ */ new WeakMap(), Zr = {});
1548
- };
1549
- }
1550
- function ri(e) {
1551
- let t = Array.isArray(e) ? e[0] : e;
1552
- return t.ownerDocument.body;
1553
- }
1554
- function ii(e, t = ri(e), n = "data-aria-hidden") {
1555
- if (t) return ni(e, {
1556
- parentNode: t,
1557
- markerName: n,
1558
- controlAttribute: "aria-hidden",
1559
- explicitBooleanValue: !0
1560
- });
1561
- }
1562
- function ai(e) {
1563
- let t = requestAnimationFrame(() => e());
1564
- return () => cancelAnimationFrame(t);
1565
- }
1566
- function oi(e, t = {}) {
1567
- let { defer: n = !0 } = t, r = n ? ai : (e) => e(), i = [];
1568
- return i.push(r(() => {
1569
- let t = typeof e == "function" ? e() : e, n = t.filter(Boolean);
1570
- n.length !== 0 && i.push(ii(n));
1571
- })), () => {
1572
- i.forEach((e) => e?.());
1573
- };
1574
- }
1575
- function si(e) {
1576
- let t = {
1577
- each(t) {
1578
- for (let n = 0; n < e.frames?.length; n += 1) {
1579
- let r = e.frames[n];
1580
- r && t(r);
1581
- }
1582
- },
1583
- addEventListener(e, n, r) {
1584
- return t.each((t) => {
1585
- try {
1586
- t.document.addEventListener(e, n, r);
1587
- } catch {}
1588
- }), () => {
1589
- try {
1590
- t.removeEventListener(e, n, r);
1591
- } catch {}
1592
- };
1593
- },
1594
- removeEventListener(e, n, r) {
1595
- t.each((t) => {
1596
- try {
1597
- t.document.removeEventListener(e, n, r);
1598
- } catch {}
1599
- });
1600
- }
1601
- };
1602
- return t;
1603
- }
1604
- function ci(e) {
1605
- let t = e.frameElement == null ? null : e.parent;
1606
- return {
1607
- addEventListener: (e, n, r) => {
1608
- try {
1609
- t?.addEventListener(e, n, r);
1610
- } catch {}
1611
- return () => {
1612
- try {
1613
- t?.removeEventListener(e, n, r);
1614
- } catch {}
1615
- };
1616
- },
1617
- removeEventListener: (e, n, r) => {
1618
- try {
1619
- t?.removeEventListener(e, n, r);
1620
- } catch {}
1621
- }
1622
- };
1623
- }
1624
- const li = "pointerdown.outside", ui = "focus.outside";
1625
- function di(e) {
1626
- for (let t of e) if (U(t) && Qt(t)) return !0;
1627
- return !1;
1628
- }
1629
- const fi = (e) => "clientY" in e;
1630
- function pi(e, t) {
1631
- if (!fi(t) || !e) return !1;
1632
- let n = e.getBoundingClientRect();
1633
- return n.width === 0 || n.height === 0 ? !1 : n.top <= t.clientY && t.clientY <= n.top + n.height && n.left <= t.clientX && t.clientX <= n.left + n.width;
1634
- }
1635
- function mi(e, t) {
1636
- return e.y <= t.y && t.y <= e.y + e.height && e.x <= t.x && t.x <= e.x + e.width;
1637
- }
1638
- function hi(e, t) {
1639
- if (!t || !fi(e)) return !1;
1640
- let n = t.scrollHeight > t.clientHeight, r = n && e.clientX > t.offsetLeft + t.clientWidth, i = t.scrollWidth > t.clientWidth, a = i && e.clientY > t.offsetTop + t.clientHeight, o = {
1641
- x: t.offsetLeft,
1642
- y: t.offsetTop,
1643
- width: t.clientWidth + (n ? 16 : 0),
1644
- height: t.clientHeight + (i ? 16 : 0)
1645
- }, s = {
1646
- x: e.clientX,
1647
- y: e.clientY
1648
- };
1649
- return mi(o, s) ? r || a : !1;
1650
- }
1651
- function gi(e, t) {
1652
- let { exclude: n, onFocusOutside: r, onPointerDownOutside: i, onInteractOutside: a, defer: o } = t;
1653
- if (!e) return;
1654
- let s = Et(e), c = Ot(e), l = si(c), u = ci(c);
1655
- function d(t) {
1656
- let r = Ht(t);
1657
- if (!U(r) || !r.isConnected || Tt(e, r) || pi(e, t)) return !1;
1658
- let i = s.querySelector(`[aria-controls="${e.id}"]`);
1659
- if (i) {
1660
- let e = on(i);
1661
- if (hi(t, e)) return !1;
1662
- }
1663
- let a = on(e);
1664
- return hi(t, a) ? !1 : !n?.(r);
1665
- }
1666
- let f = /* @__PURE__ */ new Set();
1667
- function p(t) {
1668
- function n() {
1669
- let n = o ? G : (e) => e(), r = t.composedPath?.() ?? [t.target];
1670
- n(() => {
1671
- if (!(!e || !d(t))) {
1672
- if (i || a) {
1673
- let t = bn(i, a);
1674
- e.addEventListener(li, t, { once: !0 });
1675
- }
1676
- vi(e, li, {
1677
- bubbles: !1,
1678
- cancelable: !0,
1679
- detail: {
1680
- originalEvent: t,
1681
- contextmenu: Ut(t),
1682
- focusable: di(r)
1683
- }
1684
- });
1685
- }
1686
- });
1687
- }
1688
- t.pointerType === "touch" ? (f.forEach((e) => e()), f.add(W(s, "click", n, { once: !0 })), f.add(u.addEventListener("click", n, { once: !0 })), f.add(l.addEventListener("click", n, { once: !0 }))) : n();
1689
- }
1690
- let m = /* @__PURE__ */ new Set(), h = setTimeout(() => {
1691
- m.add(W(s, "pointerdown", p, !0)), m.add(u.addEventListener("pointerdown", p, !0)), m.add(l.addEventListener("pointerdown", p, !0));
1692
- }, 0);
1693
- function g(t) {
1694
- let n = o ? G : (e) => e();
1695
- n(() => {
1696
- if (!(!e || !d(t))) {
1697
- if (r || a) {
1698
- let t = bn(r, a);
1699
- e.addEventListener(ui, t, { once: !0 });
1700
- }
1701
- vi(e, ui, {
1702
- bubbles: !1,
1703
- cancelable: !0,
1704
- detail: {
1705
- originalEvent: t,
1706
- contextmenu: !1,
1707
- focusable: Qt(Ht(t))
1708
- }
1709
- });
1710
- }
1711
- });
1712
- }
1713
- return m.add(W(s, "focusin", g, !0)), m.add(u.addEventListener("focusin", g, !0)), m.add(l.addEventListener("focusin", g, !0)), () => {
1714
- clearTimeout(h), f.forEach((e) => e()), m.forEach((e) => e());
1715
- };
1716
- }
1717
- function _i(e, t) {
1718
- let { defer: n } = t, r = n ? G : (e) => e(), i = [];
1719
- return i.push(r(() => {
1720
- let n = typeof e == "function" ? e() : e;
1721
- i.push(gi(n, t));
1722
- })), () => {
1723
- i.forEach((e) => e?.());
1724
- };
1725
- }
1726
- function vi(e, t, n) {
1727
- let r = e.ownerDocument.defaultView || window, i = new r.CustomEvent(t, n);
1728
- return e.dispatchEvent(i);
1729
- }
1730
- function yi(e, t) {
1731
- let n = (e) => {
1732
- e.key === "Escape" && (e.isComposing || t?.(e));
1733
- };
1734
- return W(Et(e), "keydown", n, { capture: !0 });
1735
- }
1736
- const Y = {
1737
- layers: [],
1738
- branches: [],
1739
- count() {
1740
- return this.layers.length;
1741
- },
1742
- pointerBlockingLayers() {
1743
- return this.layers.filter((e) => e.pointerBlocking);
1744
- },
1745
- topMostPointerBlockingLayer() {
1746
- return [...this.pointerBlockingLayers()].slice(-1)[0];
1747
- },
1748
- hasPointerBlockingLayer() {
1749
- return this.pointerBlockingLayers().length > 0;
1750
- },
1751
- isBelowPointerBlockingLayer(e) {
1752
- let t = this.indexOf(e), n = this.topMostPointerBlockingLayer() ? this.indexOf(this.topMostPointerBlockingLayer()?.node) : -1;
1753
- return t < n;
1754
- },
1755
- isTopMost(e) {
1756
- let t = this.layers[this.count() - 1];
1757
- return t?.node === e;
1758
- },
1759
- getNestedLayers(e) {
1760
- return Array.from(this.layers).slice(this.indexOf(e) + 1);
1761
- },
1762
- isInNestedLayer(e, t) {
1763
- return this.getNestedLayers(e).some((e) => Tt(e.node, t));
1764
- },
1765
- isInBranch(e) {
1766
- return Array.from(this.branches).some((t) => Tt(t, e));
1767
- },
1768
- add(e) {
1769
- let t = this.layers.push(e);
1770
- e.node.style.setProperty("--layer-index", `${t}`);
1771
- },
1772
- addBranch(e) {
1773
- this.branches.push(e);
1774
- },
1775
- remove(e) {
1776
- let t = this.indexOf(e);
1777
- if (!(t < 0)) {
1778
- if (t < this.count() - 1) {
1779
- let t = this.getNestedLayers(e);
1780
- t.forEach((e) => e.dismiss());
1781
- }
1782
- this.layers.splice(t, 1), e.style.removeProperty("--layer-index");
1783
- }
1784
- },
1785
- removeBranch(e) {
1786
- let t = this.branches.indexOf(e);
1787
- t >= 0 && this.branches.splice(t, 1);
1788
- },
1789
- indexOf(e) {
1790
- return this.layers.findIndex((t) => t.node === e);
1791
- },
1792
- dismiss(e) {
1793
- this.layers[this.indexOf(e)]?.dismiss();
1794
- },
1795
- clear() {
1796
- this.remove(this.layers[0].node);
1797
- }
1798
- };
1799
- let bi;
1800
- function xi() {
1801
- Y.layers.forEach(({ node: e }) => {
1802
- e.style.pointerEvents = Y.isBelowPointerBlockingLayer(e) ? "none" : "auto";
1803
- });
1804
- }
1805
- function Si(e) {
1806
- e.style.pointerEvents = "";
1807
- }
1808
- function Ci(e, t) {
1809
- let n = Et(e), r = [];
1810
- if (Y.hasPointerBlockingLayer() && !n.body.hasAttribute("data-inert") && (bi = document.body.style.pointerEvents, queueMicrotask(() => {
1811
- n.body.style.pointerEvents = "none", n.body.setAttribute("data-inert", "");
1812
- })), t) {
1813
- let e = gn(t, (e) => {
1814
- r.push(mn(e, { pointerEvents: "auto" }));
1815
- });
1816
- r.push(e);
1817
- }
1818
- return () => {
1819
- Y.hasPointerBlockingLayer() || (queueMicrotask(() => {
1820
- n.body.style.pointerEvents = bi, n.body.removeAttribute("data-inert"), n.body.style.length === 0 && n.body.removeAttribute("style");
1821
- }), r.forEach((e) => e()));
1822
- };
1823
- }
1824
- function wi(e, t) {
1825
- if (!e) throw Error("[@destyler/dismissable] node is `null` or `undefined`");
1826
- let { onDismiss: n, pointerBlocking: r, exclude: i, debug: a } = t, o = {
1827
- dismiss: n,
1828
- node: e,
1829
- pointerBlocking: r
1830
- };
1831
- Y.add(o), xi();
1832
- function s(r) {
1833
- let i = Ht(r.detail.originalEvent);
1834
- Y.isBelowPointerBlockingLayer(e) || Y.isInBranch(i) || (t.onPointerDownOutside?.(r), t.onInteractOutside?.(r), !r.defaultPrevented && (a && console.log("onPointerDownOutside:", r.detail.originalEvent), n?.()));
1835
- }
1836
- function c(e) {
1837
- let r = Ht(e.detail.originalEvent);
1838
- Y.isInBranch(r) || (t.onFocusOutside?.(e), t.onInteractOutside?.(e), !e.defaultPrevented && (a && console.log("onFocusOutside:", e.detail.originalEvent), n?.()));
1839
- }
1840
- function l(r) {
1841
- Y.isTopMost(e) && (t.onEscapeKeyDown?.(r), !r.defaultPrevented && n && (r.preventDefault(), n()));
1842
- }
1843
- function u(n) {
1844
- if (!e) return !1;
1845
- let r = typeof i == "function" ? i() : i, a = Array.isArray(r) ? r : [r], o = t.persistentElements?.map((e) => e()).filter(U);
1846
- return o && a.push(...o), a.some((e) => Tt(e, n)) || Y.isInNestedLayer(e, n);
1847
- }
1848
- let d = [
1849
- r ? Ci(e, t.persistentElements) : void 0,
1850
- yi(e, l),
1851
- _i(e, {
1852
- exclude: u,
1853
- onFocusOutside: c,
1854
- onPointerDownOutside: s,
1855
- defer: t.defer
1856
- })
1857
- ];
1858
- return () => {
1859
- Y.remove(e), xi(), Si(e), d.forEach((e) => e?.());
1860
- };
1861
- }
1862
- function Ti(e, t) {
1863
- let { defer: n } = t, r = n ? G : (e) => e(), i = [];
1864
- return i.push(r(() => {
1865
- let n = En(e) ? e() : e;
1866
- i.push(wi(n, t));
1867
- })), () => {
1868
- i.forEach((e) => e?.());
1869
- };
1870
- }
1871
- const Ei = (e) => e.key === "Tab", Di = (e, ...t) => typeof e == "function" ? e(...t) : e, Oi = (e) => !e.isComposing && e.key === "Escape", ki = (e) => setTimeout(e, 0);
1872
- function Ai(e) {
1873
- return e.localName === "input" && "select" in e && typeof e.select == "function";
1874
- }
1875
- const ji = {
1876
- activateTrap(e, t) {
1877
- if (e.length > 0) {
1878
- let n = e[e.length - 1];
1879
- n !== t && n.pause();
1880
- }
1881
- let n = e.indexOf(t);
1882
- n === -1 || e.splice(n, 1), e.push(t);
1883
- },
1884
- deactivateTrap(e, t) {
1885
- let n = e.indexOf(t);
1886
- n !== -1 && e.splice(n, 1), e.length > 0 && e[e.length - 1].unpause();
1887
- }
1888
- }, Mi = [];
1889
- var Ni = class {
1890
- trapStack;
1891
- config;
1892
- doc;
1893
- state = {
1894
- containers: [],
1895
- containerGroups: [],
1896
- tabbableGroups: [],
1897
- nodeFocusedBeforeActivation: null,
1898
- mostRecentlyFocusedNode: null,
1899
- active: !1,
1900
- paused: !1,
1901
- delayInitialFocusTimer: void 0,
1902
- recentNavEvent: void 0
1903
- };
1904
- get active() {
1905
- return this.state.active;
1906
- }
1907
- get paused() {
1908
- return this.state.paused;
1909
- }
1910
- constructor(e, t) {
1911
- this.trapStack = t.trapStack || Mi;
1912
- let n = {
1913
- returnFocusOnDeactivate: !0,
1914
- escapeDeactivates: !0,
1915
- delayInitialFocus: !0,
1916
- isKeyForward(e) {
1917
- return Ei(e) && !e.shiftKey;
1918
- },
1919
- isKeyBackward(e) {
1920
- return Ei(e) && e.shiftKey;
1921
- },
1922
- ...t
1923
- };
1924
- this.doc = n.document || Et(Array.isArray(e) ? e[0] : e), this.config = n, this.updateContainerElements(e), this.setupMutationObserver();
1925
- }
1926
- findContainerIndex(e, t) {
1927
- let n = typeof t?.composedPath == "function" ? t.composedPath() : void 0;
1928
- return this.state.containerGroups.findIndex(({ container: t, tabbableNodes: r }) => t.contains(e) || n?.includes(t) || r.find((t) => t === e));
1929
- }
1930
- updateTabbableNodes() {
1931
- if (this.state.containerGroups = this.state.containers.map((e) => {
1932
- let t = $t(e), n = Zt(e), r = t.length > 0 ? t[0] : void 0, i = t.length > 0 ? t[t.length - 1] : void 0, a = n.find((e) => en(e)), o = n.slice().reverse().find((e) => en(e)), s = !!t.find((e) => rn(e) > 0);
1933
- function c(e, r = !0) {
1934
- let i = t.indexOf(e);
1935
- return i < 0 ? r ? n.slice(n.indexOf(e) + 1).find((e) => en(e)) : n.slice(0, n.indexOf(e)).reverse().find((e) => en(e)) : t[i + (r ? 1 : -1)];
1936
- }
1937
- return {
1938
- container: e,
1939
- tabbableNodes: t,
1940
- focusableNodes: n,
1941
- posTabIndexesFound: s,
1942
- firstTabbableNode: r,
1943
- lastTabbableNode: i,
1944
- firstDomTabbableNode: a,
1945
- lastDomTabbableNode: o,
1946
- nextTabbableNode: c
1947
- };
1948
- }), this.state.tabbableGroups = this.state.containerGroups.filter((e) => e.tabbableNodes.length > 0), this.state.tabbableGroups.length <= 0 && !this.getNodeForOption("fallbackFocus")) throw Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");
1949
- if (this.state.containerGroups.find((e) => e.posTabIndexesFound) && this.state.containerGroups.length > 1) throw Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.");
1950
- }
1951
- listenerCleanups = [];
1952
- addListeners() {
1953
- if (this.state.active) return ji.activateTrap(this.trapStack, this), this.state.delayInitialFocusTimer = this.config.delayInitialFocus ? ki(() => {
1954
- this.tryFocus(this.getInitialFocusNode());
1955
- }) : this.tryFocus(this.getInitialFocusNode()), this.listenerCleanups.push(W(this.doc, "focusin", this.handleFocus, !0), W(this.doc, "mousedown", this.handlePointerDown, {
1956
- capture: !0,
1957
- passive: !1
1958
- }), W(this.doc, "touchstart", this.handlePointerDown, {
1959
- capture: !0,
1960
- passive: !1
1961
- }), W(this.doc, "click", this.handleClick, {
1962
- capture: !0,
1963
- passive: !1
1964
- }), W(this.doc, "keydown", this.handleTabKey, {
1965
- capture: !0,
1966
- passive: !1
1967
- }), W(this.doc, "keydown", this.handleEscapeKey)), this;
1968
- }
1969
- removeListeners() {
1970
- if (this.state.active) return this.listenerCleanups.forEach((e) => e()), this.listenerCleanups = [], this;
1971
- }
1972
- handleFocus = (e) => {
1973
- let t = Ht(e), n = this.findContainerIndex(t, e) >= 0;
1974
- if (n || ht(t)) n && (this.state.mostRecentlyFocusedNode = t);
1975
- else {
1976
- e.stopImmediatePropagation();
1977
- let t, n = !0;
1978
- if (this.state.mostRecentlyFocusedNode) if (rn(this.state.mostRecentlyFocusedNode) > 0) {
1979
- let e = this.findContainerIndex(this.state.mostRecentlyFocusedNode), { tabbableNodes: r } = this.state.containerGroups[e];
1980
- if (r.length > 0) {
1981
- let e = r.findIndex((e) => e === this.state.mostRecentlyFocusedNode);
1982
- e >= 0 && (this.config.isKeyForward(this.state.recentNavEvent) ? e + 1 < r.length && (t = r[e + 1], n = !1) : e - 1 >= 0 && (t = r[e - 1], n = !1));
1983
- }
1984
- } else this.state.containerGroups.some((e) => e.tabbableNodes.some((e) => rn(e) > 0)) || (n = !1);
1985
- else n = !1;
1986
- n && (t = this.findNextNavNode({
1987
- target: this.state.mostRecentlyFocusedNode,
1988
- isBackward: this.config.isKeyBackward(this.state.recentNavEvent)
1989
- })), t ? this.tryFocus(t) : this.tryFocus(this.state.mostRecentlyFocusedNode || this.getInitialFocusNode());
1990
- }
1991
- this.state.recentNavEvent = void 0;
1992
- };
1993
- handlePointerDown = (e) => {
1994
- let t = Ht(e);
1995
- if (!(this.findContainerIndex(t, e) >= 0)) {
1996
- if (Di(this.config.clickOutsideDeactivates, e)) {
1997
- this.deactivate({ returnFocus: this.config.returnFocusOnDeactivate });
1998
- return;
1999
- }
2000
- Di(this.config.allowOutsideClick, e) || e.preventDefault();
2001
- }
2002
- };
2003
- handleClick = (e) => {
2004
- let t = Ht(e);
2005
- this.findContainerIndex(t, e) >= 0 || Di(this.config.clickOutsideDeactivates, e) || Di(this.config.allowOutsideClick, e) || (e.preventDefault(), e.stopImmediatePropagation());
2006
- };
2007
- handleTabKey = (e) => {
2008
- if (this.config.isKeyForward(e) || this.config.isKeyBackward(e)) {
2009
- this.state.recentNavEvent = e;
2010
- let t = this.config.isKeyBackward(e), n = this.findNextNavNode({
2011
- event: e,
2012
- isBackward: t
2013
- });
2014
- if (!n) return;
2015
- Ei(e) && e.preventDefault(), this.tryFocus(n);
2016
- }
2017
- };
2018
- handleEscapeKey = (e) => {
2019
- Oi(e) && Di(this.config.escapeDeactivates, e) !== !1 && (e.preventDefault(), this.deactivate());
2020
- };
2021
- _mutationObserver;
2022
- setupMutationObserver = () => {
2023
- let e = this.doc.defaultView || window;
2024
- this._mutationObserver = new e.MutationObserver((e) => {
2025
- let t = e.some((e) => {
2026
- let t = Array.from(e.removedNodes);
2027
- return t.includes(this.state.mostRecentlyFocusedNode);
2028
- });
2029
- t && this.tryFocus(this.getInitialFocusNode());
2030
- });
2031
- };
2032
- updateObservedNodes = () => {
2033
- this._mutationObserver?.disconnect(), this.state.active && !this.state.paused && this.state.containers.forEach((e) => {
2034
- this._mutationObserver?.observe(e, {
2035
- subtree: !0,
2036
- childList: !0
2037
- });
2038
- });
2039
- };
2040
- getInitialFocusNode = () => {
2041
- let e = this.getNodeForOption("initialFocus", { hasFallback: !0 });
2042
- if (e === !1) return !1;
2043
- if (e === void 0 || e && !Qt(e)) if (this.findContainerIndex(this.doc.activeElement) >= 0) e = this.doc.activeElement;
2044
- else {
2045
- let t = this.state.tabbableGroups[0], n = t && t.firstTabbableNode;
2046
- e = n || this.getNodeForOption("fallbackFocus");
2047
- }
2048
- else e === null && (e = this.getNodeForOption("fallbackFocus"));
2049
- if (!e) throw Error("Your focus-trap needs to have at least one focusable element");
2050
- return e.isConnected || (e = this.getNodeForOption("fallbackFocus")), e;
2051
- };
2052
- tryFocus = (e) => {
2053
- if (e !== !1 && e !== kt(this.doc)) {
2054
- if (!e || !e.focus) {
2055
- this.tryFocus(this.getInitialFocusNode());
2056
- return;
2057
- }
2058
- e.focus({ preventScroll: !!this.config.preventScroll }), this.state.mostRecentlyFocusedNode = e, Ai(e) && e.select();
2059
- }
2060
- };
2061
- activate(e) {
2062
- if (this.state.active) return this;
2063
- let t = this.getOption(e, "onActivate"), n = this.getOption(e, "onPostActivate"), r = this.getOption(e, "checkCanFocusTrap");
2064
- r || this.updateTabbableNodes(), this.state.active = !0, this.state.paused = !1, this.state.nodeFocusedBeforeActivation = this.doc.activeElement || null, t?.();
2065
- let i = () => {
2066
- r && this.updateTabbableNodes(), this.addListeners(), this.updateObservedNodes(), n?.();
2067
- };
2068
- return r ? (r(this.state.containers.concat()).then(i, i), this) : (i(), this);
2069
- }
2070
- deactivate = (e) => {
2071
- if (!this.state.active) return this;
2072
- let t = {
2073
- onDeactivate: this.config.onDeactivate,
2074
- onPostDeactivate: this.config.onPostDeactivate,
2075
- checkCanReturnFocus: this.config.checkCanReturnFocus,
2076
- ...e
2077
- };
2078
- clearTimeout(this.state.delayInitialFocusTimer), this.state.delayInitialFocusTimer = void 0, this.removeListeners(), this.state.active = !1, this.state.paused = !1, this.updateObservedNodes(), ji.deactivateTrap(this.trapStack, this);
2079
- let n = this.getOption(t, "onDeactivate"), r = this.getOption(t, "onPostDeactivate"), i = this.getOption(t, "checkCanReturnFocus"), a = this.getOption(t, "returnFocus", "returnFocusOnDeactivate");
2080
- n?.();
2081
- let o = () => {
2082
- ki(() => {
2083
- if (a) {
2084
- let e = this.getReturnFocusNode(this.state.nodeFocusedBeforeActivation);
2085
- this.tryFocus(e);
2086
- }
2087
- r?.();
2088
- });
2089
- };
2090
- if (a && i) {
2091
- let e = this.getReturnFocusNode(this.state.nodeFocusedBeforeActivation);
2092
- return i(e).then(o, o), this;
2093
- }
2094
- return o(), this;
2095
- };
2096
- pause = (e) => {
2097
- if (this.state.paused || !this.state.active) return this;
2098
- let t = this.getOption(e, "onPause"), n = this.getOption(e, "onPostPause");
2099
- return this.state.paused = !0, t?.(), this.removeListeners(), this.updateObservedNodes(), n?.(), this;
2100
- };
2101
- unpause = (e) => {
2102
- if (!this.state.paused || !this.state.active) return this;
2103
- let t = this.getOption(e, "onUnpause"), n = this.getOption(e, "onPostUnpause");
2104
- return this.state.paused = !1, t?.(), this.updateTabbableNodes(), this.addListeners(), this.updateObservedNodes(), n?.(), this;
2105
- };
2106
- updateContainerElements = (e) => (this.state.containers = Array.isArray(e) ? e.filter(Boolean) : [e].filter(Boolean), this.state.active && this.updateTabbableNodes(), this.updateObservedNodes(), this);
2107
- getReturnFocusNode = (e) => {
2108
- let t = this.getNodeForOption("setReturnFocus", { params: [e] });
2109
- return t || (t === !1 ? !1 : e);
2110
- };
2111
- getOption = (e, t, n) => e && e[t] !== void 0 ? e[t] : this.config[n || t];
2112
- getNodeForOption = (e, { hasFallback: t = !1, params: n = [] } = {}) => {
2113
- let r = this.config[e];
2114
- if (typeof r == "function" && (r = r(...n)), r === !0 && (r = void 0), !r) {
2115
- if (r === void 0 || r === !1) return r;
2116
- throw Error(`\`${e}\` was specified but was not a node, or did not return a node`);
2117
- }
2118
- let i = r;
2119
- if (typeof r == "string") {
2120
- try {
2121
- i = this.doc.querySelector(r);
2122
- } catch (t) {
2123
- throw Error(`\`${e}\` appears to be an invalid selector; error="${t.message}"`);
2124
- }
2125
- if (!i && !t) throw Error(`\`${e}\` as selector refers to no known node`);
2126
- }
2127
- return i;
2128
- };
2129
- findNextNavNode = (e) => {
2130
- let { event: t, isBackward: n = !1 } = e, r = e.target || Ht(t);
2131
- this.updateTabbableNodes();
2132
- let i = null;
2133
- if (this.state.tabbableGroups.length > 0) {
2134
- let e = this.findContainerIndex(r, t), a = e >= 0 ? this.state.containerGroups[e] : void 0;
2135
- if (e < 0) i = n ? this.state.tabbableGroups[this.state.tabbableGroups.length - 1].lastTabbableNode : this.state.tabbableGroups[0].firstTabbableNode;
2136
- else if (n) {
2137
- let n = this.state.tabbableGroups.findIndex(({ firstTabbableNode: e }) => r === e);
2138
- if (n < 0 && (a?.container === r || Qt(r) && !en(r) && !a?.nextTabbableNode(r, !1)) && (n = e), n >= 0) {
2139
- let e = n === 0 ? this.state.tabbableGroups.length - 1 : n - 1, t = this.state.tabbableGroups[e];
2140
- i = rn(r) >= 0 ? t.lastTabbableNode : t.lastDomTabbableNode;
2141
- } else Ei(t) || (i = a?.nextTabbableNode(r, !1));
2142
- } else {
2143
- let n = this.state.tabbableGroups.findIndex(({ lastTabbableNode: e }) => r === e);
2144
- if (n < 0 && (a?.container === r || Qt(r) && !en(r) && !a?.nextTabbableNode(r)) && (n = e), n >= 0) {
2145
- let e = n === this.state.tabbableGroups.length - 1 ? 0 : n + 1, t = this.state.tabbableGroups[e];
2146
- i = rn(r) >= 0 ? t.firstTabbableNode : t.firstDomTabbableNode;
2147
- } else Ei(t) || (i = a?.nextTabbableNode(r));
2148
- }
2149
- } else i = this.getNodeForOption("fallbackFocus");
2150
- return i;
2151
- };
2152
- };
2153
- function Pi(e, t = {}) {
2154
- let n, r = G(() => {
2155
- let r = typeof e == "function" ? e() : e;
2156
- if (r) {
2157
- n = new Ni(r, {
2158
- escapeDeactivates: !1,
2159
- allowOutsideClick: !0,
2160
- preventScroll: !0,
2161
- returnFocusOnDeactivate: !0,
2162
- delayInitialFocus: !1,
2163
- fallbackFocus: r,
2164
- ...t,
2165
- document: Et(r)
2166
- });
2167
- try {
2168
- n.activate();
2169
- } catch {}
2170
- }
2171
- });
2172
- return function() {
2173
- n?.deactivate(), r();
2174
- };
2175
- }
2176
- const Fi = "data-scroll-lock";
2177
- function Ii(e, t) {
2178
- if (!e) return;
2179
- let n = Object.keys(t).reduce((t, n) => (t[n] = e.style.getPropertyValue(n), t), {});
2180
- return Object.assign(e.style, t), () => {
2181
- Object.assign(e.style, n);
2182
- };
2183
- }
2184
- function Li(e, t, n) {
2185
- if (!e) return;
2186
- let r = e.style.getPropertyValue(t);
2187
- return e.style.setProperty(t, n), () => {
2188
- r ? e.style.setProperty(t, r) : e.style.removeProperty(t);
2189
- };
2190
- }
2191
- function Ri(e) {
2192
- let t = e.getBoundingClientRect().left, n = Math.round(t) + e.scrollLeft;
2193
- return n ? "paddingLeft" : "paddingRight";
2194
- }
2195
- function zi(e) {
2196
- let t = e ?? document, n = t.defaultView ?? window, { documentElement: r, body: i } = t, a = i.hasAttribute(Fi);
2197
- if (a) return;
2198
- i.setAttribute(Fi, "");
2199
- let o = n.innerWidth - r.clientWidth, s = () => Li(r, "--scrollbar-width", `${o}px`), c = Ri(r), l = () => Ii(i, {
2200
- overflow: "hidden",
2201
- [c]: `${o}px`
2202
- }), u = () => {
2203
- let { scrollX: e, scrollY: t, visualViewport: r } = n, a = r?.offsetLeft ?? 0, s = r?.offsetTop ?? 0, l = Ii(i, {
2204
- position: "fixed",
2205
- overflow: "hidden",
2206
- top: `${-(t - Math.floor(s))}px`,
2207
- left: `${-(e - Math.floor(a))}px`,
2208
- right: "0",
2209
- [c]: `${o}px`
2210
- });
2211
- return () => {
2212
- l?.(), n.scrollTo({
2213
- left: e,
2214
- top: t,
2215
- behavior: "instant"
2216
- });
2217
- };
2218
- }, d = [s(), Bt() ? u() : l()];
2219
- return () => {
2220
- d.forEach((e) => e?.()), i.removeAttribute(Fi);
2221
- };
2222
- }
2223
- Symbol();
2224
- const Bi = Symbol(), Vi = Object.getPrototypeOf, Hi = /* @__PURE__ */ new WeakMap(), Ui = (e) => e && (Hi.has(e) ? Hi.get(e) : Vi(e) === Object.prototype || Vi(e) === Array.prototype), Wi = (e) => Ui(e) && e[Bi] || null, Gi = (e, t = !0) => {
2225
- Hi.set(e, t);
2226
- };
2227
- function Ki() {
2228
- if (typeof globalThis < "u" || typeof globalThis < "u") return globalThis;
2229
- if (typeof window < "u") return window;
2230
- }
2231
- function qi(e, t) {
2232
- let n = Ki();
2233
- return n ? (n[e] ||= t(), n[e]) : t();
2234
- }
2235
- const Ji = qi("__destyler__refSet", () => /* @__PURE__ */ new WeakSet()), Yi = (e) => typeof e == "object" && !!e && "$$typeof" in e && "props" in e, Xi = (e) => typeof e == "object" && !!e && "__v_isVNode" in e;
2236
- function Zi(e) {
2237
- return typeof e == "object" && !!e && "nodeType" in e && typeof e.nodeName == "string";
2238
- }
2239
- const Qi = (e) => Yi(e) || Xi(e) || Zi(e), $i = (e) => typeof e == "object" && !!e;
2240
- function ea(e) {
2241
- return $i(e) && !Ji.has(e) && (Array.isArray(e) || !(Symbol.iterator in e)) && !Qi(e) && !(e instanceof WeakMap) && !(e instanceof WeakSet) && !(e instanceof Error) && typeof e != "number" && !(e instanceof Date) && typeof e != "string" && !(e instanceof RegExp) && !(e instanceof ArrayBuffer) && !(e instanceof Promise);
2242
- }
2243
- function ta(e, t, n) {
2244
- typeof n.value == "object" && !ea(n.value) && (n.value = na(n.value)), !n.enumerable || n.get || n.set || !n.configurable || !n.writable || t === "__proto__" ? Object.defineProperty(e, t, n) : e[t] = n.value;
2245
- }
2246
- function na(e) {
2247
- if (typeof e != "object") return e;
2248
- let t = 0, n, r, i, a = Object.prototype.toString.call(e);
2249
- if (a === "[object Object]" ? i = Object.create(Object.getPrototypeOf(e) || null) : a === "[object Array]" ? i = Array.from({ length: e.length }) : a === "[object Set]" ? (i = /* @__PURE__ */ new Set(), e.forEach((e) => {
2250
- i.add(na(e));
2251
- })) : a === "[object Map]" ? (i = /* @__PURE__ */ new Map(), e.forEach((e, t) => {
2252
- i.set(na(t), na(e));
2253
- })) : a === "[object Date]" ? i = /* @__PURE__ */ new Date(+e) : a === "[object RegExp]" ? i = new RegExp(e.source, e.flags) : a === "[object DataView]" ? i = new e.constructor(na(e.buffer)) : a === "[object ArrayBuffer]" ? i = e.slice(0) : a === "[object Blob]" ? i = e.slice() : a.slice(-6) === "Array]" && (i = new e.constructor(e)), i) {
2254
- for (r = Object.getOwnPropertySymbols(e); t < r.length; t++) ta(i, r[t], Object.getOwnPropertyDescriptor(e, r[t]));
2255
- for (t = 0, r = Object.getOwnPropertyNames(e); t < r.length; t++) Object.hasOwnProperty.call(i, n = r[t]) && i[n] === e[n] || ta(i, n, Object.getOwnPropertyDescriptor(e, n));
2256
- }
2257
- return i || e;
2258
- }
2259
- const ra = qi("__destyler__proxyStateMap", () => /* @__PURE__ */ new WeakMap());
2260
- function ia(e = Object.is, t = (e, t) => new Proxy(e, t), n = /* @__PURE__ */ new WeakMap(), r = (e, t) => {
2261
- let r = n.get(e);
2262
- if (r?.[0] === t) return r[1];
2263
- let i = Array.isArray(e) ? [] : Object.create(Object.getPrototypeOf(e));
2264
- return Gi(i, !0), n.set(e, [t, i]), Reflect.ownKeys(e).forEach((t) => {
2265
- let n = Reflect.get(e, t);
2266
- Ji.has(n) ? (Gi(n, !1), i[t] = n) : ra.has(n) ? i[t] = ca(n) : i[t] = n;
2267
- }), Object.freeze(i);
2268
- }, i = /* @__PURE__ */ new WeakMap(), a = [1, 1], o = (n) => {
2269
- if (!$i(n)) throw Error("object required");
2270
- let o = i.get(n);
2271
- if (o) return o;
2272
- let s = a[0], c = /* @__PURE__ */ new Set(), l = /* @__PURE__ */ new Map(), u = (e, t = ++a[0]) => {
2273
- s !== t && (s = t, c.forEach((n) => n(e, t)));
2274
- }, d = a[1], f = (e = ++a[1]) => (d !== e && !c.size && (d = e, l.forEach(([t]) => {
2275
- let n = t[1](e);
2276
- n > s && (s = n);
2277
- })), s), p = (e) => (t, n) => {
2278
- let r = [...t];
2279
- r[1] = [e, ...r[1]], u(r, n);
2280
- }, m = (e, t) => {
2281
- if (c.size) {
2282
- let n = t[3](p(e));
2283
- l.set(e, [t, n]);
2284
- } else l.set(e, [t]);
2285
- }, h = (e) => {
2286
- let t = l.get(e);
2287
- t && (l.delete(e), t[1]?.());
2288
- }, g = (e) => {
2289
- c.add(e), c.size === 1 && l.forEach(([e], t) => {
2290
- let n = e[3](p(t));
2291
- l.set(t, [e, n]);
2292
- });
2293
- let t = () => {
2294
- c.delete(e), c.size === 0 && l.forEach(([e, t], n) => {
2295
- t && (t(), l.set(n, [e]));
2296
- });
2297
- };
2298
- return t;
2299
- }, _ = Array.isArray(n) ? [] : Object.create(Object.getPrototypeOf(n)), v = {
2300
- deleteProperty(e, t) {
2301
- let n = Reflect.get(e, t);
2302
- h(t);
2303
- let r = Reflect.deleteProperty(e, t);
2304
- return r && u([
2305
- "delete",
2306
- [t],
2307
- n
2308
- ]), r;
2309
- },
2310
- set(t, n, r, a) {
2311
- let o = Reflect.has(t, n), s = Reflect.get(t, n, a);
2312
- if (o && (e(s, r) || i.has(r) && e(s, i.get(r)))) return !0;
2313
- h(n), $i(r) && (r = Wi(r) || r);
2314
- let c = r;
2315
- if (!Object.getOwnPropertyDescriptor(t, n)?.set) {
2316
- !ra.has(r) && ea(r) && (c = oa(r));
2317
- let e = !Ji.has(c) && ra.get(c);
2318
- e && m(n, e);
2319
- }
2320
- return Reflect.set(t, n, c, a), u([
2321
- "set",
2322
- [n],
2323
- r,
2324
- s
2325
- ]), !0;
2326
- }
2327
- }, y = t(_, v);
2328
- i.set(n, y);
2329
- let b = [
2330
- _,
2331
- f,
2332
- r,
2333
- g
2334
- ];
2335
- return ra.set(y, b), Reflect.ownKeys(n).forEach((e) => {
2336
- let t = Object.getOwnPropertyDescriptor(n, e);
2337
- t.get || t.set ? Object.defineProperty(_, e, t) : y[e] = n[e];
2338
- }), y;
2339
- }) {
2340
- return [
2341
- o,
2342
- ra,
2343
- Ji,
2344
- e,
2345
- t,
2346
- ea,
2347
- n,
2348
- r,
2349
- i,
2350
- a
2351
- ];
2352
- }
2353
- const [aa] = ia();
2354
- function oa(e = {}) {
2355
- return aa(e);
2356
- }
2357
- function sa(e, t, n) {
2358
- let r = ra.get(e), i = [], a = r[3], o = !1, s = (e) => {
2359
- if (i.push(e), n) {
2360
- t(i.splice(0));
2361
- return;
2362
- }
2363
- Promise.resolve().then(() => {
2364
- o && t(i.splice(0));
2365
- });
2366
- }, c = a(s);
2367
- return o = !0, () => {
2368
- o = !1, c();
2369
- };
2370
- }
2371
- function ca(e) {
2372
- let t = ra.get(e), [n, r, i] = t;
2373
- return i(n, r());
2374
- }
2375
- function la(e) {
2376
- return Ji.add(e), e;
2377
- }
2378
- function ua(e, t) {
2379
- let n = Object.keys(t);
2380
- n.forEach((t) => {
2381
- if (Object.getOwnPropertyDescriptor(e, t)) throw Error("object property already defined");
2382
- });
2383
- let r = oa(e);
2384
- return n.forEach((e) => {
2385
- let n = t[e], { get: i, set: a } = typeof n == "function" ? { get: n } : n, o = {};
2386
- o.get = () => i(ca(r)), a && (o.set = (e) => a(r, e)), Object.defineProperty(r, e, o);
2387
- }), r;
2388
- }
2389
- function da(e, ...t) {
2390
- if (!Mn(e)) throw TypeError("Source argument must be a plain object");
2391
- let n = e;
2392
- for (let e of t) {
2393
- if (!Mn(e)) continue;
2394
- let t = zn(e);
2395
- for (let r in t) {
2396
- if (!Object.prototype.hasOwnProperty.call(t, r) || r === "__proto__" || r === "constructor" || r === "prototype") continue;
2397
- let i = n[r], a = e[r];
2398
- Mn(a) ? n[r] = Mn(i) ? da(i, a) : { ...a } : n[r] = a;
2399
- }
2400
- }
2401
- return n;
2402
- }
2403
- function X(e) {
2404
- let t = q(e) ? { type: e } : e;
2405
- return t;
2406
- }
2407
- function fa(e) {
2408
- return e ? Sn(e) ? e.slice() : [e] : [];
2409
- }
2410
- function pa(e) {
2411
- return wn(e) && e.predicate != null;
2412
- }
2413
- const ma = () => !0;
2414
- function ha(e, t) {
2415
- return e ??= ma, (n, r, i) => {
2416
- if (q(e)) {
2417
- let a = t[e];
2418
- return En(a) ? a(n, r, i) : a;
2419
- }
2420
- return pa(e) ? e.predicate(t)(n, r, i) : e?.(n, r, i);
2421
- };
2422
- }
2423
- function ga(e, t) {
2424
- return (n, r, i) => pa(e) ? e.predicate(t)(n, r, i) : e;
2425
- }
2426
- let _a = /* @__PURE__ */ function(e) {
2427
- return e.NotStarted = "Not Started", e.Running = "Running", e.Stopped = "Stopped", e;
2428
- }({}), Z = /* @__PURE__ */ function(e) {
2429
- return e.Start = "machine.start", e.Stop = "machine.stop", e.Created = "machine.created", e.Init = "machine.init", e;
2430
- }({}), va = /* @__PURE__ */ function(e) {
2431
- return e.Machine = "machine", e.Actor = "machine.actor", e;
2432
- }({});
2433
- function ya(e) {
2434
- let t = e.computed ?? K({}), n = e.context ?? K({}), r = e.initial ? e.states?.[e.initial]?.tags : [], i = oa({
2435
- value: e.initial ?? "",
2436
- previousValue: "",
2437
- event: K({}),
2438
- previousEvent: K({}),
2439
- context: ua(n, t),
2440
- done: !1,
2441
- tags: r ?? [],
2442
- hasTag(e) {
2443
- return this.tags.includes(e);
2444
- },
2445
- matches(...e) {
2446
- return e.includes(this.value);
2447
- },
2448
- can(e) {
2449
- return K(this).nextEvents.includes(e);
2450
- },
2451
- get nextEvents() {
2452
- let t = e.states?.[this.value]?.on ?? {}, n = e?.on ?? {};
2453
- return Object.keys({
2454
- ...t,
2455
- ...n
2456
- });
2457
- },
2458
- get changed() {
2459
- return this.event.value === Z.Init || !this.previousValue ? !1 : this.value !== this.previousValue;
2460
- }
2461
- });
2462
- return K(i);
2463
- }
2464
- function ba(e, t) {
2465
- return (n, r) => {
2466
- if (Tn(e)) return e;
2467
- if (En(e)) return e(n, r);
2468
- if (q(e)) {
2469
- let i = Number.parseFloat(e);
2470
- if (!Number.isNaN(i)) return i;
2471
- if (t) {
2472
- let i = t?.[e];
2473
- if (i === null) throw Error(`[@destyler/xstate > determine-delay] Cannot determine delay for \`${e}\`. It is set to null in \`options.delays\``);
2474
- return En(i) ? i(n, r) : i;
2475
- }
2476
- }
2477
- };
2478
- }
2479
- function xa(e) {
2480
- return q(e) ? { target: e } : e;
2481
- }
2482
- function Sa(e, t) {
2483
- return (n, r, i) => fa(e).map(xa).find((e) => {
2484
- let a = ha(e.guard, t), o = a(n, r, i);
2485
- return o ?? e.target ?? e.actions;
2486
- });
2487
- }
2488
- var Ca = class {
2489
- status = _a.NotStarted;
2490
- state;
2491
- initialState;
2492
- initialContext;
2493
- id;
2494
- type = va.Machine;
2495
- activityEvents = /* @__PURE__ */ new Map();
2496
- delayedEvents = /* @__PURE__ */ new Map();
2497
- stateListeners = /* @__PURE__ */ new Set();
2498
- doneListeners = /* @__PURE__ */ new Set();
2499
- contextWatchers = /* @__PURE__ */ new Set();
2500
- removeStateListener = yn;
2501
- parent;
2502
- children = /* @__PURE__ */ new Map();
2503
- guardMap;
2504
- actionMap;
2505
- delayMap;
2506
- activityMap;
2507
- sync;
2508
- options;
2509
- config;
2510
- constructor(e, t) {
2511
- this.config = na(e), this.options = na(t ?? {}), this.id = this.config.id ?? `machine-${xn()}`, this.guardMap = this.options?.guards ?? {}, this.actionMap = this.options?.actions ?? {}, this.delayMap = this.options?.delays ?? {}, this.activityMap = this.options?.activities ?? {}, this.sync = this.options?.sync ?? !1, this.state = ya(this.config), this.initialContext = ca(this.state.context);
2512
- }
2513
- get stateSnapshot() {
2514
- return K(ca(this.state));
2515
- }
2516
- getState() {
2517
- return this.stateSnapshot;
2518
- }
2519
- get contextSnapshot() {
2520
- return this.stateSnapshot.context;
2521
- }
2522
- _created = () => {
2523
- if (!this.config.created) return;
2524
- let e = X(Z.Created);
2525
- this.executeActions(this.config.created, e);
2526
- };
2527
- start = (e) => {
2528
- if (this.state.value = "", this.state.tags = [], this.status === _a.Running) return this;
2529
- this.status = _a.Running, this.removeStateListener = sa(this.state, () => {
2530
- this.stateListeners.forEach((e) => {
2531
- e(this.stateSnapshot);
2532
- });
2533
- }, this.sync), this.setupContextWatchers(), this.executeActivities(X(Z.Start), fa(this.config.activities), Z.Start), this.executeActions(this.config.entry, X(Z.Start));
2534
- let t = X(Z.Init), n = wn(e) ? e.value : e, r = wn(e) ? e.context : void 0;
2535
- r && this.setContext(r);
2536
- let i = { target: n ?? this.config.initial }, a = this.getNextStateInfo(i, t);
2537
- return this.initialState = a, this.performStateChangeEffects(this.state.value, a, t), this;
2538
- };
2539
- setupContextWatchers = () => {
2540
- let { watch: e } = this.config;
2541
- if (!e) return;
2542
- let t = ca(this.state.context), n = sa(this.state.context, () => {
2543
- let n = ca(this.state.context);
2544
- for (let [r, i] of Object.entries(e)) {
2545
- let e = this.options.compareFns?.[r] ?? Object.is;
2546
- if (e(t[r], n[r])) continue;
2547
- this.executeActions(i, this.state.event);
2548
- }
2549
- t = n;
2550
- });
2551
- this.contextWatchers.add(n);
2552
- };
2553
- stop = () => {
2554
- if (this.status !== _a.Stopped) return this.performExitEffects(this.state.value, X(Z.Stop)), this.executeActions(this.config.exit, X(Z.Stop)), this.setState(""), this.setEvent(Z.Stop), this.stopStateListeners(), this.stopChildren(), this.stopActivities(), this.stopDelayedEvents(), this.stopContextWatchers(), this.status = _a.Stopped, this;
2555
- };
2556
- stopStateListeners = () => {
2557
- this.removeStateListener(), this.stateListeners.clear();
2558
- };
2559
- stopContextWatchers = () => {
2560
- this.contextWatchers.forEach((e) => e()), this.contextWatchers.clear();
2561
- };
2562
- stopDelayedEvents = () => {
2563
- this.delayedEvents.forEach((e) => {
2564
- e.forEach((e) => e());
2565
- }), this.delayedEvents.clear();
2566
- };
2567
- stopActivities = (e) => {
2568
- e ? (this.activityEvents.get(e)?.forEach((e) => e()), this.activityEvents.get(e)?.clear(), this.activityEvents.delete(e)) : (this.activityEvents.forEach((e) => {
2569
- e.forEach((e) => e()), e.clear();
2570
- }), this.activityEvents.clear());
2571
- };
2572
- sendChild = (e, t) => {
2573
- let n = X(e), r = vn(t, this.contextSnapshot), i = this.children.get(r);
2574
- if (!i) throw Error(`[@destyler/xstate] Cannot send '${n.type}' event to unknown child`);
2575
- i.send(n);
2576
- };
2577
- stopChild = (e) => {
2578
- if (!this.children.has(e)) throw Error(`[@destyler.xstate > stop-child] Cannot stop unknown child ${e}`);
2579
- this.children.get(e).stop(), this.children.delete(e);
2580
- };
2581
- removeChild = (e) => {
2582
- this.children.delete(e);
2583
- };
2584
- stopChildren = () => {
2585
- this.children.forEach((e) => e.stop()), this.children.clear();
2586
- };
2587
- setParent = (e) => {
2588
- this.parent = e;
2589
- };
2590
- spawn = (e, t) => {
2591
- let n = vn(e);
2592
- return t && (n.id = t), n.type = va.Actor, n.setParent(this), this.children.set(n.id, K(n)), n.onDone(() => {
2593
- this.removeChild(n.id);
2594
- }).start(), K(la(n));
2595
- };
2596
- stopActivity = (e) => {
2597
- if (!this.state.value) return;
2598
- let t = this.activityEvents.get(this.state.value);
2599
- t?.get(e)?.(), t?.delete(e);
2600
- };
2601
- addActivityCleanup = (e, t, n) => {
2602
- e && (this.activityEvents.has(e) ? this.activityEvents.get(e)?.set(t, n) : this.activityEvents.set(e, new Map([[t, n]])));
2603
- };
2604
- setState = (e) => {
2605
- this.state.previousValue = this.state.value, this.state.value = e;
2606
- let t = this.getStateNode(e);
2607
- e == null ? _n(this.state.tags) : this.state.tags = fa(t?.tags);
2608
- };
2609
- setContext = (e) => {
2610
- e && da(this.state.context, e);
2611
- };
2612
- setOptions = (e) => {
2613
- let t = zn(e);
2614
- this.actionMap = {
2615
- ...this.actionMap,
2616
- ...t.actions
2617
- }, this.delayMap = {
2618
- ...this.delayMap,
2619
- ...t.delays
2620
- }, this.activityMap = {
2621
- ...this.activityMap,
2622
- ...t.activities
2623
- }, this.guardMap = {
2624
- ...this.guardMap,
2625
- ...t.guards
2626
- };
2627
- };
2628
- getStateNode = (e) => {
2629
- if (e) return this.config.states?.[e];
2630
- };
2631
- getNextStateInfo = (e, t) => {
2632
- let n = this.determineTransition(e, t), r = !n?.target, i = n?.target ?? this.state.value, a = this.state.value !== i, o = this.getStateNode(i), s = !r && !a && !n?.internal, c = {
2633
- reenter: s,
2634
- transition: n,
2635
- stateNode: o,
2636
- target: i,
2637
- changed: a
2638
- };
2639
- return this.log("NextState:", `[${t.type}]`, this.state.value, "---->", c.target), c;
2640
- };
2641
- getAfterActions = (e, t) => {
2642
- let n, r = this.state.value;
2643
- return {
2644
- entry: () => {
2645
- n = globalThis.setTimeout(() => {
2646
- let t = this.getNextStateInfo(e, this.state.event);
2647
- this.performStateChangeEffects(r, t, this.state.event);
2648
- }, t);
2649
- },
2650
- exit: () => {
2651
- globalThis.clearTimeout(n);
2652
- }
2653
- };
2654
- };
2655
- getDelayedEventActions = (e) => {
2656
- let t = this.getStateNode(e), n = this.state.event;
2657
- if (!t || !t.after) return;
2658
- let r = [], i = [];
2659
- if (Sn(t.after)) {
2660
- let e = this.determineTransition(t.after, n);
2661
- if (!e) return;
2662
- if (!On(e, "delay")) throw Error(`[@destyler/xstate > after] Delay is required for after transition: ${JSON.stringify(e)}`);
2663
- let a = ba(e.delay, this.delayMap), o = a(this.contextSnapshot, n), s = this.getAfterActions(e, o);
2664
- return r.push(s.entry), i.push(s.exit), {
2665
- entries: r,
2666
- exits: i
2667
- };
2668
- }
2669
- if (wn(t.after)) for (let e in t.after) {
2670
- let a = t.after[e], o = ba(e, this.delayMap), s = o(this.contextSnapshot, n), c = this.getAfterActions(a, s);
2671
- r.push(c.entry), i.push(c.exit);
2672
- }
2673
- return {
2674
- entries: r,
2675
- exits: i
2676
- };
2677
- };
2678
- get self() {
2679
- let e = this;
2680
- return {
2681
- id: this.id,
2682
- send: this.send.bind(this),
2683
- sendParent: this.sendParent.bind(this),
2684
- sendChild: this.sendChild.bind(this),
2685
- stop: this.stop.bind(this),
2686
- stopChild: this.stopChild.bind(this),
2687
- spawn: this.spawn.bind(this),
2688
- stopActivity: this.stopActivity.bind(this),
2689
- get state() {
2690
- return e.stateSnapshot;
2691
- },
2692
- get initialContext() {
2693
- return e.initialContext;
2694
- },
2695
- get initialState() {
2696
- return e.initialState?.target ?? "";
2697
- }
2698
- };
2699
- }
2700
- get meta() {
2701
- return {
2702
- state: this.stateSnapshot,
2703
- guards: this.guardMap,
2704
- send: this.send.bind(this),
2705
- self: this.self,
2706
- initialContext: this.initialContext,
2707
- initialState: this.initialState?.target ?? "",
2708
- getState: () => this.stateSnapshot,
2709
- getAction: (e) => this.actionMap[e],
2710
- getGuard: (e) => this.guardMap[e]
2711
- };
2712
- }
2713
- get guardMeta() {
2714
- return { state: this.stateSnapshot };
2715
- }
2716
- executeActions = (e, t) => {
2717
- let n = ga(e, this.guardMap)(this.contextSnapshot, t, this.guardMeta);
2718
- for (let e of fa(n)) {
2719
- let n = q(e) ? this.actionMap?.[e] : e;
2720
- q(e) && !n && console.warn(`[@destyler/xstate > execute-actions] No implementation found for action: \`${e}\``), n?.(this.state.context, t, this.meta);
2721
- }
2722
- };
2723
- executeActivities = (e, t, n) => {
2724
- for (let r of t) {
2725
- let t = q(r) ? this.activityMap?.[r] : r;
2726
- if (!t) {
2727
- console.warn(`[@destyler/xstate > execute-activity] No implementation found for activity: \`${r}\``);
2728
- continue;
2729
- }
2730
- let i = t(this.state.context, e, this.meta);
2731
- if (i) {
2732
- let e = q(r) ? r : r.name || xn();
2733
- this.addActivityCleanup(n ?? this.state.value, e, i);
2734
- }
2735
- }
2736
- };
2737
- createEveryActivities = (e, t) => {
2738
- if (e) if (Sn(e)) {
2739
- let n = fa(e).find((e) => {
2740
- let t = e.delay, n = ba(t, this.delayMap), r = n(this.contextSnapshot, this.state.event), i = ha(e.guard, this.guardMap), a = i(this.contextSnapshot, this.state.event, this.guardMeta);
2741
- return a ?? r != null;
2742
- });
2743
- if (!n) return;
2744
- let r = ba(n.delay, this.delayMap), i = r(this.contextSnapshot, this.state.event), a = () => {
2745
- let e = globalThis.setInterval(() => {
2746
- this.executeActions(n.actions, this.state.event);
2747
- }, i);
2748
- return () => {
2749
- globalThis.clearInterval(e);
2750
- };
2751
- };
2752
- t(a);
2753
- } else for (let n in e) {
2754
- let r = e?.[n], i = ba(n, this.delayMap), a = i(this.contextSnapshot, this.state.event), o = () => {
2755
- let e = globalThis.setInterval(() => {
2756
- this.executeActions(r, this.state.event);
2757
- }, a);
2758
- return () => {
2759
- globalThis.clearInterval(e);
2760
- };
2761
- };
2762
- t(o);
2763
- }
2764
- };
2765
- setEvent = (e) => {
2766
- this.state.previousEvent = this.state.event, this.state.event = la(X(e));
2767
- };
2768
- performExitEffects = (e, t) => {
2769
- let n = this.state.value;
2770
- if (n === "") return;
2771
- let r = e ? this.getStateNode(e) : void 0;
2772
- this.stopActivities(n);
2773
- let i = ga(r?.exit, this.guardMap)(this.contextSnapshot, t, this.guardMeta), a = fa(i), o = this.delayedEvents.get(n);
2774
- o && a.push(...o), this.executeActions(a, t), this.delayedEvents.delete(n);
2775
- };
2776
- performEntryEffects = (e, t) => {
2777
- let n = this.getStateNode(e), r = fa(n?.activities);
2778
- this.createEveryActivities(n?.every, (e) => {
2779
- r.unshift(e);
2780
- }), r.length > 0 && this.executeActivities(t, r);
2781
- let i = ga(n?.entry, this.guardMap)(this.contextSnapshot, t, this.guardMeta), a = fa(i), o = this.getDelayedEventActions(e);
2782
- n?.after && o && (this.delayedEvents.set(e, o?.exits), a.push(...o.entries)), this.executeActions(a, t), n?.type === "final" && (this.state.done = !0, this.doneListeners.forEach((e) => {
2783
- e(this.stateSnapshot);
2784
- }), this.stop());
2785
- };
2786
- performTransitionEffects = (e, t) => {
2787
- let n = this.determineTransition(e, t);
2788
- this.executeActions(n?.actions, t);
2789
- };
2790
- performStateChangeEffects = (e, t, n) => {
2791
- this.setEvent(n);
2792
- let r = t.changed || t.reenter;
2793
- r && this.performExitEffects(e, n), this.performTransitionEffects(t.transition, n), this.setState(t.target), r && this.performEntryEffects(t.target, n);
2794
- };
2795
- determineTransition = (e, t) => {
2796
- let n = Sa(e, this.guardMap);
2797
- return n?.(this.contextSnapshot, t, this.guardMeta);
2798
- };
2799
- sendParent = (e) => {
2800
- if (!this.parent) throw Error("[@destyler/xstate > send-parent] Cannot send event to parent machine, no parent is set. Use `machine.spawn()` to spawn a child machine.");
2801
- let t = X(e);
2802
- this.parent?.send(t);
2803
- };
2804
- log = (...e) => {
2805
- this.options.debug && console.log(...e);
2806
- };
2807
- send = (e) => {
2808
- let t = X(e);
2809
- this.transition(this.state.value, t);
2810
- };
2811
- transition = (e, t) => {
2812
- let n = q(e) ? this.getStateNode(e) : e?.stateNode, r = X(t);
2813
- if (!n && !this.config.on) {
2814
- let t = this.status === _a.Stopped ? "[@destyler/xstate > transition] Cannot transition a stopped machine" : `[destyler/xstate > transition] State does not have a definition for \`state\`: ${e}, \`event\`: ${r.type}`;
2815
- console.warn(t);
2816
- return;
2817
- }
2818
- let i = n?.on?.[r.type] ?? this.config.on?.[r.type], a = this.getNextStateInfo(i, r);
2819
- return this.performStateChangeEffects(this.state.value, a, r), a.stateNode;
2820
- };
2821
- subscribe = (e) => (this.stateListeners.add(e), this.status === _a.Running && e(this.stateSnapshot), () => {
2822
- this.stateListeners.delete(e);
2823
- });
2824
- onDone = (e) => (this.doneListeners.add(e), this);
2825
- onTransition = (e) => (this.stateListeners.add(e), this.status === _a.Running && e(this.stateSnapshot), this);
2826
- get [Symbol.toStringTag]() {
2827
- return "Machine";
2828
- }
2829
- getHydrationState() {
2830
- let e = this.getState();
2831
- return {
2832
- value: e.value,
2833
- tags: e.tags
2834
- };
2835
- }
2836
- };
2837
- function wa(e, t) {
2838
- return new Ca(e, t);
2839
- }
2840
- function Ta() {
2841
- return (e) => Array.from(new Set(e));
2842
- }
2843
- function Ea(e) {
2844
- return new Proxy({}, { get() {
2845
- return e;
2846
- } });
2847
- }
2848
- const Da = ft("popover").parts("arrow", "arrowTip", "anchor", "trigger", "indicator", "positioner", "content", "title", "description", "closeTrigger"), Q = Da.build(), $ = dn({
2849
- getAnchorId: (e) => e.ids?.anchor ?? `popover:${e.id}:anchor`,
2850
- getTriggerId: (e) => e.ids?.trigger ?? `popover:${e.id}:trigger`,
2851
- getContentId: (e) => e.ids?.content ?? `popover:${e.id}:content`,
2852
- getPositionerId: (e) => e.ids?.positioner ?? `popover:${e.id}:popper`,
2853
- getArrowId: (e) => e.ids?.arrow ?? `popover:${e.id}:arrow`,
2854
- getTitleId: (e) => e.ids?.title ?? `popover:${e.id}:title`,
2855
- getDescriptionId: (e) => e.ids?.description ?? `popover:${e.id}:desc`,
2856
- getCloseTriggerId: (e) => e.ids?.closeTrigger ?? `popover:${e.id}:close`,
2857
- getAnchorEl: (e) => $.getById(e, $.getAnchorId(e)),
2858
- getTriggerEl: (e) => $.getById(e, $.getTriggerId(e)),
2859
- getContentEl: (e) => $.getById(e, $.getContentId(e)),
2860
- getPositionerEl: (e) => $.getById(e, $.getPositionerId(e)),
2861
- getTitleEl: (e) => $.getById(e, $.getTitleId(e)),
2862
- getDescriptionEl: (e) => $.getById(e, $.getDescriptionId(e)),
2863
- getFocusableEls: (e) => Zt($.getContentEl(e)),
2864
- getFirstFocusableEl: (e) => $.getFocusableEls(e)[0]
2865
- });
2866
- function Oa(e, t, n) {
2867
- let r = e.matches("open"), i = e.context.currentPlacement, a = e.context.currentPortalled, o = e.context.renderedElements, s = Jr({
2868
- ...e.context.positioning,
2869
- placement: i
2870
- });
2871
- return {
2872
- portalled: a,
2873
- open: r,
2874
- setOpen(e) {
2875
- e !== r && t(e ? "OPEN" : "CLOSE");
2876
- },
2877
- reposition(e = {}) {
2878
- t({
2879
- type: "POSITIONING.SET",
2880
- options: e
2881
- });
2882
- },
2883
- getArrowProps() {
2884
- return n.element({
2885
- id: $.getArrowId(e.context),
2886
- ...Q.arrow.attrs,
2887
- dir: e.context.dir,
2888
- style: s.arrow
2889
- });
2890
- },
2891
- getArrowTipProps() {
2892
- return n.element({
2893
- ...Q.arrowTip.attrs,
2894
- dir: e.context.dir,
2895
- style: s.arrowTip
2896
- });
2897
- },
2898
- getAnchorProps() {
2899
- return n.element({
2900
- ...Q.anchor.attrs,
2901
- dir: e.context.dir,
2902
- id: $.getAnchorId(e.context)
2903
- });
2904
- },
2905
- getTriggerProps() {
2906
- return n.button({
2907
- ...Q.trigger.attrs,
2908
- dir: e.context.dir,
2909
- type: "button",
2910
- "data-placement": i,
2911
- id: $.getTriggerId(e.context),
2912
- "aria-haspopup": "dialog",
2913
- "aria-expanded": r,
2914
- "data-state": r ? "open" : "closed",
2915
- "aria-controls": $.getContentId(e.context),
2916
- onPointerDown(e) {
2917
- zt() && e.currentTarget.focus();
2918
- },
2919
- onClick(e) {
2920
- e.defaultPrevented || t("TOGGLE");
2921
- },
2922
- onBlur(e) {
2923
- t({
2924
- type: "TRIGGER_BLUR",
2925
- target: e.relatedTarget
2926
- });
2927
- }
2928
- });
2929
- },
2930
- getIndicatorProps() {
2931
- return n.element({
2932
- ...Q.indicator.attrs,
2933
- dir: e.context.dir,
2934
- "data-state": r ? "open" : "closed"
2935
- });
2936
- },
2937
- getPositionerProps() {
2938
- return n.element({
2939
- id: $.getPositionerId(e.context),
2940
- ...Q.positioner.attrs,
2941
- dir: e.context.dir,
2942
- style: s.floating
2943
- });
2944
- },
2945
- getContentProps() {
2946
- return n.element({
2947
- ...Q.content.attrs,
2948
- dir: e.context.dir,
2949
- id: $.getContentId(e.context),
2950
- tabIndex: -1,
2951
- role: "dialog",
2952
- hidden: !r,
2953
- "data-state": r ? "open" : "closed",
2954
- "data-expanded": mt(r),
2955
- "aria-labelledby": o.title ? $.getTitleId(e.context) : void 0,
2956
- "aria-describedby": o.description ? $.getDescriptionId(e.context) : void 0,
2957
- "data-placement": i
2958
- });
2959
- },
2960
- getTitleProps() {
2961
- return n.element({
2962
- ...Q.title.attrs,
2963
- id: $.getTitleId(e.context),
2964
- dir: e.context.dir
2965
- });
2966
- },
2967
- getDescriptionProps() {
2968
- return n.element({
2969
- ...Q.description.attrs,
2970
- id: $.getDescriptionId(e.context),
2971
- dir: e.context.dir
2972
- });
2973
- },
2974
- getCloseTriggerProps() {
2975
- return n.button({
2976
- ...Q.closeTrigger.attrs,
2977
- dir: e.context.dir,
2978
- id: $.getCloseTriggerId(e.context),
2979
- type: "button",
2980
- "aria-label": "close",
2981
- onClick(e) {
2982
- e.defaultPrevented || t("CLOSE");
2983
- }
2984
- });
2985
- }
2986
- };
2987
- }
2988
- function ka(e) {
2989
- let t = zn(e);
2990
- return wa({
2991
- id: "popover",
2992
- initial: t.open ? "open" : "closed",
2993
- context: {
2994
- closeOnInteractOutside: !0,
2995
- closeOnEscape: !0,
2996
- autoFocus: !0,
2997
- modal: !1,
2998
- portalled: !0,
2999
- positioning: {
3000
- placement: "bottom",
3001
- ...t.positioning
3002
- },
3003
- currentPlacement: void 0,
3004
- ...t,
3005
- renderedElements: {
3006
- title: !0,
3007
- description: !0
3008
- }
3009
- },
3010
- computed: { currentPortalled: (e) => !!e.modal || !!e.portalled },
3011
- watch: { open: ["toggleVisibility"] },
3012
- entry: ["checkRenderedElements"],
3013
- states: {
3014
- closed: { on: {
3015
- "CONTROLLED.OPEN": {
3016
- target: "open",
3017
- actions: ["setInitialFocus"]
3018
- },
3019
- TOGGLE: [{
3020
- guard: "isOpenControlled",
3021
- actions: ["invokeOnOpen"]
3022
- }, {
3023
- target: "open",
3024
- actions: ["invokeOnOpen", "setInitialFocus"]
3025
- }],
3026
- OPEN: [{
3027
- guard: "isOpenControlled",
3028
- actions: ["invokeOnOpen"]
3029
- }, {
3030
- target: "open",
3031
- actions: ["invokeOnOpen", "setInitialFocus"]
3032
- }]
3033
- } },
3034
- open: {
3035
- activities: [
3036
- "trapFocus",
3037
- "preventScroll",
3038
- "hideContentBelow",
3039
- "trackPositioning",
3040
- "trackDismissableElement",
3041
- "proxyTabFocus"
3042
- ],
3043
- on: {
3044
- "CONTROLLED.CLOSE": {
3045
- target: "closed",
3046
- actions: ["setFinalFocus"]
3047
- },
3048
- CLOSE: [{
3049
- guard: "isOpenControlled",
3050
- actions: ["invokeOnClose"]
3051
- }, {
3052
- target: "closed",
3053
- actions: ["invokeOnClose", "setFinalFocus"]
3054
- }],
3055
- TOGGLE: [{
3056
- guard: "isOpenControlled",
3057
- actions: ["invokeOnClose"]
3058
- }, {
3059
- target: "closed",
3060
- actions: ["invokeOnClose"]
3061
- }],
3062
- "POSITIONING.SET": { actions: "reposition" }
3063
- }
3064
- }
3065
- }
3066
- }, {
3067
- guards: { isOpenControlled: (e) => !!e["open.controlled"] },
3068
- activities: {
3069
- trackPositioning(e) {
3070
- e.currentPlacement = e.positioning.placement;
3071
- let t = $.getAnchorEl(e) ?? $.getTriggerEl(e), n = () => $.getPositionerEl(e);
3072
- return Kr(t, n, {
3073
- ...e.positioning,
3074
- defer: !0,
3075
- onComplete(t) {
3076
- e.currentPlacement = t.placement;
3077
- }
3078
- });
3079
- },
3080
- trackDismissableElement(e, t, { send: n }) {
3081
- let r = () => $.getContentEl(e), i = !0;
3082
- return Ti(r, {
3083
- pointerBlocking: e.modal,
3084
- exclude: $.getTriggerEl(e),
3085
- defer: !0,
3086
- onEscapeKeyDown(t) {
3087
- e.onEscapeKeyDown?.(t), !e.closeOnEscape && t.preventDefault();
3088
- },
3089
- onInteractOutside(t) {
3090
- e.onInteractOutside?.(t), !t.defaultPrevented && (i = !(t.detail.focusable || t.detail.contextmenu), e.closeOnInteractOutside || t.preventDefault());
3091
- },
3092
- onPointerDownOutside: e.onPointerDownOutside,
3093
- onFocusOutside: e.onFocusOutside,
3094
- persistentElements: e.persistentElements,
3095
- onDismiss() {
3096
- n({
3097
- type: "CLOSE",
3098
- src: "interact-outside",
3099
- restoreFocus: i
3100
- });
3101
- }
3102
- });
3103
- },
3104
- proxyTabFocus(e) {
3105
- if (e.modal || !e.portalled) return;
3106
- let t = () => $.getContentEl(e);
3107
- return un(t, {
3108
- triggerElement: $.getTriggerEl(e),
3109
- defer: !0,
3110
- onFocus(e) {
3111
- e.focus({ preventScroll: !0 });
3112
- }
3113
- });
3114
- },
3115
- hideContentBelow(e) {
3116
- if (!e.modal) return;
3117
- let t = () => [$.getContentEl(e), $.getTriggerEl(e)];
3118
- return oi(t, { defer: !0 });
3119
- },
3120
- preventScroll(e) {
3121
- if (e.modal) return zi($.getDoc(e));
3122
- },
3123
- trapFocus(e) {
3124
- if (!e.modal) return;
3125
- let t = () => $.getContentEl(e);
3126
- return Pi(t, { initialFocus: () => an({
3127
- root: $.getContentEl(e),
3128
- getInitialEl: e.initialFocusEl,
3129
- enabled: e.autoFocus
3130
- }) });
3131
- }
3132
- },
3133
- actions: {
3134
- reposition(e, t) {
3135
- let n = $.getAnchorEl(e) ?? $.getTriggerEl(e), r = () => $.getPositionerEl(e);
3136
- Kr(n, r, {
3137
- ...e.positioning,
3138
- ...t.options,
3139
- defer: !0,
3140
- listeners: !1,
3141
- onComplete(t) {
3142
- e.currentPlacement = t.placement;
3143
- }
3144
- });
3145
- },
3146
- checkRenderedElements(e) {
3147
- G(() => {
3148
- Object.assign(e.renderedElements, {
3149
- title: !!$.getTitleEl(e),
3150
- description: !!$.getDescriptionEl(e)
3151
- });
3152
- });
3153
- },
3154
- setInitialFocus(e) {
3155
- e.modal || G(() => {
3156
- let t = an({
3157
- root: $.getContentEl(e),
3158
- getInitialEl: e.initialFocusEl,
3159
- enabled: e.autoFocus
3160
- });
3161
- t?.focus({ preventScroll: !0 });
3162
- });
3163
- },
3164
- setFinalFocus(e, t) {
3165
- let n = t.restoreFocus ?? t.previousEvent?.restoreFocus;
3166
- n != null && !n || G(() => {
3167
- let t = $.getTriggerEl(e);
3168
- t?.focus({ preventScroll: !0 });
3169
- });
3170
- },
3171
- invokeOnOpen(e) {
3172
- e.onOpenChange?.({ open: !0 });
3173
- },
3174
- invokeOnClose(e) {
3175
- e.onOpenChange?.({ open: !1 });
3176
- },
3177
- toggleVisibility(e, t, { send: n }) {
3178
- n({
3179
- type: e.open ? "CONTROLLED.OPEN" : "CONTROLLED.CLOSE",
3180
- previousEvent: t
3181
- });
3182
- }
3183
- }
3184
- });
3185
- }
3186
- const Aa = Ta()([
3187
- "autoFocus",
3188
- "closeOnEscape",
3189
- "closeOnInteractOutside",
3190
- "dir",
3191
- "getRootNode",
3192
- "id",
3193
- "ids",
3194
- "initialFocusEl",
3195
- "modal",
3196
- "onEscapeKeyDown",
3197
- "onFocusOutside",
3198
- "onInteractOutside",
3199
- "onOpenChange",
3200
- "onPointerDownOutside",
3201
- "open.controlled",
3202
- "open",
3203
- "persistentElements",
3204
- "portalled",
3205
- "positioning"
3206
- ]);
3207
- Hn(Aa);
3208
- function ja(e, t) {
3209
- let { actions: n, context: r } = t ?? {}, i = x(e.state), a = sa(e.state, () => {
3210
- i.value = ca(e.state);
3211
- });
3212
- return _(() => {
3213
- a?.();
3214
- }), ee(() => {
3215
- e.setOptions({ actions: n });
3216
- }), r && E(r, (t) => {
3217
- e.setContext(S(t));
3218
- }, { deep: !0 }), i;
3219
- }
3220
- function Ma(e, t) {
3221
- let { state: n, context: r } = t ?? {}, i = typeof e == "function" ? e() : e;
3222
- return r && i.setContext(S(r)), i._created(), g(() => {
3223
- i.start(n), h(() => {
3224
- i.stop();
3225
- });
3226
- }), i;
3227
- }
3228
- function Na(e, t) {
3229
- let n = Ma(e, t), r = ja(n, t);
3230
- return [
3231
- r,
3232
- n.send,
3233
- n
3234
- ];
3235
- }
3236
- function Pa(e) {
3237
- return e.charAt(0).toUpperCase() + e.substr(1).toLowerCase();
3238
- }
3239
- const Fa = {
3240
- htmlFor: "for",
3241
- className: "class",
3242
- onDoubleClick: "onDblclick",
3243
- onChange: "onInput",
3244
- onFocus: "onFocusin",
3245
- onBlur: "onFocusout",
3246
- defaultValue: "value",
3247
- defaultChecked: "checked"
3248
- };
3249
- function Ia(e) {
3250
- return e in Fa ? Fa[e] : e.startsWith("on") ? `on${Pa(e.substr(2))}` : e.toLowerCase();
3251
- }
3252
- const La = Ea((e) => {
3253
- let t = {};
3254
- for (let n in e) {
3255
- let r = e[n];
3256
- n === "children" ? typeof r == "string" && (t.innerHTML = r) : t[Ia(n)] = e[n];
3257
- }
3258
- return t;
3259
- }), Ra = {
3260
- key: 0,
3261
- xmlns: "http://www.w3.org/2000/svg",
3262
- width: "1em",
3263
- height: "1em",
3264
- viewBox: "0 0 16 16"
3265
- }, za = {
3266
- key: 1,
3267
- xmlns: "http://www.w3.org/2000/svg",
3268
- width: "1em",
3269
- height: "1em",
3270
- viewBox: "0 0 16 16"
3271
- };
3272
- var Ba = /* @__PURE__ */ l({
3273
- name: "ComponentIcones",
3274
- __name: "ComponentsIcones",
3275
- props: { expanded: {
3276
- type: Boolean,
3277
- default: !1
3278
- } },
3279
- setup(e) {
3280
- let t = e;
3281
- return (e, n) => t.expanded ? (v(), o("svg", Ra, [a(" Icon from Catppuccin Icons by Catppuccin - https://github.com/catppuccin/vscode-icons/blob/main/LICENSE "), n[0] ||= s("g", {
3282
- fill: "none",
3283
- "stroke-linecap": "round",
3284
- "stroke-linejoin": "round"
3285
- }, [s("path", {
3286
- class: "stroke-dark dark:stroke-light",
3287
- d: "m1.87 8l.7-2.74a1 1 0 0 1 .96-.76h10.94a1 1 0 0 1 .97 1.24l-.219.875M6 13.5H2A1.5 1.5 0 0 1 .5 12V3.5a1 1 0 0 1 1-1h5a1 1 0 0 1 1 1v1"
3288
- }), s("path", {
3289
- stroke: "#67B686",
3290
- d: "m9.485 9.516l3.968 3.968m-3.968 0l3.968-3.968m-1.634-1.874l3.507 3.507a.496.496 0 0 1 0 .702l-3.507 3.507a.496.496 0 0 1-.701 0L7.61 11.85a.496.496 0 0 1 0-.702l3.507-3.507a.496.496 0 0 1 .701 0z"
3291
- })], -1)])) : (v(), o("svg", za, [a(" Icon from Catppuccin Icons by Catppuccin - https://github.com/catppuccin/vscode-icons/blob/main/LICENSE "), n[1] ||= s("g", {
3292
- fill: "none",
3293
- "stroke-linecap": "round",
3294
- "stroke-linejoin": "round"
3295
- }, [s("path", {
3296
- class: "stroke-dark dark:stroke-light",
3297
- d: "M4.5 4.5H12c.83 0 1.5.67 1.5 1.5v.5m-7.5 7H2A1.5 1.5 0 0 1 .5 12V3.5a1 1 0 0 1 1-1h5a1 1 0 0 1 1 1v1"
3298
- }), s("path", {
3299
- stroke: "#67B686",
3300
- d: "m9.485 9.516l3.968 3.968m-3.968 0l3.968-3.968m-1.634-1.874l3.507 3.507a.496.496 0 0 1 0 .702l-3.507 3.507a.496.496 0 0 1-.701 0L7.61 11.85a.496.496 0 0 1 0-.702l3.507-3.507a.496.496 0 0 1 .701 0z"
3301
- })], -1)]));
3302
- }
3303
- }), Va = Ba;
3304
- const Ha = {
3305
- key: 0,
3306
- xmlns: "http://www.w3.org/2000/svg",
3307
- width: "1em",
3308
- height: "1em",
3309
- viewBox: "0 0 16 16"
3310
- }, Ua = {
3311
- key: 1,
3312
- xmlns: "http://www.w3.org/2000/svg",
3313
- width: "1em",
3314
- height: "1em",
3315
- viewBox: "0 0 16 16"
3316
- };
3317
- var Wa = /* @__PURE__ */ l({
3318
- name: "FolderIcones",
3319
- __name: "FolderIcones",
3320
- props: { expanded: {
3321
- type: Boolean,
3322
- default: !1
3323
- } },
3324
- setup(e) {
3325
- let t = e;
3326
- return (e, n) => t.expanded ? (v(), o("svg", Ha, [a(" Icon from Catppuccin Icons by Catppuccin - https://github.com/catppuccin/vscode-icons/blob/main/LICENSE "), n[0] ||= s("path", {
3327
- fill: "none",
3328
- class: "stroke-dark dark:stroke-light",
3329
- "stroke-linecap": "round",
3330
- "stroke-linejoin": "round",
3331
- d: "m1.87 8l.7-2.74a1 1 0 0 1 .96-.76h10.94a1 1 0 0 1 .97 1.24l-1.75 7a1 1 0 0 1-.97.76H2A1.5 1.5 0 0 1 .5 12V3.5a1 1 0 0 1 1-1h5a1 1 0 0 1 1 1v1"
3332
- }, null, -1)])) : (v(), o("svg", Ua, [a(" Icon from Catppuccin Icons by Catppuccin - https://github.com/catppuccin/vscode-icons/blob/main/LICENSE "), n[1] ||= s("path", {
3333
- fill: "none",
3334
- class: "stroke-dark dark:stroke-light",
3335
- "stroke-linecap": "round",
3336
- "stroke-linejoin": "round",
3337
- d: "M4.5 4.5H12c.83 0 1.5.67 1.5 1.5v6c0 .83-.67 1.5-1.5 1.5H2A1.5 1.5 0 0 1 .5 12V3.5a1 1 0 0 1 1-1h5a1 1 0 0 1 1 1v1"
3338
- }, null, -1)]));
3339
- }
3340
- }), Ga = Wa;
3341
- const Ka = {
3342
- key: 0,
3343
- xmlns: "http://www.w3.org/2000/svg",
3344
- width: "1em",
3345
- height: "1em",
3346
- viewBox: "0 0 16 16"
3347
- }, qa = {
3348
- key: 1,
3349
- xmlns: "http://www.w3.org/2000/svg",
3350
- width: "1em",
3351
- height: "1em",
3352
- viewBox: "0 0 16 16"
3353
- };
3354
- var Ja = /* @__PURE__ */ l({
3355
- name: "ModleIcones",
3356
- __name: "ModuleIcones",
3357
- props: { expanded: {
3358
- type: Boolean,
3359
- default: !1
3360
- } },
3361
- setup(e) {
3362
- let t = e;
3363
- return (e, n) => t.expanded ? (v(), o("svg", Ka, [a(" Icon from Catppuccin Icons by Catppuccin - https://github.com/catppuccin/vscode-icons/blob/main/LICENSE "), n[0] ||= s("g", {
3364
- fill: "none",
3365
- "stroke-linecap": "round",
3366
- "stroke-linejoin": "round"
3367
- }, [s("path", {
3368
- class: "stroke-dark dark:stroke-light",
3369
- d: "m1.875 8l.686-2.743a1 1 0 0 1 .97-.757h10.938a1 1 0 0 1 .97 1.243l-.315 1.26M6 13.5H2.004A1.5 1.5 0 0 1 .5 12V3.5a1 1 0 0 1 1-1h5a1 1 0 0 1 1 1v1"
3370
- }), s("path", {
3371
- stroke: "#65bb87",
3372
- d: "M15.5 13.5v1.2a.8.8 0 0 1-.8.8h-4.4a.8.8 0 0 1-.8-.8v-1.2H9a1 1 0 0 1 0-2h.5v-1.2a.8.8 0 0 1 .8-.8h1.2V9a1 1 0 0 1 2 0v.5h1.2a.8.8 0 0 1 .8.8v1.2H15a1 1 0 0 0 0 2z"
3373
- })], -1)])) : (v(), o("svg", qa, [a(" Icon from Catppuccin Icons by Catppuccin - https://github.com/catppuccin/vscode-icons/blob/main/LICENSE "), n[1] ||= s("g", {
3374
- fill: "none",
3375
- "stroke-linecap": "round",
3376
- "stroke-linejoin": "round"
3377
- }, [s("path", {
3378
- class: "stroke-dark dark:stroke-light",
3379
- d: "M4.5 4.5H12A1.5 1.5 0 0 1 13.5 6v.5m-7.5 7H2A1.5 1.5 0 0 1 .5 12V3.5a1 1 0 0 1 1-1h5a1 1 0 0 1 1 1v1"
3380
- }), s("path", {
3381
- stroke: "#65bb87",
3382
- d: "M15.5 13.5v1.2a.8.8 0 0 1-.8.8h-4.4a.8.8 0 0 1-.8-.8v-1.2H9a1 1 0 0 1 0-2h.5v-1.2a.8.8 0 0 1 .8-.8h1.2V9a1 1 0 0 1 2 0v.5h1.2a.8.8 0 0 1 .8.8v1.2H15a1 1 0 0 0 0 2z"
3383
- })], -1)]));
3384
- }
3385
- }), Ya = Ja;
3386
- const Xa = {
3387
- key: 0,
3388
- xmlns: "http://www.w3.org/2000/svg",
3389
- width: "1em",
3390
- height: "1em",
3391
- viewBox: "0 0 16 16"
3392
- }, Za = {
3393
- key: 1,
3394
- xmlns: "http://www.w3.org/2000/svg",
3395
- width: "1em",
3396
- height: "1em",
3397
- viewBox: "0 0 16 16"
3398
- };
3399
- var Qa = /* @__PURE__ */ l({
3400
- name: "PackagesIcones",
3401
- __name: "PackagesIcones",
3402
- props: { expanded: {
3403
- type: Boolean,
3404
- default: !1
3405
- } },
3406
- setup(e) {
3407
- let t = e;
3408
- return (e, n) => t.expanded ? (v(), o("svg", Xa, [a(" Icon from Catppuccin Icons by Catppuccin - https://github.com/catppuccin/vscode-icons/blob/main/LICENSE "), n[0] ||= s("g", {
3409
- fill: "none",
3410
- "stroke-linecap": "round",
3411
- "stroke-linejoin": "round"
3412
- }, [s("path", {
3413
- class: "stroke-dark dark:stroke-light",
3414
- d: "m1.875 8l.686-2.743a1 1 0 0 1 .97-.757h10.938a1 1 0 0 1 .97 1.243l-.315 1.26M6 13.5H2.004A1.5 1.5 0 0 1 .5 12V3.5a1 1 0 0 1 1-1h5a1 1 0 0 1 1 1v1"
3415
- }), s("path", {
3416
- stroke: "#E23730",
3417
- d: "M12 15.337v-3.919L8.5 9.214m3.5 2.204l3.5-2.204M12 7.5l3.5 1.714v4.408L12 15.5l-3.5-1.878V9.214Z"
3418
- })], -1)])) : (v(), o("svg", Za, [a(" Icon from Catppuccin Icons by Catppuccin - https://github.com/catppuccin/vscode-icons/blob/main/LICENSE "), n[1] ||= s("g", {
3419
- fill: "none",
3420
- "stroke-linecap": "round",
3421
- "stroke-linejoin": "round"
3422
- }, [s("path", {
3423
- class: "stroke-dark dark:stroke-light",
3424
- d: "M4.5 4.5H12A1.5 1.5 0 0 1 13.5 6v.5m-7.5 7H2A1.5 1.5 0 0 1 .5 12V3.5a1 1 0 0 1 1-1h5a1 1 0 0 1 1 1v1"
3425
- }), s("path", {
3426
- stroke: "#E23730",
3427
- d: "M12 15.337v-3.919L8.5 9.214m3.5 2.204l3.5-2.204M12 7.5l3.5 1.714v4.408L12 15.5l-3.5-1.878V9.214Z"
3428
- })], -1)]));
3429
- }
3430
- }), $a = Qa;
3431
- const eo = {
3432
- key: 0,
3433
- xmlns: "http://www.w3.org/2000/svg",
3434
- width: "1em",
3435
- height: "1em",
3436
- viewBox: "0 0 16 16"
3437
- }, to = {
3438
- key: 1,
3439
- xmlns: "http://www.w3.org/2000/svg",
3440
- width: "1em",
3441
- height: "1em",
3442
- viewBox: "0 0 16 16"
3443
- };
3444
- var no = /* @__PURE__ */ l({
3445
- name: "SrcIcones",
3446
- __name: "SrcIcones",
3447
- props: { expanded: {
3448
- type: Boolean,
3449
- default: !1
3450
- } },
3451
- setup(e) {
3452
- let t = e;
3453
- return (e, n) => t.expanded ? (v(), o("svg", eo, [a(" Icon from Catppuccin Icons by Catppuccin - https://github.com/catppuccin/vscode-icons/blob/main/LICENSE "), n[0] ||= s("g", {
3454
- fill: "none",
3455
- "stroke-linecap": "round",
3456
- "stroke-linejoin": "round"
3457
- }, [s("path", {
3458
- class: "stroke-dark dark:stroke-light",
3459
- d: "m1.875 8l.686-2.743a1 1 0 0 1 .97-.757h10.938a1 1 0 0 1 .97 1.243l-.315 1.26M6 13.5H2.004A1.5 1.5 0 0 1 .5 12V3.5a1 1 0 0 1 1-1h5a1 1 0 0 1 1 1v1"
3460
- }), s("path", {
3461
- stroke: "#65bb87",
3462
- d: "m10.5 8.5l-3 3.5l3 3.5m2-7l3 3.5l-3 3.5"
3463
- })], -1)])) : (v(), o("svg", to, [a(" Icon from Catppuccin Icons by Catppuccin - https://github.com/catppuccin/vscode-icons/blob/main/LICENSE "), n[1] ||= s("g", {
3464
- fill: "none",
3465
- "stroke-linecap": "round",
3466
- "stroke-linejoin": "round"
3467
- }, [s("path", {
3468
- class: "stroke-dark dark:stroke-light",
3469
- d: "M4.5 4.5H12A1.5 1.5 0 0 1 13.5 6v.5m-7.5 7H2A1.5 1.5 0 0 1 .5 12V3.5a1 1 0 0 1 1-1h5a1 1 0 0 1 1 1v1"
3470
- }), s("path", {
3471
- stroke: "#65bb87",
3472
- d: "m10.5 8.5l-3 3.5l3 3.5m2-7l3 3.5l-3 3.5"
3473
- })], -1)]));
3474
- }
3475
- }), ro = no;
3476
- const io = {
3477
- key: 0,
3478
- xmlns: "http://www.w3.org/2000/svg",
3479
- width: "1em",
3480
- height: "1em",
3481
- viewBox: "0 0 16 16"
3482
- }, ao = {
3483
- key: 1,
3484
- xmlns: "http://www.w3.org/2000/svg",
3485
- width: "1em",
3486
- height: "1em",
3487
- viewBox: "0 0 16 16"
3488
- };
3489
- var oo = /* @__PURE__ */ l({
3490
- name: "ViewIcones",
3491
- __name: "ViewIcones",
3492
- props: { expanded: {
3493
- type: Boolean,
3494
- default: !1
3495
- } },
3496
- setup(e) {
3497
- let t = e;
3498
- return (e, n) => t.expanded ? (v(), o("svg", io, [a(" Icon from Catppuccin Icons by Catppuccin - https://github.com/catppuccin/vscode-icons/blob/main/LICENSE "), n[0] ||= s("g", {
3499
- fill: "none",
3500
- "stroke-linecap": "round",
3501
- "stroke-linejoin": "round"
3502
- }, [s("path", {
3503
- class: "stroke-dark dark:stroke-light",
3504
- d: "m1.875 8l.686-2.743a1 1 0 0 1 .97-.757h10.938a1 1 0 0 1 .97 1.243l-.315 1.26M6 13.5H2.004A1.5 1.5 0 0 1 .5 12V3.5a1 1 0 0 1 1-1h5a1 1 0 0 1 1 1v1"
3505
- }), s("path", {
3506
- stroke: "#E23730",
3507
- d: "M14.692 8.5H9.308a.31.31 0 0 0-.307.336l.47 5.241c.01.128.1.235.223.27l2.303 1.153l2.308-1.153a.31.31 0 0 0 .225-.27L15 8.836a.31.31 0 0 0-.307-.336"
3508
- })], -1)])) : (v(), o("svg", ao, [a(" Icon from Catppuccin Icons by Catppuccin - https://github.com/catppuccin/vscode-icons/blob/main/LICENSE "), n[1] ||= s("g", {
3509
- fill: "none",
3510
- "stroke-linecap": "round",
3511
- "stroke-linejoin": "round"
3512
- }, [s("path", {
3513
- class: "stroke-dark dark:stroke-light",
3514
- d: "M4.5 4.5H12A1.5 1.5 0 0 1 13.5 6v.5m-7.5 7H2A1.5 1.5 0 0 1 .5 12V3.5a1 1 0 0 1 1-1h5a1 1 0 0 1 1 1v1"
3515
- }), s("path", {
3516
- stroke: "#E23730",
3517
- d: "M14.692 8.5H9.308a.31.31 0 0 0-.307.336l.47 5.241c.01.128.1.235.223.27l2.303 1.153l2.308-1.153a.31.31 0 0 0 .225-.27L15 8.836a.31.31 0 0 0-.307-.336"
3518
- })], -1)]));
3519
- }
3520
- }), so = oo;
3521
- const co = {
3522
- xmlns: "http://www.w3.org/2000/svg",
3523
- width: "1em",
3524
- height: "1em",
3525
- viewBox: "0 0 16 16"
3526
- };
3527
- var lo = /* @__PURE__ */ l({
3528
- name: "VueIcones",
3529
- __name: "VueIcones",
3530
- setup(e) {
3531
- return (e, t) => (v(), o("svg", co, [a(" Icon from Catppuccin Icons by Catppuccin - https://github.com/catppuccin/vscode-icons/blob/main/LICENSE "), t[0] ||= s("g", {
3532
- fill: "none",
3533
- stroke: "#65bb87",
3534
- "stroke-linecap": "round",
3535
- "stroke-linejoin": "round"
3536
- }, [s("path", { d: "M1 1.5h5.44L8 4.56L9.56 1.5H15l-6.99 13z" }), s("path", { d: "M12.05 1.73L8 9.28L3.95 1.73" })], -1)]));
3537
- }
3538
- }), uo = lo;
3539
- const fo = { class: "mt-0" }, po = { class: "w-152 mb-2" }, mo = { class: "inline-flex items-center text-inherit not-italic leading-[0] text-center normal-case [vertical-align:-0.125em] [text-rendering:optimizeLegibility] svg:size-4" }, ho = {
3540
- key: 1,
3541
- class: "flex items-center justify-center h-[220px]"
3542
- };
3543
- var go = /* @__PURE__ */ l({
3544
- name: "ComponentSelect",
3545
- __name: "ComponentSelect",
3546
- props: {
3547
- modelValue: { default: "" },
3548
- modelModifiers: {},
3549
- scope: { default: "" },
3550
- scopeModifiers: {}
3551
- },
3552
- emits: ["update:modelValue", "update:scope"],
3553
- setup(l) {
3554
- let h = O.PRESENTED_IMAGE_SIMPLE, g = e(), _ = w(l, "modelValue"), b = w(l, "scope"), x = T("searchInputRef"), [ee, oe] = Na(ka({
3555
- id: C(),
3556
- initialFocusEl: () => x.value
3557
- })), k = r(() => Oa(ee.value, oe, La)), A = y(!1), j = y(""), se = r(() => {
3558
- if (!_.value) return [];
3559
- let e = b.value ? `module:${b.value}` : "local";
3560
- return [`${e}/${_.value}`];
3561
- }), M = y([]);
3562
- function ce(e) {
3563
- return !e.includes("/");
3564
- }
3565
- function le(e) {
3566
- let t = e.indexOf("/");
3567
- return t === -1 ? e : e.slice(0, t);
3568
- }
3569
- function ue(e) {
3570
- let t = e.split("/"), n = [], r = "";
3571
- for (let e = 0; e < Math.max(0, t.length - 1); e++) {
3572
- let i = t[e];
3573
- r = e === 0 ? i : `${r}/${i}`, n.push(r);
3574
- }
3575
- return n;
3576
- }
3577
- function N(e, t) {
3578
- let n = e || [], r = t?.node?.key, i = !!t?.expanded, a;
3579
- a = r && ce(r) ? i ? r : void 0 : r ? le(r) : n.find(ce);
3580
- let o = n.filter((e) => !ce(String(e)) || String(e) === a);
3581
- M.value = o;
3582
- }
3583
- function P() {
3584
- let e = se.value[0];
3585
- if (!e) return;
3586
- let t = ue(e);
3587
- M.value = t;
3588
- }
3589
- E(se, () => {
3590
- P();
3591
- }, { immediate: !0 }), E(A, (e) => {
3592
- e && P();
3593
- }), E(A, (e) => {
3594
- e && P();
3595
- });
3596
- let F = r(() => {
3597
- let e = j.value.trim();
3598
- return e ? g.filterRouteTree(e) : g.getRouteTreeData();
3599
- });
3600
- function de(e) {
3601
- let t = [], n = (e) => {
3602
- for (let r of e || []) {
3603
- let e = Array.isArray(r?.children) && r.children.length > 0;
3604
- e && (t.push(String(r.key)), n(r.children));
3605
- }
3606
- };
3607
- return n(e), t;
3608
- }
3609
- E(j, (e) => {
3610
- let t = String(e || "").trim().length > 0;
3611
- if (t) {
3612
- let e = F.value;
3613
- M.value = de(e);
3614
- } else P();
3615
- });
3616
- function fe(e, t) {
3617
- let n = t?.node, r = n?.dataRef ?? n;
3618
- r?.isLeaf && (_.value = r.value || "", b.value = r.scope || "", j.value = "", A.value = !1);
3619
- }
3620
- return (e, r) => {
3621
- let l = ae, g = ie, y = ne, x = re;
3622
- return v(), o("div", fo, [
3623
- s("div", m(u(S(k).getTriggerProps())), [c(l, {
3624
- value: _.value,
3625
- "onUpdate:value": r[0] ||= (e) => _.value = e,
3626
- "addon-before": b.value || "本地",
3627
- placeholder: "请输入或选择组件路径(views下的路径)"
3628
- }, null, 8, ["value", "addon-before"])], 16),
3629
- a(" 始终挂载 Teleport,内部用 Transition 控制出现/消失动画 "),
3630
- (v(), i(n, { to: "body" }, [S(k).open ? (v(), o("div", f({ key: 0 }, S(k).getPositionerProps(), { class: "z-1050" }), [s("div", f(S(k).getContentProps(), { class: "z-1050 w-162 rounded-md border border-solid p-4 border-[--g-border-color] shadow-md outline-none bg-#ffffff dark:bg-#141414 text-dark dark:text-light data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95" }), [s("div", po, [c(g, null, {
3631
- default: D(() => [c(l, {
3632
- ref: "searchInputRef",
3633
- value: S(j),
3634
- "onUpdate:value": r[1] ||= (e) => d(j) ? j.value = e : null,
3635
- "allow-clear": "",
3636
- size: "small",
3637
- placeholder: "搜索组件或路径"
3638
- }, null, 8, ["value"])]),
3639
- _: 1
3640
- })]), S(F) && S(F).length ? (v(), i(y, {
3641
- key: 0,
3642
- "expanded-keys": S(M),
3643
- "onUpdate:expandedKeys": r[2] ||= (e) => d(M) ? M.value = e : null,
3644
- class: "w-152 h-100 overflow-y-auto directory-tree-root",
3645
- "selected-keys": S(se),
3646
- "tree-data": S(F),
3647
- "show-icon": !0,
3648
- "show-line": !0,
3649
- virtual: !0,
3650
- "expand-action": "click",
3651
- onExpand: N,
3652
- onSelect: fe
3653
- }, {
3654
- switcherIcon: D(({ switcherCls: e }) => [c(S(te), { class: p(e) }, null, 8, ["class"])]),
3655
- icon: D(({ expanded: e, dataRef: n }) => [s("span", mo, [a(" 根:无 '/' 的 key 表示 "), n?.root && !n?.module ? (v(), i($a, {
3656
- key: 0,
3657
- expanded: e
3658
- }, null, 8, ["expanded"])) : n?.root && n?.module ? (v(), i(Ya, {
3659
- key: 1,
3660
- expanded: e
3661
- }, null, 8, ["expanded"])) : n?.isLeaf ? (v(), o(t, { key: 2 }, [a(" 叶子:Vue 文件图标 "), c(uo)], 2112)) : ["components", "component"].includes(String(n?.title).toLowerCase()) ? (v(), o(t, { key: 3 }, [a(" 特殊目录 "), c(Va, { expanded: e }, null, 8, ["expanded"])], 2112)) : [
3662
- "views",
3663
- "view",
3664
- "pages",
3665
- "page"
3666
- ].includes(String(n?.title).toLowerCase()) ? (v(), i(so, {
3667
- key: 4,
3668
- expanded: e
3669
- }, null, 8, ["expanded"])) : ["src"].includes(String(n?.title).toLowerCase()) ? (v(), i(ro, {
3670
- key: 5,
3671
- expanded: e
3672
- }, null, 8, ["expanded"])) : (v(), o(t, { key: 6 }, [a(" 其他目录 "), c(Ga, { expanded: e }, null, 8, ["expanded"])], 2112))])]),
3673
- _: 1
3674
- }, 8, [
3675
- "expanded-keys",
3676
- "selected-keys",
3677
- "tree-data"
3678
- ])) : (v(), o("div", ho, [c(x, {
3679
- image: S(h),
3680
- description: "没有找到匹配的组件"
3681
- }, null, 8, ["image"])]))], 16)], 16)) : a("v-if", !0)]))
3682
- ]);
3683
- };
3684
- }
3685
- }), _o = go;
3686
- export { _o as b };