@pubinfo-pr/module-rbac 0.189.2 → 0.197.1
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.
- package/dist/{ComponentSelect-oZAtd4wH.js → ComponentSelect-BTaxN2iT.js} +1 -1
- package/dist/{ComponentSelect-CZCdwf92.js → ComponentSelect-Bsyx8WZL.js} +1063 -1140
- package/dist/{DynamicRoutesForm-DsjExKfm.js → DynamicRoutesForm-DEWzomS7.js} +1 -1
- package/dist/{DynamicRoutesForm-CYFZYd3h.js → DynamicRoutesForm-uNihUvAS.js} +2 -2
- package/dist/HCheckList-B5Qk_HBI.js +2 -0
- package/dist/{HCheckList-dHyYM7wQ.js → HCheckList-DLBewmPw.js} +3 -3
- package/dist/HoverCard-69ZIOivd.js +2 -0
- package/dist/{HoverCard-DM23tFv4.js → HoverCard-BDFcxxvk.js} +3 -3
- package/dist/{IconSelect-BMDn5KYI.js → IconSelect-1pVgA_5l.js} +8 -10
- package/dist/{IconSelect-AR3QMGQ1.js → IconSelect-C5KTdyzv.js} +1 -1
- package/dist/{ImportExport-yiI4wd1A.js → ImportExport-CgvABcRb.js} +10 -14
- package/dist/ImportExport-D1e963eV.js +4 -0
- package/dist/{LayoutForm-CYBKLlSy.js → LayoutForm-Cp4bBrYl.js} +9 -14
- package/dist/LayoutForm-QFjwakyQ.js +4 -0
- package/dist/{MetaForm-LDukYEwP.js → MetaForm-DhSo6Ods.js} +40 -48
- package/dist/MetaForm-DmUbrFlb.js +4 -0
- package/dist/{OrgAndPosition-Dp33AYU-.js → OrgAndPosition-ClASobEv.js} +7 -10
- package/dist/OrgAndPosition-DoiGY5xb.js +2 -0
- package/dist/{ResourceEdit-C5Xqu79p.js → ResourceEdit-BHqmmcC7.js} +9 -11
- package/dist/ResourceEdit-Bznnmb9d.js +10 -0
- package/dist/{ResourceRelation-l2XXebMl.js → ResourceRelation-BIOzTOKA.js} +1 -1
- package/dist/{ResourceRelation-DZrmMWPf.js → ResourceRelation-ChEwIbWM.js} +2 -2
- package/dist/{ResourceRelation-DeoM1DDo.js → ResourceRelation-D_j898zp.js} +4 -5
- package/dist/{RoleSelector-ZmjR8m3i.js → RoleSelector-Cd6_RUsc.js} +23 -24
- package/dist/{TenantEdit-BDTS1Fca.js → TenantEdit-BOvXk7BZ.js} +6 -9
- package/dist/TenantEdit-BlMmL6q5.js +2 -0
- package/dist/{UserAuthorization-C1QIiu2F.js → UserAuthorization-DLeivbs7.js} +10 -13
- package/dist/{UserAuthorization-CotnhBvL.js → UserAuthorization-qGr1Sdat.js} +2 -2
- package/dist/UserEdit-CwfyqNWf.js +3 -0
- package/dist/{UserEdit-C3mqGMtl.js → UserEdit-YKS1FVW_.js} +5 -7
- package/dist/animation_item-BAILNZWQ.js +2 -0
- package/dist/{animation_item-DRuXSAya.js → animation_item-DrJJHbmN.js} +1 -1
- package/dist/api/modules/assist/gonggaofuwu.d.ts +7 -7
- package/dist/api/modules/assist/qunzujiekou.d.ts +7 -7
- package/dist/api/modules/assist/quyujiekou.d.ts +6 -6
- package/dist/api/modules/configData/heibaimingdanfuwu.d.ts +6 -6
- package/dist/api/modules/configData/xitongpeizhifuwu.d.ts +15 -15
- package/dist/api/modules/configData/zidifuwu.d.ts +11 -11
- package/dist/api/modules/log/caozuorizhifuwu.d.ts +3 -3
- package/dist/api/modules/log/denglurizhifuwu.d.ts +3 -3
- package/dist/api/modules/rbac/gangweijiekou.d.ts +7 -7
- package/dist/api/modules/rbac/jiaosejiekou.d.ts +8 -8
- package/dist/api/modules/rbac/pubJiaosezukongzhiqi.d.ts +8 -8
- package/dist/api/modules/rbac/shujuquanxianzhubiaokongzhiqi.d.ts +10 -10
- package/dist/api/modules/rbac/yonghujiekou.d.ts +16 -16
- package/dist/api/modules/rbac/yonghushoucangbiaojiekou.d.ts +6 -6
- package/dist/api/modules/rbac/yonghuzuijinchangyongbiaojiekou.d.ts +5 -5
- package/dist/api/modules/rbac/ziyuandaorudaochuxiangguanjiekou.d.ts +7 -7
- package/dist/api/modules/rbac/ziyuanjiekou.d.ts +14 -14
- package/dist/api/modules/rbac/zuhuguanlijiekou.d.ts +6 -6
- package/dist/api/modules/rbac/zuzhijiaosebiaokongzhiqi.d.ts +5 -5
- package/dist/api/modules/rbac/zuzhijiekou.d.ts +10 -10
- package/dist/api/request.d.ts +1 -1
- package/dist/{blackWhiteList-Lyj2w8Xc.js → blackWhiteList-CNQltBqC.js} +59 -58
- package/dist/blackWhiteList.css +1 -1
- package/dist/breadcrumb_setting-DjBboFwU.js +108 -0
- package/dist/{chunk-BgHNfURc.js → chunk-DITB-ELH.js} +3 -5
- package/dist/components/DirectoryIcones/ComponentsIcones.vue.d.ts +3 -2
- package/dist/components/DirectoryIcones/FolderIcones.vue.d.ts +3 -2
- package/dist/components/DirectoryIcones/ModuleIcones.vue.d.ts +3 -2
- package/dist/components/DirectoryIcones/PackagesIcones.vue.d.ts +3 -2
- package/dist/components/DirectoryIcones/SrcIcones.vue.d.ts +3 -2
- package/dist/components/DirectoryIcones/ViewIcones.vue.d.ts +3 -2
- package/dist/components/DirectoryIcones/VueIcones.vue.d.ts +2 -1
- package/dist/components/GroupSelector/index.vue.d.ts +9 -8
- package/dist/components/JsonEditorModal/index.vue.d.ts +20 -0
- package/dist/components/OrgTree/index.vue.d.ts +6 -0
- package/dist/components/OrgUserSelector/OrgSelector.vue.d.ts +15 -18
- package/dist/components/OrgUserSelector/UserSelector.vue.d.ts +15 -18
- package/dist/components/OrgUserSelector/index.d.ts +4 -2
- package/dist/components/OrgUserSelector/provider.d.ts +1 -1
- package/dist/components/ResourceIcones/BoxColorPicker.vue.d.ts +4 -6
- package/dist/components/ResourceIcones/Select.vue.d.ts +14 -22
- package/dist/components/ResourceSelector/hooks/useAppAndResource.d.ts +16 -7
- package/dist/components/ResourceSelector/index.vue.d.ts +13 -11
- package/dist/components/RoleSelector/RoleSearch.vue.d.ts +11 -9
- package/dist/components/RoleSelector/RoleSelector.vue.d.ts +11 -9
- package/dist/components/RoleSelector/TooltipLabel.vue.d.ts +3 -2
- package/dist/components/RoleSelector/useRole.d.ts +68 -4
- package/dist/composables/useLottie.d.ts +1 -1
- package/dist/context.d.ts +2 -2
- package/dist/{createAndEditDataPermission-ClTyi4Ri.js → createAndEditDataPermission-CChlLDUm.js} +1 -1
- package/dist/{createAndEditDataPermission-BwUEAkBP.js → createAndEditDataPermission-CaOBJgoV.js} +16 -23
- package/dist/{data-permission-DXJBqtlO.js → data-permission-ZRQ-Aoib.js} +3 -3
- package/dist/{dayjs.min-Bsh92e4H.js → dayjs.min-Dz51Rwu9.js} +1 -1
- package/dist/{dictionary-W_1X6Rbi.js → dictionary-CtGgtPfc.js} +1 -1
- package/dist/{drawerBlackWhiteList-83S8Dj3z.js → drawerBlackWhiteList-BqIDyn2Q.js} +1 -1
- package/dist/{drawerBlackWhiteList-B1oIt5J_.js → drawerBlackWhiteList-CkbZ_9PZ.js} +4 -6
- package/dist/{drawerDictionary-CQhYvl_i.js → drawerDictionary-D911w7pC.js} +1 -1
- package/dist/{drawerDictionary-D3yiuJSQ.js → drawerDictionary-dMHs-6Cw.js} +4 -6
- package/dist/{drawerDictionaryItem-DgMdlr4F.js → drawerDictionaryItem-CbTa_qL-.js} +4 -6
- package/dist/{drawerDictionaryItem-DPNqG0Ow.js → drawerDictionaryItem-DLUI5Yuc.js} +1 -1
- package/dist/{drawerGroup-i0awz56c.js → drawerGroup-CEEDMBg9.js} +1 -1
- package/dist/{drawerGroup-AZQsI1zw.js → drawerGroup-DEuiiDPP.js} +6 -9
- package/dist/{drawerOrganization-oZcaL3zo.js → drawerOrganization-CqEMD3gE.js} +4 -6
- package/dist/{drawerOrganization-BLSFSwWp.js → drawerOrganization-mks5NMd9.js} +1 -1
- package/dist/{drawerPosition-BQDRnJxo.js → drawerPosition-Bd0s7qze.js} +4 -6
- package/dist/drawerPosition-DwlTrlGA.js +2 -0
- package/dist/{drawerRegion-DGs1NFgB.js → drawerRegion-DUbQAZuV.js} +4 -6
- package/dist/drawerRegion-DwVzsZfT.js +2 -0
- package/dist/{drawerRole-IoKzu2MV.js → drawerRole-BNrbcSmr.js} +1 -1
- package/dist/drawerRole-BxUIekjh.js +3 -0
- package/dist/drawerRole-CyA2oFht.js +4 -0
- package/dist/{drawerRole-D74a8YGf.js → drawerRole-D5X7oHB_.js} +7 -10
- package/dist/{drawerRole-CI92ltBG.js → drawerRole-DNDyOvXw.js} +7 -10
- package/dist/{drawerRole-BVGZbMiQ.js → drawerRole-Dv61PBZR.js} +6 -9
- package/dist/{group-CFfGOevD.js → group-BbkZjv5e.js} +3 -3
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1026 -990
- package/dist/interface.d.ts +2 -2
- package/dist/{itemlist-B6JOJttB.js → itemlist-By-FV6pN.js} +1 -1
- package/dist/{layout_setting-B_bXRf0W.js → layout_setting-BUAgQ1Bk.js} +3 -3
- package/dist/{loginHistoryDetail-DRBKf4C8.js → loginHistoryDetail-C7GT2yME.js} +2 -2
- package/dist/{loginHistoryDetail-BvdsnTFV.js → loginHistoryDetail-CkH5UUGU.js} +1 -1
- package/dist/{login_history-glJa2J1x.js → login_history-D08W00Qu.js} +3 -3
- package/dist/menu_setting-BUADDjYJ.js +155 -0
- package/dist/{operateHistoryDetail-B3es707H.js → operateHistoryDetail-BaNJRfwy.js} +2 -2
- package/dist/{operateHistoryDetail-CxD6LUWE.js → operateHistoryDetail-CeVPJzD6.js} +1 -1
- package/dist/{operate_history-YpetdRIT.js → operate_history-kJwIuPg2.js} +3 -3
- package/dist/{organization-B0yFeY4J.js → organization-2bEjUTJD.js} +1631 -1647
- package/dist/other_setting-COpfREkp.js +213 -0
- package/dist/page_animation_setting-BcxbEvNQ.js +108 -0
- package/dist/{page_w_setting-CBvXCWRR.js → page_w_setting-CD_HtSUv.js} +2 -2
- package/dist/{position-Qh2Cl1Hq.js → position-CLpbgKGj.js} +1 -1
- package/dist/{region-r_QWszyO.js → region-Dd9pt_Si.js} +1 -1
- package/dist/{resource-DKpLkyJH.js → resource-DLj7QoGf.js} +9 -9
- package/dist/{role-Pm5bxxjk.js → role-JGtvRObt.js} +2 -2
- package/dist/{role_group-D86PNA85.js → role_group-CKOb_m63.js} +2 -2
- package/dist/routes/index.d.ts +2 -2
- package/dist/routes/modules/authority.manage.menu.d.ts +1 -1
- package/dist/routes/modules/log.manage.menu.d.ts +1 -1
- package/dist/routes/modules/safe.manage.menu.d.ts +1 -1
- package/dist/routes/modules/stylesetting.manage.menu.d.ts +1 -1
- package/dist/routes/modules/system.manage.menu.d.ts +1 -1
- package/dist/{safe_setting-CWQngC4j.js → safe_setting-G_ZP-jWQ.js} +7 -10
- package/dist/setItem-Cke-0D4q.js +4 -0
- package/dist/{setItem-C5euZYfz.js → setItem-kPUYTKCP.js} +13 -13
- package/dist/stores/view.d.ts +127 -22
- package/dist/tabbar_setting-n1Id5cS0.js +139 -0
- package/dist/{tenant-DTjNtlwf.js → tenant-Ol7Zskue.js} +3 -3
- package/dist/{theme_setting-j1mXqCfa.js → theme_setting-vhNDLlkc.js} +4 -4
- package/dist/{toolbar_setting-BbJEvTPu.js → toolbar_setting-Dqrvui07.js} +20 -20
- package/dist/{user-BFOmEjwR.js → user-DvCyUhZW.js} +6 -6
- package/dist/utils/routeSystem.d.ts +133 -28
- package/dist/views/blackWhiteList/components/drawerBlackWhiteList.vue.d.ts +5 -6
- package/dist/views/blackWhiteList/index.vue.d.ts +2 -1534
- package/dist/views/breadcrumb_setting/animationData.d.ts +6 -6
- package/dist/views/breadcrumb_setting/index.vue.d.ts +2 -1
- package/dist/views/components/HCheckList.vue.d.ts +4 -3
- package/dist/views/components/animation_item.vue.d.ts +4 -5
- package/dist/views/components/setItem.vue.d.ts +4 -32
- package/dist/views/data-permission/components/createAndEditDataPermission.vue.d.ts +5 -167
- package/dist/views/data-permission/index.vue.d.ts +2 -1690
- package/dist/views/dictionary/components/drawerDictionary.vue.d.ts +5 -6
- package/dist/views/dictionary/components/drawerDictionaryItem.vue.d.ts +5 -6
- package/dist/views/dictionary/index.vue.d.ts +2 -1531
- package/dist/views/dictionary/itemlist.vue.d.ts +2 -1531
- package/dist/views/group/components/drawerGroup.vue.d.ts +5 -6
- package/dist/views/group/index.vue.d.ts +2 -1531
- package/dist/views/layout_setting/index.vue.d.ts +2 -1
- package/dist/views/log_center/components/browserType.vue.d.ts +4 -3
- package/dist/views/log_center/components/loginHistoryDetail.vue.d.ts +5 -4
- package/dist/views/log_center/components/operateHistoryDetail.vue.d.ts +5 -4
- package/dist/views/log_center/login_history.vue.d.ts +2 -1510
- package/dist/views/log_center/operate_history.vue.d.ts +2 -1510
- package/dist/views/menu_setting/animationData.d.ts +12 -12
- package/dist/views/menu_setting/index.vue.d.ts +2 -1
- package/dist/views/organization/components/drawerOrganization.vue.d.ts +5 -6
- package/dist/views/organization/components/drawerRole.vue.d.ts +5 -39
- package/dist/views/organization/index.vue.d.ts +2 -80
- package/dist/views/other_setting/animationData.d.ts +6 -6
- package/dist/views/other_setting/index.vue.d.ts +2 -1
- package/dist/views/other_setting/interface.d.ts +1 -1
- package/dist/views/page_animation_setting/animationData.d.ts +10 -10
- package/dist/views/page_animation_setting/index.vue.d.ts +2 -1
- package/dist/views/page_w_setting/index.vue.d.ts +2 -1
- package/dist/views/position/components/drawerPosition.vue.d.ts +5 -6
- package/dist/views/position/index.vue.d.ts +2 -1531
- package/dist/views/region/components/drawerRegion.vue.d.ts +5 -6
- package/dist/views/region/index.vue.d.ts +2 -1532
- package/dist/views/resource/components/ComponentSelect.vue.d.ts +5 -6
- package/dist/views/resource/components/DynamicRoutesForm.vue.d.ts +8 -6
- package/dist/views/resource/components/HoverCard.vue.d.ts +9 -12
- package/dist/views/resource/components/IconSelect.vue.d.ts +6 -5
- package/dist/views/resource/components/ImportExport.vue.d.ts +6 -5
- package/dist/views/resource/components/LayoutForm.vue.d.ts +6 -5
- package/dist/views/resource/components/MetaForm.vue.d.ts +6 -5
- package/dist/views/resource/components/ResourceEdit.vue.d.ts +6 -7
- package/dist/views/resource/components/RoleRelation.vue.d.ts +4 -3
- package/dist/views/resource/hooks/useLayoutForm.d.ts +5 -4
- package/dist/views/resource/hooks/useMetaForm.d.ts +12 -3
- package/dist/views/resource/index.vue.d.ts +2 -1570
- package/dist/views/resource/interface.d.ts +1 -1
- package/dist/views/role/components/ResourceRelation.vue.d.ts +4 -1512
- package/dist/views/role/components/drawerRole.vue.d.ts +5 -43
- package/dist/views/role/index.vue.d.ts +2 -3089
- package/dist/views/role_group/components/drawerRole.vue.d.ts +5 -39
- package/dist/views/role_group/index.vue.d.ts +2 -1564
- package/dist/views/safe_setting/index.vue.d.ts +2 -3
- package/dist/views/tabbar_setting/animationData.d.ts +10 -10
- package/dist/views/tabbar_setting/index.vue.d.ts +2 -1
- package/dist/views/tenant/components/TenantEdit.vue.d.ts +6 -8
- package/dist/views/tenant/index.vue.d.ts +2 -1533
- package/dist/views/theme_setting/index.vue.d.ts +2 -1
- package/dist/views/toolbar_setting/animationData.d.ts +14 -14
- package/dist/views/toolbar_setting/index.vue.d.ts +2 -1
- package/dist/views/user/components/OrgAndPosition.vue.d.ts +8 -7
- package/dist/views/user/components/UserAuthorization.vue.d.ts +5 -39
- package/dist/views/user/components/UserEdit.vue.d.ts +6 -7
- package/dist/views/user/index.vue.d.ts +2 -1593
- package/dist/views/watermark_setting/animationData.d.ts +2 -2
- package/dist/views/watermark_setting/index.vue.d.ts +2 -30
- package/dist/{watermark_setting-B1FGbTop.js → watermark_setting-CvakGNc4.js} +11 -14
- package/package.json +16 -16
- package/src/views/blackWhiteList/index.vue +2 -1
- package/dist/HCheckList-B6K018cG.js +0 -2
- package/dist/HoverCard-CfI-SLTb.js +0 -2
- package/dist/ImportExport-Ch2KgeOH.js +0 -4
- package/dist/LayoutForm-Qwrxmybp.js +0 -4
- package/dist/MetaForm-BswxCCuV.js +0 -4
- package/dist/OrgAndPosition-CyoItQuu.js +0 -2
- package/dist/ResourceEdit-DlnTxHoF.js +0 -10
- package/dist/TenantEdit-BOMpr4z8.js +0 -2
- package/dist/UserEdit-CJYVcFZw.js +0 -3
- package/dist/animation_item-DVbSAJ9x.js +0 -2
- package/dist/breadcrumb_setting-DmZAQdwS.js +0 -108
- package/dist/drawerPosition-Dv6sl-Lf.js +0 -2
- package/dist/drawerRegion-5FtwY5Rd.js +0 -2
- package/dist/drawerRole-B7LqcyGf.js +0 -4
- package/dist/drawerRole-Bq08YzR7.js +0 -3
- package/dist/menu_setting-CuMAvx0k.js +0 -155
- package/dist/other_setting-vOU1Lnfp.js +0 -215
- package/dist/page_animation_setting-DSAKNmb1.js +0 -108
- package/dist/routeSystem-DXMoWhFo.js +0 -2
- package/dist/setItem-BxDHeWlp.js +0 -4
- package/dist/tabbar_setting-D7enWjw4.js +0 -139
|
@@ -8,7 +8,7 @@ import './ComponentSelect.css';var sides = [
|
|
|
8
8
|
"right",
|
|
9
9
|
"bottom",
|
|
10
10
|
"left"
|
|
11
|
-
], min = Math.min, max = Math.max, round = Math.round, floor = Math.floor, createCoords = (i) => ({
|
|
11
|
+
], min$1 = Math.min, max$1 = Math.max, round$1 = Math.round, floor$1 = Math.floor, createCoords = (i) => ({
|
|
12
12
|
x: i,
|
|
13
13
|
y: i
|
|
14
14
|
}), oppositeSideMap = {
|
|
@@ -21,7 +21,7 @@ import './ComponentSelect.css';var sides = [
|
|
|
21
21
|
end: "start"
|
|
22
22
|
};
|
|
23
23
|
function clamp(i, s, c) {
|
|
24
|
-
return max(i, min(s, c));
|
|
24
|
+
return max$1(i, min$1(s, c));
|
|
25
25
|
}
|
|
26
26
|
function evaluate(i, s) {
|
|
27
27
|
return typeof i == "function" ? i(s) : i;
|
|
@@ -108,371 +108,17 @@ function rectToClientRect(i) {
|
|
|
108
108
|
y: c
|
|
109
109
|
};
|
|
110
110
|
}
|
|
111
|
-
function computeCoordsFromPlacement(i, s, c) {
|
|
112
|
-
let { reference: l, floating: u } = i, d = getSideAxis(s), f = getAlignmentAxis(s), p = getAxisLength(f), m = getSide(s), h = d === "y", g = l.x + l.width / 2 - u.width / 2, _ = l.y + l.height / 2 - u.height / 2, v = l[p] / 2 - u[p] / 2, y;
|
|
113
|
-
switch (m) {
|
|
114
|
-
case "top":
|
|
115
|
-
y = {
|
|
116
|
-
x: g,
|
|
117
|
-
y: l.y - u.height
|
|
118
|
-
};
|
|
119
|
-
break;
|
|
120
|
-
case "bottom":
|
|
121
|
-
y = {
|
|
122
|
-
x: g,
|
|
123
|
-
y: l.y + l.height
|
|
124
|
-
};
|
|
125
|
-
break;
|
|
126
|
-
case "right":
|
|
127
|
-
y = {
|
|
128
|
-
x: l.x + l.width,
|
|
129
|
-
y: _
|
|
130
|
-
};
|
|
131
|
-
break;
|
|
132
|
-
case "left":
|
|
133
|
-
y = {
|
|
134
|
-
x: l.x - u.width,
|
|
135
|
-
y: _
|
|
136
|
-
};
|
|
137
|
-
break;
|
|
138
|
-
default: y = {
|
|
139
|
-
x: l.x,
|
|
140
|
-
y: l.y
|
|
141
|
-
};
|
|
142
|
-
}
|
|
143
|
-
switch (getAlignment(s)) {
|
|
144
|
-
case "start":
|
|
145
|
-
y[f] -= v * (c && h ? -1 : 1);
|
|
146
|
-
break;
|
|
147
|
-
case "end":
|
|
148
|
-
y[f] += v * (c && h ? -1 : 1);
|
|
149
|
-
break;
|
|
150
|
-
}
|
|
151
|
-
return y;
|
|
152
|
-
}
|
|
153
|
-
var computePosition$1 = async (i, s, c) => {
|
|
154
|
-
let { placement: l = "bottom", strategy: u = "absolute", middleware: d = [], platform: f } = c, p = d.filter(Boolean), m = await (f.isRTL == null ? void 0 : f.isRTL(s)), h = await f.getElementRects({
|
|
155
|
-
reference: i,
|
|
156
|
-
floating: s,
|
|
157
|
-
strategy: u
|
|
158
|
-
}), { x: g, y: _ } = computeCoordsFromPlacement(h, l, m), v = l, y = {}, b = 0;
|
|
159
|
-
for (let c = 0; c < p.length; c++) {
|
|
160
|
-
let { name: d, fn: x } = p[c], { x: S, y: C, data: w, reset: T } = await x({
|
|
161
|
-
x: g,
|
|
162
|
-
y: _,
|
|
163
|
-
initialPlacement: l,
|
|
164
|
-
placement: v,
|
|
165
|
-
strategy: u,
|
|
166
|
-
middlewareData: y,
|
|
167
|
-
rects: h,
|
|
168
|
-
platform: f,
|
|
169
|
-
elements: {
|
|
170
|
-
reference: i,
|
|
171
|
-
floating: s
|
|
172
|
-
}
|
|
173
|
-
});
|
|
174
|
-
g = S ?? g, _ = C ?? _, y = {
|
|
175
|
-
...y,
|
|
176
|
-
[d]: {
|
|
177
|
-
...y[d],
|
|
178
|
-
...w
|
|
179
|
-
}
|
|
180
|
-
}, T && b <= 50 && (b++, typeof T == "object" && (T.placement && (v = T.placement), T.rects && (h = T.rects === !0 ? await f.getElementRects({
|
|
181
|
-
reference: i,
|
|
182
|
-
floating: s,
|
|
183
|
-
strategy: u
|
|
184
|
-
}) : T.rects), {x: g, y: _} = computeCoordsFromPlacement(h, v, m)), c = -1);
|
|
185
|
-
}
|
|
186
|
-
return {
|
|
187
|
-
x: g,
|
|
188
|
-
y: _,
|
|
189
|
-
placement: v,
|
|
190
|
-
strategy: u,
|
|
191
|
-
middlewareData: y
|
|
192
|
-
};
|
|
193
|
-
};
|
|
194
|
-
async function detectOverflow(i, s) {
|
|
195
|
-
s === void 0 && (s = {});
|
|
196
|
-
let { x: c, y: l, platform: u, rects: d, elements: f, strategy: p } = i, { boundary: m = "clippingAncestors", rootBoundary: h = "viewport", elementContext: g = "floating", altBoundary: _ = !1, padding: v = 0 } = evaluate(s, i), y = getPaddingObject(v), b = f[_ ? g === "floating" ? "reference" : "floating" : g], x = rectToClientRect(await u.getClippingRect({
|
|
197
|
-
element: await (u.isElement == null ? void 0 : u.isElement(b)) ?? !0 ? b : b.contextElement || await (u.getDocumentElement == null ? void 0 : u.getDocumentElement(f.floating)),
|
|
198
|
-
boundary: m,
|
|
199
|
-
rootBoundary: h,
|
|
200
|
-
strategy: p
|
|
201
|
-
})), S = g === "floating" ? {
|
|
202
|
-
x: c,
|
|
203
|
-
y: l,
|
|
204
|
-
width: d.floating.width,
|
|
205
|
-
height: d.floating.height
|
|
206
|
-
} : d.reference, C = await (u.getOffsetParent == null ? void 0 : u.getOffsetParent(f.floating)), w = await (u.isElement == null ? void 0 : u.isElement(C)) && await (u.getScale == null ? void 0 : u.getScale(C)) || {
|
|
207
|
-
x: 1,
|
|
208
|
-
y: 1
|
|
209
|
-
}, T = rectToClientRect(u.convertOffsetParentRelativeRectToViewportRelativeRect ? await u.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
210
|
-
elements: f,
|
|
211
|
-
rect: S,
|
|
212
|
-
offsetParent: C,
|
|
213
|
-
strategy: p
|
|
214
|
-
}) : S);
|
|
215
|
-
return {
|
|
216
|
-
top: (x.top - T.top + y.top) / w.y,
|
|
217
|
-
bottom: (T.bottom - x.bottom + y.bottom) / w.y,
|
|
218
|
-
left: (x.left - T.left + y.left) / w.x,
|
|
219
|
-
right: (T.right - x.right + y.right) / w.x
|
|
220
|
-
};
|
|
221
|
-
}
|
|
222
|
-
var arrow$1 = (i) => ({
|
|
223
|
-
name: "arrow",
|
|
224
|
-
options: i,
|
|
225
|
-
async fn(s) {
|
|
226
|
-
let { x: c, y: l, placement: u, rects: d, platform: f, elements: p, middlewareData: m } = s, { element: h, padding: g = 0 } = evaluate(i, s) || {};
|
|
227
|
-
if (h == null) return {};
|
|
228
|
-
let _ = getPaddingObject(g), v = {
|
|
229
|
-
x: c,
|
|
230
|
-
y: l
|
|
231
|
-
}, y = getAlignmentAxis(u), b = getAxisLength(y), x = await f.getDimensions(h), S = y === "y", C = S ? "top" : "left", w = S ? "bottom" : "right", T = S ? "clientHeight" : "clientWidth", E = d.reference[b] + d.reference[y] - v[y] - d.floating[b], D = v[y] - d.reference[y], O = await (f.getOffsetParent == null ? void 0 : f.getOffsetParent(h)), k = O ? O[T] : 0;
|
|
232
|
-
(!k || !await (f.isElement == null ? void 0 : f.isElement(O))) && (k = p.floating[T] || d.floating[b]);
|
|
233
|
-
let A = E / 2 - D / 2, j = k / 2 - x[b] / 2 - 1, M = min(_[C], j), N = min(_[w], j), P = M, F = k - x[b] - N, I = k / 2 - x[b] / 2 + A, L = clamp(P, I, F), R = !m.arrow && getAlignment(u) != null && I !== L && d.reference[b] / 2 - (I < P ? M : N) - x[b] / 2 < 0, z = R ? I < P ? I - P : I - F : 0;
|
|
234
|
-
return {
|
|
235
|
-
[y]: v[y] + z,
|
|
236
|
-
data: {
|
|
237
|
-
[y]: L,
|
|
238
|
-
centerOffset: I - L - z,
|
|
239
|
-
...R && { alignmentOffset: z }
|
|
240
|
-
},
|
|
241
|
-
reset: R
|
|
242
|
-
};
|
|
243
|
-
}
|
|
244
|
-
}), flip$1 = function(i) {
|
|
245
|
-
return i === void 0 && (i = {}), {
|
|
246
|
-
name: "flip",
|
|
247
|
-
options: i,
|
|
248
|
-
async fn(s) {
|
|
249
|
-
var c;
|
|
250
|
-
let { placement: l, middlewareData: u, rects: d, initialPlacement: f, platform: p, elements: m } = s, { mainAxis: h = !0, crossAxis: g = !0, fallbackPlacements: _, fallbackStrategy: v = "bestFit", fallbackAxisSideDirection: y = "none", flipAlignment: b = !0, ...x } = evaluate(i, s);
|
|
251
|
-
if ((c = u.arrow) != null && c.alignmentOffset) return {};
|
|
252
|
-
let S = getSide(l), C = getSideAxis(f), w = getSide(f) === f, T = await (p.isRTL == null ? void 0 : p.isRTL(m.floating)), E = _ || (w || !b ? [getOppositePlacement(f)] : getExpandedPlacements(f)), D = y !== "none";
|
|
253
|
-
!_ && D && E.push(...getOppositeAxisPlacements(f, b, y, T));
|
|
254
|
-
let O = [f, ...E], k = await detectOverflow(s, x), A = [], j = u.flip?.overflows || [];
|
|
255
|
-
if (h && A.push(k[S]), g) {
|
|
256
|
-
let i = getAlignmentSides(l, d, T);
|
|
257
|
-
A.push(k[i[0]], k[i[1]]);
|
|
258
|
-
}
|
|
259
|
-
if (j = [...j, {
|
|
260
|
-
placement: l,
|
|
261
|
-
overflows: A
|
|
262
|
-
}], !A.every((i) => i <= 0)) {
|
|
263
|
-
let i = (u.flip?.index || 0) + 1, s = O[i];
|
|
264
|
-
if (s && (!(g === "alignment" && C !== getSideAxis(s)) || j.every((i) => i.overflows[0] > 0 && getSideAxis(i.placement) === C))) return {
|
|
265
|
-
data: {
|
|
266
|
-
index: i,
|
|
267
|
-
overflows: j
|
|
268
|
-
},
|
|
269
|
-
reset: { placement: s }
|
|
270
|
-
};
|
|
271
|
-
let c = j.filter((i) => i.overflows[0] <= 0).sort((i, s) => i.overflows[1] - s.overflows[1])[0]?.placement;
|
|
272
|
-
if (!c) switch (v) {
|
|
273
|
-
case "bestFit": {
|
|
274
|
-
let i = j.filter((i) => {
|
|
275
|
-
if (D) {
|
|
276
|
-
let s = getSideAxis(i.placement);
|
|
277
|
-
return s === C || s === "y";
|
|
278
|
-
}
|
|
279
|
-
return !0;
|
|
280
|
-
}).map((i) => [i.placement, i.overflows.filter((i) => i > 0).reduce((i, s) => i + s, 0)]).sort((i, s) => i[1] - s[1])[0]?.[0];
|
|
281
|
-
i && (c = i);
|
|
282
|
-
break;
|
|
283
|
-
}
|
|
284
|
-
case "initialPlacement":
|
|
285
|
-
c = f;
|
|
286
|
-
break;
|
|
287
|
-
}
|
|
288
|
-
if (l !== c) return { reset: { placement: c } };
|
|
289
|
-
}
|
|
290
|
-
return {};
|
|
291
|
-
}
|
|
292
|
-
};
|
|
293
|
-
};
|
|
294
|
-
function getSideOffsets(i, s) {
|
|
295
|
-
return {
|
|
296
|
-
top: i.top - s.height,
|
|
297
|
-
right: i.right - s.width,
|
|
298
|
-
bottom: i.bottom - s.height,
|
|
299
|
-
left: i.left - s.width
|
|
300
|
-
};
|
|
301
|
-
}
|
|
302
|
-
function isAnySideFullyClipped(i) {
|
|
303
|
-
return sides.some((s) => i[s] >= 0);
|
|
304
|
-
}
|
|
305
|
-
var hide$1 = function(i) {
|
|
306
|
-
return i === void 0 && (i = {}), {
|
|
307
|
-
name: "hide",
|
|
308
|
-
options: i,
|
|
309
|
-
async fn(s) {
|
|
310
|
-
let { rects: c } = s, { strategy: l = "referenceHidden", ...u } = evaluate(i, s);
|
|
311
|
-
switch (l) {
|
|
312
|
-
case "referenceHidden": {
|
|
313
|
-
let i = getSideOffsets(await detectOverflow(s, {
|
|
314
|
-
...u,
|
|
315
|
-
elementContext: "reference"
|
|
316
|
-
}), c.reference);
|
|
317
|
-
return { data: {
|
|
318
|
-
referenceHiddenOffsets: i,
|
|
319
|
-
referenceHidden: isAnySideFullyClipped(i)
|
|
320
|
-
} };
|
|
321
|
-
}
|
|
322
|
-
case "escaped": {
|
|
323
|
-
let i = getSideOffsets(await detectOverflow(s, {
|
|
324
|
-
...u,
|
|
325
|
-
altBoundary: !0
|
|
326
|
-
}), c.floating);
|
|
327
|
-
return { data: {
|
|
328
|
-
escapedOffsets: i,
|
|
329
|
-
escaped: isAnySideFullyClipped(i)
|
|
330
|
-
} };
|
|
331
|
-
}
|
|
332
|
-
default: return {};
|
|
333
|
-
}
|
|
334
|
-
}
|
|
335
|
-
};
|
|
336
|
-
}, originSides = /* @__PURE__ */ new Set(["left", "top"]);
|
|
337
|
-
async function convertValueToCoords(i, s) {
|
|
338
|
-
let { placement: c, platform: l, elements: u } = i, d = await (l.isRTL == null ? void 0 : l.isRTL(u.floating)), f = getSide(c), p = getAlignment(c), m = getSideAxis(c) === "y", h = originSides.has(f) ? -1 : 1, g = d && m ? -1 : 1, _ = evaluate(s, i), { mainAxis: v, crossAxis: y, alignmentAxis: b } = typeof _ == "number" ? {
|
|
339
|
-
mainAxis: _,
|
|
340
|
-
crossAxis: 0,
|
|
341
|
-
alignmentAxis: null
|
|
342
|
-
} : {
|
|
343
|
-
mainAxis: _.mainAxis || 0,
|
|
344
|
-
crossAxis: _.crossAxis || 0,
|
|
345
|
-
alignmentAxis: _.alignmentAxis
|
|
346
|
-
};
|
|
347
|
-
return p && typeof b == "number" && (y = p === "end" ? b * -1 : b), m ? {
|
|
348
|
-
x: y * g,
|
|
349
|
-
y: v * h
|
|
350
|
-
} : {
|
|
351
|
-
x: v * h,
|
|
352
|
-
y: y * g
|
|
353
|
-
};
|
|
354
|
-
}
|
|
355
|
-
var offset$1 = function(i) {
|
|
356
|
-
return i === void 0 && (i = 0), {
|
|
357
|
-
name: "offset",
|
|
358
|
-
options: i,
|
|
359
|
-
async fn(s) {
|
|
360
|
-
var c;
|
|
361
|
-
let { x: l, y: u, placement: d, middlewareData: f } = s, p = await convertValueToCoords(s, i);
|
|
362
|
-
return d === f.offset?.placement && (c = f.arrow) != null && c.alignmentOffset ? {} : {
|
|
363
|
-
x: l + p.x,
|
|
364
|
-
y: u + p.y,
|
|
365
|
-
data: {
|
|
366
|
-
...p,
|
|
367
|
-
placement: d
|
|
368
|
-
}
|
|
369
|
-
};
|
|
370
|
-
}
|
|
371
|
-
};
|
|
372
|
-
}, shift$1 = function(i) {
|
|
373
|
-
return i === void 0 && (i = {}), {
|
|
374
|
-
name: "shift",
|
|
375
|
-
options: i,
|
|
376
|
-
async fn(s) {
|
|
377
|
-
let { x: c, y: l, placement: u } = s, { mainAxis: d = !0, crossAxis: f = !1, limiter: p = { fn: (i) => {
|
|
378
|
-
let { x: s, y: c } = i;
|
|
379
|
-
return {
|
|
380
|
-
x: s,
|
|
381
|
-
y: c
|
|
382
|
-
};
|
|
383
|
-
} }, ...m } = evaluate(i, s), h = {
|
|
384
|
-
x: c,
|
|
385
|
-
y: l
|
|
386
|
-
}, g = await detectOverflow(s, m), _ = getSideAxis(getSide(u)), v = getOppositeAxis(_), y = h[v], b = h[_];
|
|
387
|
-
if (d) {
|
|
388
|
-
let i = v === "y" ? "top" : "left", s = v === "y" ? "bottom" : "right", c = y + g[i], l = y - g[s];
|
|
389
|
-
y = clamp(c, y, l);
|
|
390
|
-
}
|
|
391
|
-
if (f) {
|
|
392
|
-
let i = _ === "y" ? "top" : "left", s = _ === "y" ? "bottom" : "right", c = b + g[i], l = b - g[s];
|
|
393
|
-
b = clamp(c, b, l);
|
|
394
|
-
}
|
|
395
|
-
let x = p.fn({
|
|
396
|
-
...s,
|
|
397
|
-
[v]: y,
|
|
398
|
-
[_]: b
|
|
399
|
-
});
|
|
400
|
-
return {
|
|
401
|
-
...x,
|
|
402
|
-
data: {
|
|
403
|
-
x: x.x - c,
|
|
404
|
-
y: x.y - l,
|
|
405
|
-
enabled: {
|
|
406
|
-
[v]: d,
|
|
407
|
-
[_]: f
|
|
408
|
-
}
|
|
409
|
-
}
|
|
410
|
-
};
|
|
411
|
-
}
|
|
412
|
-
};
|
|
413
|
-
}, limitShift$1 = function(i) {
|
|
414
|
-
return i === void 0 && (i = {}), {
|
|
415
|
-
options: i,
|
|
416
|
-
fn(s) {
|
|
417
|
-
let { x: c, y: l, placement: u, rects: d, middlewareData: f } = s, { offset: p = 0, mainAxis: m = !0, crossAxis: h = !0 } = evaluate(i, s), g = {
|
|
418
|
-
x: c,
|
|
419
|
-
y: l
|
|
420
|
-
}, _ = getSideAxis(u), v = getOppositeAxis(_), y = g[v], b = g[_], x = evaluate(p, s), S = typeof x == "number" ? {
|
|
421
|
-
mainAxis: x,
|
|
422
|
-
crossAxis: 0
|
|
423
|
-
} : {
|
|
424
|
-
mainAxis: 0,
|
|
425
|
-
crossAxis: 0,
|
|
426
|
-
...x
|
|
427
|
-
};
|
|
428
|
-
if (m) {
|
|
429
|
-
let i = v === "y" ? "height" : "width", s = d.reference[v] - d.floating[i] + S.mainAxis, c = d.reference[v] + d.reference[i] - S.mainAxis;
|
|
430
|
-
y < s ? y = s : y > c && (y = c);
|
|
431
|
-
}
|
|
432
|
-
if (h) {
|
|
433
|
-
let i = v === "y" ? "width" : "height", s = originSides.has(getSide(u)), c = d.reference[_] - d.floating[i] + (s && f.offset?.[_] || 0) + (s ? 0 : S.crossAxis), l = d.reference[_] + d.reference[i] + (s ? 0 : f.offset?.[_] || 0) - (s ? S.crossAxis : 0);
|
|
434
|
-
b < c ? b = c : b > l && (b = l);
|
|
435
|
-
}
|
|
436
|
-
return {
|
|
437
|
-
[v]: y,
|
|
438
|
-
[_]: b
|
|
439
|
-
};
|
|
440
|
-
}
|
|
441
|
-
};
|
|
442
|
-
}, size$1 = function(i) {
|
|
443
|
-
return i === void 0 && (i = {}), {
|
|
444
|
-
name: "size",
|
|
445
|
-
options: i,
|
|
446
|
-
async fn(s) {
|
|
447
|
-
var c, l;
|
|
448
|
-
let { placement: u, rects: d, platform: f, elements: p } = s, { apply: m = () => {}, ...h } = evaluate(i, s), g = await detectOverflow(s, h), _ = getSide(u), v = getAlignment(u), y = getSideAxis(u) === "y", { width: b, height: x } = d.floating, S, C;
|
|
449
|
-
_ === "top" || _ === "bottom" ? (S = _, C = v === (await (f.isRTL == null ? void 0 : f.isRTL(p.floating)) ? "start" : "end") ? "left" : "right") : (C = _, S = v === "end" ? "top" : "bottom");
|
|
450
|
-
let w = x - g.top - g.bottom, T = b - g.left - g.right, E = min(x - g[S], w), D = min(b - g[C], T), O = !s.middlewareData.shift, k = E, A = D;
|
|
451
|
-
if ((c = s.middlewareData.shift) != null && c.enabled.x && (A = T), (l = s.middlewareData.shift) != null && l.enabled.y && (k = w), O && !v) {
|
|
452
|
-
let i = max(g.left, 0), s = max(g.right, 0), c = max(g.top, 0), l = max(g.bottom, 0);
|
|
453
|
-
y ? A = b - 2 * (i !== 0 || s !== 0 ? i + s : max(g.left, g.right)) : k = x - 2 * (c !== 0 || l !== 0 ? c + l : max(g.top, g.bottom));
|
|
454
|
-
}
|
|
455
|
-
await m({
|
|
456
|
-
...s,
|
|
457
|
-
availableWidth: A,
|
|
458
|
-
availableHeight: k
|
|
459
|
-
});
|
|
460
|
-
let j = await f.getDimensions(p.floating);
|
|
461
|
-
return b !== j.width || x !== j.height ? { reset: { rects: !0 } } : {};
|
|
462
|
-
}
|
|
463
|
-
};
|
|
464
|
-
};
|
|
465
111
|
function hasWindow() {
|
|
466
112
|
return typeof window < "u";
|
|
467
113
|
}
|
|
468
|
-
function getNodeName(i) {
|
|
114
|
+
function getNodeName$1(i) {
|
|
469
115
|
return isNode$1(i) ? (i.nodeName || "").toLowerCase() : "#document";
|
|
470
116
|
}
|
|
471
117
|
function getWindow$1(i) {
|
|
472
118
|
var s;
|
|
473
119
|
return (i == null || (s = i.ownerDocument) == null ? void 0 : s.defaultView) || window;
|
|
474
120
|
}
|
|
475
|
-
function getDocumentElement(i) {
|
|
121
|
+
function getDocumentElement$1(i) {
|
|
476
122
|
return ((isNode$1(i) ? i.ownerDocument : i.document) || window.document)?.documentElement;
|
|
477
123
|
}
|
|
478
124
|
function isNode$1(i) {
|
|
@@ -488,8 +134,8 @@ function isShadowRoot$1(i) {
|
|
|
488
134
|
return !hasWindow() || typeof ShadowRoot > "u" ? !1 : i instanceof ShadowRoot || i instanceof getWindow$1(i).ShadowRoot;
|
|
489
135
|
}
|
|
490
136
|
var invalidOverflowDisplayValues = /* @__PURE__ */ new Set(["inline", "contents"]);
|
|
491
|
-
function isOverflowElement(i) {
|
|
492
|
-
let { overflow: s, overflowX: c, overflowY: l, display: u } = getComputedStyle$
|
|
137
|
+
function isOverflowElement$1(i) {
|
|
138
|
+
let { overflow: s, overflowX: c, overflowY: l, display: u } = getComputedStyle$2(i);
|
|
493
139
|
return /auto|scroll|overlay|hidden|clip/.test(s + l + c) && !invalidOverflowDisplayValues.has(u);
|
|
494
140
|
}
|
|
495
141
|
var tableElements = /* @__PURE__ */ new Set([
|
|
@@ -498,7 +144,7 @@ var tableElements = /* @__PURE__ */ new Set([
|
|
|
498
144
|
"th"
|
|
499
145
|
]);
|
|
500
146
|
function isTableElement(i) {
|
|
501
|
-
return tableElements.has(getNodeName(i));
|
|
147
|
+
return tableElements.has(getNodeName$1(i));
|
|
502
148
|
}
|
|
503
149
|
var topLayerSelectors = [":popover-open", ":modal"];
|
|
504
150
|
function isTopLayer(i) {
|
|
@@ -530,15 +176,15 @@ var transformProperties = [
|
|
|
530
176
|
"content"
|
|
531
177
|
];
|
|
532
178
|
function isContainingBlock(i) {
|
|
533
|
-
let s = isWebKit(), c = isElement$1(i) ? getComputedStyle$
|
|
179
|
+
let s = isWebKit(), c = isElement$1(i) ? getComputedStyle$2(i) : i;
|
|
534
180
|
return transformProperties.some((i) => c[i] ? c[i] !== "none" : !1) || (c.containerType ? c.containerType !== "normal" : !1) || !s && (c.backdropFilter ? c.backdropFilter !== "none" : !1) || !s && (c.filter ? c.filter !== "none" : !1) || willChangeValues.some((i) => (c.willChange || "").includes(i)) || containValues.some((i) => (c.contain || "").includes(i));
|
|
535
181
|
}
|
|
536
182
|
function getContainingBlock(i) {
|
|
537
|
-
let s = getParentNode$
|
|
183
|
+
let s = getParentNode$2(i);
|
|
538
184
|
for (; isHTMLElement$1(s) && !isLastTraversableNode(s);) {
|
|
539
185
|
if (isContainingBlock(s)) return s;
|
|
540
186
|
if (isTopLayer(s)) return null;
|
|
541
|
-
s = getParentNode$
|
|
187
|
+
s = getParentNode$2(s);
|
|
542
188
|
}
|
|
543
189
|
return null;
|
|
544
190
|
}
|
|
@@ -551,9 +197,9 @@ var lastTraversableNodeNames = /* @__PURE__ */ new Set([
|
|
|
551
197
|
"#document"
|
|
552
198
|
]);
|
|
553
199
|
function isLastTraversableNode(i) {
|
|
554
|
-
return lastTraversableNodeNames.has(getNodeName(i));
|
|
200
|
+
return lastTraversableNodeNames.has(getNodeName$1(i));
|
|
555
201
|
}
|
|
556
|
-
function getComputedStyle$
|
|
202
|
+
function getComputedStyle$2(i) {
|
|
557
203
|
return getWindow$1(i).getComputedStyle(i);
|
|
558
204
|
}
|
|
559
205
|
function getNodeScroll(i) {
|
|
@@ -565,21 +211,21 @@ function getNodeScroll(i) {
|
|
|
565
211
|
scrollTop: i.scrollY
|
|
566
212
|
};
|
|
567
213
|
}
|
|
568
|
-
function getParentNode$
|
|
569
|
-
if (getNodeName(i) === "html") return i;
|
|
570
|
-
let s = i.assignedSlot || i.parentNode || isShadowRoot$1(i) && i.host || getDocumentElement(i);
|
|
214
|
+
function getParentNode$2(i) {
|
|
215
|
+
if (getNodeName$1(i) === "html") return i;
|
|
216
|
+
let s = i.assignedSlot || i.parentNode || isShadowRoot$1(i) && i.host || getDocumentElement$1(i);
|
|
571
217
|
return isShadowRoot$1(s) ? s.host : s;
|
|
572
218
|
}
|
|
573
219
|
function getNearestOverflowAncestor$1(i) {
|
|
574
|
-
let s = getParentNode$
|
|
575
|
-
return isLastTraversableNode(s) ? i.ownerDocument ? i.ownerDocument.body : i.body : isHTMLElement$1(s) && isOverflowElement(s) ? s : getNearestOverflowAncestor$1(s);
|
|
220
|
+
let s = getParentNode$2(i);
|
|
221
|
+
return isLastTraversableNode(s) ? i.ownerDocument ? i.ownerDocument.body : i.body : isHTMLElement$1(s) && isOverflowElement$1(s) ? s : getNearestOverflowAncestor$1(s);
|
|
576
222
|
}
|
|
577
223
|
function getOverflowAncestors(i, s, c) {
|
|
578
224
|
s === void 0 && (s = []), c === void 0 && (c = !0);
|
|
579
225
|
let l = getNearestOverflowAncestor$1(i), u = l === i.ownerDocument?.body, d = getWindow$1(l);
|
|
580
226
|
if (u) {
|
|
581
227
|
let i = getFrameElement(d);
|
|
582
|
-
return s.concat(d, d.visualViewport || [], isOverflowElement(l) ? l : [], i && c ? getOverflowAncestors(i) : []);
|
|
228
|
+
return s.concat(d, d.visualViewport || [], isOverflowElement$1(l) ? l : [], i && c ? getOverflowAncestors(i) : []);
|
|
583
229
|
}
|
|
584
230
|
return s.concat(l, getOverflowAncestors(l, [], c));
|
|
585
231
|
}
|
|
@@ -613,7 +259,7 @@ function isHTMLElement(i) {
|
|
|
613
259
|
return isObject$2(i) && i.nodeType === ELEMENT_NODE && typeof i.nodeName == "string";
|
|
614
260
|
}
|
|
615
261
|
var isDocument = (i) => isObject$2(i) && i.nodeType === DOCUMENT_NODE, isWindow = (i) => isObject$2(i) && i === i.window;
|
|
616
|
-
function getNodeName
|
|
262
|
+
function getNodeName(i) {
|
|
617
263
|
return isHTMLElement(i) ? i.localName || "" : "#document";
|
|
618
264
|
}
|
|
619
265
|
function isRootElement(i) {
|
|
@@ -621,7 +267,7 @@ function isRootElement(i) {
|
|
|
621
267
|
"html",
|
|
622
268
|
"body",
|
|
623
269
|
"#document"
|
|
624
|
-
].includes(getNodeName
|
|
270
|
+
].includes(getNodeName(i));
|
|
625
271
|
}
|
|
626
272
|
var isNode = (i) => isObject$2(i) && i.nodeType !== void 0;
|
|
627
273
|
function isShadowRoot(i) {
|
|
@@ -651,263 +297,617 @@ function contains(i, s) {
|
|
|
651
297
|
c = c.parentNode || c.host;
|
|
652
298
|
}
|
|
653
299
|
}
|
|
654
|
-
return !1;
|
|
300
|
+
return !1;
|
|
301
|
+
}
|
|
302
|
+
function getDocument(i) {
|
|
303
|
+
return isDocument(i) ? i : isWindow(i) ? i.document : i?.ownerDocument ?? document;
|
|
304
|
+
}
|
|
305
|
+
function getDocumentElement(i) {
|
|
306
|
+
return getDocument(i).documentElement;
|
|
307
|
+
}
|
|
308
|
+
function getWindow(i) {
|
|
309
|
+
return isShadowRoot(i) ? getWindow(i.host) : isDocument(i) ? i.defaultView ?? window : isHTMLElement(i) ? i.ownerDocument?.defaultView ?? window : window;
|
|
310
|
+
}
|
|
311
|
+
function getActiveElement(i) {
|
|
312
|
+
let s = i.activeElement;
|
|
313
|
+
for (; s?.shadowRoot;) {
|
|
314
|
+
let i = s.shadowRoot.activeElement;
|
|
315
|
+
if (i === s) break;
|
|
316
|
+
s = i;
|
|
317
|
+
}
|
|
318
|
+
return s;
|
|
319
|
+
}
|
|
320
|
+
function getParentNode$1(i) {
|
|
321
|
+
if (getNodeName(i) === "html") return i;
|
|
322
|
+
let s = i.assignedSlot || i.parentNode || isShadowRoot(i) && i.host || getDocumentElement(i);
|
|
323
|
+
return isShadowRoot(s) ? s.host : s;
|
|
324
|
+
}
|
|
325
|
+
var styleCache = /* @__PURE__ */ new WeakMap();
|
|
326
|
+
function getComputedStyle$1(i) {
|
|
327
|
+
return styleCache.has(i) || styleCache.set(i, getWindow(i).getComputedStyle(i)), styleCache.get(i);
|
|
328
|
+
}
|
|
329
|
+
var isDom = () => typeof document < "u";
|
|
330
|
+
function getPlatform() {
|
|
331
|
+
return navigator.userAgentData?.platform ?? navigator.platform;
|
|
332
|
+
}
|
|
333
|
+
var pt = (i) => isDom() && i.test(getPlatform()), vn = (i) => isDom() && i.test(navigator.vendor), isMac = () => pt(/^Mac/), isApple = () => pt(/mac|iphone|ipad|ipod/i), isSafari = () => isApple() && vn(/apple/i), isIos = () => pt(/iP(hone|ad|od)|iOS/);
|
|
334
|
+
function getComposedPath(i) {
|
|
335
|
+
return i.composedPath?.() ?? i.nativeEvent?.composedPath?.();
|
|
336
|
+
}
|
|
337
|
+
function getEventTarget(i) {
|
|
338
|
+
return getComposedPath(i)?.[0] ?? i.target;
|
|
339
|
+
}
|
|
340
|
+
function isContextMenuEvent(i) {
|
|
341
|
+
return i.button === 2 || isMac() && i.ctrlKey && i.button === 0;
|
|
342
|
+
}
|
|
343
|
+
function addDomEvent(i, s, c, l) {
|
|
344
|
+
let u = typeof i == "function" ? i() : i;
|
|
345
|
+
return u?.addEventListener(s, c, l), () => {
|
|
346
|
+
u?.removeEventListener(s, c, l);
|
|
347
|
+
};
|
|
348
|
+
}
|
|
349
|
+
function getDescriptor(i, s) {
|
|
350
|
+
let { type: c = "HTMLInputElement", property: l = "value" } = s, u = getWindow(i)[c].prototype;
|
|
351
|
+
return Object.getOwnPropertyDescriptor(u, l) ?? {};
|
|
352
|
+
}
|
|
353
|
+
function getElementType(i) {
|
|
354
|
+
if (i.localName === "input") return "HTMLInputElement";
|
|
355
|
+
if (i.localName === "textarea") return "HTMLTextAreaElement";
|
|
356
|
+
if (i.localName === "select") return "HTMLSelectElement";
|
|
357
|
+
}
|
|
358
|
+
function setElementValue(i, s, c = "value") {
|
|
359
|
+
let l = getElementType(i);
|
|
360
|
+
l && getDescriptor(i, {
|
|
361
|
+
type: l,
|
|
362
|
+
property: c
|
|
363
|
+
}).set?.call(i, s), i.setAttribute(c, s);
|
|
364
|
+
}
|
|
365
|
+
var isFrame = (i) => isHTMLElement(i) && i.tagName === "IFRAME", hasTabIndex = (i) => !Number.isNaN(Number.parseInt(i.getAttribute("tabindex") || "0", 10)), hasNegativeTabIndex = (i) => Number.parseInt(i.getAttribute("tabindex") || "0", 10) < 0, focusableSelector = "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";
|
|
366
|
+
function getFocusables(i, s = !1) {
|
|
367
|
+
if (!i) return [];
|
|
368
|
+
let c = Array.from(i.querySelectorAll(focusableSelector));
|
|
369
|
+
(s === !0 || s === "if-empty" && c.length === 0) && isHTMLElement(i) && isFocusable(i) && c.unshift(i);
|
|
370
|
+
let l = c.filter(isFocusable);
|
|
371
|
+
return l.forEach((i, s) => {
|
|
372
|
+
if (isFrame(i) && i.contentDocument) {
|
|
373
|
+
let c = i.contentDocument.body;
|
|
374
|
+
l.splice(s, 1, ...getFocusables(c));
|
|
375
|
+
}
|
|
376
|
+
}), l;
|
|
377
|
+
}
|
|
378
|
+
function isFocusable(i) {
|
|
379
|
+
return !i || i.closest("[inert]") ? !1 : i.matches(focusableSelector) && isElementVisible(i);
|
|
380
|
+
}
|
|
381
|
+
function getTabbables(i, s) {
|
|
382
|
+
if (!i) return [];
|
|
383
|
+
let c = Array.from(i.querySelectorAll(focusableSelector)), l = c.filter(isTabbable);
|
|
384
|
+
return s && isTabbable(i) && l.unshift(i), l.forEach((i, s) => {
|
|
385
|
+
if (isFrame(i) && i.contentDocument) {
|
|
386
|
+
let c = i.contentDocument.body, u = getTabbables(c);
|
|
387
|
+
l.splice(s, 1, ...u);
|
|
388
|
+
}
|
|
389
|
+
}), !l.length && s ? c : l;
|
|
390
|
+
}
|
|
391
|
+
function isTabbable(i) {
|
|
392
|
+
return i != null && i.tabIndex > 0 ? !0 : isFocusable(i) && !hasNegativeTabIndex(i);
|
|
393
|
+
}
|
|
394
|
+
function getTabbableEdges(i, s) {
|
|
395
|
+
let c = getTabbables(i, s);
|
|
396
|
+
return [c[0] || null, c[c.length - 1] || null];
|
|
397
|
+
}
|
|
398
|
+
function getNextTabbable(i, s) {
|
|
399
|
+
let c = getTabbables(i), l = i?.ownerDocument || document, u = s ?? l.activeElement;
|
|
400
|
+
return u && c[c.indexOf(u) + 1] || null;
|
|
401
|
+
}
|
|
402
|
+
function getTabIndex(i) {
|
|
403
|
+
return i.tabIndex < 0 && (/^(audio|video|details)$/.test(i.localName) || isEditableElement(i)) && !hasTabIndex(i) ? 0 : i.tabIndex;
|
|
404
|
+
}
|
|
405
|
+
function getInitialFocus(i) {
|
|
406
|
+
let { root: s, getInitialEl: c, filter: l, enabled: u = !0 } = i;
|
|
407
|
+
if (!u) return;
|
|
408
|
+
let d = null;
|
|
409
|
+
if (d ||= typeof c == "function" ? c() : c, d ||= s?.querySelector("[data-autofocus],[autofocus]"), !d) {
|
|
410
|
+
let i = getTabbables(s);
|
|
411
|
+
d = l ? i.filter(l)[0] : i[0];
|
|
412
|
+
}
|
|
413
|
+
return d || s || void 0;
|
|
414
|
+
}
|
|
415
|
+
function raf$1(i) {
|
|
416
|
+
let s = globalThis.requestAnimationFrame(i);
|
|
417
|
+
return () => {
|
|
418
|
+
globalThis.cancelAnimationFrame(s);
|
|
419
|
+
};
|
|
420
|
+
}
|
|
421
|
+
function getNearestOverflowAncestor(i) {
|
|
422
|
+
let s = getParentNode$1(i);
|
|
423
|
+
return isRootElement(s) ? getDocument(s).body : isHTMLElement(s) && isOverflowElement(s) ? s : getNearestOverflowAncestor(s);
|
|
424
|
+
}
|
|
425
|
+
var OVERFLOW_RE = /auto|scroll|overlay|hidden|clip/;
|
|
426
|
+
function isOverflowElement(i) {
|
|
427
|
+
let { overflow: s, overflowX: c, overflowY: l, display: u } = getWindow(i).getComputedStyle(i);
|
|
428
|
+
return OVERFLOW_RE.test(s + l + c) && !["inline", "contents"].includes(u);
|
|
429
|
+
}
|
|
430
|
+
function proxyTabFocusImpl(i, s = {}) {
|
|
431
|
+
let { triggerElement: c, onFocus: l } = s, u = i?.ownerDocument || document, d = u.body;
|
|
432
|
+
function f(s) {
|
|
433
|
+
if (s.key !== "Tab") return;
|
|
434
|
+
let f = null, [p, m] = getTabbableEdges(i, !0), h = !p && !m;
|
|
435
|
+
s.shiftKey && (u.activeElement === p || h) ? f = c : !s.shiftKey && u.activeElement === c ? f = p : !s.shiftKey && (u.activeElement === m || h) && (f = getNextTabbable(d, c)), f && (s.preventDefault(), typeof l == "function" ? l(f) : f.focus());
|
|
436
|
+
}
|
|
437
|
+
return addDomEvent(u, "keydown", f, !0);
|
|
438
|
+
}
|
|
439
|
+
function proxyTabFocus(i, s) {
|
|
440
|
+
let { defer: c, triggerElement: l, ...u } = s, d = c ? raf$1 : (i) => i(), f = [];
|
|
441
|
+
return f.push(d(() => {
|
|
442
|
+
let s = typeof i == "function" ? i() : i, c = typeof l == "function" ? l() : l;
|
|
443
|
+
f.push(proxyTabFocusImpl(s, {
|
|
444
|
+
triggerElement: c,
|
|
445
|
+
...u
|
|
446
|
+
}));
|
|
447
|
+
})), () => {
|
|
448
|
+
f.forEach((i) => i?.());
|
|
449
|
+
};
|
|
450
|
+
}
|
|
451
|
+
function createScope(i) {
|
|
452
|
+
let s = {
|
|
453
|
+
getRootNode: (i) => i.getRootNode?.() ?? document,
|
|
454
|
+
getDoc: (i) => getDocument(s.getRootNode(i)),
|
|
455
|
+
getWin: (i) => s.getDoc(i).defaultView ?? window,
|
|
456
|
+
getActiveElement: (i) => getActiveElement(s.getRootNode(i)),
|
|
457
|
+
isActiveElement: (i, c) => c === s.getActiveElement(i),
|
|
458
|
+
getById: (i, c) => s.getRootNode(i).getElementById(c),
|
|
459
|
+
setValue: (i, s) => {
|
|
460
|
+
i == null || s == null || setElementValue(i, s.toString());
|
|
461
|
+
}
|
|
462
|
+
};
|
|
463
|
+
return {
|
|
464
|
+
...s,
|
|
465
|
+
...i
|
|
466
|
+
};
|
|
467
|
+
}
|
|
468
|
+
var cleanups = /* @__PURE__ */ new WeakMap();
|
|
469
|
+
function set$1(i, s, c) {
|
|
470
|
+
cleanups.has(i) || cleanups.set(i, /* @__PURE__ */ new Map());
|
|
471
|
+
let l = cleanups.get(i), u = l.get(s);
|
|
472
|
+
if (!u) return l.set(s, c()), () => {
|
|
473
|
+
l.get(s)?.(), l.delete(s);
|
|
474
|
+
};
|
|
475
|
+
let d = c(), f = () => {
|
|
476
|
+
d(), u(), l.delete(s);
|
|
477
|
+
};
|
|
478
|
+
return l.set(s, f), () => {
|
|
479
|
+
l.get(s) === f && (d(), l.set(s, u));
|
|
480
|
+
};
|
|
481
|
+
}
|
|
482
|
+
function setStyle(i, s) {
|
|
483
|
+
return i ? set$1(i, "style", () => {
|
|
484
|
+
let c = i.style.cssText;
|
|
485
|
+
return Object.assign(i.style, s), () => {
|
|
486
|
+
i.style.cssText = c;
|
|
487
|
+
};
|
|
488
|
+
}) : () => {};
|
|
489
|
+
}
|
|
490
|
+
var fps = 1e3 / 60;
|
|
491
|
+
function waitForElement(i, s) {
|
|
492
|
+
let c = i();
|
|
493
|
+
if (isHTMLElement(c) && c.isConnected) return s(c), () => void 0;
|
|
494
|
+
{
|
|
495
|
+
let c = setInterval(() => {
|
|
496
|
+
let l = i();
|
|
497
|
+
isHTMLElement(l) && l.isConnected && (s(l), clearInterval(c));
|
|
498
|
+
}, fps);
|
|
499
|
+
return () => clearInterval(c);
|
|
500
|
+
}
|
|
655
501
|
}
|
|
656
|
-
function
|
|
657
|
-
|
|
502
|
+
function waitForElements(i, s) {
|
|
503
|
+
let c = [];
|
|
504
|
+
return i?.forEach((i) => {
|
|
505
|
+
let l = waitForElement(i, s);
|
|
506
|
+
c.push(l);
|
|
507
|
+
}), () => {
|
|
508
|
+
c.forEach((i) => i());
|
|
509
|
+
};
|
|
658
510
|
}
|
|
659
|
-
function
|
|
660
|
-
|
|
511
|
+
function clear(i) {
|
|
512
|
+
for (; i.length > 0;) i.pop();
|
|
513
|
+
return i;
|
|
661
514
|
}
|
|
662
|
-
function
|
|
663
|
-
return
|
|
515
|
+
function runIfFn(i, ...s) {
|
|
516
|
+
return (typeof i == "function" ? i(...s) : i) ?? void 0;
|
|
664
517
|
}
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
518
|
+
var cast = (i) => i;
|
|
519
|
+
function noop() {}
|
|
520
|
+
function callAll(...i) {
|
|
521
|
+
return (...s) => {
|
|
522
|
+
i.forEach((i) => {
|
|
523
|
+
i?.(...s);
|
|
524
|
+
});
|
|
525
|
+
};
|
|
673
526
|
}
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
527
|
+
var uuid = /* @__PURE__ */ (() => {
|
|
528
|
+
let i = 0;
|
|
529
|
+
return () => (i++, i.toString(36));
|
|
530
|
+
})(), isArray = (i) => Array.isArray(i), isObjectLike = (i) => typeof i == "object" && !!i, isObject$1 = (i) => isObjectLike(i) && !isArray(i), isNumber = (i) => typeof i == "number" && !Number.isNaN(i), isString = (i) => typeof i == "string", isFunction = (i) => typeof i == "function", isNull = (i) => i == null;
|
|
531
|
+
function hasProp(i, s) {
|
|
532
|
+
return Object.prototype.hasOwnProperty.call(i, s);
|
|
678
533
|
}
|
|
679
|
-
var
|
|
680
|
-
function
|
|
681
|
-
|
|
534
|
+
var baseGetTag = (i) => Object.prototype.toString.call(i), fnToString = Function.prototype.toString, objectCtorString = fnToString.call(Object);
|
|
535
|
+
function isPlainObject(i) {
|
|
536
|
+
if (!isObjectLike(i) || baseGetTag(i) !== "[object Object]") return !1;
|
|
537
|
+
let s = Object.getPrototypeOf(i);
|
|
538
|
+
if (s === null) return !0;
|
|
539
|
+
let c = hasProp(s, "constructor") && s.constructor;
|
|
540
|
+
return typeof c == "function" && c instanceof c && fnToString.call(c) === objectCtorString;
|
|
682
541
|
}
|
|
683
|
-
var
|
|
684
|
-
function
|
|
685
|
-
|
|
542
|
+
var { floor, abs, round, min, max, sign } = Math;
|
|
543
|
+
function compact(i) {
|
|
544
|
+
if (!isPlainObject$1(i) || i === void 0) return i;
|
|
545
|
+
let s = Reflect.ownKeys(i).filter((i) => typeof i == "string"), c = {};
|
|
546
|
+
for (let l of s) {
|
|
547
|
+
let s = i[l];
|
|
548
|
+
s !== void 0 && (c[l] = compact(s));
|
|
549
|
+
}
|
|
550
|
+
return c;
|
|
686
551
|
}
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
return i.composedPath?.() ?? i.nativeEvent?.composedPath?.();
|
|
552
|
+
function isPlainObject$1(i) {
|
|
553
|
+
return i && typeof i == "object" && i.constructor === Object;
|
|
690
554
|
}
|
|
691
|
-
function
|
|
692
|
-
|
|
555
|
+
function computeCoordsFromPlacement(i, s, c) {
|
|
556
|
+
let { reference: l, floating: u } = i, d = getSideAxis(s), f = getAlignmentAxis(s), p = getAxisLength(f), m = getSide(s), h = d === "y", g = l.x + l.width / 2 - u.width / 2, _ = l.y + l.height / 2 - u.height / 2, v = l[p] / 2 - u[p] / 2, y;
|
|
557
|
+
switch (m) {
|
|
558
|
+
case "top":
|
|
559
|
+
y = {
|
|
560
|
+
x: g,
|
|
561
|
+
y: l.y - u.height
|
|
562
|
+
};
|
|
563
|
+
break;
|
|
564
|
+
case "bottom":
|
|
565
|
+
y = {
|
|
566
|
+
x: g,
|
|
567
|
+
y: l.y + l.height
|
|
568
|
+
};
|
|
569
|
+
break;
|
|
570
|
+
case "right":
|
|
571
|
+
y = {
|
|
572
|
+
x: l.x + l.width,
|
|
573
|
+
y: _
|
|
574
|
+
};
|
|
575
|
+
break;
|
|
576
|
+
case "left":
|
|
577
|
+
y = {
|
|
578
|
+
x: l.x - u.width,
|
|
579
|
+
y: _
|
|
580
|
+
};
|
|
581
|
+
break;
|
|
582
|
+
default: y = {
|
|
583
|
+
x: l.x,
|
|
584
|
+
y: l.y
|
|
585
|
+
};
|
|
586
|
+
}
|
|
587
|
+
switch (getAlignment(s)) {
|
|
588
|
+
case "start":
|
|
589
|
+
y[f] -= v * (c && h ? -1 : 1);
|
|
590
|
+
break;
|
|
591
|
+
case "end":
|
|
592
|
+
y[f] += v * (c && h ? -1 : 1);
|
|
593
|
+
break;
|
|
594
|
+
}
|
|
595
|
+
return y;
|
|
693
596
|
}
|
|
694
|
-
|
|
695
|
-
|
|
597
|
+
var computePosition$1 = async (i, s, c) => {
|
|
598
|
+
let { placement: l = "bottom", strategy: u = "absolute", middleware: d = [], platform: f } = c, p = d.filter(Boolean), m = await (f.isRTL == null ? void 0 : f.isRTL(s)), h = await f.getElementRects({
|
|
599
|
+
reference: i,
|
|
600
|
+
floating: s,
|
|
601
|
+
strategy: u
|
|
602
|
+
}), { x: g, y: _ } = computeCoordsFromPlacement(h, l, m), v = l, y = {}, b = 0;
|
|
603
|
+
for (let c = 0; c < p.length; c++) {
|
|
604
|
+
let { name: d, fn: x } = p[c], { x: S, y: C, data: w, reset: T } = await x({
|
|
605
|
+
x: g,
|
|
606
|
+
y: _,
|
|
607
|
+
initialPlacement: l,
|
|
608
|
+
placement: v,
|
|
609
|
+
strategy: u,
|
|
610
|
+
middlewareData: y,
|
|
611
|
+
rects: h,
|
|
612
|
+
platform: f,
|
|
613
|
+
elements: {
|
|
614
|
+
reference: i,
|
|
615
|
+
floating: s
|
|
616
|
+
}
|
|
617
|
+
});
|
|
618
|
+
g = S ?? g, _ = C ?? _, y = {
|
|
619
|
+
...y,
|
|
620
|
+
[d]: {
|
|
621
|
+
...y[d],
|
|
622
|
+
...w
|
|
623
|
+
}
|
|
624
|
+
}, T && b <= 50 && (b++, typeof T == "object" && (T.placement && (v = T.placement), T.rects && (h = T.rects === !0 ? await f.getElementRects({
|
|
625
|
+
reference: i,
|
|
626
|
+
floating: s,
|
|
627
|
+
strategy: u
|
|
628
|
+
}) : T.rects), {x: g, y: _} = computeCoordsFromPlacement(h, v, m)), c = -1);
|
|
629
|
+
}
|
|
630
|
+
return {
|
|
631
|
+
x: g,
|
|
632
|
+
y: _,
|
|
633
|
+
placement: v,
|
|
634
|
+
strategy: u,
|
|
635
|
+
middlewareData: y
|
|
636
|
+
};
|
|
637
|
+
};
|
|
638
|
+
async function detectOverflow(i, s) {
|
|
639
|
+
s === void 0 && (s = {});
|
|
640
|
+
let { x: c, y: l, platform: u, rects: d, elements: f, strategy: p } = i, { boundary: m = "clippingAncestors", rootBoundary: h = "viewport", elementContext: g = "floating", altBoundary: _ = !1, padding: v = 0 } = evaluate(s, i), y = getPaddingObject(v), b = f[_ ? g === "floating" ? "reference" : "floating" : g], x = rectToClientRect(await u.getClippingRect({
|
|
641
|
+
element: await (u.isElement == null ? void 0 : u.isElement(b)) ?? !0 ? b : b.contextElement || await (u.getDocumentElement == null ? void 0 : u.getDocumentElement(f.floating)),
|
|
642
|
+
boundary: m,
|
|
643
|
+
rootBoundary: h,
|
|
644
|
+
strategy: p
|
|
645
|
+
})), S = g === "floating" ? {
|
|
646
|
+
x: c,
|
|
647
|
+
y: l,
|
|
648
|
+
width: d.floating.width,
|
|
649
|
+
height: d.floating.height
|
|
650
|
+
} : d.reference, C = await (u.getOffsetParent == null ? void 0 : u.getOffsetParent(f.floating)), w = await (u.isElement == null ? void 0 : u.isElement(C)) && await (u.getScale == null ? void 0 : u.getScale(C)) || {
|
|
651
|
+
x: 1,
|
|
652
|
+
y: 1
|
|
653
|
+
}, T = rectToClientRect(u.convertOffsetParentRelativeRectToViewportRelativeRect ? await u.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
654
|
+
elements: f,
|
|
655
|
+
rect: S,
|
|
656
|
+
offsetParent: C,
|
|
657
|
+
strategy: p
|
|
658
|
+
}) : S);
|
|
659
|
+
return {
|
|
660
|
+
top: (x.top - T.top + y.top) / w.y,
|
|
661
|
+
bottom: (T.bottom - x.bottom + y.bottom) / w.y,
|
|
662
|
+
left: (x.left - T.left + y.left) / w.x,
|
|
663
|
+
right: (T.right - x.right + y.right) / w.x
|
|
664
|
+
};
|
|
696
665
|
}
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
666
|
+
var arrow$1 = (i) => ({
|
|
667
|
+
name: "arrow",
|
|
668
|
+
options: i,
|
|
669
|
+
async fn(s) {
|
|
670
|
+
let { x: c, y: l, placement: u, rects: d, platform: f, elements: p, middlewareData: m } = s, { element: h, padding: g = 0 } = evaluate(i, s) || {};
|
|
671
|
+
if (h == null) return {};
|
|
672
|
+
let _ = getPaddingObject(g), v = {
|
|
673
|
+
x: c,
|
|
674
|
+
y: l
|
|
675
|
+
}, y = getAlignmentAxis(u), b = getAxisLength(y), x = await f.getDimensions(h), S = y === "y", C = S ? "top" : "left", w = S ? "bottom" : "right", T = S ? "clientHeight" : "clientWidth", E = d.reference[b] + d.reference[y] - v[y] - d.floating[b], D = v[y] - d.reference[y], O = await (f.getOffsetParent == null ? void 0 : f.getOffsetParent(h)), k = O ? O[T] : 0;
|
|
676
|
+
(!k || !await (f.isElement == null ? void 0 : f.isElement(O))) && (k = p.floating[T] || d.floating[b]);
|
|
677
|
+
let A = E / 2 - D / 2, j = k / 2 - x[b] / 2 - 1, M = min$1(_[C], j), N = min$1(_[w], j), P = M, F = k - x[b] - N, I = k / 2 - x[b] / 2 + A, L = clamp(P, I, F), R = !m.arrow && getAlignment(u) != null && I !== L && d.reference[b] / 2 - (I < P ? M : N) - x[b] / 2 < 0, z = R ? I < P ? I - P : I - F : 0;
|
|
678
|
+
return {
|
|
679
|
+
[y]: v[y] + z,
|
|
680
|
+
data: {
|
|
681
|
+
[y]: L,
|
|
682
|
+
centerOffset: I - L - z,
|
|
683
|
+
...R && { alignmentOffset: z }
|
|
684
|
+
},
|
|
685
|
+
reset: R
|
|
686
|
+
};
|
|
687
|
+
}
|
|
688
|
+
}), flip$1 = function(i) {
|
|
689
|
+
return i === void 0 && (i = {}), {
|
|
690
|
+
name: "flip",
|
|
691
|
+
options: i,
|
|
692
|
+
async fn(s) {
|
|
693
|
+
var c;
|
|
694
|
+
let { placement: l, middlewareData: u, rects: d, initialPlacement: f, platform: p, elements: m } = s, { mainAxis: h = !0, crossAxis: g = !0, fallbackPlacements: _, fallbackStrategy: v = "bestFit", fallbackAxisSideDirection: y = "none", flipAlignment: b = !0, ...x } = evaluate(i, s);
|
|
695
|
+
if ((c = u.arrow) != null && c.alignmentOffset) return {};
|
|
696
|
+
let S = getSide(l), C = getSideAxis(f), w = getSide(f) === f, T = await (p.isRTL == null ? void 0 : p.isRTL(m.floating)), E = _ || (w || !b ? [getOppositePlacement(f)] : getExpandedPlacements(f)), D = y !== "none";
|
|
697
|
+
!_ && D && E.push(...getOppositeAxisPlacements(f, b, y, T));
|
|
698
|
+
let O = [f, ...E], k = await detectOverflow(s, x), A = [], j = u.flip?.overflows || [];
|
|
699
|
+
if (h && A.push(k[S]), g) {
|
|
700
|
+
let i = getAlignmentSides(l, d, T);
|
|
701
|
+
A.push(k[i[0]], k[i[1]]);
|
|
702
|
+
}
|
|
703
|
+
if (j = [...j, {
|
|
704
|
+
placement: l,
|
|
705
|
+
overflows: A
|
|
706
|
+
}], !A.every((i) => i <= 0)) {
|
|
707
|
+
let i = (u.flip?.index || 0) + 1, s = O[i];
|
|
708
|
+
if (s && (!(g === "alignment" && C !== getSideAxis(s)) || j.every((i) => getSideAxis(i.placement) === C ? i.overflows[0] > 0 : !0))) return {
|
|
709
|
+
data: {
|
|
710
|
+
index: i,
|
|
711
|
+
overflows: j
|
|
712
|
+
},
|
|
713
|
+
reset: { placement: s }
|
|
714
|
+
};
|
|
715
|
+
let c = j.filter((i) => i.overflows[0] <= 0).sort((i, s) => i.overflows[1] - s.overflows[1])[0]?.placement;
|
|
716
|
+
if (!c) switch (v) {
|
|
717
|
+
case "bestFit": {
|
|
718
|
+
let i = j.filter((i) => {
|
|
719
|
+
if (D) {
|
|
720
|
+
let s = getSideAxis(i.placement);
|
|
721
|
+
return s === C || s === "y";
|
|
722
|
+
}
|
|
723
|
+
return !0;
|
|
724
|
+
}).map((i) => [i.placement, i.overflows.filter((i) => i > 0).reduce((i, s) => i + s, 0)]).sort((i, s) => i[1] - s[1])[0]?.[0];
|
|
725
|
+
i && (c = i);
|
|
726
|
+
break;
|
|
727
|
+
}
|
|
728
|
+
case "initialPlacement":
|
|
729
|
+
c = f;
|
|
730
|
+
break;
|
|
731
|
+
}
|
|
732
|
+
if (l !== c) return { reset: { placement: c } };
|
|
733
|
+
}
|
|
734
|
+
return {};
|
|
735
|
+
}
|
|
736
|
+
};
|
|
737
|
+
};
|
|
738
|
+
function getSideOffsets(i, s) {
|
|
739
|
+
return {
|
|
740
|
+
top: i.top - s.height,
|
|
741
|
+
right: i.right - s.width,
|
|
742
|
+
bottom: i.bottom - s.height,
|
|
743
|
+
left: i.left - s.width
|
|
701
744
|
};
|
|
702
745
|
}
|
|
703
|
-
function
|
|
704
|
-
|
|
705
|
-
return Object.getOwnPropertyDescriptor(u, l) ?? {};
|
|
706
|
-
}
|
|
707
|
-
function getElementType(i) {
|
|
708
|
-
if (i.localName === "input") return "HTMLInputElement";
|
|
709
|
-
if (i.localName === "textarea") return "HTMLTextAreaElement";
|
|
710
|
-
if (i.localName === "select") return "HTMLSelectElement";
|
|
711
|
-
}
|
|
712
|
-
function setElementValue(i, s, c = "value") {
|
|
713
|
-
let l = getElementType(i);
|
|
714
|
-
l && getDescriptor(i, {
|
|
715
|
-
type: l,
|
|
716
|
-
property: c
|
|
717
|
-
}).set?.call(i, s), i.setAttribute(c, s);
|
|
746
|
+
function isAnySideFullyClipped(i) {
|
|
747
|
+
return sides.some((s) => i[s] >= 0);
|
|
718
748
|
}
|
|
719
|
-
var
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
749
|
+
var hide$1 = function(i) {
|
|
750
|
+
return i === void 0 && (i = {}), {
|
|
751
|
+
name: "hide",
|
|
752
|
+
options: i,
|
|
753
|
+
async fn(s) {
|
|
754
|
+
let { rects: c } = s, { strategy: l = "referenceHidden", ...u } = evaluate(i, s);
|
|
755
|
+
switch (l) {
|
|
756
|
+
case "referenceHidden": {
|
|
757
|
+
let i = getSideOffsets(await detectOverflow(s, {
|
|
758
|
+
...u,
|
|
759
|
+
elementContext: "reference"
|
|
760
|
+
}), c.reference);
|
|
761
|
+
return { data: {
|
|
762
|
+
referenceHiddenOffsets: i,
|
|
763
|
+
referenceHidden: isAnySideFullyClipped(i)
|
|
764
|
+
} };
|
|
765
|
+
}
|
|
766
|
+
case "escaped": {
|
|
767
|
+
let i = getSideOffsets(await detectOverflow(s, {
|
|
768
|
+
...u,
|
|
769
|
+
altBoundary: !0
|
|
770
|
+
}), c.floating);
|
|
771
|
+
return { data: {
|
|
772
|
+
escapedOffsets: i,
|
|
773
|
+
escaped: isAnySideFullyClipped(i)
|
|
774
|
+
} };
|
|
775
|
+
}
|
|
776
|
+
default: return {};
|
|
777
|
+
}
|
|
729
778
|
}
|
|
730
|
-
}
|
|
731
|
-
}
|
|
732
|
-
function
|
|
733
|
-
|
|
779
|
+
};
|
|
780
|
+
}, originSides = /* @__PURE__ */ new Set(["left", "top"]);
|
|
781
|
+
async function convertValueToCoords(i, s) {
|
|
782
|
+
let { placement: c, platform: l, elements: u } = i, d = await (l.isRTL == null ? void 0 : l.isRTL(u.floating)), f = getSide(c), p = getAlignment(c), m = getSideAxis(c) === "y", h = originSides.has(f) ? -1 : 1, g = d && m ? -1 : 1, _ = evaluate(s, i), { mainAxis: v, crossAxis: y, alignmentAxis: b } = typeof _ == "number" ? {
|
|
783
|
+
mainAxis: _,
|
|
784
|
+
crossAxis: 0,
|
|
785
|
+
alignmentAxis: null
|
|
786
|
+
} : {
|
|
787
|
+
mainAxis: _.mainAxis || 0,
|
|
788
|
+
crossAxis: _.crossAxis || 0,
|
|
789
|
+
alignmentAxis: _.alignmentAxis
|
|
790
|
+
};
|
|
791
|
+
return p && typeof b == "number" && (y = p === "end" ? b * -1 : b), m ? {
|
|
792
|
+
x: y * g,
|
|
793
|
+
y: v * h
|
|
794
|
+
} : {
|
|
795
|
+
x: v * h,
|
|
796
|
+
y: y * g
|
|
797
|
+
};
|
|
734
798
|
}
|
|
735
|
-
function
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
l
|
|
799
|
+
var offset$1 = function(i) {
|
|
800
|
+
return i === void 0 && (i = 0), {
|
|
801
|
+
name: "offset",
|
|
802
|
+
options: i,
|
|
803
|
+
async fn(s) {
|
|
804
|
+
var c;
|
|
805
|
+
let { x: l, y: u, placement: d, middlewareData: f } = s, p = await convertValueToCoords(s, i);
|
|
806
|
+
return d === f.offset?.placement && (c = f.arrow) != null && c.alignmentOffset ? {} : {
|
|
807
|
+
x: l + p.x,
|
|
808
|
+
y: u + p.y,
|
|
809
|
+
data: {
|
|
810
|
+
...p,
|
|
811
|
+
placement: d
|
|
812
|
+
}
|
|
813
|
+
};
|
|
742
814
|
}
|
|
743
|
-
}), !l.length && s ? c : l;
|
|
744
|
-
}
|
|
745
|
-
function isTabbable(i) {
|
|
746
|
-
return i != null && i.tabIndex > 0 ? !0 : isFocusable(i) && !hasNegativeTabIndex(i);
|
|
747
|
-
}
|
|
748
|
-
function getTabbableEdges(i, s) {
|
|
749
|
-
let c = getTabbables(i, s);
|
|
750
|
-
return [c[0] || null, c[c.length - 1] || null];
|
|
751
|
-
}
|
|
752
|
-
function getNextTabbable(i, s) {
|
|
753
|
-
let c = getTabbables(i), l = i?.ownerDocument || document, u = s ?? l.activeElement;
|
|
754
|
-
return u && c[c.indexOf(u) + 1] || null;
|
|
755
|
-
}
|
|
756
|
-
function getTabIndex(i) {
|
|
757
|
-
return i.tabIndex < 0 && (/^(audio|video|details)$/.test(i.localName) || isEditableElement(i)) && !hasTabIndex(i) ? 0 : i.tabIndex;
|
|
758
|
-
}
|
|
759
|
-
function getInitialFocus(i) {
|
|
760
|
-
let { root: s, getInitialEl: c, filter: l, enabled: u = !0 } = i;
|
|
761
|
-
if (!u) return;
|
|
762
|
-
let d = null;
|
|
763
|
-
if (d ||= typeof c == "function" ? c() : c, d ||= s?.querySelector("[data-autofocus],[autofocus]"), !d) {
|
|
764
|
-
let i = getTabbables(s);
|
|
765
|
-
d = l ? i.filter(l)[0] : i[0];
|
|
766
|
-
}
|
|
767
|
-
return d || s || void 0;
|
|
768
|
-
}
|
|
769
|
-
function raf(i) {
|
|
770
|
-
let s = globalThis.requestAnimationFrame(i);
|
|
771
|
-
return () => {
|
|
772
|
-
globalThis.cancelAnimationFrame(s);
|
|
773
815
|
};
|
|
774
|
-
}
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
}
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
816
|
+
}, shift$1 = function(i) {
|
|
817
|
+
return i === void 0 && (i = {}), {
|
|
818
|
+
name: "shift",
|
|
819
|
+
options: i,
|
|
820
|
+
async fn(s) {
|
|
821
|
+
let { x: c, y: l, placement: u } = s, { mainAxis: d = !0, crossAxis: f = !1, limiter: p = { fn: (i) => {
|
|
822
|
+
let { x: s, y: c } = i;
|
|
823
|
+
return {
|
|
824
|
+
x: s,
|
|
825
|
+
y: c
|
|
826
|
+
};
|
|
827
|
+
} }, ...m } = evaluate(i, s), h = {
|
|
828
|
+
x: c,
|
|
829
|
+
y: l
|
|
830
|
+
}, g = await detectOverflow(s, m), _ = getSideAxis(getSide(u)), v = getOppositeAxis(_), y = h[v], b = h[_];
|
|
831
|
+
if (d) {
|
|
832
|
+
let i = v === "y" ? "top" : "left", s = v === "y" ? "bottom" : "right", c = y + g[i], l = y - g[s];
|
|
833
|
+
y = clamp(c, y, l);
|
|
834
|
+
}
|
|
835
|
+
if (f) {
|
|
836
|
+
let i = _ === "y" ? "top" : "left", s = _ === "y" ? "bottom" : "right", c = b + g[i], l = b - g[s];
|
|
837
|
+
b = clamp(c, b, l);
|
|
838
|
+
}
|
|
839
|
+
let x = p.fn({
|
|
840
|
+
...s,
|
|
841
|
+
[v]: y,
|
|
842
|
+
[_]: b
|
|
843
|
+
});
|
|
844
|
+
return {
|
|
845
|
+
...x,
|
|
846
|
+
data: {
|
|
847
|
+
x: x.x - c,
|
|
848
|
+
y: x.y - l,
|
|
849
|
+
enabled: {
|
|
850
|
+
[v]: d,
|
|
851
|
+
[_]: f
|
|
852
|
+
}
|
|
853
|
+
}
|
|
854
|
+
};
|
|
855
|
+
}
|
|
803
856
|
};
|
|
804
|
-
}
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
857
|
+
}, limitShift$1 = function(i) {
|
|
858
|
+
return i === void 0 && (i = {}), {
|
|
859
|
+
options: i,
|
|
860
|
+
fn(s) {
|
|
861
|
+
let { x: c, y: l, placement: u, rects: d, middlewareData: f } = s, { offset: p = 0, mainAxis: m = !0, crossAxis: h = !0 } = evaluate(i, s), g = {
|
|
862
|
+
x: c,
|
|
863
|
+
y: l
|
|
864
|
+
}, _ = getSideAxis(u), v = getOppositeAxis(_), y = g[v], b = g[_], x = evaluate(p, s), S = typeof x == "number" ? {
|
|
865
|
+
mainAxis: x,
|
|
866
|
+
crossAxis: 0
|
|
867
|
+
} : {
|
|
868
|
+
mainAxis: 0,
|
|
869
|
+
crossAxis: 0,
|
|
870
|
+
...x
|
|
871
|
+
};
|
|
872
|
+
if (m) {
|
|
873
|
+
let i = v === "y" ? "height" : "width", s = d.reference[v] - d.floating[i] + S.mainAxis, c = d.reference[v] + d.reference[i] - S.mainAxis;
|
|
874
|
+
y < s ? y = s : y > c && (y = c);
|
|
875
|
+
}
|
|
876
|
+
if (h) {
|
|
877
|
+
let i = v === "y" ? "width" : "height", s = originSides.has(getSide(u)), c = d.reference[_] - d.floating[i] + (s && f.offset?.[_] || 0) + (s ? 0 : S.crossAxis), l = d.reference[_] + d.reference[i] + (s ? 0 : f.offset?.[_] || 0) - (s ? S.crossAxis : 0);
|
|
878
|
+
b < c ? b = c : b > l && (b = l);
|
|
879
|
+
}
|
|
880
|
+
return {
|
|
881
|
+
[v]: y,
|
|
882
|
+
[_]: b
|
|
883
|
+
};
|
|
815
884
|
}
|
|
816
885
|
};
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
var
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
let c = i.style.cssText;
|
|
839
|
-
return Object.assign(i.style, s), () => {
|
|
840
|
-
i.style.cssText = c;
|
|
841
|
-
};
|
|
842
|
-
}) : () => {};
|
|
843
|
-
}
|
|
844
|
-
var fps = 1e3 / 60;
|
|
845
|
-
function waitForElement(i, s) {
|
|
846
|
-
let c = i();
|
|
847
|
-
if (isHTMLElement(c) && c.isConnected) return s(c), () => void 0;
|
|
848
|
-
{
|
|
849
|
-
let c = setInterval(() => {
|
|
850
|
-
let l = i();
|
|
851
|
-
isHTMLElement(l) && l.isConnected && (s(l), clearInterval(c));
|
|
852
|
-
}, fps);
|
|
853
|
-
return () => clearInterval(c);
|
|
854
|
-
}
|
|
855
|
-
}
|
|
856
|
-
function waitForElements(i, s) {
|
|
857
|
-
let c = [];
|
|
858
|
-
return i?.forEach((i) => {
|
|
859
|
-
let l = waitForElement(i, s);
|
|
860
|
-
c.push(l);
|
|
861
|
-
}), () => {
|
|
862
|
-
c.forEach((i) => i());
|
|
863
|
-
};
|
|
864
|
-
}
|
|
865
|
-
function clear(i) {
|
|
866
|
-
for (; i.length > 0;) i.pop();
|
|
867
|
-
return i;
|
|
868
|
-
}
|
|
869
|
-
function runIfFn(i, ...s) {
|
|
870
|
-
return (typeof i == "function" ? i(...s) : i) ?? void 0;
|
|
871
|
-
}
|
|
872
|
-
var cast = (i) => i;
|
|
873
|
-
function noop() {}
|
|
874
|
-
function callAll(...i) {
|
|
875
|
-
return (...s) => {
|
|
876
|
-
i.forEach((i) => {
|
|
877
|
-
i?.(...s);
|
|
878
|
-
});
|
|
886
|
+
}, size$1 = function(i) {
|
|
887
|
+
return i === void 0 && (i = {}), {
|
|
888
|
+
name: "size",
|
|
889
|
+
options: i,
|
|
890
|
+
async fn(s) {
|
|
891
|
+
var c, l;
|
|
892
|
+
let { placement: u, rects: d, platform: f, elements: p } = s, { apply: m = () => {}, ...h } = evaluate(i, s), g = await detectOverflow(s, h), _ = getSide(u), v = getAlignment(u), y = getSideAxis(u) === "y", { width: b, height: x } = d.floating, S, C;
|
|
893
|
+
_ === "top" || _ === "bottom" ? (S = _, C = v === (await (f.isRTL == null ? void 0 : f.isRTL(p.floating)) ? "start" : "end") ? "left" : "right") : (C = _, S = v === "end" ? "top" : "bottom");
|
|
894
|
+
let w = x - g.top - g.bottom, T = b - g.left - g.right, E = min$1(x - g[S], w), D = min$1(b - g[C], T), O = !s.middlewareData.shift, k = E, A = D;
|
|
895
|
+
if ((c = s.middlewareData.shift) != null && c.enabled.x && (A = T), (l = s.middlewareData.shift) != null && l.enabled.y && (k = w), O && !v) {
|
|
896
|
+
let i = max$1(g.left, 0), s = max$1(g.right, 0), c = max$1(g.top, 0), l = max$1(g.bottom, 0);
|
|
897
|
+
y ? A = b - 2 * (i !== 0 || s !== 0 ? i + s : max$1(g.left, g.right)) : k = x - 2 * (c !== 0 || l !== 0 ? c + l : max$1(g.top, g.bottom));
|
|
898
|
+
}
|
|
899
|
+
await m({
|
|
900
|
+
...s,
|
|
901
|
+
availableWidth: A,
|
|
902
|
+
availableHeight: k
|
|
903
|
+
});
|
|
904
|
+
let j = await f.getDimensions(p.floating);
|
|
905
|
+
return b !== j.width || x !== j.height ? { reset: { rects: !0 } } : {};
|
|
906
|
+
}
|
|
879
907
|
};
|
|
880
|
-
}
|
|
881
|
-
var uuid = /* @__PURE__ */ (() => {
|
|
882
|
-
let i = 0;
|
|
883
|
-
return () => (i++, i.toString(36));
|
|
884
|
-
})(), isArray = (i) => Array.isArray(i), isObjectLike = (i) => typeof i == "object" && !!i, isObject = (i) => isObjectLike(i) && !isArray(i), isNumber = (i) => typeof i == "number" && !Number.isNaN(i), isString = (i) => typeof i == "string", isFunction = (i) => typeof i == "function", isNull = (i) => i == null;
|
|
885
|
-
function hasProp(i, s) {
|
|
886
|
-
return Object.prototype.hasOwnProperty.call(i, s);
|
|
887
|
-
}
|
|
888
|
-
var baseGetTag = (i) => Object.prototype.toString.call(i), fnToString = Function.prototype.toString, objectCtorString = fnToString.call(Object);
|
|
889
|
-
function isPlainObject(i) {
|
|
890
|
-
if (!isObjectLike(i) || baseGetTag(i) !== "[object Object]") return !1;
|
|
891
|
-
let s = Object.getPrototypeOf(i);
|
|
892
|
-
if (s === null) return !0;
|
|
893
|
-
let c = hasProp(s, "constructor") && s.constructor;
|
|
894
|
-
return typeof c == "function" && c instanceof c && fnToString.call(c) === objectCtorString;
|
|
895
|
-
}
|
|
896
|
-
var { floor: floor$1, abs, round: round$1, min: min$1, max: max$1, sign } = Math;
|
|
897
|
-
function compact(i) {
|
|
898
|
-
if (!isPlainObject$1(i) || i === void 0) return i;
|
|
899
|
-
let s = Reflect.ownKeys(i).filter((i) => typeof i == "string"), c = {};
|
|
900
|
-
for (let l of s) {
|
|
901
|
-
let s = i[l];
|
|
902
|
-
s !== void 0 && (c[l] = compact(s));
|
|
903
|
-
}
|
|
904
|
-
return c;
|
|
905
|
-
}
|
|
906
|
-
function isPlainObject$1(i) {
|
|
907
|
-
return i && typeof i == "object" && i.constructor === Object;
|
|
908
|
-
}
|
|
908
|
+
};
|
|
909
909
|
function getCssDimensions(i) {
|
|
910
|
-
let s = getComputedStyle$
|
|
910
|
+
let s = getComputedStyle$2(i), c = parseFloat(s.width) || 0, l = parseFloat(s.height) || 0, u = isHTMLElement$1(i), d = u ? i.offsetWidth : c, f = u ? i.offsetHeight : l, p = round$1(c) !== d || round$1(l) !== f;
|
|
911
911
|
return p && (c = d, l = f), {
|
|
912
912
|
width: c,
|
|
913
913
|
height: l,
|
|
@@ -920,7 +920,7 @@ function unwrapElement(i) {
|
|
|
920
920
|
function getScale(i) {
|
|
921
921
|
let s = unwrapElement(i);
|
|
922
922
|
if (!isHTMLElement$1(s)) return createCoords(1);
|
|
923
|
-
let c = s.getBoundingClientRect(), { width: l, height: u, $: d } = getCssDimensions(s), f = (d ? round(c.width) : c.width) / l, p = (d ? round(c.height) : c.height) / u;
|
|
923
|
+
let c = s.getBoundingClientRect(), { width: l, height: u, $: d } = getCssDimensions(s), f = (d ? round$1(c.width) : c.width) / l, p = (d ? round$1(c.height) : c.height) / u;
|
|
924
924
|
return (!f || !Number.isFinite(f)) && (f = 1), (!p || !Number.isFinite(p)) && (p = 1), {
|
|
925
925
|
x: f,
|
|
926
926
|
y: p
|
|
@@ -945,7 +945,7 @@ function getBoundingClientRect(i, s, c, l) {
|
|
|
945
945
|
if (d) {
|
|
946
946
|
let i = getWindow$1(d), s = l && isElement$1(l) ? getWindow$1(l) : l, c = i, u = getFrameElement(c);
|
|
947
947
|
for (; u && l && s !== c;) {
|
|
948
|
-
let i = getScale(u), s = u.getBoundingClientRect(), l = getComputedStyle$
|
|
948
|
+
let i = getScale(u), s = u.getBoundingClientRect(), l = getComputedStyle$2(u), d = s.left + (u.clientLeft + parseFloat(l.paddingLeft)) * i.x, f = s.top + (u.clientTop + parseFloat(l.paddingTop)) * i.y;
|
|
949
949
|
m *= i.x, h *= i.y, g *= i.x, _ *= i.y, m += d, h += f, c = getWindow$1(u), u = getFrameElement(c);
|
|
950
950
|
}
|
|
951
951
|
}
|
|
@@ -958,28 +958,27 @@ function getBoundingClientRect(i, s, c, l) {
|
|
|
958
958
|
}
|
|
959
959
|
function getWindowScrollBarX(i, s) {
|
|
960
960
|
let c = getNodeScroll(i).scrollLeft;
|
|
961
|
-
return s ? s.left + c : getBoundingClientRect(getDocumentElement(i)).left + c;
|
|
961
|
+
return s ? s.left + c : getBoundingClientRect(getDocumentElement$1(i)).left + c;
|
|
962
962
|
}
|
|
963
|
-
function getHTMLOffset(i, s
|
|
964
|
-
|
|
965
|
-
let l = i.getBoundingClientRect();
|
|
963
|
+
function getHTMLOffset(i, s) {
|
|
964
|
+
let c = i.getBoundingClientRect();
|
|
966
965
|
return {
|
|
967
|
-
x:
|
|
968
|
-
y:
|
|
966
|
+
x: c.left + s.scrollLeft - getWindowScrollBarX(i, c),
|
|
967
|
+
y: c.top + s.scrollTop
|
|
969
968
|
};
|
|
970
969
|
}
|
|
971
970
|
function convertOffsetParentRelativeRectToViewportRelativeRect(i) {
|
|
972
|
-
let { elements: s, rect: c, offsetParent: l, strategy: u } = i, d = u === "fixed", f = getDocumentElement(l), p = s ? isTopLayer(s.floating) : !1;
|
|
971
|
+
let { elements: s, rect: c, offsetParent: l, strategy: u } = i, d = u === "fixed", f = getDocumentElement$1(l), p = s ? isTopLayer(s.floating) : !1;
|
|
973
972
|
if (l === f || p && d) return c;
|
|
974
973
|
let m = {
|
|
975
974
|
scrollLeft: 0,
|
|
976
975
|
scrollTop: 0
|
|
977
976
|
}, h = createCoords(1), g = createCoords(0), _ = isHTMLElement$1(l);
|
|
978
|
-
if ((_ || !_ && !d) && ((getNodeName(l) !== "body" || isOverflowElement(f)) && (m = getNodeScroll(l)), isHTMLElement$1(l))) {
|
|
977
|
+
if ((_ || !_ && !d) && ((getNodeName$1(l) !== "body" || isOverflowElement$1(f)) && (m = getNodeScroll(l)), isHTMLElement$1(l))) {
|
|
979
978
|
let i = getBoundingClientRect(l);
|
|
980
979
|
h = getScale(l), g.x = i.x + l.clientLeft, g.y = i.y + l.clientTop;
|
|
981
980
|
}
|
|
982
|
-
let v = f && !_ && !d ? getHTMLOffset(f, m
|
|
981
|
+
let v = f && !_ && !d ? getHTMLOffset(f, m) : createCoords(0);
|
|
983
982
|
return {
|
|
984
983
|
width: c.width * h.x,
|
|
985
984
|
height: c.height * h.y,
|
|
@@ -991,21 +990,27 @@ function getClientRects(i) {
|
|
|
991
990
|
return Array.from(i.getClientRects());
|
|
992
991
|
}
|
|
993
992
|
function getDocumentRect(i) {
|
|
994
|
-
let s = getDocumentElement(i), c = getNodeScroll(i), l = i.ownerDocument.body, u = max(s.scrollWidth, s.clientWidth, l.scrollWidth, l.clientWidth), d = max(s.scrollHeight, s.clientHeight, l.scrollHeight, l.clientHeight), f = -c.scrollLeft + getWindowScrollBarX(i), p = -c.scrollTop;
|
|
995
|
-
return getComputedStyle$
|
|
993
|
+
let s = getDocumentElement$1(i), c = getNodeScroll(i), l = i.ownerDocument.body, u = max$1(s.scrollWidth, s.clientWidth, l.scrollWidth, l.clientWidth), d = max$1(s.scrollHeight, s.clientHeight, l.scrollHeight, l.clientHeight), f = -c.scrollLeft + getWindowScrollBarX(i), p = -c.scrollTop;
|
|
994
|
+
return getComputedStyle$2(l).direction === "rtl" && (f += max$1(s.clientWidth, l.clientWidth) - u), {
|
|
996
995
|
width: u,
|
|
997
996
|
height: d,
|
|
998
997
|
x: f,
|
|
999
998
|
y: p
|
|
1000
999
|
};
|
|
1001
1000
|
}
|
|
1001
|
+
var SCROLLBAR_MAX = 25;
|
|
1002
1002
|
function getViewportRect(i, s) {
|
|
1003
|
-
let c = getWindow$1(i), l = getDocumentElement(i), u = c.visualViewport, d = l.clientWidth, f = l.clientHeight, p = 0, m = 0;
|
|
1003
|
+
let c = getWindow$1(i), l = getDocumentElement$1(i), u = c.visualViewport, d = l.clientWidth, f = l.clientHeight, p = 0, m = 0;
|
|
1004
1004
|
if (u) {
|
|
1005
1005
|
d = u.width, f = u.height;
|
|
1006
1006
|
let i = isWebKit();
|
|
1007
1007
|
(!i || i && s === "fixed") && (p = u.offsetLeft, m = u.offsetTop);
|
|
1008
1008
|
}
|
|
1009
|
+
let h = getWindowScrollBarX(l);
|
|
1010
|
+
if (h <= 0) {
|
|
1011
|
+
let i = l.ownerDocument, s = i.body, c = getComputedStyle(s), u = i.compatMode === "CSS1Compat" && parseFloat(c.marginLeft) + parseFloat(c.marginRight) || 0, f = Math.abs(l.clientWidth - s.clientWidth - u);
|
|
1012
|
+
f <= SCROLLBAR_MAX && (d -= f);
|
|
1013
|
+
} else h <= SCROLLBAR_MAX && (d += h);
|
|
1009
1014
|
return {
|
|
1010
1015
|
width: d,
|
|
1011
1016
|
height: f,
|
|
@@ -1013,6 +1018,7 @@ function getViewportRect(i, s) {
|
|
|
1013
1018
|
y: m
|
|
1014
1019
|
};
|
|
1015
1020
|
}
|
|
1021
|
+
var absoluteOrFixed = /* @__PURE__ */ new Set(["absolute", "fixed"]);
|
|
1016
1022
|
function getInnerBoundingClientRect(i, s) {
|
|
1017
1023
|
let c = getBoundingClientRect(i, !0, s === "fixed"), l = c.top + i.clientTop, u = c.left + i.clientLeft, d = isHTMLElement$1(i) ? getScale(i) : createCoords(1);
|
|
1018
1024
|
return {
|
|
@@ -1025,7 +1031,7 @@ function getInnerBoundingClientRect(i, s) {
|
|
|
1025
1031
|
function getClientRectFromClippingAncestor(i, s, c) {
|
|
1026
1032
|
let l;
|
|
1027
1033
|
if (s === "viewport") l = getViewportRect(i, c);
|
|
1028
|
-
else if (s === "document") l = getDocumentRect(getDocumentElement(i));
|
|
1034
|
+
else if (s === "document") l = getDocumentRect(getDocumentElement$1(i));
|
|
1029
1035
|
else if (isElement$1(s)) l = getInnerBoundingClientRect(s, c);
|
|
1030
1036
|
else {
|
|
1031
1037
|
let c = getVisualOffsets(i);
|
|
@@ -1039,23 +1045,23 @@ function getClientRectFromClippingAncestor(i, s, c) {
|
|
|
1039
1045
|
return rectToClientRect(l);
|
|
1040
1046
|
}
|
|
1041
1047
|
function hasFixedPositionAncestor(i, s) {
|
|
1042
|
-
let c = getParentNode$
|
|
1043
|
-
return c === s || !isElement$1(c) || isLastTraversableNode(c) ? !1 : getComputedStyle$
|
|
1048
|
+
let c = getParentNode$2(i);
|
|
1049
|
+
return c === s || !isElement$1(c) || isLastTraversableNode(c) ? !1 : getComputedStyle$2(c).position === "fixed" || hasFixedPositionAncestor(c, s);
|
|
1044
1050
|
}
|
|
1045
1051
|
function getClippingElementAncestors(i, s) {
|
|
1046
1052
|
let c = s.get(i);
|
|
1047
1053
|
if (c) return c;
|
|
1048
|
-
let l = getOverflowAncestors(i, [], !1).filter((i) => isElement$1(i) && getNodeName(i) !== "body"), u = null, d = getComputedStyle$
|
|
1054
|
+
let l = getOverflowAncestors(i, [], !1).filter((i) => isElement$1(i) && getNodeName$1(i) !== "body"), u = null, d = getComputedStyle$2(i).position === "fixed", f = d ? getParentNode$2(i) : i;
|
|
1049
1055
|
for (; isElement$1(f) && !isLastTraversableNode(f);) {
|
|
1050
|
-
let s = getComputedStyle$
|
|
1051
|
-
!c && s.position === "fixed" && (u = null), (d ? !c && !u : !c && s.position === "static" && u &&
|
|
1056
|
+
let s = getComputedStyle$2(f), c = isContainingBlock(f);
|
|
1057
|
+
!c && s.position === "fixed" && (u = null), (d ? !c && !u : !c && s.position === "static" && u && absoluteOrFixed.has(u.position) || isOverflowElement$1(f) && !c && hasFixedPositionAncestor(i, f)) ? l = l.filter((i) => i !== f) : u = s, f = getParentNode$2(f);
|
|
1052
1058
|
}
|
|
1053
1059
|
return s.set(i, l), l;
|
|
1054
1060
|
}
|
|
1055
1061
|
function getClippingRect(i) {
|
|
1056
1062
|
let { element: s, boundary: c, rootBoundary: l, strategy: u } = i, d = [...c === "clippingAncestors" ? isTopLayer(s) ? [] : getClippingElementAncestors(s, this._c) : [].concat(c), l], f = d[0], p = d.reduce((i, c) => {
|
|
1057
1063
|
let l = getClientRectFromClippingAncestor(s, c, u);
|
|
1058
|
-
return i.top = max(l.top, i.top), i.right = min(l.right, i.right), i.bottom = min(l.bottom, i.bottom), i.left = max(l.left, i.left), i;
|
|
1064
|
+
return i.top = max$1(l.top, i.top), i.right = min$1(l.right, i.right), i.bottom = min$1(l.bottom, i.bottom), i.left = max$1(l.left, i.left), i;
|
|
1059
1065
|
}, getClientRectFromClippingAncestor(s, f, u));
|
|
1060
1066
|
return {
|
|
1061
1067
|
width: p.right - p.left,
|
|
@@ -1072,14 +1078,14 @@ function getDimensions(i) {
|
|
|
1072
1078
|
};
|
|
1073
1079
|
}
|
|
1074
1080
|
function getRectRelativeToOffsetParent(i, s, c) {
|
|
1075
|
-
let l = isHTMLElement$1(s), u = getDocumentElement(s), d = c === "fixed", f = getBoundingClientRect(i, !0, d, s), p = {
|
|
1081
|
+
let l = isHTMLElement$1(s), u = getDocumentElement$1(s), d = c === "fixed", f = getBoundingClientRect(i, !0, d, s), p = {
|
|
1076
1082
|
scrollLeft: 0,
|
|
1077
1083
|
scrollTop: 0
|
|
1078
1084
|
}, m = createCoords(0);
|
|
1079
1085
|
function h() {
|
|
1080
1086
|
m.x = getWindowScrollBarX(u);
|
|
1081
1087
|
}
|
|
1082
|
-
if (l || !l && !d) if ((getNodeName(s) !== "body" || isOverflowElement(u)) && (p = getNodeScroll(s)), l) {
|
|
1088
|
+
if (l || !l && !d) if ((getNodeName$1(s) !== "body" || isOverflowElement$1(u)) && (p = getNodeScroll(s)), l) {
|
|
1083
1089
|
let i = getBoundingClientRect(s, !0, d, s);
|
|
1084
1090
|
m.x = i.x + s.clientLeft, m.y = i.y + s.clientTop;
|
|
1085
1091
|
} else u && h();
|
|
@@ -1093,22 +1099,22 @@ function getRectRelativeToOffsetParent(i, s, c) {
|
|
|
1093
1099
|
};
|
|
1094
1100
|
}
|
|
1095
1101
|
function isStaticPositioned(i) {
|
|
1096
|
-
return getComputedStyle$
|
|
1102
|
+
return getComputedStyle$2(i).position === "static";
|
|
1097
1103
|
}
|
|
1098
1104
|
function getTrueOffsetParent(i, s) {
|
|
1099
|
-
if (!isHTMLElement$1(i) || getComputedStyle$
|
|
1105
|
+
if (!isHTMLElement$1(i) || getComputedStyle$2(i).position === "fixed") return null;
|
|
1100
1106
|
if (s) return s(i);
|
|
1101
1107
|
let c = i.offsetParent;
|
|
1102
|
-
return getDocumentElement(i) === c && (c = c.ownerDocument.body), c;
|
|
1108
|
+
return getDocumentElement$1(i) === c && (c = c.ownerDocument.body), c;
|
|
1103
1109
|
}
|
|
1104
1110
|
function getOffsetParent(i, s) {
|
|
1105
1111
|
let c = getWindow$1(i);
|
|
1106
1112
|
if (isTopLayer(i)) return c;
|
|
1107
1113
|
if (!isHTMLElement$1(i)) {
|
|
1108
|
-
let s = getParentNode$
|
|
1114
|
+
let s = getParentNode$2(i);
|
|
1109
1115
|
for (; s && !isLastTraversableNode(s);) {
|
|
1110
1116
|
if (isElement$1(s) && !isStaticPositioned(s)) return s;
|
|
1111
|
-
s = getParentNode$
|
|
1117
|
+
s = getParentNode$2(s);
|
|
1112
1118
|
}
|
|
1113
1119
|
return c;
|
|
1114
1120
|
}
|
|
@@ -1129,11 +1135,11 @@ var getElementRects = async function(i) {
|
|
|
1129
1135
|
};
|
|
1130
1136
|
};
|
|
1131
1137
|
function isRTL(i) {
|
|
1132
|
-
return getComputedStyle$
|
|
1138
|
+
return getComputedStyle$2(i).direction === "rtl";
|
|
1133
1139
|
}
|
|
1134
1140
|
var platform = {
|
|
1135
1141
|
convertOffsetParentRelativeRectToViewportRelativeRect,
|
|
1136
|
-
getDocumentElement,
|
|
1142
|
+
getDocumentElement: getDocumentElement$1,
|
|
1137
1143
|
getClippingRect,
|
|
1138
1144
|
getOffsetParent,
|
|
1139
1145
|
getElementRects,
|
|
@@ -1147,7 +1153,7 @@ function rectsAreEqual(i, s) {
|
|
|
1147
1153
|
return i.x === s.x && i.y === s.y && i.width === s.width && i.height === s.height;
|
|
1148
1154
|
}
|
|
1149
1155
|
function observeMove(i, s) {
|
|
1150
|
-
let c = null, l, u = getDocumentElement(i);
|
|
1156
|
+
let c = null, l, u = getDocumentElement$1(i);
|
|
1151
1157
|
function d() {
|
|
1152
1158
|
var i;
|
|
1153
1159
|
clearTimeout(l), (i = c) == null || i.disconnect(), c = null;
|
|
@@ -1156,9 +1162,9 @@ function observeMove(i, s) {
|
|
|
1156
1162
|
p === void 0 && (p = !1), m === void 0 && (m = 1), d();
|
|
1157
1163
|
let h = i.getBoundingClientRect(), { left: g, top: _, width: v, height: y } = h;
|
|
1158
1164
|
if (p || s(), !v || !y) return;
|
|
1159
|
-
let b = floor(_), x = floor(u.clientWidth - (g + v)), S = floor(u.clientHeight - (_ + y)), C = floor(g), w = {
|
|
1165
|
+
let b = floor$1(_), x = floor$1(u.clientWidth - (g + v)), S = floor$1(u.clientHeight - (_ + y)), C = floor$1(g), w = {
|
|
1160
1166
|
rootMargin: -b + "px " + -x + "px " + -S + "px " + -C + "px",
|
|
1161
|
-
threshold: max(0, min(1, m)) || 1
|
|
1167
|
+
threshold: max$1(0, min$1(1, m)) || 1
|
|
1162
1168
|
}, T = !0;
|
|
1163
1169
|
function E(s) {
|
|
1164
1170
|
let c = s[0].intersectionRatio;
|
|
@@ -1413,7 +1419,7 @@ function getPlacementImpl(i, s, c = {}) {
|
|
|
1413
1419
|
s.style.setProperty("--x", `${d}px`), s.style.setProperty("--y", `${_}px`), u.hideWhenDetached && (i.middlewareData.hide?.referenceHidden ? (s.style.setProperty("visibility", "hidden"), s.style.setProperty("pointer-events", "none")) : (s.style.removeProperty("visibility"), s.style.removeProperty("pointer-events")));
|
|
1414
1420
|
let v = s.firstElementChild;
|
|
1415
1421
|
if (v) {
|
|
1416
|
-
let i = getComputedStyle(v);
|
|
1422
|
+
let i = getComputedStyle$1(v);
|
|
1417
1423
|
s.style.setProperty("--z-index", i.zIndex);
|
|
1418
1424
|
}
|
|
1419
1425
|
}, v = async () => {
|
|
@@ -1424,7 +1430,7 @@ function getPlacementImpl(i, s, c = {}) {
|
|
|
1424
1430
|
};
|
|
1425
1431
|
}
|
|
1426
1432
|
function getPlacement(i, s, c = {}) {
|
|
1427
|
-
let { defer: l, ...u } = c, d = l ? raf : (i) => i(), f = [];
|
|
1433
|
+
let { defer: l, ...u } = c, d = l ? raf$1 : (i) => i(), f = [];
|
|
1428
1434
|
return f.push(d(() => {
|
|
1429
1435
|
let c = typeof i == "function" ? i() : i, l = typeof s == "function" ? s() : s;
|
|
1430
1436
|
f.push(getPlacementImpl(c, l, u));
|
|
@@ -1523,12 +1529,12 @@ function hideOthers(i, s = getParentNode(i), c = "data-aria-hidden") {
|
|
|
1523
1529
|
explicitBooleanValue: !0
|
|
1524
1530
|
});
|
|
1525
1531
|
}
|
|
1526
|
-
function raf
|
|
1532
|
+
function raf(i) {
|
|
1527
1533
|
let s = requestAnimationFrame(() => i());
|
|
1528
1534
|
return () => cancelAnimationFrame(s);
|
|
1529
1535
|
}
|
|
1530
1536
|
function ariaHidden(i, s = {}) {
|
|
1531
|
-
let { defer: c = !0 } = s, l = c ? raf
|
|
1537
|
+
let { defer: c = !0 } = s, l = c ? raf : (i) => i(), u = [];
|
|
1532
1538
|
return u.push(l(() => {
|
|
1533
1539
|
let s = (typeof i == "function" ? i() : i).filter(Boolean);
|
|
1534
1540
|
s.length !== 0 && u.push(hideOthers(s));
|
|
@@ -1625,7 +1631,7 @@ function trackInteractOutsideImpl(i, s) {
|
|
|
1625
1631
|
let v = /* @__PURE__ */ new Set();
|
|
1626
1632
|
function y(s) {
|
|
1627
1633
|
function c() {
|
|
1628
|
-
let c = f ? raf : (i) => i(), l = s.composedPath?.() ?? [s.target];
|
|
1634
|
+
let c = f ? raf$1 : (i) => i(), l = s.composedPath?.() ?? [s.target];
|
|
1629
1635
|
c(() => {
|
|
1630
1636
|
if (!(!i || !_(s))) {
|
|
1631
1637
|
if (u || d) {
|
|
@@ -1650,7 +1656,7 @@ function trackInteractOutsideImpl(i, s) {
|
|
|
1650
1656
|
b.add(addDomEvent(p, "pointerdown", y, !0)), b.add(g.addEventListener("pointerdown", y, !0)), b.add(h.addEventListener("pointerdown", y, !0));
|
|
1651
1657
|
}, 0);
|
|
1652
1658
|
function S(s) {
|
|
1653
|
-
(f ? raf : (i) => i())(() => {
|
|
1659
|
+
(f ? raf$1 : (i) => i())(() => {
|
|
1654
1660
|
if (!(!i || !_(s))) {
|
|
1655
1661
|
if (l || d) {
|
|
1656
1662
|
let s = callAll(l, d);
|
|
@@ -1673,7 +1679,7 @@ function trackInteractOutsideImpl(i, s) {
|
|
|
1673
1679
|
};
|
|
1674
1680
|
}
|
|
1675
1681
|
function trackInteractOutside(i, s) {
|
|
1676
|
-
let { defer: c } = s, l = c ? raf : (i) => i(), u = [];
|
|
1682
|
+
let { defer: c } = s, l = c ? raf$1 : (i) => i(), u = [];
|
|
1677
1683
|
return u.push(l(() => {
|
|
1678
1684
|
let c = typeof i == "function" ? i() : i;
|
|
1679
1685
|
u.push(trackInteractOutsideImpl(c, s));
|
|
@@ -1808,7 +1814,7 @@ function trackDismissableElementImpl(i, s) {
|
|
|
1808
1814
|
};
|
|
1809
1815
|
}
|
|
1810
1816
|
function trackDismissableElement(i, s) {
|
|
1811
|
-
let { defer: c } = s, l = c ? raf : (i) => i(), u = [];
|
|
1817
|
+
let { defer: c } = s, l = c ? raf$1 : (i) => i(), u = [];
|
|
1812
1818
|
return u.push(l(() => {
|
|
1813
1819
|
let c = isFunction(i) ? i() : i;
|
|
1814
1820
|
u.push(trackDismissableElementImpl(c, s));
|
|
@@ -1834,20 +1840,6 @@ var activeFocusTraps = {
|
|
|
1834
1840
|
c !== -1 && i.splice(c, 1), i.length > 0 && i[i.length - 1].unpause();
|
|
1835
1841
|
}
|
|
1836
1842
|
}, sharedTrapStack = [], FocusTrap = class {
|
|
1837
|
-
trapStack;
|
|
1838
|
-
config;
|
|
1839
|
-
doc;
|
|
1840
|
-
state = {
|
|
1841
|
-
containers: [],
|
|
1842
|
-
containerGroups: [],
|
|
1843
|
-
tabbableGroups: [],
|
|
1844
|
-
nodeFocusedBeforeActivation: null,
|
|
1845
|
-
mostRecentlyFocusedNode: null,
|
|
1846
|
-
active: !1,
|
|
1847
|
-
paused: !1,
|
|
1848
|
-
delayInitialFocusTimer: void 0,
|
|
1849
|
-
recentNavEvent: void 0
|
|
1850
|
-
};
|
|
1851
1843
|
get active() {
|
|
1852
1844
|
return this.state.active;
|
|
1853
1845
|
}
|
|
@@ -1855,7 +1847,161 @@ var activeFocusTraps = {
|
|
|
1855
1847
|
return this.state.paused;
|
|
1856
1848
|
}
|
|
1857
1849
|
constructor(i, s) {
|
|
1858
|
-
this.
|
|
1850
|
+
this.state = {
|
|
1851
|
+
containers: [],
|
|
1852
|
+
containerGroups: [],
|
|
1853
|
+
tabbableGroups: [],
|
|
1854
|
+
nodeFocusedBeforeActivation: null,
|
|
1855
|
+
mostRecentlyFocusedNode: null,
|
|
1856
|
+
active: !1,
|
|
1857
|
+
paused: !1,
|
|
1858
|
+
delayInitialFocusTimer: void 0,
|
|
1859
|
+
recentNavEvent: void 0
|
|
1860
|
+
}, this.listenerCleanups = [], this.handleFocus = (i) => {
|
|
1861
|
+
let s = getEventTarget(i), c = this.findContainerIndex(s, i) >= 0;
|
|
1862
|
+
if (c || isDocument(s)) c && (this.state.mostRecentlyFocusedNode = s);
|
|
1863
|
+
else {
|
|
1864
|
+
i.stopImmediatePropagation();
|
|
1865
|
+
let s, c = !0;
|
|
1866
|
+
if (this.state.mostRecentlyFocusedNode) if (getTabIndex(this.state.mostRecentlyFocusedNode) > 0) {
|
|
1867
|
+
let i = this.findContainerIndex(this.state.mostRecentlyFocusedNode), { tabbableNodes: l } = this.state.containerGroups[i];
|
|
1868
|
+
if (l.length > 0) {
|
|
1869
|
+
let i = l.findIndex((i) => i === this.state.mostRecentlyFocusedNode);
|
|
1870
|
+
i >= 0 && (this.config.isKeyForward(this.state.recentNavEvent) ? i + 1 < l.length && (s = l[i + 1], c = !1) : i - 1 >= 0 && (s = l[i - 1], c = !1));
|
|
1871
|
+
}
|
|
1872
|
+
} else this.state.containerGroups.some((i) => i.tabbableNodes.some((i) => getTabIndex(i) > 0)) || (c = !1);
|
|
1873
|
+
else c = !1;
|
|
1874
|
+
c && (s = this.findNextNavNode({
|
|
1875
|
+
target: this.state.mostRecentlyFocusedNode,
|
|
1876
|
+
isBackward: this.config.isKeyBackward(this.state.recentNavEvent)
|
|
1877
|
+
})), s ? this.tryFocus(s) : this.tryFocus(this.state.mostRecentlyFocusedNode || this.getInitialFocusNode());
|
|
1878
|
+
}
|
|
1879
|
+
this.state.recentNavEvent = void 0;
|
|
1880
|
+
}, this.handlePointerDown = (i) => {
|
|
1881
|
+
let s = getEventTarget(i);
|
|
1882
|
+
if (!(this.findContainerIndex(s, i) >= 0)) {
|
|
1883
|
+
if (valueOrHandler(this.config.clickOutsideDeactivates, i)) {
|
|
1884
|
+
this.deactivate({ returnFocus: this.config.returnFocusOnDeactivate });
|
|
1885
|
+
return;
|
|
1886
|
+
}
|
|
1887
|
+
valueOrHandler(this.config.allowOutsideClick, i) || i.preventDefault();
|
|
1888
|
+
}
|
|
1889
|
+
}, this.handleClick = (i) => {
|
|
1890
|
+
let s = getEventTarget(i);
|
|
1891
|
+
this.findContainerIndex(s, i) >= 0 || valueOrHandler(this.config.clickOutsideDeactivates, i) || valueOrHandler(this.config.allowOutsideClick, i) || (i.preventDefault(), i.stopImmediatePropagation());
|
|
1892
|
+
}, this.handleTabKey = (i) => {
|
|
1893
|
+
if (this.config.isKeyForward(i) || this.config.isKeyBackward(i)) {
|
|
1894
|
+
this.state.recentNavEvent = i;
|
|
1895
|
+
let s = this.config.isKeyBackward(i), c = this.findNextNavNode({
|
|
1896
|
+
event: i,
|
|
1897
|
+
isBackward: s
|
|
1898
|
+
});
|
|
1899
|
+
if (!c) return;
|
|
1900
|
+
isTabEvent(i) && i.preventDefault(), this.tryFocus(c);
|
|
1901
|
+
}
|
|
1902
|
+
}, this.handleEscapeKey = (i) => {
|
|
1903
|
+
isEscapeEvent(i) && valueOrHandler(this.config.escapeDeactivates, i) !== !1 && (i.preventDefault(), this.deactivate());
|
|
1904
|
+
}, this.setupMutationObserver = () => {
|
|
1905
|
+
this._mutationObserver = new (this.doc.defaultView || window).MutationObserver((i) => {
|
|
1906
|
+
i.some((i) => Array.from(i.removedNodes).includes(this.state.mostRecentlyFocusedNode)) && this.tryFocus(this.getInitialFocusNode());
|
|
1907
|
+
});
|
|
1908
|
+
}, this.updateObservedNodes = () => {
|
|
1909
|
+
this._mutationObserver?.disconnect(), this.state.active && !this.state.paused && this.state.containers.forEach((i) => {
|
|
1910
|
+
this._mutationObserver?.observe(i, {
|
|
1911
|
+
subtree: !0,
|
|
1912
|
+
childList: !0
|
|
1913
|
+
});
|
|
1914
|
+
});
|
|
1915
|
+
}, this.getInitialFocusNode = () => {
|
|
1916
|
+
let i = this.getNodeForOption("initialFocus", { hasFallback: !0 });
|
|
1917
|
+
if (i === !1) return !1;
|
|
1918
|
+
if (i === void 0 || i && !isFocusable(i)) if (this.findContainerIndex(this.doc.activeElement) >= 0) i = this.doc.activeElement;
|
|
1919
|
+
else {
|
|
1920
|
+
let s = this.state.tabbableGroups[0];
|
|
1921
|
+
i = s && s.firstTabbableNode || this.getNodeForOption("fallbackFocus");
|
|
1922
|
+
}
|
|
1923
|
+
else i === null && (i = this.getNodeForOption("fallbackFocus"));
|
|
1924
|
+
if (!i) throw Error("Your focus-trap needs to have at least one focusable element");
|
|
1925
|
+
return i.isConnected || (i = this.getNodeForOption("fallbackFocus")), i;
|
|
1926
|
+
}, this.tryFocus = (i) => {
|
|
1927
|
+
if (i !== !1 && i !== getActiveElement(this.doc)) {
|
|
1928
|
+
if (!i || !i.focus) {
|
|
1929
|
+
this.tryFocus(this.getInitialFocusNode());
|
|
1930
|
+
return;
|
|
1931
|
+
}
|
|
1932
|
+
i.focus({ preventScroll: !!this.config.preventScroll }), this.state.mostRecentlyFocusedNode = i, isSelectableInput(i) && i.select();
|
|
1933
|
+
}
|
|
1934
|
+
}, this.deactivate = (i) => {
|
|
1935
|
+
if (!this.state.active) return this;
|
|
1936
|
+
let s = {
|
|
1937
|
+
onDeactivate: this.config.onDeactivate,
|
|
1938
|
+
onPostDeactivate: this.config.onPostDeactivate,
|
|
1939
|
+
checkCanReturnFocus: this.config.checkCanReturnFocus,
|
|
1940
|
+
...i
|
|
1941
|
+
};
|
|
1942
|
+
clearTimeout(this.state.delayInitialFocusTimer), this.state.delayInitialFocusTimer = void 0, this.removeListeners(), this.state.active = !1, this.state.paused = !1, this.updateObservedNodes(), activeFocusTraps.deactivateTrap(this.trapStack, this);
|
|
1943
|
+
let c = this.getOption(s, "onDeactivate"), l = this.getOption(s, "onPostDeactivate"), u = this.getOption(s, "checkCanReturnFocus"), d = this.getOption(s, "returnFocus", "returnFocusOnDeactivate");
|
|
1944
|
+
c?.();
|
|
1945
|
+
let f = () => {
|
|
1946
|
+
delay(() => {
|
|
1947
|
+
if (d) {
|
|
1948
|
+
let i = this.getReturnFocusNode(this.state.nodeFocusedBeforeActivation);
|
|
1949
|
+
this.tryFocus(i);
|
|
1950
|
+
}
|
|
1951
|
+
l?.();
|
|
1952
|
+
});
|
|
1953
|
+
};
|
|
1954
|
+
return d && u ? (u(this.getReturnFocusNode(this.state.nodeFocusedBeforeActivation)).then(f, f), this) : (f(), this);
|
|
1955
|
+
}, this.pause = (i) => {
|
|
1956
|
+
if (this.state.paused || !this.state.active) return this;
|
|
1957
|
+
let s = this.getOption(i, "onPause"), c = this.getOption(i, "onPostPause");
|
|
1958
|
+
return this.state.paused = !0, s?.(), this.removeListeners(), this.updateObservedNodes(), c?.(), this;
|
|
1959
|
+
}, this.unpause = (i) => {
|
|
1960
|
+
if (!this.state.paused || !this.state.active) return this;
|
|
1961
|
+
let s = this.getOption(i, "onUnpause"), c = this.getOption(i, "onPostUnpause");
|
|
1962
|
+
return this.state.paused = !1, s?.(), this.updateTabbableNodes(), this.addListeners(), this.updateObservedNodes(), c?.(), this;
|
|
1963
|
+
}, this.updateContainerElements = (i) => (this.state.containers = Array.isArray(i) ? i.filter(Boolean) : [i].filter(Boolean), this.state.active && this.updateTabbableNodes(), this.updateObservedNodes(), this), this.getReturnFocusNode = (i) => {
|
|
1964
|
+
let s = this.getNodeForOption("setReturnFocus", { params: [i] });
|
|
1965
|
+
return s || (s === !1 ? !1 : i);
|
|
1966
|
+
}, this.getOption = (i, s, c) => i && i[s] !== void 0 ? i[s] : this.config[c || s], this.getNodeForOption = (i, { hasFallback: s = !1, params: c = [] } = {}) => {
|
|
1967
|
+
let l = this.config[i];
|
|
1968
|
+
if (typeof l == "function" && (l = l(...c)), l === !0 && (l = void 0), !l) {
|
|
1969
|
+
if (l === void 0 || l === !1) return l;
|
|
1970
|
+
throw Error(`\`${i}\` was specified but was not a node, or did not return a node`);
|
|
1971
|
+
}
|
|
1972
|
+
let u = l;
|
|
1973
|
+
if (typeof l == "string") {
|
|
1974
|
+
try {
|
|
1975
|
+
u = this.doc.querySelector(l);
|
|
1976
|
+
} catch (s) {
|
|
1977
|
+
throw Error(`\`${i}\` appears to be an invalid selector; error="${s.message}"`);
|
|
1978
|
+
}
|
|
1979
|
+
if (!u && !s) throw Error(`\`${i}\` as selector refers to no known node`);
|
|
1980
|
+
}
|
|
1981
|
+
return u;
|
|
1982
|
+
}, this.findNextNavNode = (i) => {
|
|
1983
|
+
let { event: s, isBackward: c = !1 } = i, l = i.target || getEventTarget(s);
|
|
1984
|
+
this.updateTabbableNodes();
|
|
1985
|
+
let u = null;
|
|
1986
|
+
if (this.state.tabbableGroups.length > 0) {
|
|
1987
|
+
let i = this.findContainerIndex(l, s), d = i >= 0 ? this.state.containerGroups[i] : void 0;
|
|
1988
|
+
if (i < 0) u = c ? this.state.tabbableGroups[this.state.tabbableGroups.length - 1].lastTabbableNode : this.state.tabbableGroups[0].firstTabbableNode;
|
|
1989
|
+
else if (c) {
|
|
1990
|
+
let c = this.state.tabbableGroups.findIndex(({ firstTabbableNode: i }) => l === i);
|
|
1991
|
+
if (c < 0 && (d?.container === l || isFocusable(l) && !isTabbable(l) && !d?.nextTabbableNode(l, !1)) && (c = i), c >= 0) {
|
|
1992
|
+
let i = c === 0 ? this.state.tabbableGroups.length - 1 : c - 1, s = this.state.tabbableGroups[i];
|
|
1993
|
+
u = getTabIndex(l) >= 0 ? s.lastTabbableNode : s.lastDomTabbableNode;
|
|
1994
|
+
} else isTabEvent(s) || (u = d?.nextTabbableNode(l, !1));
|
|
1995
|
+
} else {
|
|
1996
|
+
let c = this.state.tabbableGroups.findIndex(({ lastTabbableNode: i }) => l === i);
|
|
1997
|
+
if (c < 0 && (d?.container === l || isFocusable(l) && !isTabbable(l) && !d?.nextTabbableNode(l)) && (c = i), c >= 0) {
|
|
1998
|
+
let i = c === this.state.tabbableGroups.length - 1 ? 0 : c + 1, s = this.state.tabbableGroups[i];
|
|
1999
|
+
u = getTabIndex(l) >= 0 ? s.firstTabbableNode : s.firstDomTabbableNode;
|
|
2000
|
+
} else isTabEvent(s) || (u = d?.nextTabbableNode(l));
|
|
2001
|
+
}
|
|
2002
|
+
} else u = this.getNodeForOption("fallbackFocus");
|
|
2003
|
+
return u;
|
|
2004
|
+
}, this.trapStack = s.trapStack || sharedTrapStack;
|
|
1859
2005
|
let c = {
|
|
1860
2006
|
returnFocusOnDeactivate: !0,
|
|
1861
2007
|
escapeDeactivates: !0,
|
|
@@ -1895,7 +2041,6 @@ var activeFocusTraps = {
|
|
|
1895
2041
|
}), this.state.tabbableGroups = this.state.containerGroups.filter((i) => i.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");
|
|
1896
2042
|
if (this.state.containerGroups.find((i) => i.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.");
|
|
1897
2043
|
}
|
|
1898
|
-
listenerCleanups = [];
|
|
1899
2044
|
addListeners() {
|
|
1900
2045
|
if (this.state.active) return activeFocusTraps.activateTrap(this.trapStack, this), this.state.delayInitialFocusTimer = this.config.delayInitialFocus ? delay(() => {
|
|
1901
2046
|
this.tryFocus(this.getInitialFocusNode());
|
|
@@ -1916,90 +2061,6 @@ var activeFocusTraps = {
|
|
|
1916
2061
|
removeListeners() {
|
|
1917
2062
|
if (this.state.active) return this.listenerCleanups.forEach((i) => i()), this.listenerCleanups = [], this;
|
|
1918
2063
|
}
|
|
1919
|
-
handleFocus = (i) => {
|
|
1920
|
-
let s = getEventTarget(i), c = this.findContainerIndex(s, i) >= 0;
|
|
1921
|
-
if (c || isDocument(s)) c && (this.state.mostRecentlyFocusedNode = s);
|
|
1922
|
-
else {
|
|
1923
|
-
i.stopImmediatePropagation();
|
|
1924
|
-
let s, c = !0;
|
|
1925
|
-
if (this.state.mostRecentlyFocusedNode) if (getTabIndex(this.state.mostRecentlyFocusedNode) > 0) {
|
|
1926
|
-
let i = this.findContainerIndex(this.state.mostRecentlyFocusedNode), { tabbableNodes: l } = this.state.containerGroups[i];
|
|
1927
|
-
if (l.length > 0) {
|
|
1928
|
-
let i = l.findIndex((i) => i === this.state.mostRecentlyFocusedNode);
|
|
1929
|
-
i >= 0 && (this.config.isKeyForward(this.state.recentNavEvent) ? i + 1 < l.length && (s = l[i + 1], c = !1) : i - 1 >= 0 && (s = l[i - 1], c = !1));
|
|
1930
|
-
}
|
|
1931
|
-
} else this.state.containerGroups.some((i) => i.tabbableNodes.some((i) => getTabIndex(i) > 0)) || (c = !1);
|
|
1932
|
-
else c = !1;
|
|
1933
|
-
c && (s = this.findNextNavNode({
|
|
1934
|
-
target: this.state.mostRecentlyFocusedNode,
|
|
1935
|
-
isBackward: this.config.isKeyBackward(this.state.recentNavEvent)
|
|
1936
|
-
})), s ? this.tryFocus(s) : this.tryFocus(this.state.mostRecentlyFocusedNode || this.getInitialFocusNode());
|
|
1937
|
-
}
|
|
1938
|
-
this.state.recentNavEvent = void 0;
|
|
1939
|
-
};
|
|
1940
|
-
handlePointerDown = (i) => {
|
|
1941
|
-
let s = getEventTarget(i);
|
|
1942
|
-
if (!(this.findContainerIndex(s, i) >= 0)) {
|
|
1943
|
-
if (valueOrHandler(this.config.clickOutsideDeactivates, i)) {
|
|
1944
|
-
this.deactivate({ returnFocus: this.config.returnFocusOnDeactivate });
|
|
1945
|
-
return;
|
|
1946
|
-
}
|
|
1947
|
-
valueOrHandler(this.config.allowOutsideClick, i) || i.preventDefault();
|
|
1948
|
-
}
|
|
1949
|
-
};
|
|
1950
|
-
handleClick = (i) => {
|
|
1951
|
-
let s = getEventTarget(i);
|
|
1952
|
-
this.findContainerIndex(s, i) >= 0 || valueOrHandler(this.config.clickOutsideDeactivates, i) || valueOrHandler(this.config.allowOutsideClick, i) || (i.preventDefault(), i.stopImmediatePropagation());
|
|
1953
|
-
};
|
|
1954
|
-
handleTabKey = (i) => {
|
|
1955
|
-
if (this.config.isKeyForward(i) || this.config.isKeyBackward(i)) {
|
|
1956
|
-
this.state.recentNavEvent = i;
|
|
1957
|
-
let s = this.config.isKeyBackward(i), c = this.findNextNavNode({
|
|
1958
|
-
event: i,
|
|
1959
|
-
isBackward: s
|
|
1960
|
-
});
|
|
1961
|
-
if (!c) return;
|
|
1962
|
-
isTabEvent(i) && i.preventDefault(), this.tryFocus(c);
|
|
1963
|
-
}
|
|
1964
|
-
};
|
|
1965
|
-
handleEscapeKey = (i) => {
|
|
1966
|
-
isEscapeEvent(i) && valueOrHandler(this.config.escapeDeactivates, i) !== !1 && (i.preventDefault(), this.deactivate());
|
|
1967
|
-
};
|
|
1968
|
-
_mutationObserver;
|
|
1969
|
-
setupMutationObserver = () => {
|
|
1970
|
-
this._mutationObserver = new (this.doc.defaultView || window).MutationObserver((i) => {
|
|
1971
|
-
i.some((i) => Array.from(i.removedNodes).includes(this.state.mostRecentlyFocusedNode)) && this.tryFocus(this.getInitialFocusNode());
|
|
1972
|
-
});
|
|
1973
|
-
};
|
|
1974
|
-
updateObservedNodes = () => {
|
|
1975
|
-
this._mutationObserver?.disconnect(), this.state.active && !this.state.paused && this.state.containers.forEach((i) => {
|
|
1976
|
-
this._mutationObserver?.observe(i, {
|
|
1977
|
-
subtree: !0,
|
|
1978
|
-
childList: !0
|
|
1979
|
-
});
|
|
1980
|
-
});
|
|
1981
|
-
};
|
|
1982
|
-
getInitialFocusNode = () => {
|
|
1983
|
-
let i = this.getNodeForOption("initialFocus", { hasFallback: !0 });
|
|
1984
|
-
if (i === !1) return !1;
|
|
1985
|
-
if (i === void 0 || i && !isFocusable(i)) if (this.findContainerIndex(this.doc.activeElement) >= 0) i = this.doc.activeElement;
|
|
1986
|
-
else {
|
|
1987
|
-
let s = this.state.tabbableGroups[0];
|
|
1988
|
-
i = s && s.firstTabbableNode || this.getNodeForOption("fallbackFocus");
|
|
1989
|
-
}
|
|
1990
|
-
else i === null && (i = this.getNodeForOption("fallbackFocus"));
|
|
1991
|
-
if (!i) throw Error("Your focus-trap needs to have at least one focusable element");
|
|
1992
|
-
return i.isConnected || (i = this.getNodeForOption("fallbackFocus")), i;
|
|
1993
|
-
};
|
|
1994
|
-
tryFocus = (i) => {
|
|
1995
|
-
if (i !== !1 && i !== getActiveElement(this.doc)) {
|
|
1996
|
-
if (!i || !i.focus) {
|
|
1997
|
-
this.tryFocus(this.getInitialFocusNode());
|
|
1998
|
-
return;
|
|
1999
|
-
}
|
|
2000
|
-
i.focus({ preventScroll: !!this.config.preventScroll }), this.state.mostRecentlyFocusedNode = i, isSelectableInput(i) && i.select();
|
|
2001
|
-
}
|
|
2002
|
-
};
|
|
2003
2064
|
activate(i) {
|
|
2004
2065
|
if (this.state.active) return this;
|
|
2005
2066
|
let s = this.getOption(i, "onActivate"), c = this.getOption(i, "onPostActivate"), l = this.getOption(i, "checkCanFocusTrap");
|
|
@@ -2009,87 +2070,9 @@ var activeFocusTraps = {
|
|
|
2009
2070
|
};
|
|
2010
2071
|
return l ? (l(this.state.containers.concat()).then(u, u), this) : (u(), this);
|
|
2011
2072
|
}
|
|
2012
|
-
deactivate = (i) => {
|
|
2013
|
-
if (!this.state.active) return this;
|
|
2014
|
-
let s = {
|
|
2015
|
-
onDeactivate: this.config.onDeactivate,
|
|
2016
|
-
onPostDeactivate: this.config.onPostDeactivate,
|
|
2017
|
-
checkCanReturnFocus: this.config.checkCanReturnFocus,
|
|
2018
|
-
...i
|
|
2019
|
-
};
|
|
2020
|
-
clearTimeout(this.state.delayInitialFocusTimer), this.state.delayInitialFocusTimer = void 0, this.removeListeners(), this.state.active = !1, this.state.paused = !1, this.updateObservedNodes(), activeFocusTraps.deactivateTrap(this.trapStack, this);
|
|
2021
|
-
let c = this.getOption(s, "onDeactivate"), l = this.getOption(s, "onPostDeactivate"), u = this.getOption(s, "checkCanReturnFocus"), d = this.getOption(s, "returnFocus", "returnFocusOnDeactivate");
|
|
2022
|
-
c?.();
|
|
2023
|
-
let f = () => {
|
|
2024
|
-
delay(() => {
|
|
2025
|
-
if (d) {
|
|
2026
|
-
let i = this.getReturnFocusNode(this.state.nodeFocusedBeforeActivation);
|
|
2027
|
-
this.tryFocus(i);
|
|
2028
|
-
}
|
|
2029
|
-
l?.();
|
|
2030
|
-
});
|
|
2031
|
-
};
|
|
2032
|
-
return d && u ? (u(this.getReturnFocusNode(this.state.nodeFocusedBeforeActivation)).then(f, f), this) : (f(), this);
|
|
2033
|
-
};
|
|
2034
|
-
pause = (i) => {
|
|
2035
|
-
if (this.state.paused || !this.state.active) return this;
|
|
2036
|
-
let s = this.getOption(i, "onPause"), c = this.getOption(i, "onPostPause");
|
|
2037
|
-
return this.state.paused = !0, s?.(), this.removeListeners(), this.updateObservedNodes(), c?.(), this;
|
|
2038
|
-
};
|
|
2039
|
-
unpause = (i) => {
|
|
2040
|
-
if (!this.state.paused || !this.state.active) return this;
|
|
2041
|
-
let s = this.getOption(i, "onUnpause"), c = this.getOption(i, "onPostUnpause");
|
|
2042
|
-
return this.state.paused = !1, s?.(), this.updateTabbableNodes(), this.addListeners(), this.updateObservedNodes(), c?.(), this;
|
|
2043
|
-
};
|
|
2044
|
-
updateContainerElements = (i) => (this.state.containers = Array.isArray(i) ? i.filter(Boolean) : [i].filter(Boolean), this.state.active && this.updateTabbableNodes(), this.updateObservedNodes(), this);
|
|
2045
|
-
getReturnFocusNode = (i) => {
|
|
2046
|
-
let s = this.getNodeForOption("setReturnFocus", { params: [i] });
|
|
2047
|
-
return s || (s === !1 ? !1 : i);
|
|
2048
|
-
};
|
|
2049
|
-
getOption = (i, s, c) => i && i[s] !== void 0 ? i[s] : this.config[c || s];
|
|
2050
|
-
getNodeForOption = (i, { hasFallback: s = !1, params: c = [] } = {}) => {
|
|
2051
|
-
let l = this.config[i];
|
|
2052
|
-
if (typeof l == "function" && (l = l(...c)), l === !0 && (l = void 0), !l) {
|
|
2053
|
-
if (l === void 0 || l === !1) return l;
|
|
2054
|
-
throw Error(`\`${i}\` was specified but was not a node, or did not return a node`);
|
|
2055
|
-
}
|
|
2056
|
-
let u = l;
|
|
2057
|
-
if (typeof l == "string") {
|
|
2058
|
-
try {
|
|
2059
|
-
u = this.doc.querySelector(l);
|
|
2060
|
-
} catch (s) {
|
|
2061
|
-
throw Error(`\`${i}\` appears to be an invalid selector; error="${s.message}"`);
|
|
2062
|
-
}
|
|
2063
|
-
if (!u && !s) throw Error(`\`${i}\` as selector refers to no known node`);
|
|
2064
|
-
}
|
|
2065
|
-
return u;
|
|
2066
|
-
};
|
|
2067
|
-
findNextNavNode = (i) => {
|
|
2068
|
-
let { event: s, isBackward: c = !1 } = i, l = i.target || getEventTarget(s);
|
|
2069
|
-
this.updateTabbableNodes();
|
|
2070
|
-
let u = null;
|
|
2071
|
-
if (this.state.tabbableGroups.length > 0) {
|
|
2072
|
-
let i = this.findContainerIndex(l, s), d = i >= 0 ? this.state.containerGroups[i] : void 0;
|
|
2073
|
-
if (i < 0) u = c ? this.state.tabbableGroups[this.state.tabbableGroups.length - 1].lastTabbableNode : this.state.tabbableGroups[0].firstTabbableNode;
|
|
2074
|
-
else if (c) {
|
|
2075
|
-
let c = this.state.tabbableGroups.findIndex(({ firstTabbableNode: i }) => l === i);
|
|
2076
|
-
if (c < 0 && (d?.container === l || isFocusable(l) && !isTabbable(l) && !d?.nextTabbableNode(l, !1)) && (c = i), c >= 0) {
|
|
2077
|
-
let i = c === 0 ? this.state.tabbableGroups.length - 1 : c - 1, s = this.state.tabbableGroups[i];
|
|
2078
|
-
u = getTabIndex(l) >= 0 ? s.lastTabbableNode : s.lastDomTabbableNode;
|
|
2079
|
-
} else isTabEvent(s) || (u = d?.nextTabbableNode(l, !1));
|
|
2080
|
-
} else {
|
|
2081
|
-
let c = this.state.tabbableGroups.findIndex(({ lastTabbableNode: i }) => l === i);
|
|
2082
|
-
if (c < 0 && (d?.container === l || isFocusable(l) && !isTabbable(l) && !d?.nextTabbableNode(l)) && (c = i), c >= 0) {
|
|
2083
|
-
let i = c === this.state.tabbableGroups.length - 1 ? 0 : c + 1, s = this.state.tabbableGroups[i];
|
|
2084
|
-
u = getTabIndex(l) >= 0 ? s.firstTabbableNode : s.firstDomTabbableNode;
|
|
2085
|
-
} else isTabEvent(s) || (u = d?.nextTabbableNode(l));
|
|
2086
|
-
}
|
|
2087
|
-
} else u = this.getNodeForOption("fallbackFocus");
|
|
2088
|
-
return u;
|
|
2089
|
-
};
|
|
2090
2073
|
};
|
|
2091
2074
|
function trapFocus(i, s = {}) {
|
|
2092
|
-
let c, l = raf(() => {
|
|
2075
|
+
let c, l = raf$1(() => {
|
|
2093
2076
|
let l = typeof i == "function" ? i() : i;
|
|
2094
2077
|
if (l) {
|
|
2095
2078
|
c = new FocusTrap(l, {
|
|
@@ -2150,10 +2133,10 @@ function preventBodyScroll(i) {
|
|
|
2150
2133
|
behavior: "instant"
|
|
2151
2134
|
});
|
|
2152
2135
|
};
|
|
2153
|
-
})() :
|
|
2136
|
+
})() : assignStyle(u, {
|
|
2154
2137
|
overflow: "hidden",
|
|
2155
2138
|
[p]: `${d}px`
|
|
2156
|
-
})
|
|
2139
|
+
})];
|
|
2157
2140
|
return () => {
|
|
2158
2141
|
m.forEach((i) => i?.()), u.removeAttribute(LOCK_CLASSNAME);
|
|
2159
2142
|
};
|
|
@@ -2174,9 +2157,9 @@ var refSet = globalRef("__destyler__refSet", () => /* @__PURE__ */ new WeakSet()
|
|
|
2174
2157
|
function isDOMElement(i) {
|
|
2175
2158
|
return typeof i == "object" && !!i && "nodeType" in i && typeof i.nodeName == "string";
|
|
2176
2159
|
}
|
|
2177
|
-
var isElement = (i) => isReactElement(i) || isVueElement(i) || isDOMElement(i), isObject
|
|
2160
|
+
var isElement = (i) => isReactElement(i) || isVueElement(i) || isDOMElement(i), isObject = (i) => typeof i == "object" && !!i;
|
|
2178
2161
|
function canProxy(i) {
|
|
2179
|
-
return isObject
|
|
2162
|
+
return isObject(i) && !refSet.has(i) && (Array.isArray(i) || !(Symbol.iterator in i)) && !isElement(i) && !(i instanceof WeakMap) && !(i instanceof WeakSet) && !(i instanceof Error) && typeof i != "number" && !(i instanceof Date) && typeof i != "string" && !(i instanceof RegExp) && !(i instanceof ArrayBuffer) && !(i instanceof Promise);
|
|
2180
2163
|
}
|
|
2181
2164
|
function set(i, s, c) {
|
|
2182
2165
|
typeof c.value == "object" && !canProxy(c.value) && (c.value = clone(c.value)), !c.enumerable || c.get || c.set || !c.configurable || !c.writable || s === "__proto__" ? Object.defineProperty(i, s, c) : i[s] = c.value;
|
|
@@ -2204,7 +2187,7 @@ function buildProxyFunction(i = Object.is, s = (i, s) => new Proxy(i, s), c = /*
|
|
|
2204
2187
|
refSet.has(c) ? (markToTrack(c, !1), u[s] = c) : proxyStateMap.has(c) ? u[s] = snapshot(c) : u[s] = c;
|
|
2205
2188
|
}), Object.freeze(u);
|
|
2206
2189
|
}, u = /* @__PURE__ */ new WeakMap(), d = [1, 1], f = (c) => {
|
|
2207
|
-
if (!isObject
|
|
2190
|
+
if (!isObject(c)) throw Error("object required");
|
|
2208
2191
|
let f = u.get(c);
|
|
2209
2192
|
if (f) return f;
|
|
2210
2193
|
let p = d[0], m = /* @__PURE__ */ new Set(), h = /* @__PURE__ */ new Map(), g = (i, s = ++d[0]) => {
|
|
@@ -2244,7 +2227,7 @@ function buildProxyFunction(i = Object.is, s = (i, s) => new Proxy(i, s), c = /*
|
|
|
2244
2227
|
set(s, c, l, d) {
|
|
2245
2228
|
let f = Reflect.has(s, c), p = Reflect.get(s, c, d);
|
|
2246
2229
|
if (f && (i(p, l) || u.has(l) && i(p, u.get(l)))) return !0;
|
|
2247
|
-
x(c), isObject
|
|
2230
|
+
x(c), isObject(l) && (l = getUntracked(l) || l);
|
|
2248
2231
|
let m = l;
|
|
2249
2232
|
if (!Object.getOwnPropertyDescriptor(s, c)?.set) {
|
|
2250
2233
|
!proxyStateMap.has(l) && canProxy(l) && (m = proxy(l));
|
|
@@ -2341,7 +2324,7 @@ function toArray(i) {
|
|
|
2341
2324
|
return i ? isArray(i) ? i.slice() : [i] : [];
|
|
2342
2325
|
}
|
|
2343
2326
|
function isGuardHelper(i) {
|
|
2344
|
-
return isObject(i) && i.predicate != null;
|
|
2327
|
+
return isObject$1(i) && i.predicate != null;
|
|
2345
2328
|
}
|
|
2346
2329
|
var Truthy = () => !0;
|
|
2347
2330
|
function determineGuardFn(i, s) {
|
|
@@ -2416,29 +2399,228 @@ function determineTransitionFn(i, s) {
|
|
|
2416
2399
|
return (c, l, u) => toArray(i).map(toTarget).find((i) => determineGuardFn(i.guard, s)(c, l, u) ?? i.target ?? i.actions);
|
|
2417
2400
|
}
|
|
2418
2401
|
var Machine = class {
|
|
2419
|
-
status = MachineStatus.NotStarted;
|
|
2420
|
-
state;
|
|
2421
|
-
initialState;
|
|
2422
|
-
initialContext;
|
|
2423
|
-
id;
|
|
2424
|
-
type = MachineType.Machine;
|
|
2425
|
-
activityEvents = /* @__PURE__ */ new Map();
|
|
2426
|
-
delayedEvents = /* @__PURE__ */ new Map();
|
|
2427
|
-
stateListeners = /* @__PURE__ */ new Set();
|
|
2428
|
-
doneListeners = /* @__PURE__ */ new Set();
|
|
2429
|
-
contextWatchers = /* @__PURE__ */ new Set();
|
|
2430
|
-
removeStateListener = noop;
|
|
2431
|
-
parent;
|
|
2432
|
-
children = /* @__PURE__ */ new Map();
|
|
2433
|
-
guardMap;
|
|
2434
|
-
actionMap;
|
|
2435
|
-
delayMap;
|
|
2436
|
-
activityMap;
|
|
2437
|
-
sync;
|
|
2438
|
-
options;
|
|
2439
|
-
config;
|
|
2440
2402
|
constructor(i, s) {
|
|
2441
|
-
this.
|
|
2403
|
+
this.status = MachineStatus.NotStarted, this.type = MachineType.Machine, this.activityEvents = /* @__PURE__ */ new Map(), this.delayedEvents = /* @__PURE__ */ new Map(), this.stateListeners = /* @__PURE__ */ new Set(), this.doneListeners = /* @__PURE__ */ new Set(), this.contextWatchers = /* @__PURE__ */ new Set(), this.removeStateListener = noop, this.children = /* @__PURE__ */ new Map(), this._created = () => {
|
|
2404
|
+
if (!this.config.created) return;
|
|
2405
|
+
let i = toEvent(ActionTypes.Created);
|
|
2406
|
+
this.executeActions(this.config.created, i);
|
|
2407
|
+
}, this.start = (i) => {
|
|
2408
|
+
if (this.state.value = "", this.state.tags = [], this.status === MachineStatus.Running) return this;
|
|
2409
|
+
this.status = MachineStatus.Running, this.removeStateListener = subscribe(this.state, () => {
|
|
2410
|
+
this.stateListeners.forEach((i) => {
|
|
2411
|
+
i(this.stateSnapshot);
|
|
2412
|
+
});
|
|
2413
|
+
}, this.sync), this.setupContextWatchers(), this.executeActivities(toEvent(ActionTypes.Start), toArray(this.config.activities), ActionTypes.Start), this.executeActions(this.config.entry, toEvent(ActionTypes.Start));
|
|
2414
|
+
let s = toEvent(ActionTypes.Init), c = isObject$1(i) ? i.value : i, l = isObject$1(i) ? i.context : void 0;
|
|
2415
|
+
l && this.setContext(l);
|
|
2416
|
+
let u = { target: c ?? this.config.initial }, d = this.getNextStateInfo(u, s);
|
|
2417
|
+
return this.initialState = d, this.performStateChangeEffects(this.state.value, d, s), this;
|
|
2418
|
+
}, this.setupContextWatchers = () => {
|
|
2419
|
+
let { watch: i } = this.config;
|
|
2420
|
+
if (!i) return;
|
|
2421
|
+
let s = snapshot(this.state.context), c = subscribe(this.state.context, () => {
|
|
2422
|
+
let c = snapshot(this.state.context);
|
|
2423
|
+
for (let [l, u] of Object.entries(i)) (this.options.compareFns?.[l] ?? Object.is)(s[l], c[l]) || this.executeActions(u, this.state.event);
|
|
2424
|
+
s = c;
|
|
2425
|
+
});
|
|
2426
|
+
this.contextWatchers.add(c);
|
|
2427
|
+
}, this.stop = () => {
|
|
2428
|
+
if (this.status !== MachineStatus.Stopped) return this.performExitEffects(this.state.value, toEvent(ActionTypes.Stop)), this.executeActions(this.config.exit, toEvent(ActionTypes.Stop)), this.setState(""), this.setEvent(ActionTypes.Stop), this.stopStateListeners(), this.stopChildren(), this.stopActivities(), this.stopDelayedEvents(), this.stopContextWatchers(), this.status = MachineStatus.Stopped, this;
|
|
2429
|
+
}, this.stopStateListeners = () => {
|
|
2430
|
+
this.removeStateListener(), this.stateListeners.clear();
|
|
2431
|
+
}, this.stopContextWatchers = () => {
|
|
2432
|
+
this.contextWatchers.forEach((i) => i()), this.contextWatchers.clear();
|
|
2433
|
+
}, this.stopDelayedEvents = () => {
|
|
2434
|
+
this.delayedEvents.forEach((i) => {
|
|
2435
|
+
i.forEach((i) => i());
|
|
2436
|
+
}), this.delayedEvents.clear();
|
|
2437
|
+
}, this.stopActivities = (i) => {
|
|
2438
|
+
i ? (this.activityEvents.get(i)?.forEach((i) => i()), this.activityEvents.get(i)?.clear(), this.activityEvents.delete(i)) : (this.activityEvents.forEach((i) => {
|
|
2439
|
+
i.forEach((i) => i()), i.clear();
|
|
2440
|
+
}), this.activityEvents.clear());
|
|
2441
|
+
}, this.sendChild = (i, s) => {
|
|
2442
|
+
let c = toEvent(i), l = runIfFn(s, this.contextSnapshot), u = this.children.get(l);
|
|
2443
|
+
if (!u) throw Error(`[@destyler/xstate] Cannot send '${c.type}' event to unknown child`);
|
|
2444
|
+
u.send(c);
|
|
2445
|
+
}, this.stopChild = (i) => {
|
|
2446
|
+
if (!this.children.has(i)) throw Error(`[@destyler.xstate > stop-child] Cannot stop unknown child ${i}`);
|
|
2447
|
+
this.children.get(i).stop(), this.children.delete(i);
|
|
2448
|
+
}, this.removeChild = (i) => {
|
|
2449
|
+
this.children.delete(i);
|
|
2450
|
+
}, this.stopChildren = () => {
|
|
2451
|
+
this.children.forEach((i) => i.stop()), this.children.clear();
|
|
2452
|
+
}, this.setParent = (i) => {
|
|
2453
|
+
this.parent = i;
|
|
2454
|
+
}, this.spawn = (i, s) => {
|
|
2455
|
+
let c = runIfFn(i);
|
|
2456
|
+
return s && (c.id = s), c.type = MachineType.Actor, c.setParent(this), this.children.set(c.id, cast(c)), c.onDone(() => {
|
|
2457
|
+
this.removeChild(c.id);
|
|
2458
|
+
}).start(), cast(ref$1(c));
|
|
2459
|
+
}, this.stopActivity = (i) => {
|
|
2460
|
+
if (!this.state.value) return;
|
|
2461
|
+
let s = this.activityEvents.get(this.state.value);
|
|
2462
|
+
s?.get(i)?.(), s?.delete(i);
|
|
2463
|
+
}, this.addActivityCleanup = (i, s, c) => {
|
|
2464
|
+
i && (this.activityEvents.has(i) ? this.activityEvents.get(i)?.set(s, c) : this.activityEvents.set(i, new Map([[s, c]])));
|
|
2465
|
+
}, this.setState = (i) => {
|
|
2466
|
+
this.state.previousValue = this.state.value, this.state.value = i;
|
|
2467
|
+
let s = this.getStateNode(i);
|
|
2468
|
+
i == null ? clear(this.state.tags) : this.state.tags = toArray(s?.tags);
|
|
2469
|
+
}, this.setContext = (i) => {
|
|
2470
|
+
i && deepMerge(this.state.context, i);
|
|
2471
|
+
}, this.setOptions = (i) => {
|
|
2472
|
+
let s = compact(i);
|
|
2473
|
+
this.actionMap = {
|
|
2474
|
+
...this.actionMap,
|
|
2475
|
+
...s.actions
|
|
2476
|
+
}, this.delayMap = {
|
|
2477
|
+
...this.delayMap,
|
|
2478
|
+
...s.delays
|
|
2479
|
+
}, this.activityMap = {
|
|
2480
|
+
...this.activityMap,
|
|
2481
|
+
...s.activities
|
|
2482
|
+
}, this.guardMap = {
|
|
2483
|
+
...this.guardMap,
|
|
2484
|
+
...s.guards
|
|
2485
|
+
};
|
|
2486
|
+
}, this.getStateNode = (i) => {
|
|
2487
|
+
if (i) return this.config.states?.[i];
|
|
2488
|
+
}, this.getNextStateInfo = (i, s) => {
|
|
2489
|
+
let c = this.determineTransition(i, s), l = !c?.target, u = c?.target ?? this.state.value, d = this.state.value !== u, f = this.getStateNode(u), p = {
|
|
2490
|
+
reenter: !l && !d && !c?.internal,
|
|
2491
|
+
transition: c,
|
|
2492
|
+
stateNode: f,
|
|
2493
|
+
target: u,
|
|
2494
|
+
changed: d
|
|
2495
|
+
};
|
|
2496
|
+
return this.log("NextState:", `[${s.type}]`, this.state.value, "---->", p.target), p;
|
|
2497
|
+
}, this.getAfterActions = (i, s) => {
|
|
2498
|
+
let c, l = this.state.value;
|
|
2499
|
+
return {
|
|
2500
|
+
entry: () => {
|
|
2501
|
+
c = globalThis.setTimeout(() => {
|
|
2502
|
+
let s = this.getNextStateInfo(i, this.state.event);
|
|
2503
|
+
this.performStateChangeEffects(l, s, this.state.event);
|
|
2504
|
+
}, s);
|
|
2505
|
+
},
|
|
2506
|
+
exit: () => {
|
|
2507
|
+
globalThis.clearTimeout(c);
|
|
2508
|
+
}
|
|
2509
|
+
};
|
|
2510
|
+
}, this.getDelayedEventActions = (i) => {
|
|
2511
|
+
let s = this.getStateNode(i), c = this.state.event;
|
|
2512
|
+
if (!s || !s.after) return;
|
|
2513
|
+
let l = [], u = [];
|
|
2514
|
+
if (isArray(s.after)) {
|
|
2515
|
+
let i = this.determineTransition(s.after, c);
|
|
2516
|
+
if (!i) return;
|
|
2517
|
+
if (!hasProp(i, "delay")) throw Error(`[@destyler/xstate > after] Delay is required for after transition: ${JSON.stringify(i)}`);
|
|
2518
|
+
let d = determineDelayFn(i.delay, this.delayMap)(this.contextSnapshot, c), f = this.getAfterActions(i, d);
|
|
2519
|
+
return l.push(f.entry), u.push(f.exit), {
|
|
2520
|
+
entries: l,
|
|
2521
|
+
exits: u
|
|
2522
|
+
};
|
|
2523
|
+
}
|
|
2524
|
+
if (isObject$1(s.after)) for (let i in s.after) {
|
|
2525
|
+
let d = s.after[i], f = determineDelayFn(i, this.delayMap)(this.contextSnapshot, c), p = this.getAfterActions(d, f);
|
|
2526
|
+
l.push(p.entry), u.push(p.exit);
|
|
2527
|
+
}
|
|
2528
|
+
return {
|
|
2529
|
+
entries: l,
|
|
2530
|
+
exits: u
|
|
2531
|
+
};
|
|
2532
|
+
}, this.executeActions = (i, s) => {
|
|
2533
|
+
let c = determineActionsFn(i, this.guardMap)(this.contextSnapshot, s, this.guardMeta);
|
|
2534
|
+
for (let i of toArray(c)) {
|
|
2535
|
+
let c = isString(i) ? this.actionMap?.[i] : i;
|
|
2536
|
+
isString(i) && !c && console.warn(`[@destyler/xstate > execute-actions] No implementation found for action: \`${i}\``), c?.(this.state.context, s, this.meta);
|
|
2537
|
+
}
|
|
2538
|
+
}, this.executeActivities = (i, s, c) => {
|
|
2539
|
+
for (let l of s) {
|
|
2540
|
+
let s = isString(l) ? this.activityMap?.[l] : l;
|
|
2541
|
+
if (!s) {
|
|
2542
|
+
console.warn(`[@destyler/xstate > execute-activity] No implementation found for activity: \`${l}\``);
|
|
2543
|
+
continue;
|
|
2544
|
+
}
|
|
2545
|
+
let u = s(this.state.context, i, this.meta);
|
|
2546
|
+
if (u) {
|
|
2547
|
+
let i = isString(l) ? l : l.name || uuid();
|
|
2548
|
+
this.addActivityCleanup(c ?? this.state.value, i, u);
|
|
2549
|
+
}
|
|
2550
|
+
}
|
|
2551
|
+
}, this.createEveryActivities = (i, s) => {
|
|
2552
|
+
if (i) if (isArray(i)) {
|
|
2553
|
+
let c = toArray(i).find((i) => {
|
|
2554
|
+
let s = i.delay, c = determineDelayFn(s, this.delayMap)(this.contextSnapshot, this.state.event);
|
|
2555
|
+
return determineGuardFn(i.guard, this.guardMap)(this.contextSnapshot, this.state.event, this.guardMeta) ?? c != null;
|
|
2556
|
+
});
|
|
2557
|
+
if (!c) return;
|
|
2558
|
+
let l = determineDelayFn(c.delay, this.delayMap)(this.contextSnapshot, this.state.event);
|
|
2559
|
+
s(() => {
|
|
2560
|
+
let i = globalThis.setInterval(() => {
|
|
2561
|
+
this.executeActions(c.actions, this.state.event);
|
|
2562
|
+
}, l);
|
|
2563
|
+
return () => {
|
|
2564
|
+
globalThis.clearInterval(i);
|
|
2565
|
+
};
|
|
2566
|
+
});
|
|
2567
|
+
} else for (let c in i) {
|
|
2568
|
+
let l = i?.[c], u = determineDelayFn(c, this.delayMap)(this.contextSnapshot, this.state.event);
|
|
2569
|
+
s(() => {
|
|
2570
|
+
let i = globalThis.setInterval(() => {
|
|
2571
|
+
this.executeActions(l, this.state.event);
|
|
2572
|
+
}, u);
|
|
2573
|
+
return () => {
|
|
2574
|
+
globalThis.clearInterval(i);
|
|
2575
|
+
};
|
|
2576
|
+
});
|
|
2577
|
+
}
|
|
2578
|
+
}, this.setEvent = (i) => {
|
|
2579
|
+
this.state.previousEvent = this.state.event, this.state.event = ref$1(toEvent(i));
|
|
2580
|
+
}, this.performExitEffects = (i, s) => {
|
|
2581
|
+
let c = this.state.value;
|
|
2582
|
+
if (c === "") return;
|
|
2583
|
+
let l = i ? this.getStateNode(i) : void 0;
|
|
2584
|
+
this.stopActivities(c);
|
|
2585
|
+
let u = toArray(determineActionsFn(l?.exit, this.guardMap)(this.contextSnapshot, s, this.guardMeta)), d = this.delayedEvents.get(c);
|
|
2586
|
+
d && u.push(...d), this.executeActions(u, s), this.delayedEvents.delete(c);
|
|
2587
|
+
}, this.performEntryEffects = (i, s) => {
|
|
2588
|
+
let c = this.getStateNode(i), l = toArray(c?.activities);
|
|
2589
|
+
this.createEveryActivities(c?.every, (i) => {
|
|
2590
|
+
l.unshift(i);
|
|
2591
|
+
}), l.length > 0 && this.executeActivities(s, l);
|
|
2592
|
+
let u = toArray(determineActionsFn(c?.entry, this.guardMap)(this.contextSnapshot, s, this.guardMeta)), d = this.getDelayedEventActions(i);
|
|
2593
|
+
c?.after && d && (this.delayedEvents.set(i, d?.exits), u.push(...d.entries)), this.executeActions(u, s), c?.type === "final" && (this.state.done = !0, this.doneListeners.forEach((i) => {
|
|
2594
|
+
i(this.stateSnapshot);
|
|
2595
|
+
}), this.stop());
|
|
2596
|
+
}, this.performTransitionEffects = (i, s) => {
|
|
2597
|
+
let c = this.determineTransition(i, s);
|
|
2598
|
+
this.executeActions(c?.actions, s);
|
|
2599
|
+
}, this.performStateChangeEffects = (i, s, c) => {
|
|
2600
|
+
this.setEvent(c);
|
|
2601
|
+
let l = s.changed || s.reenter;
|
|
2602
|
+
l && this.performExitEffects(i, c), this.performTransitionEffects(s.transition, c), this.setState(s.target), l && this.performEntryEffects(s.target, c);
|
|
2603
|
+
}, this.determineTransition = (i, s) => determineTransitionFn(i, this.guardMap)?.(this.contextSnapshot, s, this.guardMeta), this.sendParent = (i) => {
|
|
2604
|
+
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.");
|
|
2605
|
+
let s = toEvent(i);
|
|
2606
|
+
this.parent?.send(s);
|
|
2607
|
+
}, this.log = (...i) => {
|
|
2608
|
+
this.options.debug && console.log(...i);
|
|
2609
|
+
}, this.send = (i) => {
|
|
2610
|
+
let s = toEvent(i);
|
|
2611
|
+
this.transition(this.state.value, s);
|
|
2612
|
+
}, this.transition = (i, s) => {
|
|
2613
|
+
let c = isString(i) ? this.getStateNode(i) : i?.stateNode, l = toEvent(s);
|
|
2614
|
+
if (!c && !this.config.on) {
|
|
2615
|
+
let s = this.status === MachineStatus.Stopped ? "[@destyler/xstate > transition] Cannot transition a stopped machine" : `[destyler/xstate > transition] State does not have a definition for \`state\`: ${i}, \`event\`: ${l.type}`;
|
|
2616
|
+
console.warn(s);
|
|
2617
|
+
return;
|
|
2618
|
+
}
|
|
2619
|
+
let u = c?.on?.[l.type] ?? this.config.on?.[l.type], d = this.getNextStateInfo(u, l);
|
|
2620
|
+
return this.performStateChangeEffects(this.state.value, d, l), d.stateNode;
|
|
2621
|
+
}, this.subscribe = (i) => (this.stateListeners.add(i), this.status === MachineStatus.Running && i(this.stateSnapshot), () => {
|
|
2622
|
+
this.stateListeners.delete(i);
|
|
2623
|
+
}), this.onDone = (i) => (this.doneListeners.add(i), this), this.onTransition = (i) => (this.stateListeners.add(i), this.status === MachineStatus.Running && i(this.stateSnapshot), this), this.config = clone(i), this.options = clone(s ?? {}), this.id = this.config.id ?? `machine-${uuid()}`, 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 = createProxy(this.config), this.initialContext = snapshot(this.state.context);
|
|
2442
2624
|
}
|
|
2443
2625
|
get stateSnapshot() {
|
|
2444
2626
|
return cast(snapshot(this.state));
|
|
@@ -2449,158 +2631,6 @@ var Machine = class {
|
|
|
2449
2631
|
get contextSnapshot() {
|
|
2450
2632
|
return this.stateSnapshot.context;
|
|
2451
2633
|
}
|
|
2452
|
-
_created = () => {
|
|
2453
|
-
if (!this.config.created) return;
|
|
2454
|
-
let i = toEvent(ActionTypes.Created);
|
|
2455
|
-
this.executeActions(this.config.created, i);
|
|
2456
|
-
};
|
|
2457
|
-
start = (i) => {
|
|
2458
|
-
if (this.state.value = "", this.state.tags = [], this.status === MachineStatus.Running) return this;
|
|
2459
|
-
this.status = MachineStatus.Running, this.removeStateListener = subscribe(this.state, () => {
|
|
2460
|
-
this.stateListeners.forEach((i) => {
|
|
2461
|
-
i(this.stateSnapshot);
|
|
2462
|
-
});
|
|
2463
|
-
}, this.sync), this.setupContextWatchers(), this.executeActivities(toEvent(ActionTypes.Start), toArray(this.config.activities), ActionTypes.Start), this.executeActions(this.config.entry, toEvent(ActionTypes.Start));
|
|
2464
|
-
let s = toEvent(ActionTypes.Init), c = isObject(i) ? i.value : i, l = isObject(i) ? i.context : void 0;
|
|
2465
|
-
l && this.setContext(l);
|
|
2466
|
-
let u = { target: c ?? this.config.initial }, d = this.getNextStateInfo(u, s);
|
|
2467
|
-
return this.initialState = d, this.performStateChangeEffects(this.state.value, d, s), this;
|
|
2468
|
-
};
|
|
2469
|
-
setupContextWatchers = () => {
|
|
2470
|
-
let { watch: i } = this.config;
|
|
2471
|
-
if (!i) return;
|
|
2472
|
-
let s = snapshot(this.state.context), c = subscribe(this.state.context, () => {
|
|
2473
|
-
let c = snapshot(this.state.context);
|
|
2474
|
-
for (let [l, u] of Object.entries(i)) (this.options.compareFns?.[l] ?? Object.is)(s[l], c[l]) || this.executeActions(u, this.state.event);
|
|
2475
|
-
s = c;
|
|
2476
|
-
});
|
|
2477
|
-
this.contextWatchers.add(c);
|
|
2478
|
-
};
|
|
2479
|
-
stop = () => {
|
|
2480
|
-
if (this.status !== MachineStatus.Stopped) return this.performExitEffects(this.state.value, toEvent(ActionTypes.Stop)), this.executeActions(this.config.exit, toEvent(ActionTypes.Stop)), this.setState(""), this.setEvent(ActionTypes.Stop), this.stopStateListeners(), this.stopChildren(), this.stopActivities(), this.stopDelayedEvents(), this.stopContextWatchers(), this.status = MachineStatus.Stopped, this;
|
|
2481
|
-
};
|
|
2482
|
-
stopStateListeners = () => {
|
|
2483
|
-
this.removeStateListener(), this.stateListeners.clear();
|
|
2484
|
-
};
|
|
2485
|
-
stopContextWatchers = () => {
|
|
2486
|
-
this.contextWatchers.forEach((i) => i()), this.contextWatchers.clear();
|
|
2487
|
-
};
|
|
2488
|
-
stopDelayedEvents = () => {
|
|
2489
|
-
this.delayedEvents.forEach((i) => {
|
|
2490
|
-
i.forEach((i) => i());
|
|
2491
|
-
}), this.delayedEvents.clear();
|
|
2492
|
-
};
|
|
2493
|
-
stopActivities = (i) => {
|
|
2494
|
-
i ? (this.activityEvents.get(i)?.forEach((i) => i()), this.activityEvents.get(i)?.clear(), this.activityEvents.delete(i)) : (this.activityEvents.forEach((i) => {
|
|
2495
|
-
i.forEach((i) => i()), i.clear();
|
|
2496
|
-
}), this.activityEvents.clear());
|
|
2497
|
-
};
|
|
2498
|
-
sendChild = (i, s) => {
|
|
2499
|
-
let c = toEvent(i), l = runIfFn(s, this.contextSnapshot), u = this.children.get(l);
|
|
2500
|
-
if (!u) throw Error(`[@destyler/xstate] Cannot send '${c.type}' event to unknown child`);
|
|
2501
|
-
u.send(c);
|
|
2502
|
-
};
|
|
2503
|
-
stopChild = (i) => {
|
|
2504
|
-
if (!this.children.has(i)) throw Error(`[@destyler.xstate > stop-child] Cannot stop unknown child ${i}`);
|
|
2505
|
-
this.children.get(i).stop(), this.children.delete(i);
|
|
2506
|
-
};
|
|
2507
|
-
removeChild = (i) => {
|
|
2508
|
-
this.children.delete(i);
|
|
2509
|
-
};
|
|
2510
|
-
stopChildren = () => {
|
|
2511
|
-
this.children.forEach((i) => i.stop()), this.children.clear();
|
|
2512
|
-
};
|
|
2513
|
-
setParent = (i) => {
|
|
2514
|
-
this.parent = i;
|
|
2515
|
-
};
|
|
2516
|
-
spawn = (i, s) => {
|
|
2517
|
-
let c = runIfFn(i);
|
|
2518
|
-
return s && (c.id = s), c.type = MachineType.Actor, c.setParent(this), this.children.set(c.id, cast(c)), c.onDone(() => {
|
|
2519
|
-
this.removeChild(c.id);
|
|
2520
|
-
}).start(), cast(ref$1(c));
|
|
2521
|
-
};
|
|
2522
|
-
stopActivity = (i) => {
|
|
2523
|
-
if (!this.state.value) return;
|
|
2524
|
-
let s = this.activityEvents.get(this.state.value);
|
|
2525
|
-
s?.get(i)?.(), s?.delete(i);
|
|
2526
|
-
};
|
|
2527
|
-
addActivityCleanup = (i, s, c) => {
|
|
2528
|
-
i && (this.activityEvents.has(i) ? this.activityEvents.get(i)?.set(s, c) : this.activityEvents.set(i, new Map([[s, c]])));
|
|
2529
|
-
};
|
|
2530
|
-
setState = (i) => {
|
|
2531
|
-
this.state.previousValue = this.state.value, this.state.value = i;
|
|
2532
|
-
let s = this.getStateNode(i);
|
|
2533
|
-
i == null ? clear(this.state.tags) : this.state.tags = toArray(s?.tags);
|
|
2534
|
-
};
|
|
2535
|
-
setContext = (i) => {
|
|
2536
|
-
i && deepMerge(this.state.context, i);
|
|
2537
|
-
};
|
|
2538
|
-
setOptions = (i) => {
|
|
2539
|
-
let s = compact(i);
|
|
2540
|
-
this.actionMap = {
|
|
2541
|
-
...this.actionMap,
|
|
2542
|
-
...s.actions
|
|
2543
|
-
}, this.delayMap = {
|
|
2544
|
-
...this.delayMap,
|
|
2545
|
-
...s.delays
|
|
2546
|
-
}, this.activityMap = {
|
|
2547
|
-
...this.activityMap,
|
|
2548
|
-
...s.activities
|
|
2549
|
-
}, this.guardMap = {
|
|
2550
|
-
...this.guardMap,
|
|
2551
|
-
...s.guards
|
|
2552
|
-
};
|
|
2553
|
-
};
|
|
2554
|
-
getStateNode = (i) => {
|
|
2555
|
-
if (i) return this.config.states?.[i];
|
|
2556
|
-
};
|
|
2557
|
-
getNextStateInfo = (i, s) => {
|
|
2558
|
-
let c = this.determineTransition(i, s), l = !c?.target, u = c?.target ?? this.state.value, d = this.state.value !== u, f = this.getStateNode(u), p = {
|
|
2559
|
-
reenter: !l && !d && !c?.internal,
|
|
2560
|
-
transition: c,
|
|
2561
|
-
stateNode: f,
|
|
2562
|
-
target: u,
|
|
2563
|
-
changed: d
|
|
2564
|
-
};
|
|
2565
|
-
return this.log("NextState:", `[${s.type}]`, this.state.value, "---->", p.target), p;
|
|
2566
|
-
};
|
|
2567
|
-
getAfterActions = (i, s) => {
|
|
2568
|
-
let c, l = this.state.value;
|
|
2569
|
-
return {
|
|
2570
|
-
entry: () => {
|
|
2571
|
-
c = globalThis.setTimeout(() => {
|
|
2572
|
-
let s = this.getNextStateInfo(i, this.state.event);
|
|
2573
|
-
this.performStateChangeEffects(l, s, this.state.event);
|
|
2574
|
-
}, s);
|
|
2575
|
-
},
|
|
2576
|
-
exit: () => {
|
|
2577
|
-
globalThis.clearTimeout(c);
|
|
2578
|
-
}
|
|
2579
|
-
};
|
|
2580
|
-
};
|
|
2581
|
-
getDelayedEventActions = (i) => {
|
|
2582
|
-
let s = this.getStateNode(i), c = this.state.event;
|
|
2583
|
-
if (!s || !s.after) return;
|
|
2584
|
-
let l = [], u = [];
|
|
2585
|
-
if (isArray(s.after)) {
|
|
2586
|
-
let i = this.determineTransition(s.after, c);
|
|
2587
|
-
if (!i) return;
|
|
2588
|
-
if (!hasProp(i, "delay")) throw Error(`[@destyler/xstate > after] Delay is required for after transition: ${JSON.stringify(i)}`);
|
|
2589
|
-
let d = determineDelayFn(i.delay, this.delayMap)(this.contextSnapshot, c), f = this.getAfterActions(i, d);
|
|
2590
|
-
return l.push(f.entry), u.push(f.exit), {
|
|
2591
|
-
entries: l,
|
|
2592
|
-
exits: u
|
|
2593
|
-
};
|
|
2594
|
-
}
|
|
2595
|
-
if (isObject(s.after)) for (let i in s.after) {
|
|
2596
|
-
let d = s.after[i], f = determineDelayFn(i, this.delayMap)(this.contextSnapshot, c), p = this.getAfterActions(d, f);
|
|
2597
|
-
l.push(p.entry), u.push(p.exit);
|
|
2598
|
-
}
|
|
2599
|
-
return {
|
|
2600
|
-
entries: l,
|
|
2601
|
-
exits: u
|
|
2602
|
-
};
|
|
2603
|
-
};
|
|
2604
2634
|
get self() {
|
|
2605
2635
|
let i = this;
|
|
2606
2636
|
return {
|
|
@@ -2639,113 +2669,6 @@ var Machine = class {
|
|
|
2639
2669
|
get guardMeta() {
|
|
2640
2670
|
return { state: this.stateSnapshot };
|
|
2641
2671
|
}
|
|
2642
|
-
executeActions = (i, s) => {
|
|
2643
|
-
let c = determineActionsFn(i, this.guardMap)(this.contextSnapshot, s, this.guardMeta);
|
|
2644
|
-
for (let i of toArray(c)) {
|
|
2645
|
-
let c = isString(i) ? this.actionMap?.[i] : i;
|
|
2646
|
-
isString(i) && !c && console.warn(`[@destyler/xstate > execute-actions] No implementation found for action: \`${i}\``), c?.(this.state.context, s, this.meta);
|
|
2647
|
-
}
|
|
2648
|
-
};
|
|
2649
|
-
executeActivities = (i, s, c) => {
|
|
2650
|
-
for (let l of s) {
|
|
2651
|
-
let s = isString(l) ? this.activityMap?.[l] : l;
|
|
2652
|
-
if (!s) {
|
|
2653
|
-
console.warn(`[@destyler/xstate > execute-activity] No implementation found for activity: \`${l}\``);
|
|
2654
|
-
continue;
|
|
2655
|
-
}
|
|
2656
|
-
let u = s(this.state.context, i, this.meta);
|
|
2657
|
-
if (u) {
|
|
2658
|
-
let i = isString(l) ? l : l.name || uuid();
|
|
2659
|
-
this.addActivityCleanup(c ?? this.state.value, i, u);
|
|
2660
|
-
}
|
|
2661
|
-
}
|
|
2662
|
-
};
|
|
2663
|
-
createEveryActivities = (i, s) => {
|
|
2664
|
-
if (i) if (isArray(i)) {
|
|
2665
|
-
let c = toArray(i).find((i) => {
|
|
2666
|
-
let s = i.delay, c = determineDelayFn(s, this.delayMap)(this.contextSnapshot, this.state.event);
|
|
2667
|
-
return determineGuardFn(i.guard, this.guardMap)(this.contextSnapshot, this.state.event, this.guardMeta) ?? c != null;
|
|
2668
|
-
});
|
|
2669
|
-
if (!c) return;
|
|
2670
|
-
let l = determineDelayFn(c.delay, this.delayMap)(this.contextSnapshot, this.state.event);
|
|
2671
|
-
s(() => {
|
|
2672
|
-
let i = globalThis.setInterval(() => {
|
|
2673
|
-
this.executeActions(c.actions, this.state.event);
|
|
2674
|
-
}, l);
|
|
2675
|
-
return () => {
|
|
2676
|
-
globalThis.clearInterval(i);
|
|
2677
|
-
};
|
|
2678
|
-
});
|
|
2679
|
-
} else for (let c in i) {
|
|
2680
|
-
let l = i?.[c], u = determineDelayFn(c, this.delayMap)(this.contextSnapshot, this.state.event);
|
|
2681
|
-
s(() => {
|
|
2682
|
-
let i = globalThis.setInterval(() => {
|
|
2683
|
-
this.executeActions(l, this.state.event);
|
|
2684
|
-
}, u);
|
|
2685
|
-
return () => {
|
|
2686
|
-
globalThis.clearInterval(i);
|
|
2687
|
-
};
|
|
2688
|
-
});
|
|
2689
|
-
}
|
|
2690
|
-
};
|
|
2691
|
-
setEvent = (i) => {
|
|
2692
|
-
this.state.previousEvent = this.state.event, this.state.event = ref$1(toEvent(i));
|
|
2693
|
-
};
|
|
2694
|
-
performExitEffects = (i, s) => {
|
|
2695
|
-
let c = this.state.value;
|
|
2696
|
-
if (c === "") return;
|
|
2697
|
-
let l = i ? this.getStateNode(i) : void 0;
|
|
2698
|
-
this.stopActivities(c);
|
|
2699
|
-
let u = toArray(determineActionsFn(l?.exit, this.guardMap)(this.contextSnapshot, s, this.guardMeta)), d = this.delayedEvents.get(c);
|
|
2700
|
-
d && u.push(...d), this.executeActions(u, s), this.delayedEvents.delete(c);
|
|
2701
|
-
};
|
|
2702
|
-
performEntryEffects = (i, s) => {
|
|
2703
|
-
let c = this.getStateNode(i), l = toArray(c?.activities);
|
|
2704
|
-
this.createEveryActivities(c?.every, (i) => {
|
|
2705
|
-
l.unshift(i);
|
|
2706
|
-
}), l.length > 0 && this.executeActivities(s, l);
|
|
2707
|
-
let u = toArray(determineActionsFn(c?.entry, this.guardMap)(this.contextSnapshot, s, this.guardMeta)), d = this.getDelayedEventActions(i);
|
|
2708
|
-
c?.after && d && (this.delayedEvents.set(i, d?.exits), u.push(...d.entries)), this.executeActions(u, s), c?.type === "final" && (this.state.done = !0, this.doneListeners.forEach((i) => {
|
|
2709
|
-
i(this.stateSnapshot);
|
|
2710
|
-
}), this.stop());
|
|
2711
|
-
};
|
|
2712
|
-
performTransitionEffects = (i, s) => {
|
|
2713
|
-
let c = this.determineTransition(i, s);
|
|
2714
|
-
this.executeActions(c?.actions, s);
|
|
2715
|
-
};
|
|
2716
|
-
performStateChangeEffects = (i, s, c) => {
|
|
2717
|
-
this.setEvent(c);
|
|
2718
|
-
let l = s.changed || s.reenter;
|
|
2719
|
-
l && this.performExitEffects(i, c), this.performTransitionEffects(s.transition, c), this.setState(s.target), l && this.performEntryEffects(s.target, c);
|
|
2720
|
-
};
|
|
2721
|
-
determineTransition = (i, s) => determineTransitionFn(i, this.guardMap)?.(this.contextSnapshot, s, this.guardMeta);
|
|
2722
|
-
sendParent = (i) => {
|
|
2723
|
-
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.");
|
|
2724
|
-
let s = toEvent(i);
|
|
2725
|
-
this.parent?.send(s);
|
|
2726
|
-
};
|
|
2727
|
-
log = (...i) => {
|
|
2728
|
-
this.options.debug && console.log(...i);
|
|
2729
|
-
};
|
|
2730
|
-
send = (i) => {
|
|
2731
|
-
let s = toEvent(i);
|
|
2732
|
-
this.transition(this.state.value, s);
|
|
2733
|
-
};
|
|
2734
|
-
transition = (i, s) => {
|
|
2735
|
-
let c = isString(i) ? this.getStateNode(i) : i?.stateNode, l = toEvent(s);
|
|
2736
|
-
if (!c && !this.config.on) {
|
|
2737
|
-
let s = this.status === MachineStatus.Stopped ? "[@destyler/xstate > transition] Cannot transition a stopped machine" : `[destyler/xstate > transition] State does not have a definition for \`state\`: ${i}, \`event\`: ${l.type}`;
|
|
2738
|
-
console.warn(s);
|
|
2739
|
-
return;
|
|
2740
|
-
}
|
|
2741
|
-
let u = c?.on?.[l.type] ?? this.config.on?.[l.type], d = this.getNextStateInfo(u, l);
|
|
2742
|
-
return this.performStateChangeEffects(this.state.value, d, l), d.stateNode;
|
|
2743
|
-
};
|
|
2744
|
-
subscribe = (i) => (this.stateListeners.add(i), this.status === MachineStatus.Running && i(this.stateSnapshot), () => {
|
|
2745
|
-
this.stateListeners.delete(i);
|
|
2746
|
-
});
|
|
2747
|
-
onDone = (i) => (this.doneListeners.add(i), this);
|
|
2748
|
-
onTransition = (i) => (this.stateListeners.add(i), this.status === MachineStatus.Running && i(this.stateSnapshot), this);
|
|
2749
2672
|
get [Symbol.toStringTag]() {
|
|
2750
2673
|
return "Machine";
|
|
2751
2674
|
}
|
|
@@ -3058,7 +2981,7 @@ function machine(i) {
|
|
|
3058
2981
|
});
|
|
3059
2982
|
},
|
|
3060
2983
|
checkRenderedElements(i) {
|
|
3061
|
-
raf(() => {
|
|
2984
|
+
raf$1(() => {
|
|
3062
2985
|
Object.assign(i.renderedElements, {
|
|
3063
2986
|
title: !!dom.getTitleEl(i),
|
|
3064
2987
|
description: !!dom.getDescriptionEl(i)
|
|
@@ -3066,7 +2989,7 @@ function machine(i) {
|
|
|
3066
2989
|
});
|
|
3067
2990
|
},
|
|
3068
2991
|
setInitialFocus(i) {
|
|
3069
|
-
i.modal || raf(() => {
|
|
2992
|
+
i.modal || raf$1(() => {
|
|
3070
2993
|
getInitialFocus({
|
|
3071
2994
|
root: dom.getContentEl(i),
|
|
3072
2995
|
getInitialEl: i.initialFocusEl,
|
|
@@ -3076,7 +2999,7 @@ function machine(i) {
|
|
|
3076
2999
|
},
|
|
3077
3000
|
setFinalFocus(i, s) {
|
|
3078
3001
|
let c = s.restoreFocus ?? s.previousEvent?.restoreFocus;
|
|
3079
|
-
c != null && !c || raf(() => {
|
|
3002
|
+
c != null && !c || raf$1(() => {
|
|
3080
3003
|
dom.getTriggerEl(i)?.focus({ preventScroll: !0 });
|
|
3081
3004
|
});
|
|
3082
3005
|
},
|
|
@@ -3164,7 +3087,7 @@ var normalizeProps$1 = createNormalizer((i) => {
|
|
|
3164
3087
|
let s = {};
|
|
3165
3088
|
for (let c in i) {
|
|
3166
3089
|
let l = i[c];
|
|
3167
|
-
c === "children" ? typeof l == "string" && (s.
|
|
3090
|
+
c === "children" ? (typeof l == "string" || typeof l == "number") && (s.textContent = String(l)) : s[toVueProp(c)] = i[c];
|
|
3168
3091
|
}
|
|
3169
3092
|
return s;
|
|
3170
3093
|
}), _hoisted_1$7 = {
|
|
@@ -3188,7 +3111,7 @@ var normalizeProps$1 = createNormalizer((i) => {
|
|
|
3188
3111
|
} },
|
|
3189
3112
|
setup(i) {
|
|
3190
3113
|
let s = i;
|
|
3191
|
-
return (i, c) => s.expanded ? (openBlock(), createElementBlock("svg", _hoisted_1$7, c[0] ||= [createElementVNode("g", {
|
|
3114
|
+
return (i, c) => s.expanded ? (openBlock(), createElementBlock("svg", _hoisted_1$7, [...c[0] ||= [createElementVNode("g", {
|
|
3192
3115
|
fill: "none",
|
|
3193
3116
|
"stroke-linecap": "round",
|
|
3194
3117
|
"stroke-linejoin": "round"
|
|
@@ -3198,7 +3121,7 @@ var normalizeProps$1 = createNormalizer((i) => {
|
|
|
3198
3121
|
}), createElementVNode("path", {
|
|
3199
3122
|
stroke: "#67B686",
|
|
3200
3123
|
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"
|
|
3201
|
-
})], -1)])) : (openBlock(), createElementBlock("svg", _hoisted_2$6, c[1] ||= [createElementVNode("g", {
|
|
3124
|
+
})], -1)]])) : (openBlock(), createElementBlock("svg", _hoisted_2$6, [...c[1] ||= [createElementVNode("g", {
|
|
3202
3125
|
fill: "none",
|
|
3203
3126
|
"stroke-linecap": "round",
|
|
3204
3127
|
"stroke-linejoin": "round"
|
|
@@ -3208,7 +3131,7 @@ var normalizeProps$1 = createNormalizer((i) => {
|
|
|
3208
3131
|
}), createElementVNode("path", {
|
|
3209
3132
|
stroke: "#67B686",
|
|
3210
3133
|
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"
|
|
3211
|
-
})], -1)]));
|
|
3134
|
+
})], -1)]]));
|
|
3212
3135
|
}
|
|
3213
3136
|
}), _hoisted_1$6 = {
|
|
3214
3137
|
key: 0,
|
|
@@ -3231,19 +3154,19 @@ var normalizeProps$1 = createNormalizer((i) => {
|
|
|
3231
3154
|
} },
|
|
3232
3155
|
setup(i) {
|
|
3233
3156
|
let s = i;
|
|
3234
|
-
return (i, c) => s.expanded ? (openBlock(), createElementBlock("svg", _hoisted_1$6, c[0] ||= [createElementVNode("path", {
|
|
3157
|
+
return (i, c) => s.expanded ? (openBlock(), createElementBlock("svg", _hoisted_1$6, [...c[0] ||= [createElementVNode("path", {
|
|
3235
3158
|
fill: "none",
|
|
3236
3159
|
class: "stroke-dark dark:stroke-light",
|
|
3237
3160
|
"stroke-linecap": "round",
|
|
3238
3161
|
"stroke-linejoin": "round",
|
|
3239
3162
|
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"
|
|
3240
|
-
}, null, -1)])) : (openBlock(), createElementBlock("svg", _hoisted_2$5, c[1] ||= [createElementVNode("path", {
|
|
3163
|
+
}, null, -1)]])) : (openBlock(), createElementBlock("svg", _hoisted_2$5, [...c[1] ||= [createElementVNode("path", {
|
|
3241
3164
|
fill: "none",
|
|
3242
3165
|
class: "stroke-dark dark:stroke-light",
|
|
3243
3166
|
"stroke-linecap": "round",
|
|
3244
3167
|
"stroke-linejoin": "round",
|
|
3245
3168
|
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"
|
|
3246
|
-
}, null, -1)]));
|
|
3169
|
+
}, null, -1)]]));
|
|
3247
3170
|
}
|
|
3248
3171
|
}), _hoisted_1$5 = {
|
|
3249
3172
|
key: 0,
|
|
@@ -3266,7 +3189,7 @@ var normalizeProps$1 = createNormalizer((i) => {
|
|
|
3266
3189
|
} },
|
|
3267
3190
|
setup(i) {
|
|
3268
3191
|
let s = i;
|
|
3269
|
-
return (i, c) => s.expanded ? (openBlock(), createElementBlock("svg", _hoisted_1$5, c[0] ||= [createElementVNode("g", {
|
|
3192
|
+
return (i, c) => s.expanded ? (openBlock(), createElementBlock("svg", _hoisted_1$5, [...c[0] ||= [createElementVNode("g", {
|
|
3270
3193
|
fill: "none",
|
|
3271
3194
|
"stroke-linecap": "round",
|
|
3272
3195
|
"stroke-linejoin": "round"
|
|
@@ -3276,7 +3199,7 @@ var normalizeProps$1 = createNormalizer((i) => {
|
|
|
3276
3199
|
}), createElementVNode("path", {
|
|
3277
3200
|
stroke: "#65bb87",
|
|
3278
3201
|
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"
|
|
3279
|
-
})], -1)])) : (openBlock(), createElementBlock("svg", _hoisted_2$4, c[1] ||= [createElementVNode("g", {
|
|
3202
|
+
})], -1)]])) : (openBlock(), createElementBlock("svg", _hoisted_2$4, [...c[1] ||= [createElementVNode("g", {
|
|
3280
3203
|
fill: "none",
|
|
3281
3204
|
"stroke-linecap": "round",
|
|
3282
3205
|
"stroke-linejoin": "round"
|
|
@@ -3286,7 +3209,7 @@ var normalizeProps$1 = createNormalizer((i) => {
|
|
|
3286
3209
|
}), createElementVNode("path", {
|
|
3287
3210
|
stroke: "#65bb87",
|
|
3288
3211
|
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"
|
|
3289
|
-
})], -1)]));
|
|
3212
|
+
})], -1)]]));
|
|
3290
3213
|
}
|
|
3291
3214
|
}), _hoisted_1$4 = {
|
|
3292
3215
|
key: 0,
|
|
@@ -3309,7 +3232,7 @@ var normalizeProps$1 = createNormalizer((i) => {
|
|
|
3309
3232
|
} },
|
|
3310
3233
|
setup(i) {
|
|
3311
3234
|
let s = i;
|
|
3312
|
-
return (i, c) => s.expanded ? (openBlock(), createElementBlock("svg", _hoisted_1$4, c[0] ||= [createElementVNode("g", {
|
|
3235
|
+
return (i, c) => s.expanded ? (openBlock(), createElementBlock("svg", _hoisted_1$4, [...c[0] ||= [createElementVNode("g", {
|
|
3313
3236
|
fill: "none",
|
|
3314
3237
|
"stroke-linecap": "round",
|
|
3315
3238
|
"stroke-linejoin": "round"
|
|
@@ -3319,7 +3242,7 @@ var normalizeProps$1 = createNormalizer((i) => {
|
|
|
3319
3242
|
}), createElementVNode("path", {
|
|
3320
3243
|
stroke: "#E23730",
|
|
3321
3244
|
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"
|
|
3322
|
-
})], -1)])) : (openBlock(), createElementBlock("svg", _hoisted_2$3, c[1] ||= [createElementVNode("g", {
|
|
3245
|
+
})], -1)]])) : (openBlock(), createElementBlock("svg", _hoisted_2$3, [...c[1] ||= [createElementVNode("g", {
|
|
3323
3246
|
fill: "none",
|
|
3324
3247
|
"stroke-linecap": "round",
|
|
3325
3248
|
"stroke-linejoin": "round"
|
|
@@ -3329,7 +3252,7 @@ var normalizeProps$1 = createNormalizer((i) => {
|
|
|
3329
3252
|
}), createElementVNode("path", {
|
|
3330
3253
|
stroke: "#E23730",
|
|
3331
3254
|
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"
|
|
3332
|
-
})], -1)]));
|
|
3255
|
+
})], -1)]]));
|
|
3333
3256
|
}
|
|
3334
3257
|
}), _hoisted_1$3 = {
|
|
3335
3258
|
key: 0,
|
|
@@ -3352,7 +3275,7 @@ var normalizeProps$1 = createNormalizer((i) => {
|
|
|
3352
3275
|
} },
|
|
3353
3276
|
setup(i) {
|
|
3354
3277
|
let s = i;
|
|
3355
|
-
return (i, c) => s.expanded ? (openBlock(), createElementBlock("svg", _hoisted_1$3, c[0] ||= [createElementVNode("g", {
|
|
3278
|
+
return (i, c) => s.expanded ? (openBlock(), createElementBlock("svg", _hoisted_1$3, [...c[0] ||= [createElementVNode("g", {
|
|
3356
3279
|
fill: "none",
|
|
3357
3280
|
"stroke-linecap": "round",
|
|
3358
3281
|
"stroke-linejoin": "round"
|
|
@@ -3362,7 +3285,7 @@ var normalizeProps$1 = createNormalizer((i) => {
|
|
|
3362
3285
|
}), createElementVNode("path", {
|
|
3363
3286
|
stroke: "#65bb87",
|
|
3364
3287
|
d: "m10.5 8.5l-3 3.5l3 3.5m2-7l3 3.5l-3 3.5"
|
|
3365
|
-
})], -1)])) : (openBlock(), createElementBlock("svg", _hoisted_2$2, c[1] ||= [createElementVNode("g", {
|
|
3288
|
+
})], -1)]])) : (openBlock(), createElementBlock("svg", _hoisted_2$2, [...c[1] ||= [createElementVNode("g", {
|
|
3366
3289
|
fill: "none",
|
|
3367
3290
|
"stroke-linecap": "round",
|
|
3368
3291
|
"stroke-linejoin": "round"
|
|
@@ -3372,7 +3295,7 @@ var normalizeProps$1 = createNormalizer((i) => {
|
|
|
3372
3295
|
}), createElementVNode("path", {
|
|
3373
3296
|
stroke: "#65bb87",
|
|
3374
3297
|
d: "m10.5 8.5l-3 3.5l3 3.5m2-7l3 3.5l-3 3.5"
|
|
3375
|
-
})], -1)]));
|
|
3298
|
+
})], -1)]]));
|
|
3376
3299
|
}
|
|
3377
3300
|
}), _hoisted_1$2 = {
|
|
3378
3301
|
key: 0,
|
|
@@ -3395,7 +3318,7 @@ var normalizeProps$1 = createNormalizer((i) => {
|
|
|
3395
3318
|
} },
|
|
3396
3319
|
setup(i) {
|
|
3397
3320
|
let s = i;
|
|
3398
|
-
return (i, c) => s.expanded ? (openBlock(), createElementBlock("svg", _hoisted_1$2, c[0] ||= [createElementVNode("g", {
|
|
3321
|
+
return (i, c) => s.expanded ? (openBlock(), createElementBlock("svg", _hoisted_1$2, [...c[0] ||= [createElementVNode("g", {
|
|
3399
3322
|
fill: "none",
|
|
3400
3323
|
"stroke-linecap": "round",
|
|
3401
3324
|
"stroke-linejoin": "round"
|
|
@@ -3405,7 +3328,7 @@ var normalizeProps$1 = createNormalizer((i) => {
|
|
|
3405
3328
|
}), createElementVNode("path", {
|
|
3406
3329
|
stroke: "#E23730",
|
|
3407
3330
|
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"
|
|
3408
|
-
})], -1)])) : (openBlock(), createElementBlock("svg", _hoisted_2$1, c[1] ||= [createElementVNode("g", {
|
|
3331
|
+
})], -1)]])) : (openBlock(), createElementBlock("svg", _hoisted_2$1, [...c[1] ||= [createElementVNode("g", {
|
|
3409
3332
|
fill: "none",
|
|
3410
3333
|
"stroke-linecap": "round",
|
|
3411
3334
|
"stroke-linejoin": "round"
|
|
@@ -3415,7 +3338,7 @@ var normalizeProps$1 = createNormalizer((i) => {
|
|
|
3415
3338
|
}), createElementVNode("path", {
|
|
3416
3339
|
stroke: "#E23730",
|
|
3417
3340
|
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"
|
|
3418
|
-
})], -1)]));
|
|
3341
|
+
})], -1)]]));
|
|
3419
3342
|
}
|
|
3420
3343
|
}), _hoisted_1$1 = {
|
|
3421
3344
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -3426,12 +3349,12 @@ var normalizeProps$1 = createNormalizer((i) => {
|
|
|
3426
3349
|
name: "VueIcones",
|
|
3427
3350
|
__name: "VueIcones",
|
|
3428
3351
|
setup(i) {
|
|
3429
|
-
return (i, s) => (openBlock(), createElementBlock("svg", _hoisted_1$1, s[0] ||= [createElementVNode("g", {
|
|
3352
|
+
return (i, s) => (openBlock(), createElementBlock("svg", _hoisted_1$1, [...s[0] ||= [createElementVNode("g", {
|
|
3430
3353
|
fill: "none",
|
|
3431
3354
|
stroke: "#65bb87",
|
|
3432
3355
|
"stroke-linecap": "round",
|
|
3433
3356
|
"stroke-linejoin": "round"
|
|
3434
|
-
}, [createElementVNode("path", { d: "M1 1.5h5.44L8 4.56L9.56 1.5H15l-6.99 13z" }), createElementVNode("path", { d: "M12.05 1.73L8 9.28L3.95 1.73" })], -1)]));
|
|
3357
|
+
}, [createElementVNode("path", { d: "M1 1.5h5.44L8 4.56L9.56 1.5H15l-6.99 13z" }), createElementVNode("path", { d: "M12.05 1.73L8 9.28L3.95 1.73" })], -1)]]));
|
|
3435
3358
|
}
|
|
3436
3359
|
}), _hoisted_1 = { class: "mt-0" }, _hoisted_2 = { class: "w-152 mb-2" }, _hoisted_3 = { 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" }, _hoisted_4 = {
|
|
3437
3360
|
key: 1,
|