From 5fba79c4ca75bcb7824a3787b614ee57ef005762 Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 26 Aug 2026 05:10:03 +0000 Subject: [PATCH 01/23] Update source translation strings --- netbox/translations/en/LC_MESSAGES/django.po | 207 ++++++++++--------- 1 file changed, 104 insertions(+), 103 deletions(-) diff --git a/netbox/translations/en/LC_MESSAGES/django.po b/netbox/translations/en/LC_MESSAGES/django.po index 14e32a788..b91d6fee7 100644 --- a/netbox/translations/en/LC_MESSAGES/django.po +++ b/netbox/translations/en/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-08-25 05:09+0000\n" +"POT-Creation-Date: 2026-08-26 05:09+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -446,8 +446,8 @@ msgstr "" #: netbox/circuits/forms/filtersets.py:123 #: netbox/circuits/forms/filtersets.py:331 netbox/dcim/forms/bulk_edit.py:222 #: netbox/dcim/forms/bulk_edit.py:628 netbox/dcim/forms/bulk_edit.py:849 -#: netbox/dcim/forms/bulk_edit.py:1103 netbox/dcim/forms/bulk_edit.py:1202 -#: netbox/dcim/forms/bulk_edit.py:1229 netbox/dcim/forms/bulk_edit.py:1773 +#: netbox/dcim/forms/bulk_edit.py:1107 netbox/dcim/forms/bulk_edit.py:1206 +#: netbox/dcim/forms/bulk_edit.py:1233 netbox/dcim/forms/bulk_edit.py:1787 #: netbox/dcim/forms/bulk_import.py:1629 netbox/dcim/forms/filtersets.py:1283 #: netbox/dcim/forms/filtersets.py:1613 netbox/dcim/forms/filtersets.py:1829 #: netbox/dcim/forms/filtersets.py:1848 netbox/dcim/forms/filtersets.py:1872 @@ -455,7 +455,7 @@ msgstr "" #: netbox/dcim/tables/devices.py:857 netbox/dcim/tables/devices.py:1130 #: netbox/dcim/tables/devicetypes.py:214 netbox/dcim/tables/devicetypes.py:255 #: netbox/dcim/tables/devicetypes.py:274 netbox/dcim/tables/racks.py:54 -#: netbox/extras/forms/bulk_edit.py:313 netbox/extras/tables/tables.py:558 +#: netbox/extras/forms/bulk_edit.py:318 netbox/extras/tables/tables.py:558 #: netbox/netbox/ui/attrs.py:252 #: netbox/templates/extras/panels/customfieldchoiceset_choices.html:11 msgid "Color" @@ -473,9 +473,9 @@ msgstr "" #: netbox/core/tables/change_logging.py:33 netbox/core/tables/data.py:22 #: netbox/core/tables/jobs.py:22 netbox/dcim/forms/bulk_edit.py:816 #: netbox/dcim/forms/bulk_edit.py:948 netbox/dcim/forms/bulk_edit.py:1014 -#: netbox/dcim/forms/bulk_edit.py:1033 netbox/dcim/forms/bulk_edit.py:1056 -#: netbox/dcim/forms/bulk_edit.py:1098 netbox/dcim/forms/bulk_edit.py:1146 -#: netbox/dcim/forms/bulk_edit.py:1197 netbox/dcim/forms/bulk_edit.py:1224 +#: netbox/dcim/forms/bulk_edit.py:1037 netbox/dcim/forms/bulk_edit.py:1060 +#: netbox/dcim/forms/bulk_edit.py:1102 netbox/dcim/forms/bulk_edit.py:1150 +#: netbox/dcim/forms/bulk_edit.py:1201 netbox/dcim/forms/bulk_edit.py:1228 #: netbox/dcim/forms/bulk_import.py:215 netbox/dcim/forms/bulk_import.py:301 #: netbox/dcim/forms/bulk_import.py:830 netbox/dcim/forms/bulk_import.py:856 #: netbox/dcim/forms/bulk_import.py:882 netbox/dcim/forms/bulk_import.py:903 @@ -538,7 +538,7 @@ msgstr "" #: netbox/dcim/forms/bulk_edit.py:366 netbox/dcim/forms/bulk_edit.py:475 #: netbox/dcim/forms/bulk_edit.py:719 netbox/dcim/forms/bulk_edit.py:778 #: netbox/dcim/forms/bulk_edit.py:822 netbox/dcim/forms/bulk_edit.py:942 -#: netbox/dcim/forms/bulk_edit.py:1747 netbox/dcim/forms/bulk_edit.py:1791 +#: netbox/dcim/forms/bulk_edit.py:1761 netbox/dcim/forms/bulk_edit.py:1805 #: netbox/dcim/forms/bulk_import.py:106 netbox/dcim/forms/bulk_import.py:165 #: netbox/dcim/forms/bulk_import.py:282 netbox/dcim/forms/bulk_import.py:391 #: netbox/dcim/forms/bulk_import.py:622 netbox/dcim/forms/bulk_import.py:782 @@ -601,7 +601,7 @@ msgstr "" #: netbox/circuits/forms/filtersets.py:342 netbox/dcim/forms/bulk_edit.py:131 #: netbox/dcim/forms/bulk_edit.py:195 netbox/dcim/forms/bulk_edit.py:361 #: netbox/dcim/forms/bulk_edit.py:486 netbox/dcim/forms/bulk_edit.py:709 -#: netbox/dcim/forms/bulk_edit.py:834 netbox/dcim/forms/bulk_edit.py:1796 +#: netbox/dcim/forms/bulk_edit.py:834 netbox/dcim/forms/bulk_edit.py:1810 #: netbox/dcim/forms/bulk_import.py:125 netbox/dcim/forms/bulk_import.py:170 #: netbox/dcim/forms/bulk_import.py:268 netbox/dcim/forms/bulk_import.py:396 #: netbox/dcim/forms/bulk_import.py:596 netbox/dcim/forms/bulk_import.py:1609 @@ -761,21 +761,21 @@ msgstr "" #: netbox/circuits/forms/bulk_edit.py:184 #: netbox/circuits/forms/bulk_edit.py:332 netbox/dcim/forms/bulk_create.py:37 -#: netbox/dcim/forms/bulk_edit.py:802 netbox/dcim/forms/bulk_edit.py:1038 -#: netbox/dcim/forms/bulk_edit.py:1073 netbox/dcim/forms/bulk_edit.py:1117 -#: netbox/dcim/forms/bulk_edit.py:1161 netbox/dcim/forms/bulk_edit.py:1206 -#: netbox/dcim/forms/bulk_edit.py:1233 netbox/dcim/forms/bulk_edit.py:1251 -#: netbox/dcim/forms/bulk_edit.py:1274 netbox/dcim/forms/bulk_edit.py:1297 -#: netbox/extras/forms/bulk_edit.py:43 netbox/extras/forms/bulk_edit.py:160 -#: netbox/extras/forms/bulk_edit.py:193 netbox/extras/forms/bulk_edit.py:221 -#: netbox/extras/forms/bulk_edit.py:251 netbox/extras/forms/bulk_edit.py:299 -#: netbox/extras/forms/bulk_edit.py:317 netbox/extras/forms/bulk_edit.py:362 -#: netbox/extras/forms/bulk_edit.py:379 netbox/extras/forms/bulk_edit.py:421 -#: netbox/extras/forms/bulk_edit.py:446 netbox/extras/tables/tables.py:97 -#: netbox/ipam/tables/vlans.py:218 netbox/ipam/tables/vlans.py:245 -#: netbox/netbox/forms/bulk_edit.py:79 netbox/netbox/forms/bulk_edit.py:91 -#: netbox/netbox/forms/bulk_edit.py:103 netbox/netbox/ui/panels.py:223 -#: netbox/netbox/ui/panels.py:232 +#: netbox/dcim/forms/bulk_edit.py:802 netbox/dcim/forms/bulk_edit.py:1019 +#: netbox/dcim/forms/bulk_edit.py:1042 netbox/dcim/forms/bulk_edit.py:1077 +#: netbox/dcim/forms/bulk_edit.py:1121 netbox/dcim/forms/bulk_edit.py:1165 +#: netbox/dcim/forms/bulk_edit.py:1210 netbox/dcim/forms/bulk_edit.py:1237 +#: netbox/dcim/forms/bulk_edit.py:1260 netbox/dcim/forms/bulk_edit.py:1283 +#: netbox/dcim/forms/bulk_edit.py:1306 netbox/extras/forms/bulk_edit.py:43 +#: netbox/extras/forms/bulk_edit.py:160 netbox/extras/forms/bulk_edit.py:193 +#: netbox/extras/forms/bulk_edit.py:221 netbox/extras/forms/bulk_edit.py:251 +#: netbox/extras/forms/bulk_edit.py:299 netbox/extras/forms/bulk_edit.py:322 +#: netbox/extras/forms/bulk_edit.py:367 netbox/extras/forms/bulk_edit.py:384 +#: netbox/extras/forms/bulk_edit.py:426 netbox/extras/forms/bulk_edit.py:451 +#: netbox/extras/tables/tables.py:97 netbox/ipam/tables/vlans.py:218 +#: netbox/ipam/tables/vlans.py:245 netbox/netbox/forms/bulk_edit.py:83 +#: netbox/netbox/forms/bulk_edit.py:95 netbox/netbox/forms/bulk_edit.py:107 +#: netbox/netbox/ui/panels.py:223 netbox/netbox/ui/panels.py:232 #: netbox/templates/circuits/inc/circuit_termination_fields.html:89 #: netbox/templates/core/plugin.html:80 #: netbox/templates/dcim/cablebundle.html:21 @@ -815,10 +815,10 @@ msgid "Upstream speed (Kbps)" msgstr "" #: netbox/circuits/forms/bulk_edit.py:210 netbox/dcim/forms/bulk_edit.py:978 -#: netbox/dcim/forms/bulk_edit.py:1354 netbox/dcim/forms/bulk_edit.py:1371 -#: netbox/dcim/forms/bulk_edit.py:1388 netbox/dcim/forms/bulk_edit.py:1409 -#: netbox/dcim/forms/bulk_edit.py:1504 netbox/dcim/forms/bulk_edit.py:1676 -#: netbox/dcim/forms/bulk_edit.py:1693 +#: netbox/dcim/forms/bulk_edit.py:1368 netbox/dcim/forms/bulk_edit.py:1385 +#: netbox/dcim/forms/bulk_edit.py:1402 netbox/dcim/forms/bulk_edit.py:1423 +#: netbox/dcim/forms/bulk_edit.py:1518 netbox/dcim/forms/bulk_edit.py:1690 +#: netbox/dcim/forms/bulk_edit.py:1707 msgid "Mark connected" msgstr "" @@ -864,7 +864,7 @@ msgstr "" #: netbox/circuits/forms/bulk_import.py:253 #: netbox/circuits/forms/filtersets.py:393 #: netbox/circuits/forms/model_forms.py:399 netbox/dcim/forms/bulk_edit.py:372 -#: netbox/dcim/forms/bulk_edit.py:1301 netbox/dcim/forms/bulk_edit.py:1737 +#: netbox/dcim/forms/bulk_edit.py:1310 netbox/dcim/forms/bulk_edit.py:1751 #: netbox/dcim/forms/bulk_import.py:287 netbox/dcim/forms/bulk_import.py:1315 #: netbox/dcim/forms/filtersets.py:421 netbox/dcim/forms/filtersets.py:919 #: netbox/dcim/forms/filtersets.py:1990 netbox/dcim/forms/filtersets.py:2030 @@ -1186,7 +1186,7 @@ msgstr "" msgid "Term Side" msgstr "" -#: netbox/circuits/forms/filtersets.py:296 netbox/dcim/forms/bulk_edit.py:1596 +#: netbox/circuits/forms/filtersets.py:296 netbox/dcim/forms/bulk_edit.py:1610 #: netbox/extras/forms/model_forms.py:794 netbox/extras/ui/panels.py:446 #: netbox/ipam/forms/filtersets.py:154 netbox/ipam/forms/filtersets.py:663 #: netbox/ipam/forms/model_forms.py:362 netbox/ipam/ui/panels.py:122 @@ -1683,8 +1683,8 @@ msgid "Terminations" msgstr "" #: netbox/circuits/tables/virtual_circuits.py:106 -#: netbox/dcim/forms/bulk_edit.py:749 netbox/dcim/forms/bulk_edit.py:1320 -#: netbox/dcim/forms/bulk_edit.py:1732 netbox/dcim/forms/bulk_edit.py:1786 +#: netbox/dcim/forms/bulk_edit.py:749 netbox/dcim/forms/bulk_edit.py:1334 +#: netbox/dcim/forms/bulk_edit.py:1746 netbox/dcim/forms/bulk_edit.py:1800 #: netbox/dcim/forms/bulk_import.py:764 netbox/dcim/forms/bulk_import.py:825 #: netbox/dcim/forms/bulk_import.py:851 netbox/dcim/forms/bulk_import.py:877 #: netbox/dcim/forms/bulk_import.py:898 netbox/dcim/forms/bulk_import.py:954 @@ -1763,7 +1763,7 @@ msgstr "" msgid "Connection" msgstr "" -#: netbox/circuits/ui/panels.py:99 netbox/dcim/forms/bulk_edit.py:1480 +#: netbox/circuits/ui/panels.py:99 netbox/dcim/forms/bulk_edit.py:1494 #: netbox/dcim/forms/bulk_import.py:836 netbox/dcim/forms/bulk_import.py:862 #: netbox/dcim/forms/filtersets.py:1497 netbox/dcim/forms/filtersets.py:1537 #: netbox/dcim/forms/filtersets.py:1675 netbox/dcim/tables/devices.py:662 @@ -1950,7 +1950,7 @@ msgid "Cancelled" msgstr "" #: netbox/core/constants.py:30 netbox/extras/choices.py:197 -#: netbox/extras/forms/bulk_edit.py:403 netbox/extras/forms/filtersets.py:549 +#: netbox/extras/forms/bulk_edit.py:408 netbox/extras/forms/filtersets.py:549 #: netbox/extras/tables/tables.py:707 msgid "Debug" msgstr "" @@ -2037,8 +2037,8 @@ msgstr "" #: netbox/core/forms/bulk_edit.py:25 netbox/core/forms/filtersets.py:47 #: netbox/core/tables/data.py:28 netbox/dcim/choices.py:2109 -#: netbox/dcim/forms/bulk_edit.py:1151 netbox/dcim/forms/bulk_edit.py:1255 -#: netbox/dcim/forms/bulk_edit.py:1278 netbox/dcim/forms/bulk_edit.py:1442 +#: netbox/dcim/forms/bulk_edit.py:1155 netbox/dcim/forms/bulk_edit.py:1264 +#: netbox/dcim/forms/bulk_edit.py:1287 netbox/dcim/forms/bulk_edit.py:1456 #: netbox/dcim/forms/filtersets.py:1687 netbox/dcim/forms/filtersets.py:1780 #: netbox/dcim/forms/filtersets.py:1913 netbox/dcim/forms/filtersets.py:1932 #: netbox/dcim/forms/filtersets.py:1951 netbox/dcim/forms/filtersets.py:1966 @@ -2218,8 +2218,8 @@ msgid "Rack Elevations" msgstr "" #: netbox/core/forms/model_forms.py:151 netbox/dcim/choices.py:1980 -#: netbox/dcim/forms/bulk_edit.py:990 netbox/dcim/forms/bulk_edit.py:1396 -#: netbox/dcim/forms/bulk_edit.py:1417 netbox/dcim/tables/racks.py:172 +#: netbox/dcim/forms/bulk_edit.py:990 netbox/dcim/forms/bulk_edit.py:1410 +#: netbox/dcim/forms/bulk_edit.py:1431 netbox/dcim/tables/racks.py:172 #: netbox/netbox/navigation/menu.py:324 netbox/netbox/navigation/menu.py:328 msgid "Power" msgstr "" @@ -3079,7 +3079,7 @@ msgstr "" #: netbox/dcim/choices.py:170 netbox/dcim/forms/bulk_edit.py:87 #: netbox/dcim/forms/bulk_edit.py:101 netbox/dcim/forms/bulk_edit.py:181 #: netbox/dcim/forms/bulk_edit.py:623 netbox/dcim/forms/bulk_edit.py:651 -#: netbox/dcim/forms/bulk_edit.py:1447 netbox/dcim/forms/bulk_import.py:78 +#: netbox/dcim/forms/bulk_edit.py:1461 netbox/dcim/forms/bulk_import.py:78 #: netbox/dcim/forms/bulk_import.py:92 netbox/dcim/forms/bulk_import.py:155 #: netbox/dcim/forms/bulk_import.py:531 netbox/dcim/forms/bulk_import.py:557 #: netbox/dcim/forms/bulk_import.py:683 netbox/dcim/forms/bulk_import.py:959 @@ -3211,7 +3211,7 @@ msgid "Virtual" msgstr "" #: netbox/dcim/choices.py:885 netbox/dcim/choices.py:1392 -#: netbox/dcim/forms/bulk_edit.py:1602 netbox/dcim/forms/filtersets.py:1645 +#: netbox/dcim/forms/bulk_edit.py:1616 netbox/dcim/forms/filtersets.py:1645 #: netbox/dcim/forms/filtersets.py:1771 netbox/dcim/forms/model_forms.py:1189 #: netbox/dcim/forms/model_forms.py:1653 netbox/dcim/ui/panels.py:556 #: netbox/netbox/navigation/menu.py:157 netbox/netbox/navigation/menu.py:161 @@ -3222,7 +3222,7 @@ msgstr "" msgid "Virtual interfaces" msgstr "" -#: netbox/dcim/choices.py:1177 netbox/dcim/forms/bulk_edit.py:1455 +#: netbox/dcim/choices.py:1177 netbox/dcim/forms/bulk_edit.py:1469 #: netbox/dcim/forms/bulk_import.py:966 netbox/dcim/forms/model_forms.py:1171 #: netbox/dcim/tables/devices.py:761 #: netbox/virtualization/forms/bulk_edit.py:231 @@ -4017,7 +4017,7 @@ msgstr "" msgid "Assigned VID" msgstr "" -#: netbox/dcim/filtersets.py:2158 netbox/dcim/forms/bulk_edit.py:1568 +#: netbox/dcim/filtersets.py:2158 netbox/dcim/forms/bulk_edit.py:1582 #: netbox/dcim/forms/bulk_import.py:1051 netbox/dcim/forms/filtersets.py:1755 #: netbox/dcim/forms/model_forms.py:1619 #: netbox/dcim/models/device_components.py:958 @@ -4207,9 +4207,10 @@ msgstr "" msgid "Tags" msgstr "" -#: netbox/dcim/forms/bulk_create.py:120 netbox/dcim/forms/filtersets.py:1909 -#: netbox/dcim/forms/filtersets.py:1928 netbox/dcim/forms/model_forms.py:640 -#: netbox/dcim/forms/model_forms.py:707 netbox/dcim/forms/object_create.py:155 +#: netbox/dcim/forms/bulk_create.py:120 netbox/dcim/forms/bulk_edit.py:1255 +#: netbox/dcim/forms/filtersets.py:1909 netbox/dcim/forms/filtersets.py:1928 +#: netbox/dcim/forms/model_forms.py:640 netbox/dcim/forms/model_forms.py:707 +#: netbox/dcim/forms/object_create.py:155 #: netbox/dcim/forms/object_create.py:256 netbox/dcim/tables/devices.py:169 #: netbox/templates/dcim/panels/front_port_mappings.html:9 #: netbox/templates/dcim/panels/rear_port_mappings.html:9 @@ -4249,7 +4250,7 @@ msgstr "" #: netbox/dcim/forms/bulk_edit.py:235 netbox/dcim/forms/bulk_edit.py:508 #: netbox/dcim/forms/bulk_edit.py:584 netbox/dcim/forms/bulk_edit.py:656 #: netbox/dcim/forms/bulk_edit.py:675 netbox/dcim/forms/bulk_edit.py:762 -#: netbox/dcim/forms/bulk_edit.py:1306 netbox/dcim/forms/bulk_edit.py:1742 +#: netbox/dcim/forms/bulk_edit.py:1315 netbox/dcim/forms/bulk_edit.py:1756 #: netbox/dcim/forms/bulk_import.py:209 netbox/dcim/forms/bulk_import.py:433 #: netbox/dcim/forms/bulk_import.py:483 netbox/dcim/forms/bulk_import.py:567 #: netbox/dcim/forms/bulk_import.py:603 netbox/dcim/forms/bulk_import.py:1321 @@ -4330,7 +4331,7 @@ msgstr "" #: netbox/dcim/views.py:983 netbox/dcim/views.py:1111 #: netbox/extras/forms/bulk_edit.py:57 netbox/extras/forms/bulk_edit.py:144 #: netbox/extras/forms/bulk_edit.py:198 netbox/extras/forms/bulk_edit.py:226 -#: netbox/extras/forms/bulk_edit.py:322 netbox/extras/forms/bulk_edit.py:348 +#: netbox/extras/forms/bulk_edit.py:327 netbox/extras/forms/bulk_edit.py:353 #: netbox/extras/forms/filtersets.py:74 netbox/extras/forms/filtersets.py:175 #: netbox/extras/forms/filtersets.py:271 netbox/extras/forms/filtersets.py:302 #: netbox/ipam/forms/bulk_edit.py:167 @@ -4516,7 +4517,7 @@ msgstr "" msgid "Config template" msgstr "" -#: netbox/dcim/forms/bulk_edit.py:680 netbox/dcim/forms/bulk_edit.py:1086 +#: netbox/dcim/forms/bulk_edit.py:680 netbox/dcim/forms/bulk_edit.py:1090 #: netbox/dcim/forms/bulk_import.py:609 netbox/dcim/forms/filtersets.py:135 #: netbox/dcim/forms/filtersets.py:1438 netbox/dcim/forms/model_forms.py:661 #: netbox/dcim/forms/model_forms.py:1048 netbox/dcim/forms/model_forms.py:1065 @@ -4582,11 +4583,11 @@ msgid "Bundle" msgstr "" #: netbox/dcim/forms/bulk_edit.py:844 netbox/dcim/forms/bulk_edit.py:1009 -#: netbox/dcim/forms/bulk_edit.py:1028 netbox/dcim/forms/bulk_edit.py:1051 -#: netbox/dcim/forms/bulk_edit.py:1093 netbox/dcim/forms/bulk_edit.py:1141 -#: netbox/dcim/forms/bulk_edit.py:1192 netbox/dcim/forms/bulk_edit.py:1219 -#: netbox/dcim/forms/bulk_edit.py:1246 netbox/dcim/forms/bulk_edit.py:1269 -#: netbox/dcim/forms/bulk_edit.py:1292 netbox/dcim/forms/filtersets.py:88 +#: netbox/dcim/forms/bulk_edit.py:1032 netbox/dcim/forms/bulk_edit.py:1055 +#: netbox/dcim/forms/bulk_edit.py:1097 netbox/dcim/forms/bulk_edit.py:1145 +#: netbox/dcim/forms/bulk_edit.py:1196 netbox/dcim/forms/bulk_edit.py:1223 +#: netbox/dcim/forms/bulk_edit.py:1250 netbox/dcim/forms/bulk_edit.py:1278 +#: netbox/dcim/forms/bulk_edit.py:1301 netbox/dcim/forms/filtersets.py:88 #: netbox/dcim/forms/object_create.py:48 #: netbox/templates/dcim/inc/panels/inventory_items.html:19 #: netbox/templates/dcim/panels/component_inventory_items.html:9 @@ -4635,42 +4636,42 @@ msgstr "" msgid "Max utilization" msgstr "" -#: netbox/dcim/forms/bulk_edit.py:1061 +#: netbox/dcim/forms/bulk_edit.py:1065 msgid "Maximum draw" msgstr "" -#: netbox/dcim/forms/bulk_edit.py:1064 +#: netbox/dcim/forms/bulk_edit.py:1068 #: netbox/dcim/models/device_component_templates.py:303 #: netbox/dcim/models/device_components.py:511 msgid "Maximum power draw (watts)" msgstr "" -#: netbox/dcim/forms/bulk_edit.py:1067 +#: netbox/dcim/forms/bulk_edit.py:1071 msgid "Allocated draw" msgstr "" -#: netbox/dcim/forms/bulk_edit.py:1070 +#: netbox/dcim/forms/bulk_edit.py:1074 #: netbox/dcim/models/device_component_templates.py:310 #: netbox/dcim/models/device_components.py:518 msgid "Allocated power draw (watts)" msgstr "" -#: netbox/dcim/forms/bulk_edit.py:1107 netbox/dcim/forms/bulk_import.py:909 +#: netbox/dcim/forms/bulk_edit.py:1111 netbox/dcim/forms/bulk_import.py:909 #: netbox/dcim/forms/model_forms.py:1144 netbox/dcim/forms/model_forms.py:1509 #: netbox/dcim/forms/model_forms.py:1838 netbox/dcim/forms/object_import.py:56 msgid "Power port" msgstr "" -#: netbox/dcim/forms/bulk_edit.py:1112 netbox/dcim/forms/bulk_import.py:916 +#: netbox/dcim/forms/bulk_edit.py:1116 netbox/dcim/forms/bulk_import.py:916 msgid "Feed leg" msgstr "" -#: netbox/dcim/forms/bulk_edit.py:1158 netbox/dcim/forms/bulk_edit.py:1489 +#: netbox/dcim/forms/bulk_edit.py:1162 netbox/dcim/forms/bulk_edit.py:1503 #: netbox/dcim/forms/filtersets.py:1787 netbox/dcim/ui/panels.py:492 msgid "Management only" msgstr "" -#: netbox/dcim/forms/bulk_edit.py:1168 netbox/dcim/forms/bulk_edit.py:1495 +#: netbox/dcim/forms/bulk_edit.py:1172 netbox/dcim/forms/bulk_edit.py:1509 #: netbox/dcim/forms/bulk_import.py:1002 netbox/dcim/forms/filtersets.py:1711 #: netbox/dcim/forms/filtersets.py:1796 netbox/dcim/forms/object_import.py:91 #: netbox/dcim/models/device_component_templates.py:473 @@ -4678,7 +4679,7 @@ msgstr "" msgid "PoE mode" msgstr "" -#: netbox/dcim/forms/bulk_edit.py:1174 netbox/dcim/forms/bulk_edit.py:1501 +#: netbox/dcim/forms/bulk_edit.py:1178 netbox/dcim/forms/bulk_edit.py:1515 #: netbox/dcim/forms/bulk_import.py:1008 netbox/dcim/forms/filtersets.py:1716 #: netbox/dcim/forms/filtersets.py:1801 netbox/dcim/forms/object_import.py:96 #: netbox/dcim/models/device_component_templates.py:480 @@ -4686,26 +4687,30 @@ msgstr "" msgid "PoE type" msgstr "" -#: netbox/dcim/forms/bulk_edit.py:1180 netbox/dcim/forms/filtersets.py:1731 +#: netbox/dcim/forms/bulk_edit.py:1184 netbox/dcim/forms/filtersets.py:1731 #: netbox/dcim/forms/filtersets.py:1806 netbox/dcim/forms/object_import.py:101 msgid "Wireless role" msgstr "" -#: netbox/dcim/forms/bulk_edit.py:1327 netbox/dcim/forms/model_forms.py:832 +#: netbox/dcim/forms/bulk_edit.py:1320 netbox/dcim/ui/panels.py:301 +msgid "Part ID" +msgstr "" + +#: netbox/dcim/forms/bulk_edit.py:1341 netbox/dcim/forms/model_forms.py:832 #: netbox/dcim/forms/model_forms.py:1454 netbox/dcim/tables/devices.py:330 msgid "Module" msgstr "" -#: netbox/dcim/forms/bulk_edit.py:1469 netbox/dcim/tables/devices.py:766 +#: netbox/dcim/forms/bulk_edit.py:1483 netbox/dcim/tables/devices.py:766 #: netbox/dcim/ui/panels.py:509 msgid "LAG" msgstr "" -#: netbox/dcim/forms/bulk_edit.py:1474 netbox/dcim/forms/model_forms.py:1536 +#: netbox/dcim/forms/bulk_edit.py:1488 netbox/dcim/forms/model_forms.py:1536 msgid "Virtual device contexts" msgstr "" -#: netbox/dcim/forms/bulk_edit.py:1509 netbox/dcim/forms/bulk_import.py:1011 +#: netbox/dcim/forms/bulk_edit.py:1523 netbox/dcim/forms/bulk_import.py:1011 #: netbox/virtualization/forms/bulk_edit.py:252 #: netbox/virtualization/forms/bulk_import.py:205 #: netbox/vpn/forms/bulk_edit.py:128 netbox/vpn/forms/bulk_edit.py:196 @@ -4716,7 +4721,7 @@ msgstr "" msgid "Mode" msgstr "" -#: netbox/dcim/forms/bulk_edit.py:1517 netbox/dcim/forms/bulk_import.py:1017 +#: netbox/dcim/forms/bulk_edit.py:1531 netbox/dcim/forms/bulk_import.py:1017 #: netbox/dcim/forms/model_forms.py:1585 netbox/ipam/forms/bulk_import.py:184 #: netbox/ipam/forms/filtersets.py:603 netbox/ipam/models/vlans.py:99 #: netbox/virtualization/forms/bulk_edit.py:259 @@ -4725,7 +4730,7 @@ msgstr "" msgid "VLAN group" msgstr "" -#: netbox/dcim/forms/bulk_edit.py:1526 netbox/dcim/forms/bulk_import.py:1024 +#: netbox/dcim/forms/bulk_edit.py:1540 netbox/dcim/forms/bulk_import.py:1024 #: netbox/dcim/forms/model_forms.py:1591 netbox/dcim/tables/devices.py:627 #: netbox/dcim/ui/panels.py:498 netbox/virtualization/forms/bulk_edit.py:267 #: netbox/virtualization/forms/bulk_import.py:218 @@ -4733,7 +4738,7 @@ msgstr "" msgid "Untagged VLAN" msgstr "" -#: netbox/dcim/forms/bulk_edit.py:1535 netbox/dcim/forms/bulk_import.py:1031 +#: netbox/dcim/forms/bulk_edit.py:1549 netbox/dcim/forms/bulk_import.py:1031 #: netbox/dcim/forms/model_forms.py:1600 netbox/dcim/tables/devices.py:633 #: netbox/virtualization/forms/bulk_edit.py:275 #: netbox/virtualization/forms/bulk_import.py:225 @@ -4741,34 +4746,34 @@ msgstr "" msgid "Tagged VLANs" msgstr "" -#: netbox/dcim/forms/bulk_edit.py:1538 +#: netbox/dcim/forms/bulk_edit.py:1552 msgid "Add tagged VLANs" msgstr "" -#: netbox/dcim/forms/bulk_edit.py:1547 +#: netbox/dcim/forms/bulk_edit.py:1561 msgid "Remove tagged VLANs" msgstr "" -#: netbox/dcim/forms/bulk_edit.py:1558 netbox/dcim/forms/bulk_import.py:1044 +#: netbox/dcim/forms/bulk_edit.py:1572 netbox/dcim/forms/bulk_import.py:1044 #: netbox/dcim/forms/model_forms.py:1609 #: netbox/virtualization/forms/bulk_import.py:238 #: netbox/virtualization/forms/model_forms.py:439 msgid "Q-in-Q Service VLAN" msgstr "" -#: netbox/dcim/forms/bulk_edit.py:1573 netbox/dcim/forms/model_forms.py:1572 +#: netbox/dcim/forms/bulk_edit.py:1587 netbox/dcim/forms/model_forms.py:1572 #: netbox/wireless/forms/filtersets.py:26 msgid "Wireless LAN group" msgstr "" -#: netbox/dcim/forms/bulk_edit.py:1578 netbox/dcim/forms/model_forms.py:1577 +#: netbox/dcim/forms/bulk_edit.py:1592 netbox/dcim/forms/model_forms.py:1577 #: netbox/dcim/tables/devices.py:671 netbox/dcim/ui/panels.py:568 #: netbox/netbox/navigation/menu.py:163 #: netbox/wireless/tables/wirelesslan.py:20 msgid "Wireless LANs" msgstr "" -#: netbox/dcim/forms/bulk_edit.py:1587 netbox/dcim/forms/filtersets.py:1642 +#: netbox/dcim/forms/bulk_edit.py:1601 netbox/dcim/forms/filtersets.py:1642 #: netbox/dcim/forms/model_forms.py:1643 netbox/dcim/ui/panels.py:513 #: netbox/ipam/forms/bulk_edit.py:232 netbox/ipam/forms/bulk_edit.py:318 #: netbox/ipam/forms/filtersets.py:196 netbox/netbox/navigation/menu.py:118 @@ -4779,25 +4784,25 @@ msgstr "" msgid "Addressing" msgstr "" -#: netbox/dcim/forms/bulk_edit.py:1588 netbox/dcim/forms/filtersets.py:861 +#: netbox/dcim/forms/bulk_edit.py:1602 netbox/dcim/forms/filtersets.py:861 #: netbox/dcim/forms/model_forms.py:1644 #: netbox/virtualization/forms/model_forms.py:460 msgid "Operation" msgstr "" -#: netbox/dcim/forms/bulk_edit.py:1589 netbox/dcim/forms/filtersets.py:1643 +#: netbox/dcim/forms/bulk_edit.py:1603 netbox/dcim/forms/filtersets.py:1643 #: netbox/dcim/forms/filtersets.py:1770 netbox/dcim/forms/model_forms.py:1188 #: netbox/dcim/forms/model_forms.py:1646 msgid "PoE" msgstr "" -#: netbox/dcim/forms/bulk_edit.py:1590 netbox/dcim/forms/model_forms.py:1645 +#: netbox/dcim/forms/bulk_edit.py:1604 netbox/dcim/forms/model_forms.py:1645 #: netbox/dcim/ui/panels.py:505 netbox/virtualization/forms/bulk_edit.py:291 #: netbox/virtualization/forms/model_forms.py:461 msgid "Related Interfaces" msgstr "" -#: netbox/dcim/forms/bulk_edit.py:1592 netbox/dcim/forms/filtersets.py:1644 +#: netbox/dcim/forms/bulk_edit.py:1606 netbox/dcim/forms/filtersets.py:1644 #: netbox/dcim/forms/model_forms.py:1649 #: netbox/virtualization/forms/bulk_edit.py:294 #: netbox/virtualization/forms/filtersets.py:275 @@ -4805,15 +4810,15 @@ msgstr "" msgid "802.1Q Switching" msgstr "" -#: netbox/dcim/forms/bulk_edit.py:1597 +#: netbox/dcim/forms/bulk_edit.py:1611 msgid "Add/Remove" msgstr "" -#: netbox/dcim/forms/bulk_edit.py:1656 netbox/dcim/forms/bulk_edit.py:1658 +#: netbox/dcim/forms/bulk_edit.py:1670 netbox/dcim/forms/bulk_edit.py:1672 msgid "Interface mode must be specified to assign VLANs" msgstr "" -#: netbox/dcim/forms/bulk_edit.py:1663 +#: netbox/dcim/forms/bulk_edit.py:1677 msgid "An access interface cannot have tagged VLANs assigned." msgstr "" @@ -5563,7 +5568,7 @@ msgstr "" msgid "Occupied" msgstr "" -#: netbox/dcim/forms/filtersets.py:1665 netbox/extras/forms/bulk_edit.py:433 +#: netbox/dcim/forms/filtersets.py:1665 netbox/extras/forms/bulk_edit.py:438 #: netbox/extras/forms/bulk_import.py:332 netbox/extras/forms/filtersets.py:595 #: netbox/extras/forms/model_forms.py:896 netbox/extras/tables/tables.py:765 msgid "Kind" @@ -8064,7 +8069,7 @@ msgstr "" msgid "VLAN Groups" msgstr "" -#: netbox/dcim/tests/test_api.py:61 +#: netbox/dcim/tests/test_api.py:64 msgid "Test case must set peer_termination_type" msgstr "" @@ -8105,10 +8110,6 @@ msgstr "" msgid "Parent item" msgstr "" -#: netbox/dcim/ui/panels.py:301 -msgid "Part ID" -msgstr "" - #: netbox/dcim/ui/panels.py:344 msgid "Connected device" msgstr "" @@ -8804,24 +8805,24 @@ msgstr "" msgid "Button class" msgstr "" -#: netbox/extras/forms/bulk_edit.py:165 netbox/extras/forms/bulk_edit.py:384 +#: netbox/extras/forms/bulk_edit.py:165 netbox/extras/forms/bulk_edit.py:389 #: netbox/extras/forms/filtersets.py:208 netbox/extras/forms/filtersets.py:531 #: netbox/extras/models/mixins.py:107 netbox/extras/ui/panels.py:238 #: netbox/extras/ui/panels.py:464 msgid "MIME type" msgstr "" -#: netbox/extras/forms/bulk_edit.py:170 netbox/extras/forms/bulk_edit.py:389 +#: netbox/extras/forms/bulk_edit.py:170 netbox/extras/forms/bulk_edit.py:394 #: netbox/extras/forms/filtersets.py:211 netbox/extras/forms/filtersets.py:534 msgid "File name" msgstr "" -#: netbox/extras/forms/bulk_edit.py:174 netbox/extras/forms/bulk_edit.py:393 +#: netbox/extras/forms/bulk_edit.py:174 netbox/extras/forms/bulk_edit.py:398 #: netbox/extras/forms/filtersets.py:215 netbox/extras/forms/filtersets.py:538 msgid "File extension" msgstr "" -#: netbox/extras/forms/bulk_edit.py:179 netbox/extras/forms/bulk_edit.py:398 +#: netbox/extras/forms/bulk_edit.py:179 netbox/extras/forms/bulk_edit.py:403 #: netbox/extras/forms/filtersets.py:219 netbox/extras/forms/filtersets.py:542 msgid "As attachment" msgstr "" @@ -8860,11 +8861,19 @@ msgstr "" msgid "Event types" msgstr "" -#: netbox/extras/forms/bulk_edit.py:357 +#: netbox/extras/forms/bulk_edit.py:304 netbox/extras/views.py:846 +msgid "Conditions" +msgstr "" + +#: netbox/extras/forms/bulk_edit.py:306 netbox/extras/forms/model_forms.py:567 +msgid "Enter conditions in JSON format." +msgstr "" + +#: netbox/extras/forms/bulk_edit.py:362 msgid "Is active" msgstr "" -#: netbox/extras/forms/bulk_edit.py:408 netbox/extras/forms/bulk_import.py:216 +#: netbox/extras/forms/bulk_edit.py:413 netbox/extras/forms/bulk_import.py:216 #: netbox/extras/forms/filtersets.py:522 msgid "Auto sync enabled" msgstr "" @@ -9284,10 +9293,6 @@ msgstr "" msgid "Action choice" msgstr "" -#: netbox/extras/forms/model_forms.py:567 -msgid "Enter conditions in JSON format." -msgstr "" - #: netbox/extras/forms/model_forms.py:571 msgid "" "Enter parameters to pass to the action in Date: Thu, 27 Aug 2026 09:42:30 -0400 Subject: [PATCH 02/23] Closes #23044: Add workflow to enforce milestone assignment on issue closure (#23045) Reopens any issue that is closed as completed without a milestone assigned, after a short grace period to allow for the milestone being set immediately after closure. --- .github/workflows/enforce-milestone.yml | 37 +++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/enforce-milestone.yml diff --git a/.github/workflows/enforce-milestone.yml b/.github/workflows/enforce-milestone.yml new file mode 100644 index 000000000..f2eb13e42 --- /dev/null +++ b/.github/workflows/enforce-milestone.yml @@ -0,0 +1,37 @@ +name: Enforce milestone on close + +on: + issues: + types: + - closed + +permissions: + issues: write + +jobs: + check-milestone: + name: Check Milestone + if: github.repository == 'netbox-community/netbox' && github.event.issue.state_reason == 'completed' + runs-on: ubuntu-slim + + steps: + - name: Reopen issues completed without a milestone + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GH_REPO: ${{ github.repository }} + ISSUE: ${{ github.event.issue.number }} + run: | + # Grace period, in case the milestone is assigned immediately after closure + sleep 90 + + # Re-check the issue: bail out if it has been reopened or a milestone has since been set + DATA=$(gh issue view "$ISSUE" --json state,milestone) + STATE=$(jq -r '.state' <<< "$DATA") + MILESTONE=$(jq -r '.milestone.title // ""' <<< "$DATA") + if [ "$STATE" != "CLOSED" ] || [ -n "$MILESTONE" ]; then + echo "Nothing to do (state=$STATE, milestone=${MILESTONE:-none})" + exit 0 + fi + + gh issue reopen "$ISSUE" --comment \ + "This issue was closed as completed without a milestone assigned, and has been reopened automatically. Please assign the milestone for the upcoming release, then close the issue again." From f91e0e9fb38ed9bdf4fef5471f432beaca688893 Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Thu, 27 Aug 2026 10:48:10 -0400 Subject: [PATCH 03/23] Fixes #23038: Don't append cache-busting parameter to signed static file URLs Storage backends such as S3 may return presigned URLs whose signature covers the entire query string. Appending a version parameter to such a URL after it has been signed invalidates the signature, causing the storage backend to reject the request with a 403. Return signed URLs unmodified. These embed an expiration and are regenerated on each request, so they require no cache-busting parameter. Co-Authored-By: Claude Opus 5 --- .../utilities/templatetags/builtins/tags.py | 26 ++++++- netbox/utilities/tests/test_templatetags.py | 68 +++++++++++++++++++ 2 files changed, 93 insertions(+), 1 deletion(-) diff --git a/netbox/utilities/templatetags/builtins/tags.py b/netbox/utilities/templatetags/builtins/tags.py index 289fb6c5f..7186607dc 100644 --- a/netbox/utilities/templatetags/builtins/tags.py +++ b/netbox/utilities/templatetags/builtins/tags.py @@ -21,6 +21,14 @@ __all__ = ( register = template.Library() +# Query parameters which indicate that a URL has been cryptographically signed by the storage +# backend. Parameters must not be appended to such URLs, as doing so invalidates the signature. +SIGNED_URL_PARAMS = ( + 'signature', # AWS signature v2; Google Cloud Storage v2 + 'x-amz-signature', # AWS signature v4 (also MinIO, Ceph, Garage, Cloudflare R2, et al.) + 'x-goog-signature', # Google Cloud Storage v4 +) + @register.inclusion_tag('builtins/tag.html') def tag(value, viewname=None): @@ -159,6 +167,11 @@ def static_with_params(path, **params): parameter conflicts. A warning will be logged if any of the provided parameters conflict with existing parameters in the URL. + URLs which have been cryptographically signed by the storage backend (e.g. S3 presigned + URLs) are returned unmodified, as appending parameters to them would invalidate their + signature. Such URLs embed an expiration and are regenerated on each request, so they + require no cache-busting parameters. + Args: path: The static file path (e.g., 'setmode.js') **params: Query parameters to append (e.g., v='4.3.1') @@ -170,6 +183,8 @@ def static_with_params(path, **params): If any provided parameters conflict with existing URL parameters, a warning will be logged and the new parameter value will override the existing one. """ + logger = logging.getLogger('netbox.utilities.templatetags.tags') + # Get the base static URL static_url = static(path) @@ -177,8 +192,17 @@ def static_with_params(path, **params): parsed = urlparse(static_url) existing_params = parse_qs(parsed.query) + # If the storage backend has signed the URL, return it as-is. Signature schemes such as AWS + # signature v4 cover the entire query string, so appending a parameter here would invalidate + # the signature and the request would be rejected by the storage backend. + if signature_params := [p for p in existing_params if p.lower() in SIGNED_URL_PARAMS]: + logger.debug( + f"Static URL '{static_url}' is signed ({', '.join(signature_params)}); " + f"omitting parameters {tuple(params)}" + ) + return static_url + # Check for duplicate parameters and log warnings - logger = logging.getLogger('netbox.utilities.templatetags.tags') for key, value in params.items(): if key in existing_params: logger.warning( diff --git a/netbox/utilities/tests/test_templatetags.py b/netbox/utilities/tests/test_templatetags.py index 7da38f163..ea41b10ee 100644 --- a/netbox/utilities/tests/test_templatetags.py +++ b/netbox/utilities/tests/test_templatetags.py @@ -106,6 +106,74 @@ class StaticWithParamsTestCase(TestCase): self.assertIn('v=new_version', result) self.assertNotIn('v=old_version', result) + @override_settings(STATIC_URL='https://s3.example.com/netbox/static/') + def test_static_with_params_sigv4_presigned_url(self): + """Test that parameters are not appended to an AWS signature v4 presigned URL.""" + signed_url = ( + 'https://s3.example.com/netbox/static/test.js' + '?X-Amz-Algorithm=AWS4-HMAC-SHA256' + '&X-Amz-Credential=ABC123%2F20260827%2Fus-east-1%2Fs3%2Faws4_request' + '&X-Amz-Date=20260827T141543Z' + '&X-Amz-Expires=3600' + '&X-Amz-SignedHeaders=host' + '&X-Amz-Signature=7a5af16a67d2bc7dc15b77fab733cafdc1344414d884fcf2e0b997b0b78dabca' + ) + with patch('utilities.templatetags.builtins.tags.static') as mock_static: + mock_static.return_value = signed_url + + result = static_with_params('test.js', v='1.0.0') + + # The signed URL must be returned verbatim: appending a parameter would be included in + # the signature calculation performed by the storage backend, invalidating the signature. + self.assertEqual(result, signed_url) + self.assertNotIn('v=1.0.0', result) + + @override_settings(STATIC_URL='https://s3.example.com/netbox/static/') + def test_static_with_params_sigv2_presigned_url(self): + """Test that parameters are not appended to an AWS signature v2 presigned URL.""" + signed_url = ( + 'https://s3.example.com/netbox/static/test.js' + '?AWSAccessKeyId=ABC123&Signature=hR9%2F5pRTOWo%3D&Expires=1748635659' + ) + with patch('utilities.templatetags.builtins.tags.static') as mock_static: + mock_static.return_value = signed_url + + result = static_with_params('test.js', v='1.0.0') + + self.assertEqual(result, signed_url) + self.assertNotIn('v=1.0.0', result) + + @override_settings(STATIC_URL='https://storage.example.com/netbox/static/') + def test_static_with_params_gcs_presigned_url(self): + """Test that parameters are not appended to a Google Cloud Storage v4 signed URL.""" + signed_url = ( + 'https://storage.example.com/netbox/static/test.js' + '?X-Goog-Algorithm=GOOG4-RSA-SHA256' + '&X-Goog-Credential=netbox%40example.iam.gserviceaccount.com%2F20260827%2Fauto%2Fstorage' + '%2Fgoog4_request' + '&X-Goog-Date=20260827T141543Z' + '&X-Goog-Expires=3600' + '&X-Goog-SignedHeaders=host' + '&X-Goog-Signature=4bd3a1f0' + ) + with patch('utilities.templatetags.builtins.tags.static') as mock_static: + mock_static.return_value = signed_url + + result = static_with_params('test.js', v='1.0.0') + + self.assertEqual(result, signed_url) + self.assertNotIn('v=1.0.0', result) + + @override_settings(STATIC_URL='https://s3.example.com/netbox/static/') + def test_static_with_params_unsigned_s3_url(self): + """Test that parameters are appended to an unsigned (public bucket) S3 URL.""" + with patch('utilities.templatetags.builtins.tags.static') as mock_static: + mock_static.return_value = 'https://s3.example.com/netbox/static/test.js' + + result = static_with_params('test.js', v='1.0.0') + + self.assertEqual(result, 'https://s3.example.com/netbox/static/test.js?v=1.0.0') + class BadgeTestCase(TestCase): """ From db859c11b71aa622ffb76262e124ebdcdb0bc66a Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Thu, 27 Aug 2026 11:01:08 -0400 Subject: [PATCH 04/23] Defer debug log formatting in static_with_params() Co-Authored-By: Claude Opus 5 --- netbox/utilities/templatetags/builtins/tags.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/netbox/utilities/templatetags/builtins/tags.py b/netbox/utilities/templatetags/builtins/tags.py index 7186607dc..f8763c8b2 100644 --- a/netbox/utilities/templatetags/builtins/tags.py +++ b/netbox/utilities/templatetags/builtins/tags.py @@ -197,8 +197,8 @@ def static_with_params(path, **params): # the signature and the request would be rejected by the storage backend. if signature_params := [p for p in existing_params if p.lower() in SIGNED_URL_PARAMS]: logger.debug( - f"Static URL '{static_url}' is signed ({', '.join(signature_params)}); " - f"omitting parameters {tuple(params)}" + "Static URL '%s' is signed (%s); omitting parameters %s", + static_url, ', '.join(signature_params), tuple(params) ) return static_url From f657bcb78a9862c0e20196e696dcadb77114d71f Mon Sep 17 00:00:00 2001 From: Martin Hauser Date: Thu, 27 Aug 2026 22:36:05 +0200 Subject: [PATCH 05/23] Fixes #23043: Correct Front Port position validation for bulk creation (#23055) --- docs/models/dcim/frontport.md | 8 +- netbox/dcim/forms/mixins.py | 23 ++++-- netbox/dcim/forms/object_create.py | 26 +++--- netbox/dcim/tests/test_forms.py | 125 +++++++++++++++++++++++++++++ netbox/dcim/tests/test_views.py | 37 +++++++++ 5 files changed, 197 insertions(+), 22 deletions(-) diff --git a/docs/models/dcim/frontport.md b/docs/models/dcim/frontport.md index 7ea617250..ed1172dcf 100644 --- a/docs/models/dcim/frontport.md +++ b/docs/models/dcim/frontport.md @@ -1,6 +1,6 @@ # Front Ports -Front ports are pass-through ports which represent physical cable connections that comprise part of a longer path. For example, the ports on the front face of a UTP patch panel would be modeled in NetBox as front ports. Each port is assigned a physical type, and must be mapped to a specific [rear port](./rearport.md) on the same device. A single rear port may be mapped to multiple front ports, using numeric positions to annotate the specific alignment of each. +Front ports are pass-through ports which represent physical cable connections that comprise part of a longer path. For example, the ports on the front face of a UTP patch panel would be modeled in NetBox as front ports. Each port is assigned a physical type, and must be mapped to one or more [rear port](./rearport.md) positions on the same device. A single rear port may be mapped to multiple front ports, using numeric positions to annotate the specific alignment of each. !!! tip Like most device components, front ports are instantiated automatically from [front port templates](./frontporttemplate.md) assigned to the selected device type when a device is created. @@ -27,12 +27,16 @@ An alternative physical label identifying the port. The port's termination type. +### Positions + +The number of [rear port](./rearport.md) positions to which this front port maps. For a front port which passes through to a single rear port position, set this to `1`. + ### Rear Ports The rear port and position to which this front port maps. !!! tip - When creating multiple front ports using a patterned name (e.g. `Port [1-12]`), you may select the equivalent number of rear port-position mappings from the list. + When creating multiple front ports using a patterned name (e.g. `Port [1-12]`), select one rear port-position mapping for every position of every front port being created. For example, 12 front ports with two positions each requires 24 mappings, which are assigned to the generated ports in order. ### Color diff --git a/netbox/dcim/forms/mixins.py b/netbox/dcim/forms/mixins.py index 6e0e82846..2b204c08c 100644 --- a/netbox/dcim/forms/mixins.py +++ b/netbox/dcim/forms/mixins.py @@ -183,19 +183,26 @@ class FrontPortFormMixin(forms.Form): def clean(self): super().clean() - # Check that the total number of FrontPorts and positions matches the selected number of RearPort:position - # mappings. Note that `name` will be a list under FrontPortCreateForm, in which cases we multiply the number of - # FrontPorts being creation by the number of positions. - positions = self.cleaned_data['positions'] - frontport_count = len(self.cleaned_data['name']) if type(self.cleaned_data['name']) is list else 1 - rearport_count = len(self.cleaned_data['rear_ports']) - if frontport_count * positions != rearport_count: + # All three are required fields, so bail out if any of them failed its own validation + positions = self.cleaned_data.get('positions') + name = self.cleaned_data.get('name') + rear_ports = self.cleaned_data.get('rear_ports') + if not (positions and name and rear_ports): + return + + # `name` is a list under FrontPortCreateForm, and each generated FrontPort consumes `positions` mappings + frontport_count = len(name) if isinstance(name, list) else 1 + frontport_position_count = frontport_count * positions + rearport_count = len(rear_ports) + + # {frontport_count} receives the position total. Its name is unchanged to keep existing translations valid. + if frontport_position_count != rearport_count: raise forms.ValidationError({ 'rear_ports': _( "The total number of front port positions ({frontport_count}) must match the selected number of " "rear port positions ({rearport_count})." ).format( - frontport_count=frontport_count, + frontport_count=frontport_position_count, rearport_count=rearport_count ) }) diff --git a/netbox/dcim/forms/object_create.py b/netbox/dcim/forms/object_create.py index a367d55b3..634fdae08 100644 --- a/netbox/dcim/forms/object_create.py +++ b/netbox/dcim/forms/object_create.py @@ -62,18 +62,20 @@ class ComponentCreateForm(forms.Form): return pattern_count = len(patterns) for field_name in self.replication_fields: - value_count = len(self.cleaned_data[field_name]) - if self.cleaned_data[field_name]: - if value_count == 1: - # If the field resolves to a single value (because no pattern was used), multiply it by the number - # of expected values. This allows us to reuse the same label when creating multiple components. - self.cleaned_data[field_name] = self.cleaned_data[field_name] * pattern_count - elif value_count != pattern_count: - raise forms.ValidationError({ - field_name: _( - "The provided pattern specifies {value_count} values, but {pattern_count} are expected." - ).format(value_count=value_count, pattern_count=pattern_count) - }, code='label_pattern_mismatch') + # A field is absent from cleaned_data if it failed its own validation, e.g. an inverted numeric range + if not (values := self.cleaned_data.get(field_name)): + continue + value_count = len(values) + if value_count == 1: + # If the field resolves to a single value (because no pattern was used), multiply it by the number + # of expected values. This allows us to reuse the same label when creating multiple components. + self.cleaned_data[field_name] = values * pattern_count + elif value_count != pattern_count: + raise forms.ValidationError({ + field_name: _( + "The provided pattern specifies {value_count} values, but {pattern_count} are expected." + ).format(value_count=value_count, pattern_count=pattern_count) + }, code='label_pattern_mismatch') # diff --git a/netbox/dcim/tests/test_forms.py b/netbox/dcim/tests/test_forms.py index 7bf03075e..4177de4cf 100644 --- a/netbox/dcim/tests/test_forms.py +++ b/netbox/dcim/tests/test_forms.py @@ -319,6 +319,13 @@ class FrontPortTestCase(TestCase): RearPort(name='RearPort4', device=cls.device, type=PortTypeChoices.TYPE_8P8C), ) RearPort.objects.bulk_create(cls.rear_ports) + cls.rear_port_templates = ( + RearPortTemplate(name='RearPort1', device_type=cls.device.device_type, type=PortTypeChoices.TYPE_8P8C), + RearPortTemplate(name='RearPort2', device_type=cls.device.device_type, type=PortTypeChoices.TYPE_8P8C), + RearPortTemplate(name='RearPort3', device_type=cls.device.device_type, type=PortTypeChoices.TYPE_8P8C), + RearPortTemplate(name='RearPort4', device_type=cls.device.device_type, type=PortTypeChoices.TYPE_8P8C), + ) + RearPortTemplate.objects.bulk_create(cls.rear_port_templates) def test_front_port_label_count_valid(self): """ @@ -353,6 +360,124 @@ class FrontPortTestCase(TestCase): self.assertFalse(form.is_valid()) self.assertIn('label', form.errors) + def test_front_port_position_count_valid(self): + """ + Test that generating front ports with multiple positions each passes form validation. + """ + front_port_data = { + 'device': self.device.pk, + 'name': 'FrontPort[1-2]', + 'type': PortTypeChoices.TYPE_8P8C, + 'positions': 2, + 'rear_ports': [f'{rear_port.pk}:1' for rear_port in self.rear_ports], + } + form = FrontPortCreateForm(front_port_data) + + self.assertTrue(form.is_valid(), form.errors) + + def test_front_port_position_count_mismatch(self): + """ + Check that the mismatch error reports the total number of front port positions, not the port count. + """ + bad_front_port_data = { + 'device': self.device.pk, + 'name': 'FrontPort[1-2]', + 'type': PortTypeChoices.TYPE_8P8C, + 'positions': 2, + 'rear_ports': [f'{rear_port.pk}:1' for rear_port in self.rear_ports[:2]], + } + form = FrontPortCreateForm(bad_front_port_data) + + self.assertFalse(form.is_valid()) + self.assertIn( + 'The total number of front port positions (4) must match the selected number of rear port ' + 'positions (2).', + form.errors['rear_ports'] + ) + + def test_front_port_template_position_count_mismatch(self): + """ + Check that the front port template form reports the same corrected position total. + """ + bad_front_port_template_data = { + 'device_type': self.device.device_type.pk, + 'name': 'FrontPort[1-2]', + 'type': PortTypeChoices.TYPE_8P8C, + 'positions': 2, + 'rear_ports': [f'{rear_port_template.pk}:1' for rear_port_template in self.rear_port_templates[:2]], + } + form = FrontPortTemplateCreateForm(bad_front_port_template_data) + + self.assertFalse(form.is_valid()) + self.assertIn( + 'The total number of front port positions (4) must match the selected number of rear port ' + 'positions (2).', + form.errors['rear_ports'] + ) + + def test_front_port_missing_rear_ports(self): + """ + Check that omitting the rear port selection reports a field error rather than raising an exception. + """ + bad_front_port_data = { + 'device': self.device.pk, + 'name': 'FrontPort[1-2]', + 'type': PortTypeChoices.TYPE_8P8C, + 'positions': 1, + } + form = FrontPortCreateForm(bad_front_port_data) + + self.assertFalse(form.is_valid()) + self.assertIn('rear_ports', form.errors) + + def test_front_port_invalid_positions(self): + """ + Check that a non-numeric position count reports a field error rather than raising an exception. + """ + bad_front_port_data = { + 'device': self.device.pk, + 'name': 'FrontPort[1-2]', + 'type': PortTypeChoices.TYPE_8P8C, + 'positions': 'two', + 'rear_ports': [f'{rear_port.pk}:1' for rear_port in self.rear_ports[:2]], + } + form = FrontPortCreateForm(bad_front_port_data) + + self.assertFalse(form.is_valid()) + self.assertIn('positions', form.errors) + + def test_front_port_template_missing_rear_ports(self): + """ + Check that the front port template form also reports a field error rather than raising an exception. + """ + bad_front_port_template_data = { + 'device_type': self.device.device_type.pk, + 'name': 'FrontPort[1-2]', + 'type': PortTypeChoices.TYPE_8P8C, + 'positions': 1, + } + form = FrontPortTemplateCreateForm(bad_front_port_template_data) + + self.assertFalse(form.is_valid()) + self.assertIn('rear_ports', form.errors) + + def test_front_port_invalid_label_range(self): + """ + Check that an inverted label range reports a field error rather than raising an exception. + """ + bad_front_port_data = { + 'device': self.device.pk, + 'name': 'FrontPort[1-2]', + 'label': 'Port[2-1]', + 'type': PortTypeChoices.TYPE_8P8C, + 'positions': 1, + 'rear_ports': [f'{rear_port.pk}:1' for rear_port in self.rear_ports[:2]], + } + form = FrontPortCreateForm(bad_front_port_data) + + self.assertFalse(form.is_valid()) + self.assertIn('label', form.errors) + class InterfaceTestCase(TestCase): diff --git a/netbox/dcim/tests/test_views.py b/netbox/dcim/tests/test_views.py index 244f61f9f..87a0d3f66 100644 --- a/netbox/dcim/tests/test_views.py +++ b/netbox/dcim/tests/test_views.py @@ -3658,6 +3658,43 @@ class FrontPortTestCase(ViewTestCases.DeviceComponentViewTestCase): self.assertEqual(response.status_code, 200) self.assertFalse(FrontPort.objects.filter(name='Front Port 10').exists()) + def test_create_multiple_objects_with_multiple_positions(self): + """ + Check that bulk creation gives each generated front port its own slice of the selected mappings. + """ + device = Device.objects.get(name='Device 1') + rear_ports = ( + RearPort(device=device, name='Rear Port 7', positions=2), + RearPort(device=device, name='Rear Port 8', positions=2), + ) + RearPort.objects.bulk_create(rear_ports) + self.add_permissions('dcim.add_frontport') + + response = self.client.post(self._get_url('add'), post_data({ + 'device': device.pk, + 'name': 'Multi Port [1-2]', + 'type': PortTypeChoices.TYPE_8P8C, + 'positions': 2, + 'rear_ports': [ + f'{rear_ports[0].pk}:1', + f'{rear_ports[0].pk}:2', + f'{rear_ports[1].pk}:1', + f'{rear_ports[1].pk}:2', + ], + })) + + self.assertHttpStatus(response, 302) + for front_port_name, rear_port in (('Multi Port 1', rear_ports[0]), ('Multi Port 2', rear_ports[1])): + front_port = FrontPort.objects.get(device=device, name=front_port_name) + self.assertEqual(front_port.positions, 2) + self.assertEqual( + [ + (m.front_port_position, m.rear_port_id, m.rear_port_position) + for m in front_port.mappings.order_by('front_port_position') + ], + [(1, rear_port.pk, 1), (2, rear_port.pk, 2)] + ) + def test_trace(self): self.add_permissions( 'dcim.view_frontport', From dbaafd132fb9150c411bd84786437461130ed194 Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 28 Aug 2026 07:31:39 +0000 Subject: [PATCH 06/23] Update source translation strings --- netbox/translations/en/LC_MESSAGES/django.po | 40 ++++++++++---------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/netbox/translations/en/LC_MESSAGES/django.po b/netbox/translations/en/LC_MESSAGES/django.po index b91d6fee7..cc5032ee4 100644 --- a/netbox/translations/en/LC_MESSAGES/django.po +++ b/netbox/translations/en/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-08-26 05:09+0000\n" +"POT-Creation-Date: 2026-08-28 07:31+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -183,7 +183,7 @@ msgstr "" #: netbox/dcim/forms/filtersets.py:2136 netbox/dcim/forms/filtersets.py:2160 #: netbox/dcim/forms/model_forms.py:168 netbox/dcim/forms/model_forms.py:211 #: netbox/dcim/forms/model_forms.py:294 netbox/dcim/forms/model_forms.py:615 -#: netbox/dcim/forms/model_forms.py:901 netbox/dcim/forms/object_create.py:294 +#: netbox/dcim/forms/model_forms.py:901 netbox/dcim/forms/object_create.py:296 #: netbox/dcim/tables/devices.py:157 netbox/dcim/tables/power.py:26 #: netbox/dcim/tables/power.py:90 netbox/dcim/tables/racks.py:135 #: netbox/dcim/tables/racks.py:222 netbox/dcim/tables/sites.py:102 @@ -1144,7 +1144,7 @@ msgstr "" #: netbox/dcim/forms/filtersets.py:1227 netbox/dcim/forms/filtersets.py:1322 #: netbox/dcim/forms/filtersets.py:1362 netbox/dcim/forms/filtersets.py:2104 #: netbox/dcim/forms/filtersets.py:2128 netbox/dcim/forms/filtersets.py:2152 -#: netbox/dcim/forms/model_forms.py:131 netbox/dcim/forms/object_create.py:278 +#: netbox/dcim/forms/model_forms.py:131 netbox/dcim/forms/object_create.py:280 #: netbox/dcim/tables/devices.py:147 netbox/dcim/tables/sites.py:65 #: netbox/extras/filtersets.py:712 netbox/ipam/forms/bulk_edit.py:409 #: netbox/ipam/forms/filtersets.py:246 netbox/ipam/forms/filtersets.py:477 @@ -1164,7 +1164,7 @@ msgstr "" #: netbox/dcim/forms/filtersets.py:395 netbox/dcim/forms/filtersets.py:491 #: netbox/dcim/forms/filtersets.py:886 netbox/dcim/forms/filtersets.py:1108 #: netbox/dcim/forms/filtersets.py:1189 netbox/dcim/forms/filtersets.py:1327 -#: netbox/dcim/forms/filtersets.py:1367 netbox/dcim/forms/object_create.py:286 +#: netbox/dcim/forms/filtersets.py:1367 netbox/dcim/forms/object_create.py:288 #: netbox/extras/filtersets.py:729 netbox/ipam/forms/bulk_edit.py:414 #: netbox/ipam/forms/filtersets.py:171 netbox/ipam/forms/filtersets.py:251 #: netbox/ipam/forms/filtersets.py:482 netbox/ipam/forms/filtersets.py:585 @@ -1708,7 +1708,7 @@ msgstr "" #: netbox/dcim/forms/filtersets.py:2168 netbox/dcim/forms/model_forms.py:794 #: netbox/dcim/forms/model_forms.py:1025 netbox/dcim/forms/model_forms.py:1439 #: netbox/dcim/forms/model_forms.py:1933 netbox/dcim/forms/model_forms.py:2006 -#: netbox/dcim/forms/object_create.py:207 netbox/dcim/tables/connections.py:23 +#: netbox/dcim/forms/object_create.py:209 netbox/dcim/tables/connections.py:23 #: netbox/dcim/tables/connections.py:42 netbox/dcim/tables/connections.py:61 #: netbox/dcim/tables/devices.py:293 netbox/dcim/tables/devices.py:399 #: netbox/dcim/tables/devices.py:440 netbox/dcim/tables/devices.py:482 @@ -3940,7 +3940,7 @@ msgid "Virtual Chassis (ID)" msgstr "" #: netbox/dcim/filtersets.py:1876 netbox/dcim/forms/filtersets.py:130 -#: netbox/dcim/forms/object_create.py:329 netbox/dcim/tables/devices.py:215 +#: netbox/dcim/forms/object_create.py:331 netbox/dcim/tables/devices.py:215 #: netbox/netbox/navigation/menu.py:88 #: netbox/templates/dcim/device_edit.html:95 #: netbox/templates/dcim/virtualchassis_edit.html:28 @@ -4210,8 +4210,8 @@ msgstr "" #: netbox/dcim/forms/bulk_create.py:120 netbox/dcim/forms/bulk_edit.py:1255 #: netbox/dcim/forms/filtersets.py:1909 netbox/dcim/forms/filtersets.py:1928 #: netbox/dcim/forms/model_forms.py:640 netbox/dcim/forms/model_forms.py:707 -#: netbox/dcim/forms/object_create.py:155 -#: netbox/dcim/forms/object_create.py:256 netbox/dcim/tables/devices.py:169 +#: netbox/dcim/forms/object_create.py:157 +#: netbox/dcim/forms/object_create.py:258 netbox/dcim/tables/devices.py:169 #: netbox/templates/dcim/panels/front_port_mappings.html:9 #: netbox/templates/dcim/panels/rear_port_mappings.html:9 #: netbox/templates/dcim/panels/virtual_chassis_members.html:9 @@ -4413,7 +4413,7 @@ msgstr "" #: netbox/dcim/forms/filtersets.py:1249 netbox/dcim/forms/filtersets.py:1393 #: netbox/dcim/forms/model_forms.py:327 netbox/dcim/forms/model_forms.py:371 #: netbox/dcim/forms/model_forms.py:631 netbox/dcim/forms/model_forms.py:933 -#: netbox/dcim/forms/object_create.py:303 netbox/dcim/tables/devices.py:165 +#: netbox/dcim/forms/object_create.py:305 netbox/dcim/tables/devices.py:165 #: netbox/dcim/tables/power.py:67 netbox/dcim/tables/racks.py:237 #: netbox/ipam/forms/filtersets.py:502 #: netbox/templates/dcim/inc/cable_termination.html:16 @@ -4459,7 +4459,7 @@ msgstr "" #: netbox/dcim/forms/model_forms.py:1084 netbox/dcim/forms/model_forms.py:1128 #: netbox/dcim/forms/model_forms.py:1155 netbox/dcim/forms/model_forms.py:1183 #: netbox/dcim/forms/model_forms.py:1204 netbox/dcim/forms/model_forms.py:1244 -#: netbox/dcim/forms/model_forms.py:1262 netbox/dcim/forms/object_create.py:119 +#: netbox/dcim/forms/model_forms.py:1262 netbox/dcim/forms/object_create.py:121 #: netbox/dcim/tables/devicetypes.py:84 netbox/dcim/ui/panels.py:128 msgid "Device Type" msgstr "" @@ -4488,7 +4488,7 @@ msgstr "" #: netbox/dcim/forms/model_forms.py:1129 netbox/dcim/forms/model_forms.py:1156 #: netbox/dcim/forms/model_forms.py:1184 netbox/dcim/forms/model_forms.py:1205 #: netbox/dcim/forms/model_forms.py:1245 netbox/dcim/forms/model_forms.py:1263 -#: netbox/dcim/forms/object_create.py:120 netbox/dcim/tables/modules.py:52 +#: netbox/dcim/forms/object_create.py:122 netbox/dcim/tables/modules.py:52 #: netbox/dcim/tables/modules.py:102 netbox/dcim/views.py:2964 msgid "Module Type" msgstr "" @@ -5707,7 +5707,7 @@ msgstr "" msgid "Rear ports" msgstr "" -#: netbox/dcim/forms/mixins.py:195 +#: netbox/dcim/forms/mixins.py:202 #, python-brace-format msgid "" "The total number of front port positions ({frontport_count}) must match the " @@ -5938,42 +5938,42 @@ msgstr "" msgid "A MAC address can only be assigned to a single object." msgstr "" -#: netbox/dcim/forms/object_create.py:50 netbox/dcim/forms/object_create.py:157 -#: netbox/dcim/forms/object_create.py:258 +#: netbox/dcim/forms/object_create.py:50 netbox/dcim/forms/object_create.py:159 +#: netbox/dcim/forms/object_create.py:260 msgid "" "Alphanumeric ranges are supported. (Must match the number of objects being " "created.)" msgstr "" -#: netbox/dcim/forms/object_create.py:74 +#: netbox/dcim/forms/object_create.py:76 #, python-brace-format msgid "" "The provided pattern specifies {value_count} values, but {pattern_count} are " "expected." msgstr "" -#: netbox/dcim/forms/object_create.py:312 netbox/dcim/tables/devices.py:1160 +#: netbox/dcim/forms/object_create.py:314 netbox/dcim/tables/devices.py:1160 #: netbox/ipam/tables/fhrp.py:31 netbox/ipam/ui/panels.py:185 #: netbox/ipam/views.py:1594 netbox/templates/dcim/virtualchassis_edit.html:59 #: netbox/users/views.py:375 msgid "Members" msgstr "" -#: netbox/dcim/forms/object_create.py:322 +#: netbox/dcim/forms/object_create.py:324 msgid "Initial position" msgstr "" -#: netbox/dcim/forms/object_create.py:325 +#: netbox/dcim/forms/object_create.py:327 msgid "" "Position of the first member device. Increases by one for each additional " "member." msgstr "" -#: netbox/dcim/forms/object_create.py:330 +#: netbox/dcim/forms/object_create.py:332 msgid "Member Devices" msgstr "" -#: netbox/dcim/forms/object_create.py:345 +#: netbox/dcim/forms/object_create.py:347 msgid "A position must be specified for the first VC member." msgstr "" From 6437626d6dd458fc0fe32f3cbd26a8a2342df6dc Mon Sep 17 00:00:00 2001 From: Martin Hauser Date: Thu, 27 Aug 2026 15:46:51 +0200 Subject: [PATCH 07/23] fix(ipam): Support multiple values for VLANGroup scope filters Replace NumberFilter with MultiValueNumberFilter for VLANGroup scope filters (Region, Site Group, Site, Location, Rack Group, Rack, Cluster Group, Cluster). Update filter_scope method to use `__in` lookup and add comprehensive test coverage for multi-value filtering. Fixes #22671 --- netbox/ipam/filtersets.py | 18 ++--- netbox/ipam/tests/test_filtersets.py | 100 ++++++++++++++++++++++++--- 2 files changed, 101 insertions(+), 17 deletions(-) diff --git a/netbox/ipam/filtersets.py b/netbox/ipam/filtersets.py index 97abd274a..9f190d023 100644 --- a/netbox/ipam/filtersets.py +++ b/netbox/ipam/filtersets.py @@ -946,28 +946,28 @@ class FHRPGroupAssignmentFilterSet(ChangeLoggedModelFilterSet): @register_filterset class VLANGroupFilterSet(OrganizationalModelFilterSet, TenancyFilterSet): scope_type = MultiValueContentTypeFilter() - region = django_filters.NumberFilter( + region = MultiValueNumberFilter( method='filter_scope' ) - site_group = django_filters.NumberFilter( + site_group = MultiValueNumberFilter( method='filter_scope' ) - site = django_filters.NumberFilter( + site = MultiValueNumberFilter( method='filter_scope' ) - location = django_filters.NumberFilter( + location = MultiValueNumberFilter( method='filter_scope' ) - rack_group = django_filters.NumberFilter( + rack_group = MultiValueNumberFilter( method='filter_scope' ) - rack = django_filters.NumberFilter( + rack = MultiValueNumberFilter( method='filter_scope' ) - cluster_group = django_filters.NumberFilter( + cluster_group = MultiValueNumberFilter( method='filter_scope' ) - cluster = django_filters.NumberFilter( + cluster = MultiValueNumberFilter( method='filter_scope' ) contains_vid = django_filters.NumberFilter( @@ -992,7 +992,7 @@ class VLANGroupFilterSet(OrganizationalModelFilterSet, TenancyFilterSet): model_name = name.replace('_', '') return queryset.filter( scope_type=ContentType.objects.get(model=model_name), - scope_id=value + scope_id__in=value ) diff --git a/netbox/ipam/tests/test_filtersets.py b/netbox/ipam/tests/test_filtersets.py index 7b1fa8339..7c3fb14f3 100644 --- a/netbox/ipam/tests/test_filtersets.py +++ b/netbox/ipam/tests/test_filtersets.py @@ -5,7 +5,19 @@ from netaddr import IPNetwork from circuits.models import Provider from dcim.choices import InterfaceModeChoices, InterfaceTypeChoices -from dcim.models import Device, DeviceRole, DeviceType, Interface, Location, Manufacturer, Rack, Region, Site, SiteGroup +from dcim.models import ( + Device, + DeviceRole, + DeviceType, + Interface, + Location, + Manufacturer, + Rack, + RackGroup, + Region, + Site, + SiteGroup, +) from ipam.choices import * from ipam.filtersets import * from ipam.models import * @@ -1779,32 +1791,104 @@ class VLANGroupTestCase(TestCase, ChangeLoggedFilterSetTests): self.assertEqual(self.filterset(params, self.queryset).qs.count(), 1) def test_region(self): - params = {'region': Region.objects.first().pk} + regions = ( + Region.objects.get(slug='region-1'), + Region.objects.create(name='Region 2', slug='region-2'), + ) + VLANGroup.objects.create(name='VLAN Group 9', slug='vlan-group-9', scope=regions[1]) + + params = {'region': [regions[0].pk]} self.assertEqual(self.filterset(params, self.queryset).qs.count(), 1) + params = {'region': [regions[0].pk, regions[1].pk]} + self.assertEqual(self.filterset(params, self.queryset).qs.count(), 2) def test_site_group(self): - params = {'site_group': SiteGroup.objects.first().pk} + site_groups = ( + SiteGroup.objects.get(slug='site-group-1'), + SiteGroup.objects.create(name='Site Group 2', slug='site-group-2'), + ) + VLANGroup.objects.create(name='VLAN Group 9', slug='vlan-group-9', scope=site_groups[1]) + + params = {'site_group': [site_groups[0].pk]} self.assertEqual(self.filterset(params, self.queryset).qs.count(), 1) + params = {'site_group': [site_groups[0].pk, site_groups[1].pk]} + self.assertEqual(self.filterset(params, self.queryset).qs.count(), 2) def test_site(self): - params = {'site': Site.objects.first().pk} + sites = ( + Site.objects.get(slug='site-1'), + Site.objects.create(name='Site 2', slug='site-2'), + ) + VLANGroup.objects.create(name='VLAN Group 9', slug='vlan-group-9', scope=sites[1]) + + params = {'site': [sites[0].pk]} self.assertEqual(self.filterset(params, self.queryset).qs.count(), 1) + params = {'site': [sites[0].pk, sites[1].pk]} + self.assertEqual(self.filterset(params, self.queryset).qs.count(), 2) def test_location(self): - params = {'location': Location.objects.first().pk} + site = Site.objects.get(slug='site-1') + locations = ( + Location.objects.get(slug='location-1'), + Location.objects.create(name='Location 2', slug='location-2', site=site), + ) + VLANGroup.objects.create(name='VLAN Group 9', slug='vlan-group-9', scope=locations[1]) + + params = {'location': [locations[0].pk]} self.assertEqual(self.filterset(params, self.queryset).qs.count(), 1) + params = {'location': [locations[0].pk, locations[1].pk]} + self.assertEqual(self.filterset(params, self.queryset).qs.count(), 2) + + def test_rack_group(self): + rack_groups = ( + RackGroup.objects.create(name='Rack Group 1', slug='rack-group-1'), + RackGroup.objects.create(name='Rack Group 2', slug='rack-group-2'), + ) + VLANGroup.objects.create(name='VLAN Group 9', slug='vlan-group-9', scope=rack_groups[0]) + VLANGroup.objects.create(name='VLAN Group 10', slug='vlan-group-10', scope=rack_groups[1]) + + params = {'rack_group': [rack_groups[0].pk]} + self.assertEqual(self.filterset(params, self.queryset).qs.count(), 1) + params = {'rack_group': [rack_groups[0].pk, rack_groups[1].pk]} + self.assertEqual(self.filterset(params, self.queryset).qs.count(), 2) def test_rack(self): - params = {'rack': Rack.objects.first().pk} + site = Site.objects.get(slug='site-1') + racks = ( + Rack.objects.get(name='Rack 1'), + Rack.objects.create(name='Rack 2', site=site), + ) + VLANGroup.objects.create(name='VLAN Group 9', slug='vlan-group-9', scope=racks[1]) + + params = {'rack': [racks[0].pk]} self.assertEqual(self.filterset(params, self.queryset).qs.count(), 1) + params = {'rack': [racks[0].pk, racks[1].pk]} + self.assertEqual(self.filterset(params, self.queryset).qs.count(), 2) def test_cluster_group(self): - params = {'cluster_group': ClusterGroup.objects.first().pk} + cluster_groups = ( + ClusterGroup.objects.get(slug='cluster-group-1'), + ClusterGroup.objects.create(name='Cluster Group 2', slug='cluster-group-2'), + ) + VLANGroup.objects.create(name='VLAN Group 9', slug='vlan-group-9', scope=cluster_groups[1]) + + params = {'cluster_group': [cluster_groups[0].pk]} self.assertEqual(self.filterset(params, self.queryset).qs.count(), 1) + params = {'cluster_group': [cluster_groups[0].pk, cluster_groups[1].pk]} + self.assertEqual(self.filterset(params, self.queryset).qs.count(), 2) def test_cluster(self): - params = {'cluster': Cluster.objects.first().pk} + cluster_type = ClusterType.objects.get(slug='cluster-type-1') + clusters = ( + Cluster.objects.get(name='Cluster 1'), + Cluster.objects.create(name='Cluster 2', type=cluster_type), + ) + VLANGroup.objects.create(name='VLAN Group 9', slug='vlan-group-9', scope=clusters[1]) + + params = {'cluster': [clusters[0].pk]} self.assertEqual(self.filterset(params, self.queryset).qs.count(), 1) + params = {'cluster': [clusters[0].pk, clusters[1].pk]} + self.assertEqual(self.filterset(params, self.queryset).qs.count(), 2) def test_tenant(self): tenants = Tenant.objects.all()[:2] From 88f90dc8cae12b315b1cd9bc43172775746d5574 Mon Sep 17 00:00:00 2001 From: Martin Hauser Date: Thu, 27 Aug 2026 22:02:41 +0200 Subject: [PATCH 08/23] fix(forms): Fix owner field placement in PowerOutlet and Service forms Move owner field from fieldsets to Meta.fields in PowerOutletForm and add it to ServiceCreateForm Meta.fields. Ensures owner field appears in forms and can be properly saved. Adds test coverage with Owner creation. Fixes #23052 --- netbox/dcim/forms/model_forms.py | 4 ++-- netbox/dcim/tests/test_views.py | 6 +++++- netbox/ipam/forms/model_forms.py | 2 +- netbox/ipam/tests/test_views.py | 5 ++++- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/netbox/dcim/forms/model_forms.py b/netbox/dcim/forms/model_forms.py index 7745deb60..8ab3091fa 100644 --- a/netbox/dcim/forms/model_forms.py +++ b/netbox/dcim/forms/model_forms.py @@ -1517,7 +1517,7 @@ class PowerOutletForm(ModularDeviceComponentForm): fieldsets = ( FieldSet( 'device', 'module', 'name', 'label', 'type', 'status', 'color', 'power_port', 'feed_leg', 'mark_connected', - 'description', 'owner', 'tags', + 'description', 'tags', ), ) @@ -1525,7 +1525,7 @@ class PowerOutletForm(ModularDeviceComponentForm): model = PowerOutlet fields = [ 'device', 'module', 'name', 'label', 'type', 'status', 'color', 'power_port', 'feed_leg', 'mark_connected', - 'description', 'tags', + 'description', 'owner', 'tags', ] diff --git a/netbox/dcim/tests/test_views.py b/netbox/dcim/tests/test_views.py index 87a0d3f66..076c10346 100644 --- a/netbox/dcim/tests/test_views.py +++ b/netbox/dcim/tests/test_views.py @@ -20,7 +20,7 @@ from extras.models import ConfigContext, ConfigTemplate from ipam.models import ASN, RIR, VLAN, VRF from netbox.choices import CSVDelimiterChoices, ImportFormatChoices, WeightUnitChoices from tenancy.models import Tenant -from users.models import ObjectPermission, User +from users.models import ObjectPermission, Owner, User from utilities.testing import ViewTestCases, create_tags, create_test_device, post_data from wireless.models import WirelessLAN @@ -3240,6 +3240,8 @@ class PowerOutletTestCase(ViewTestCases.DeviceComponentViewTestCase): ) PowerOutlet.objects.bulk_create(power_outlets) + owner = Owner.objects.create(name='Owner 1') + tags = create_tags('Alpha', 'Bravo', 'Charlie') cls.form_data = { @@ -3250,6 +3252,7 @@ class PowerOutletTestCase(ViewTestCases.DeviceComponentViewTestCase): 'power_port': powerports[1].pk, 'feed_leg': PowerOutletFeedLegChoices.FEED_LEG_B, 'description': 'A power outlet', + 'owner': owner.pk, 'tags': [t.pk for t in tags], } @@ -3261,6 +3264,7 @@ class PowerOutletTestCase(ViewTestCases.DeviceComponentViewTestCase): 'power_port': powerports[1].pk, 'feed_leg': PowerOutletFeedLegChoices.FEED_LEG_B, 'description': 'A power outlet', + 'owner': owner.pk, 'tags': [t.pk for t in tags], } diff --git a/netbox/ipam/forms/model_forms.py b/netbox/ipam/forms/model_forms.py index f6f4a17b9..1b223ccdc 100644 --- a/netbox/ipam/forms/model_forms.py +++ b/netbox/ipam/forms/model_forms.py @@ -910,7 +910,7 @@ class ServiceCreateForm(ServiceForm): class Meta(ServiceForm.Meta): fields = [ - 'service_template', 'name', 'protocol', 'ports', 'ipaddresses', 'description', + 'service_template', 'name', 'protocol', 'ports', 'ipaddresses', 'description', 'owner', 'comments', 'tags', 'parent_object_type', ] diff --git a/netbox/ipam/tests/test_views.py b/netbox/ipam/tests/test_views.py index 90b863d32..efb2a405d 100644 --- a/netbox/ipam/tests/test_views.py +++ b/netbox/ipam/tests/test_views.py @@ -20,7 +20,7 @@ from ipam.utils import AvailableIPSpace from ipam.views import AggregatePrefixesView, PrefixPrefixesView from netbox.choices import CSVDelimiterChoices, ImportFormatChoices from tenancy.models import Tenant -from users.models import Group, ObjectPermission +from users.models import Group, ObjectPermission, Owner from utilities.testing import ViewTestCases, create_tags @@ -2561,6 +2561,8 @@ class ServiceTestCase(ViewTestCases.PrimaryObjectViewTestCase): ) IPAddress.objects.bulk_create(ip_addresses) + owner = Owner.objects.create(name='Owner 1') + tags = create_tags('Alpha', 'Bravo', 'Charlie') cls.form_data = { @@ -2571,6 +2573,7 @@ class ServiceTestCase(ViewTestCases.PrimaryObjectViewTestCase): 'ports': '104,105', 'ipaddresses': [], 'description': 'A new service', + 'owner': owner.pk, 'tags': [t.pk for t in tags], } From fe194e700396e8064149a21bd96e3821c71c18e5 Mon Sep 17 00:00:00 2001 From: Martin Hauser Date: Fri, 28 Aug 2026 16:03:43 +0200 Subject: [PATCH 09/23] fix(ui): Reconcile sidebar state when crossing the responsive breakpoint SideNav classified the viewport only during construction. Resizing past the `lg` breakpoint therefore left the desktop sidebar in its previous mobile state, and the menu group containing the current page remained collapsed until the pointer entered the sidebar. Use the existing desktop media query as an event source. Apply the persisted pin preference directly to the body attributes during initialization and on each breakpoint transition, then reinitialize the active menu section. Avoid calling `pin()` or `unpin()` during responsive transitions so Bootstrap retains ownership of its collapse state and the stored preference is not rewritten unnecessarily. Also remove the `show` class from a menu group toggle when collapsing its section to keep the toggle and menu state synchronized. Fixes #23035 --- netbox/project-static/dist/netbox.js | 2 +- netbox/project-static/dist/netbox.js.map | 6 ++--- netbox/project-static/src/sidenav.ts | 34 +++++++++++++++++------- 3 files changed, 28 insertions(+), 14 deletions(-) diff --git a/netbox/project-static/dist/netbox.js b/netbox/project-static/dist/netbox.js index 7eebe7cd6..92c036fcc 100644 --- a/netbox/project-static/dist/netbox.js +++ b/netbox/project-static/dist/netbox.js @@ -3,7 +3,7 @@ `+h.join("")+` - `}}function q(){t.calendarContainer.classList.add("hasWeeks");var f=te("div","flatpickr-weekwrapper");f.appendChild(te("span","flatpickr-weekday",t.l10n.weekAbbreviation));var h=te("div","flatpickr-weeks");return f.appendChild(h),{weekWrapper:f,weekNumbers:h}}function M(f,h){h===void 0&&(h=!0);var v=h?f:f-t.currentMonth;v<0&&t._hidePrevMonthArrow===!0||v>0&&t._hideNextMonthArrow===!0||(t.currentMonth+=v,(t.currentMonth<0||t.currentMonth>11)&&(t.currentYear+=t.currentMonth>11?1:-1,t.currentMonth=(t.currentMonth+12)%12,ue("onYearChange"),Z()),Q(),ue("onMonthChange"),Ai())}function D(f,h){if(f===void 0&&(f=!0),h===void 0&&(h=!0),t.input.value="",t.altInput!==void 0&&(t.altInput.value=""),t.mobileInput!==void 0&&(t.mobileInput.value=""),t.selectedDates=[],t.latestSelectedDateObj=void 0,h===!0&&(t.currentYear=t._initialDate.getFullYear(),t.currentMonth=t._initialDate.getMonth()),t.config.enableTime===!0){var v=Nr(t.config),b=v.hours,S=v.minutes,N=v.seconds;y(b,S,N)}t.redraw(),f&&ue("onChange")}function B(){t.isOpen=!1,t.isMobile||(t.calendarContainer!==void 0&&t.calendarContainer.classList.remove("open"),t._input!==void 0&&t._input.classList.remove("active")),ue("onClose")}function V(){t.config!==void 0&&ue("onDestroy");for(var f=t._handlers.length;f--;)t._handlers[f].remove();if(t._handlers=[],t.mobileInput)t.mobileInput.parentNode&&t.mobileInput.parentNode.removeChild(t.mobileInput),t.mobileInput=void 0;else if(t.calendarContainer&&t.calendarContainer.parentNode)if(t.config.static&&t.calendarContainer.parentNode){var h=t.calendarContainer.parentNode;if(h.lastChild&&h.removeChild(h.lastChild),h.parentNode){for(;h.firstChild;)h.parentNode.insertBefore(h.firstChild,h);h.parentNode.removeChild(h)}}else t.calendarContainer.parentNode.removeChild(t.calendarContainer);t.altInput&&(t.input.type="text",t.altInput.parentNode&&t.altInput.parentNode.removeChild(t.altInput),delete t.altInput),t.input&&(t.input.type=t.input._type,t.input.classList.remove("flatpickr-input"),t.input.removeAttribute("readonly")),["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach(function(v){try{delete t[v]}catch(b){}})}function U(f){return t.calendarContainer.contains(f)}function Y(f){if(t.isOpen&&!t.config.inline){var h=Ve(f),v=U(h),b=h===t.input||h===t.altInput||t.element.contains(h)||f.path&&f.path.indexOf&&(~f.path.indexOf(t.input)||~f.path.indexOf(t.altInput)),S=!b&&!v&&!U(f.relatedTarget),N=!t.config.ignoredFocusElements.some(function(X){return X.contains(h)});S&&N&&(t.config.allowInput&&t.setDate(t._input.value,!1,t.config.altInput?t.config.altFormat:t.config.dateFormat),t.timeContainer!==void 0&&t.minuteElement!==void 0&&t.hourElement!==void 0&&t.input.value!==""&&t.input.value!==void 0&&l(),t.close(),t.config&&t.config.mode==="range"&&t.selectedDates.length===1&&t.clear(!1))}}function ee(f){if(!(!f||t.config.minDate&&ft.config.maxDate.getFullYear())){var h=f,v=t.currentYear!==h;t.currentYear=h||t.currentYear,t.config.maxDate&&t.currentYear===t.config.maxDate.getFullYear()?t.currentMonth=Math.min(t.config.maxDate.getMonth(),t.currentMonth):t.config.minDate&&t.currentYear===t.config.minDate.getFullYear()&&(t.currentMonth=Math.max(t.config.minDate.getMonth(),t.currentMonth)),v&&(t.redraw(),ue("onYearChange"),Z())}}function oe(f,h){var v;h===void 0&&(h=!0);var b=t.parseDate(f,void 0,h);if(t.config.minDate&&b&&ze(b,t.config.minDate,h!==void 0?h:!t.minDateHasTime)<0||t.config.maxDate&&b&&ze(b,t.config.maxDate,h!==void 0?h:!t.maxDateHasTime)>0)return!1;if(!t.config.enable&&t.config.disable.length===0)return!0;if(b===void 0)return!1;for(var S=!!t.config.enable,N=(v=t.config.enable)!==null&&v!==void 0?v:t.config.disable,X=0,P=void 0;X=P.from.getTime()&&b.getTime()<=P.to.getTime())return S}return!S}function Et(f){return t.daysContainer!==void 0?f.className.indexOf("hidden")===-1&&f.className.indexOf("flatpickr-disabled")===-1&&t.daysContainer.contains(f):!1}function Fr(f){var h=f.target===t._input,v=t._input.value.trimEnd()!==zr();h&&v&&!(f.relatedTarget&&U(f.relatedTarget))&&t.setDate(t._input.value,!0,f.target===t.altInput?t.config.altFormat:t.config.dateFormat)}function nn(f){var h=Ve(f),v=t.config.wrap?n.contains(h):h===t._input,b=t.config.allowInput,S=t.isOpen&&(!b||!v),N=t.config.inline&&v&&!b;if(f.keyCode===13&&v){if(b)return t.setDate(t._input.value,!0,h===t.altInput?t.config.altFormat:t.config.dateFormat),t.close(),h.blur();t.open()}else if(U(h)||S||N){var X=!!t.timeContainer&&t.timeContainer.contains(h);switch(f.keyCode){case 13:X?(f.preventDefault(),l(),an()):ln(f);break;case 27:f.preventDefault(),an();break;case 8:case 46:v&&!t.config.allowInput&&(f.preventDefault(),t.clear());break;case 37:case 39:if(!X&&!v){f.preventDefault();var P=o();if(t.daysContainer!==void 0&&(b===!1||P&&Et(P))){var J=f.keyCode===39?1:-1;f.ctrlKey?(f.stopPropagation(),M(J),W(I(1),0)):W(void 0,J)}}else t.hourElement&&t.hourElement.focus();break;case 38:case 40:f.preventDefault();var H=f.keyCode===40?1:-1;t.daysContainer&&h.$i!==void 0||h===t.input||h===t.altInput?f.ctrlKey?(f.stopPropagation(),ee(t.currentYear-H),W(I(1),0)):X||W(void 0,H*7):h===t.currentYearElement?ee(t.currentYear-H):t.config.enableTime&&(!X&&t.hourElement&&t.hourElement.focus(),l(f),t._debouncedChange());break;case 9:if(X){var K=[t.hourElement,t.minuteElement,t.secondElement,t.amPM].concat(t.pluginElements).filter(function(We){return We}),re=K.indexOf(h);if(re!==-1){var it=K[re+(f.shiftKey?-1:1)];f.preventDefault(),(it||t._input).focus()}}else!t.config.noCalendar&&t.daysContainer&&t.daysContainer.contains(h)&&f.shiftKey&&(f.preventDefault(),t._input.focus());break;default:break}}if(t.amPM!==void 0&&h===t.amPM)switch(f.key){case t.l10n.amPM[0].charAt(0):case t.l10n.amPM[0].charAt(0).toLowerCase():t.amPM.textContent=t.l10n.amPM[0],d(),st();break;case t.l10n.amPM[1].charAt(0):case t.l10n.amPM[1].charAt(0).toLowerCase():t.amPM.textContent=t.l10n.amPM[1],d(),st();break}(v||U(h))&&ue("onKeyDown",f)}function rn(f,h){if(h===void 0&&(h="flatpickr-day"),!(t.selectedDates.length!==1||f&&(!f.classList.contains(h)||f.classList.contains("flatpickr-disabled")))){for(var v=f?f.dateObj.getTime():t.days.firstElementChild.dateObj.getTime(),b=t.parseDate(t.selectedDates[0],void 0,!0).getTime(),S=Math.min(v,t.selectedDates[0].getTime()),N=Math.max(v,t.selectedDates[0].getTime()),X=!1,P=0,J=0,H=S;HS&&HP)?P=H:H>b&&(!J||H ."+h));K.forEach(function(re){var it=re.dateObj,We=it.getTime(),$n=P>0&&We0&&We>J;if($n){re.classList.add("notAllowed"),["inRange","startRange","endRange"].forEach(function(cn){re.classList.remove(cn)});return}else if(X&&!$n)return;["startRange","inRange","endRange","notAllowed"].forEach(function(cn){re.classList.remove(cn)}),f!==void 0&&(f.classList.add(v<=t.selectedDates[0].getTime()?"startRange":"endRange"),bv&&We===b&&re.classList.add("endRange"),We>=P&&(J===0||We<=J)&&Cc(We,b,v)&&re.classList.add("inRange"))})}}function _i(){t.isOpen&&!t.config.static&&!t.config.inline&&on()}function $r(f,h){if(h===void 0&&(h=t._positionElement),t.isMobile===!0){if(f){f.preventDefault();var v=Ve(f);v&&v.blur()}t.mobileInput!==void 0&&(t.mobileInput.focus(),t.mobileInput.click()),ue("onOpen");return}else if(t._input.disabled||t.config.inline)return;var b=t.isOpen;t.isOpen=!0,b||(t.calendarContainer.classList.add("open"),t._input.classList.add("active"),ue("onOpen"),on(h)),t.config.enableTime===!0&&t.config.noCalendar===!0&&t.config.allowInput===!1&&(f===void 0||!t.timeContainer.contains(f.relatedTarget))&&setTimeout(function(){return t.hourElement.select()},50)}function wi(f){return function(h){var v=t.config["_"+f+"Date"]=t.parseDate(h,t.config.dateFormat),b=t.config["_"+(f==="min"?"max":"min")+"Date"];v!==void 0&&(t[f==="min"?"minDateHasTime":"maxDateHasTime"]=v.getHours()>0||v.getMinutes()>0||v.getSeconds()>0),t.selectedDates&&(t.selectedDates=t.selectedDates.filter(function(S){return oe(S)}),!t.selectedDates.length&&f==="min"&&p(v),st()),t.daysContainer&&(Pn(),v!==void 0?t.currentYearElement[f]=v.getFullYear().toString():t.currentYearElement.removeAttribute(f),t.currentYearElement.disabled=!!b&&v!==void 0&&b.getFullYear()===v.getFullYear())}}function xi(){var f=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],h=Me(Me({},JSON.parse(JSON.stringify(n.dataset||{}))),e),v={};t.config.parseDate=h.parseDate,t.config.formatDate=h.formatDate,Object.defineProperty(t.config,"enable",{get:function(){return t.config._enable},set:function(K){t.config._enable=ds(K)}}),Object.defineProperty(t.config,"disable",{get:function(){return t.config._disable},set:function(K){t.config._disable=ds(K)}});var b=h.mode==="time";if(!h.dateFormat&&(h.enableTime||b)){var S=be.defaultConfig.dateFormat||It.dateFormat;v.dateFormat=h.noCalendar||b?"H:i"+(h.enableSeconds?":S":""):S+" H:i"+(h.enableSeconds?":S":"")}if(h.altInput&&(h.enableTime||b)&&!h.altFormat){var N=be.defaultConfig.altFormat||It.altFormat;v.altFormat=h.noCalendar||b?"h:i"+(h.enableSeconds?":S K":" K"):N+(" h:i"+(h.enableSeconds?":S":"")+" K")}Object.defineProperty(t.config,"minDate",{get:function(){return t.config._minDate},set:wi("min")}),Object.defineProperty(t.config,"maxDate",{get:function(){return t.config._maxDate},set:wi("max")});var X=function(K){return function(re){t.config[K==="min"?"_minTime":"_maxTime"]=t.parseDate(re,"H:i:S")}};Object.defineProperty(t.config,"minTime",{get:function(){return t.config._minTime},set:X("min")}),Object.defineProperty(t.config,"maxTime",{get:function(){return t.config._maxTime},set:X("max")}),h.mode==="time"&&(t.config.noCalendar=!0,t.config.enableTime=!0),Object.assign(t.config,v,h);for(var P=0;P-1?t.config[H]=Or(J[H]).map(s).concat(t.config[H]):typeof h[H]=="undefined"&&(t.config[H]=J[H])}h.altInputClass||(t.config.altInputClass=Hn().className+" "+t.config.altInputClass),ue("onParseConfig")}function Hn(){return t.config.wrap?n.querySelector("[data-input]"):n}function Ci(){typeof t.config.locale!="object"&&typeof be.l10ns[t.config.locale]=="undefined"&&t.config.errorHandler(new Error("flatpickr: invalid locale "+t.config.locale)),t.l10n=Me(Me({},be.l10ns.default),typeof t.config.locale=="object"?t.config.locale:t.config.locale!=="default"?be.l10ns[t.config.locale]:void 0),vt.D="("+t.l10n.weekdays.shorthand.join("|")+")",vt.l="("+t.l10n.weekdays.longhand.join("|")+")",vt.M="("+t.l10n.months.shorthand.join("|")+")",vt.F="("+t.l10n.months.longhand.join("|")+")",vt.K="("+t.l10n.amPM[0]+"|"+t.l10n.amPM[1]+"|"+t.l10n.amPM[0].toLowerCase()+"|"+t.l10n.amPM[1].toLowerCase()+")";var f=Me(Me({},e),JSON.parse(JSON.stringify(n.dataset||{})));f.time_24hr===void 0&&be.defaultConfig.time_24hr===void 0&&(t.config.time_24hr=t.l10n.time_24hr),t.formatDate=os(t),t.parseDate=Lr({config:t.config,l10n:t.l10n})}function on(f){if(typeof t.config.position=="function")return void t.config.position(t,f);if(t.calendarContainer!==void 0){ue("onPreCalendarPosition");var h=f||t._positionElement,v=Array.prototype.reduce.call(t.calendarContainer.children,(function(nu,iu){return nu+iu.offsetHeight}),0),b=t.calendarContainer.offsetWidth,S=t.config.position.split(" "),N=S[0],X=S.length>1?S[1]:null,P=h.getBoundingClientRect(),J=window.innerHeight-P.bottom,H=N==="above"||N!=="below"&&Jv,K=window.pageYOffset+P.top+(H?-v-2:h.offsetHeight+2);if(Le(t.calendarContainer,"arrowTop",!H),Le(t.calendarContainer,"arrowBottom",H),!t.config.inline){var re=window.pageXOffset+P.left,it=!1,We=!1;X==="center"?(re-=(b-P.width)/2,it=!0):X==="right"&&(re-=b-P.width,We=!0),Le(t.calendarContainer,"arrowLeft",!it&&!We),Le(t.calendarContainer,"arrowCenter",it),Le(t.calendarContainer,"arrowRight",We);var $n=window.document.body.offsetWidth-(window.pageXOffset+P.right),cn=re+b>window.document.body.offsetWidth,Kc=$n+b>window.document.body.offsetWidth;if(Le(t.calendarContainer,"rightMost",cn),!t.config.static)if(t.calendarContainer.style.top=K+"px",!cn)t.calendarContainer.style.left=re+"px",t.calendarContainer.style.right="auto";else if(!Kc)t.calendarContainer.style.left="auto",t.calendarContainer.style.right=$n+"px";else{var jr=ot();if(jr===void 0)return;var Xc=window.document.body.offsetWidth,Qc=Math.max(0,Xc/2-b/2),Jc=".flatpickr-calendar.centerMost:before",Zc=".flatpickr-calendar.centerMost:after",eu=jr.cssRules.length,tu="{left:"+P.left+"px;right:auto;}";Le(t.calendarContainer,"rightMost",!1),Le(t.calendarContainer,"centerMost",!0),jr.insertRule(Jc+","+Zc+tu,eu),t.calendarContainer.style.left=Qc+"px",t.calendarContainer.style.right="auto"}}}}function ot(){for(var f=null,h=0;ht.currentMonth+t.config.showMonths-1)&&t.config.mode!=="range";if(t.selectedDateElem=b,t.config.mode==="single")t.selectedDates=[S];else if(t.config.mode==="multiple"){var X=Vr(S);X?t.selectedDates.splice(parseInt(X),1):t.selectedDates.push(S)}else t.config.mode==="range"&&(t.selectedDates.length===2&&t.clear(!1,!1),t.latestSelectedDateObj=S,t.selectedDates.push(S),ze(S,t.selectedDates[0],!0)!==0&&t.selectedDates.sort(function(K,re){return K.getTime()-re.getTime()}));if(d(),N){var P=t.currentYear!==S.getFullYear();t.currentYear=S.getFullYear(),t.currentMonth=S.getMonth(),P&&(ue("onYearChange"),Z()),ue("onMonthChange")}if(Ai(),Q(),st(),!N&&t.config.mode!=="range"&&t.config.showMonths===1?k(b):t.selectedDateElem!==void 0&&t.hourElement===void 0&&t.selectedDateElem&&t.selectedDateElem.focus(),t.hourElement!==void 0&&t.hourElement!==void 0&&t.hourElement.focus(),t.config.closeOnSelect){var J=t.config.mode==="single"&&!t.config.enableTime,H=t.config.mode==="range"&&t.selectedDates.length===2&&!t.config.enableTime;(J||H)&&an()}_()}}var Pt={locale:[Ci,He],showMonths:[Te,a,Ue],minDate:[A],maxDate:[A],positionElement:[fs],clickOpens:[function(){t.config.clickOpens===!0?(g(t._input,"focus",t.open),g(t._input,"click",t.open)):(t._input.removeEventListener("focus",t.open),t._input.removeEventListener("click",t.open))}]};function Ti(f,h){if(f!==null&&typeof f=="object"){Object.assign(t.config,f);for(var v in f)Pt[v]!==void 0&&Pt[v].forEach(function(b){return b()})}else t.config[f]=h,Pt[f]!==void 0?Pt[f].forEach(function(b){return b()}):Sr.indexOf(f)>-1&&(t.config[f]=Or(h));t.redraw(),st(!0)}function Fn(f,h){var v=[];if(f instanceof Array)v=f.map(function(b){return t.parseDate(b,h)});else if(f instanceof Date||typeof f=="number")v=[t.parseDate(f,h)];else if(typeof f=="string")switch(t.config.mode){case"single":case"time":v=[t.parseDate(f,h)];break;case"multiple":v=f.split(t.config.conjunction).map(function(b){return t.parseDate(b,h)});break;case"range":v=f.split(t.l10n.rangeSeparator).map(function(b){return t.parseDate(b,h)});break;default:break}else t.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(f)));t.selectedDates=t.config.allowInvalidPreload?v:v.filter(function(b){return b instanceof Date&&oe(b,!1)}),t.config.mode==="range"&&t.selectedDates.sort(function(b,S){return b.getTime()-S.getTime()})}function Si(f,h,v){if(h===void 0&&(h=!1),v===void 0&&(v=t.config.dateFormat),f!==0&&!f||f instanceof Array&&f.length===0)return t.clear(h);Fn(f,v),t.latestSelectedDateObj=t.selectedDates[t.selectedDates.length-1],t.redraw(),A(void 0,h),p(),t.selectedDates.length===0&&t.clear(!1),st(h),h&&ue("onChange")}function ds(f){return f.slice().map(function(h){return typeof h=="string"||typeof h=="number"||h instanceof Date?t.parseDate(h,void 0,!0):h&&typeof h=="object"&&h.from&&h.to?{from:t.parseDate(h.from,void 0),to:t.parseDate(h.to,void 0)}:h}).filter(function(h){return h})}function zc(){t.selectedDates=[],t.now=t.parseDate(t.config.now)||new Date;var f=t.config.defaultDate||((t.input.nodeName==="INPUT"||t.input.nodeName==="TEXTAREA")&&t.input.placeholder&&t.input.value===t.input.placeholder?null:t.input.value);f&&Fn(f,t.config.dateFormat),t._initialDate=t.selectedDates.length>0?t.selectedDates[0]:t.config.minDate&&t.config.minDate.getTime()>t.now.getTime()?t.config.minDate:t.config.maxDate&&t.config.maxDate.getTime()0&&(t.latestSelectedDateObj=t.selectedDates[0]),t.config.minTime!==void 0&&(t.config.minTime=t.parseDate(t.config.minTime,"H:i")),t.config.maxTime!==void 0&&(t.config.maxTime=t.parseDate(t.config.maxTime,"H:i")),t.minDateHasTime=!!t.config.minDate&&(t.config.minDate.getHours()>0||t.config.minDate.getMinutes()>0||t.config.minDate.getSeconds()>0),t.maxDateHasTime=!!t.config.maxDate&&(t.config.maxDate.getHours()>0||t.config.maxDate.getMinutes()>0||t.config.maxDate.getSeconds()>0)}function jc(){if(t.input=Hn(),!t.input){t.config.errorHandler(new Error("Invalid input element specified"));return}t.input._type=t.input.type,t.input.type="text",t.input.classList.add("flatpickr-input"),t._input=t.input,t.config.altInput&&(t.altInput=te(t.input.nodeName,t.config.altInputClass),t._input=t.altInput,t.altInput.placeholder=t.input.placeholder,t.altInput.disabled=t.input.disabled,t.altInput.required=t.input.required,t.altInput.tabIndex=t.input.tabIndex,t.altInput.type="text",t.input.setAttribute("type","hidden"),!t.config.static&&t.input.parentNode&&t.input.parentNode.insertBefore(t.altInput,t.input.nextSibling)),t.config.allowInput||t._input.setAttribute("readonly","readonly"),fs()}function fs(){t._positionElement=t.config.positionElement||t._input}function Wc(){var f=t.config.enableTime?t.config.noCalendar?"time":"datetime-local":"date";t.mobileInput=te("input",t.input.className+" flatpickr-mobile"),t.mobileInput.tabIndex=1,t.mobileInput.type=f,t.mobileInput.disabled=t.input.disabled,t.mobileInput.required=t.input.required,t.mobileInput.placeholder=t.input.placeholder,t.mobileFormatStr=f==="datetime-local"?"Y-m-d\\TH:i:S":f==="date"?"Y-m-d":"H:i:S",t.selectedDates.length>0&&(t.mobileInput.defaultValue=t.mobileInput.value=t.formatDate(t.selectedDates[0],t.mobileFormatStr)),t.config.minDate&&(t.mobileInput.min=t.formatDate(t.config.minDate,"Y-m-d")),t.config.maxDate&&(t.mobileInput.max=t.formatDate(t.config.maxDate,"Y-m-d")),t.input.getAttribute("step")&&(t.mobileInput.step=String(t.input.getAttribute("step"))),t.input.type="hidden",t.altInput!==void 0&&(t.altInput.type="hidden");try{t.input.parentNode&&t.input.parentNode.insertBefore(t.mobileInput,t.input.nextSibling)}catch(h){}g(t.mobileInput,"change",function(h){t.setDate(Ve(h).value,!1,t.mobileFormatStr),ue("onChange"),ue("onClose")})}function qc(f){if(t.isOpen===!0)return t.close();t.open(f)}function ue(f,h){if(t.config!==void 0){var v=t.config[f];if(v!==void 0&&v.length>0)for(var b=0;v[b]&&b=0&&ze(f,t.selectedDates[1])<=0}function Ai(){t.config.noCalendar||t.isMobile||!t.monthNav||(t.yearElements.forEach(function(f,h){var v=new Date(t.currentYear,t.currentMonth,1);v.setMonth(t.currentMonth+h),t.config.showMonths>1||t.config.monthSelectorType==="static"?t.monthElements[h].textContent=vi(v.getMonth(),t.config.shorthandCurrentMonth,t.l10n)+" ":t.monthsDropdownContainer.value=v.getMonth().toString(),f.value=v.getFullYear().toString()}),t._hidePrevMonthArrow=t.config.minDate!==void 0&&(t.currentYear===t.config.minDate.getFullYear()?t.currentMonth<=t.config.minDate.getMonth():t.currentYeart.config.maxDate.getMonth():t.currentYear>t.config.maxDate.getFullYear()))}function zr(f){var h=f||(t.config.altInput?t.config.altFormat:t.config.dateFormat);return t.selectedDates.map(function(v){return t.formatDate(v,h)}).filter(function(v,b,S){return t.config.mode!=="range"||t.config.enableTime||S.indexOf(v)===b}).join(t.config.mode!=="range"?t.config.conjunction:t.l10n.rangeSeparator)}function st(f){f===void 0&&(f=!0),t.mobileInput!==void 0&&t.mobileFormatStr&&(t.mobileInput.value=t.latestSelectedDateObj!==void 0?t.formatDate(t.latestSelectedDateObj,t.mobileFormatStr):""),t.input.value=zr(t.config.dateFormat),t.altInput!==void 0&&(t.altInput.value=zr(t.config.altFormat)),f!==!1&&ue("onValueUpdate")}function Yc(f){var h=Ve(f),v=t.prevMonthNav.contains(h),b=t.nextMonthNav.contains(h);v||b?M(v?-1:1):t.yearElements.indexOf(h)>=0?h.select():h.classList.contains("arrowUp")?t.changeYear(t.currentYear+1):h.classList.contains("arrowDown")&&t.changeYear(t.currentYear-1)}function Gc(f){f.preventDefault();var h=f.type==="keydown",v=Ve(f),b=v;t.amPM!==void 0&&v===t.amPM&&(t.amPM.textContent=t.l10n.amPM[Be(t.amPM.textContent===t.l10n.amPM[0])]);var S=parseFloat(b.getAttribute("min")),N=parseFloat(b.getAttribute("max")),X=parseFloat(b.getAttribute("step")),P=parseInt(b.value,10),J=f.delta||(h?f.which===38?1:-1:0),H=P+X*J;if(typeof b.value!="undefined"&&b.value.length===2){var K=b===t.hourElement,re=b===t.minuteElement;HN&&(H=b===t.hourElement?H-N-Be(!t.amPM):S,re&&T(void 0,1,t.hourElement)),t.amPM&&K&&(X===1?H+P===23:Math.abs(H-P)>X)&&(t.amPM.textContent=t.l10n.amPM[Be(t.amPM.textContent===t.l10n.amPM[0])]),b.value=Oe(H)}}return r(),t}function Ln(n,e){for(var t=Array.prototype.slice.call(n).filter(function(s){return s instanceof HTMLElement}),i=[],r=0;r option"))if(e.selected){for(let t of R("#id_columns"))t.appendChild(e.cloneNode(!0));e.remove()}n.preventDefault()}function lv(n){for(let e of R("#id_columns > option"))if(e.selected){for(let t of R("#id_available_columns"))t.appendChild(e.cloneNode(!0));e.remove()}n.preventDefault()}function Oc(n,e){return at(this,null,function*(){return yield Dn(n,e)})}function cv(n){var l,u,c;n.preventDefault();let e=n.currentTarget,t=e.getAttribute("data-url");if(t==null){Nt("danger","Error Updating Table Configuration","No API path defined for configuration form.").show();return}let i=((l=document.activeElement)==null?void 0:l.getAttribute("value"))==="Reset",r=(c=(u=e.getAttribute("data-config-root"))==null?void 0:u.split("."))!=null?c:[];if(i){let d=r.reduceRight((p,y)=>({[y]:p}),{});Oc(t,d).then(p=>{Zt(p)?Nt("danger","Error Resetting Table Configuration",p.error).show():window.location.href=window.location.origin+window.location.pathname});return}let o=wl(e,"select[name=columns]"),s=Object.assign({},...o.map(d=>({[d.name]:d.options}))),a=r.reduceRight((d,p)=>({[p]:d}),s);Oc(t,a).then(d=>{Zt(d)?Nt("danger","Error Updating Table Configuration",d.error).show():window.location.href=window.location.origin+window.location.pathname})}function Lc(){for(let n of R("#add_columns"))n.addEventListener("click",av);for(let n of R("#remove_columns"))n.addEventListener("click",lv);for(let n of R("form.userconfigform"))n.addEventListener("submit",cv)}var uv="(min-width: 992px)",ss=class{constructor(e){le(this,"base");le(this,"state");this.base=e,this.state=new hi({pinned:!0},{persist:!0,key:"netbox-sidenav"}),this.init(),this.initLinks()}bodyHas(e){return document.body.hasAttribute(`data-sidenav-${e}`)}bodyRemove(...e){for(let t of e)document.body.removeAttribute(`data-sidenav-${t}`)}bodyAdd(...e){for(let t of e)document.body.setAttribute(`data-sidenav-${t}`,"")}init(){for(let e of this.base.querySelectorAll(".sidenav-toggle"))e.addEventListener("click",t=>this.onToggle(t));for(let e of R(".sidenav-toggle-mobile"))e.addEventListener("click",t=>this.onMobileToggle(t));window.matchMedia(uv).matches?this.state.get("pinned")?this.pin():this.unpin():(this.bodyRemove("hide"),this.bodyAdd("hidden")),window.addEventListener("resize",()=>this.onResize()),this.base.addEventListener("mouseenter",()=>this.onEnter()),this.base.addEventListener("mouseleave",()=>this.onLeave())}initLinks(){for(let e of this.getActiveLinks())this.bodyHas("show")?this.activateLink(e,"expand"):this.bodyHas("hidden")&&this.activateLink(e,"collapse")}show(){this.bodyAdd("show"),this.bodyRemove("hidden","hide")}hide(){this.bodyAdd("hidden"),this.bodyRemove("pinned","show");for(let e of this.base.querySelectorAll(".collapse"))e.classList.remove("show")}pin(){this.bodyAdd("show","pinned"),this.bodyRemove("hidden"),this.state.set("pinned",!0)}unpin(){this.bodyRemove("pinned","show"),this.bodyAdd("hidden");for(let e of this.base.querySelectorAll(".collapse"))e.classList.remove("show");this.state.set("pinned",!1)}activateLink(e,t){var r;let i=e.closest(".dropdown-menu");if(hr(i)){let o=i.parentElement,s=(r=i.parentElement)==null?void 0:r.querySelector(".nav-link");if(hr(s)&&hr(o))switch(t){case"expand":s.setAttribute("aria-expanded","true"),o.classList.add("active"),i.classList.add("show"),e.classList.add("active");break;case"collapse":s.setAttribute("aria-expanded","false"),o.classList.remove("active"),i.classList.remove("show"),e.classList.remove("active");break}}}*getActiveLinks(){for(let e of this.base.querySelectorAll("ul.navbar-nav .nav-item .dropdown-item")){let t=e.querySelector("a");if(t){let i=new RegExp(t.href,"gi");window.location.href.match(i)&&(yield e)}}}onEnter(){if(!this.bodyHas("pinned")){this.bodyRemove("hide","hidden"),this.bodyAdd("show");for(let e of this.getActiveLinks())this.activateLink(e,"expand")}}onLeave(){if(!this.bodyHas("pinned")){this.bodyRemove("show"),this.bodyAdd("hide");for(let e of this.getActiveLinks())this.activateLink(e,"collapse");this.bodyRemove("hide"),this.bodyAdd("hidden")}}onResize(){this.bodyHas("show")&&!this.bodyHas("pinned")&&(this.bodyRemove("show"),this.bodyAdd("hidden"))}onToggle(e){e.preventDefault(),this.state.get("pinned")?this.unpin():this.pin()}onMobileToggle(e){e.preventDefault(),this.bodyHas("hidden")?this.show():this.hide()}};function Mc(){for(let n of R(".navbar-vertical"))new ss(n)}var E=class n{static getElements(e,t=document){if(typeof e=="string"){let i="getElementById"in t?t:void 0;if(i&&!isNaN(+e[0])){let o=i.getElementById(e);return o?[o]:[]}let r=t.querySelectorAll(e);if(!r.length&&e[0]!=="."&&e[0]!=="#"&&(r=t.querySelectorAll("."+e),r.length||(r=t.querySelectorAll("#"+e)),!r.length)){let o=t.querySelector(`[gs-id="${e}"]`);return o?[o]:[]}return Array.from(r)}return[e]}static getElement(e,t=document){if(typeof e=="string"){let i="getElementById"in t?t:void 0;if(!e.length)return null;if(i&&e[0]==="#")return i.getElementById(e.substring(1));if(e[0]==="#"||e[0]==="."||e[0]==="[")return t.querySelector(e);if(i&&!isNaN(+e[0]))return i.getElementById(e);let r=t.querySelector(e);return i&&!r&&(r=i.getElementById(e)),r||(r=t.querySelector("."+e)),r}return e}static lazyLoad(e){var t,i;return e.lazyLoad||((i=(t=e.grid)==null?void 0:t.opts)==null?void 0:i.lazyLoad)&&e.lazyLoad!==!1}static createDiv(e,t){let i=document.createElement("div");return e.forEach(r=>{r&&i.classList.add(r)}),t==null||t.appendChild(i),i}static shouldSizeToContent(e,t=!1){return(e==null?void 0:e.grid)&&(t?e.sizeToContent===!0||e.grid.opts.sizeToContent===!0&&e.sizeToContent===void 0:!!e.sizeToContent||e.grid.opts.sizeToContent&&e.sizeToContent!==!1)}static isIntercepted(e,t){return!(e.y>=t.y+t.h||e.y+e.h<=t.y||e.x+e.w<=t.x||e.x>=t.x+t.w)}static isTouching(e,t){return n.isIntercepted(e,{x:t.x-.5,y:t.y-.5,w:t.w+1,h:t.h+1})}static areaIntercept(e,t){let i=e.x>t.x?e.x:t.x,r=e.x+e.wt.y?e.y:t.y,s=e.y+e.h{var a,l,u,c;let s=t*(((a=r.y)!=null?a:1e4)-((l=o.y)!=null?l:1e4));return s===0?t*(((u=r.x)!=null?u:1e4)-((c=o.x)!=null?c:1e4)):s})}static find(e,t){return t?e.find(i=>i.id===t):void 0}static toBool(e){return typeof e=="boolean"?e:typeof e=="string"?(e=e.toLowerCase(),!(e===""||e==="no"||e==="false"||e==="0")):!!e}static toNumber(e){return e===null||e.length===0?void 0:Number(e)}static parseHeight(e){let t,i="px";if(typeof e=="string")if(e==="auto"||e==="")t=0;else{let r=e.match(/^(-[0-9]+\.[0-9]+|[0-9]*\.[0-9]+|-[0-9]+|[0-9]+)(px|em|rem|vh|vw|%|cm|mm)?$/);if(!r)throw new Error(`Invalid height val = ${e}`);i=r[2]||"px",t=parseFloat(r[1])}else t=e;return{h:t,unit:i}}static defaults(e,...t){return t.forEach(i=>{for(let r in i){if(!i.hasOwnProperty(r))return;e[r]===null||e[r]===void 0?e[r]=i[r]:typeof i[r]=="object"&&typeof e[r]=="object"&&n.defaults(e[r],i[r])}}),e}static same(e,t){if(typeof e!="object")return e==t;if(typeof e!=typeof t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let i in e)if(e[i]!==t[i])return!1;return!0}static copyPos(e,t,i=!1){return t.x!==void 0&&(e.x=t.x),t.y!==void 0&&(e.y=t.y),t.w!==void 0&&(e.w=t.w),t.h!==void 0&&(e.h=t.h),i&&(t.minW&&(e.minW=t.minW),t.minH&&(e.minH=t.minH),t.maxW&&(e.maxW=t.maxW),t.maxH&&(e.maxH=t.maxH)),e}static samePos(e,t){return e&&t&&e.x===t.x&&e.y===t.y&&(e.w||1)===(t.w||1)&&(e.h||1)===(t.h||1)}static sanitizeMinMax(e){e.minW||delete e.minW,e.minH||delete e.minH,e.maxW||delete e.maxW,e.maxH||delete e.maxH}static removeInternalAndSame(e,t){if(!(typeof e!="object"||typeof t!="object")&&!(Array.isArray(e)||Array.isArray(t)))for(let i in e){let r=e[i],o=t[i];i[0]==="_"||r===o?delete e[i]:r&&typeof r=="object"&&o!==void 0&&(n.removeInternalAndSame(r,o),Object.keys(r).length||delete e[i])}}static removeInternalForSave(e,t=!0){for(let i in e)(i[0]==="_"||e[i]===null||e[i]===void 0)&&delete e[i];delete e.grid,t&&delete e.el,e.autoPosition||delete e.autoPosition,e.noResize||delete e.noResize,e.noMove||delete e.noMove,e.locked||delete e.locked,(e.w===1||e.w===e.minW)&&delete e.w,(e.h===1||e.h===e.minH)&&delete e.h}static throttle(e,t){let i=!1;return(...r)=>{i||(i=!0,setTimeout(()=>{e(...r),i=!1},t))}}static removePositioningStyles(e){let t=e.style;t.position&&t.removeProperty("position"),t.left&&t.removeProperty("left"),t.top&&t.removeProperty("top"),t.width&&t.removeProperty("width"),t.height&&t.removeProperty("height")}static getScrollElement(e){if(!e)return document.scrollingElement||document.documentElement;let t=getComputedStyle(e).overflowY;return(t==="auto"||t==="scroll")&&e.scrollHeight>e.clientHeight?e:n.getScrollElement(e.parentElement)}static updateScrollResize(e,t,i){let r=n.getScrollElement(t),o=r.clientHeight,s=r===n.getScrollElement()?0:r.getBoundingClientRect().top,a=e.clientY-s,l=ao-i;l?r.scrollBy({behavior:"smooth",top:a-i}):u&&r.scrollBy({behavior:"smooth",top:i-(o-a)})}static clone(e){return e==null||typeof e!="object"?e:e instanceof Array?[...e]:O({},e)}static cloneDeep(e){let t=["parentGrid","el","grid","subGrid","engine"],i=n.clone(e);for(let r in i)i.hasOwnProperty(r)&&typeof i[r]=="object"&&r.substring(0,2)!=="__"&&!t.find(o=>o===r)&&(i[r]=n.cloneDeep(e[r]));return i}static cloneNode(e){let t=e.cloneNode(!0);return t.removeAttribute("id"),t}static appendTo(e,t){let i;typeof t=="string"?i=n.getElement(t):i=t,i&&i.appendChild(e)}static addElStyles(e,t){if(t instanceof Object)for(let i in t)t.hasOwnProperty(i)&&(Array.isArray(t[i])?t[i].forEach(r=>{e.style[i]=r}):e.style[i]=t[i])}static initEvent(e,t){let i={type:t.type},r={button:0,which:0,buttons:1,bubbles:!0,cancelable:!0,target:t.target?t.target:e.target};return["altKey","ctrlKey","metaKey","shiftKey"].forEach(o=>i[o]=e[o]),["pageX","pageY","clientX","clientY","screenX","screenY"].forEach(o=>i[o]=e[o]),O(O({},i),r)}static simulateMouseEvent(e,t,i){var s,a,l,u;let r=e,o=new MouseEvent(t,{bubbles:!0,composed:!0,cancelable:!0,view:window,detail:1,screenX:e.screenX,screenY:e.screenY,clientX:e.clientX,clientY:e.clientY,ctrlKey:(s=r.ctrlKey)!=null?s:!1,altKey:(a=r.altKey)!=null?a:!1,shiftKey:(l=r.shiftKey)!=null?l:!1,metaKey:(u=r.metaKey)!=null?u:!1,button:0,relatedTarget:e.target});(i||e.target).dispatchEvent(o)}static getValuesFromTransformedElement(e){let t=document.createElement("div");n.addElStyles(t,{opacity:"0",position:"fixed",top:"0px",left:"0px",width:"1px",height:"1px",zIndex:"-999999"}),e.appendChild(t);let i=t.getBoundingClientRect();return e.removeChild(t),t.remove(),{xScale:1/i.width,yScale:1/i.height,xOffset:i.left,yOffset:i.top}}static swap(e,t,i){if(!e)return;let r=e[t];e[t]=e[i],e[i]=r}static canBeRotated(e){var t;return!(!e||e.w===e.h||e.locked||e.noResize||(t=e.grid)!=null&&t.opts.disableResize||e.minW&&e.minW===e.maxW||e.minH&&e.minH===e.maxH)}};var Mn=class n{constructor(e={}){this.addedNodes=[],this.removedNodes=[],this.defaultColumn=12,this.column=e.column||this.defaultColumn,this.column>this.defaultColumn&&(this.defaultColumn=this.column),this.maxRow=e.maxRow,this._float=e.float,this.nodes=e.nodes||[],this.onChange=e.onChange}batchUpdate(e=!0,t=!0){return!!this.batchMode===e?this:(this.batchMode=e,e?(this._prevFloat=this._float,this._float=!0,this.cleanNodes(),this.saveInitial()):(this._float=this._prevFloat,delete this._prevFloat,t&&this._packNodes(),this._notify()),this)}_useEntireRowArea(e,t){return(!this.float||this.batchMode&&!this._prevFloat)&&!this._hasLocked&&(!e._moving||e._skipDown||t.y<=e.y)}_fixCollisions(e,t=e,i,r={}){if(this.sortNodes(-1),i=i||this.collide(e,t),!i)return!1;if(e._moving&&!r.nested&&!this.float&&this.swap(e,i))return!0;let o=t;!this._loading&&this._useEntireRowArea(e,t)&&(o={x:0,w:this.column,y:t.y,h:t.h},i=this.collide(e,o,r.skip));let s=!1,a={nested:!0,pack:!1},l=0;for(;i=i||this.collide(e,o,r.skip);){if(l++>this.nodes.length*2)throw new Error("Infinite collide check");let u;if(i.locked||this._loading||e._moving&&!e._skipDown&&t.y>e.y&&!this.float&&(!this.collide(i,se(O({},i),{y:e.y}),e)||!this.collide(i,se(O({},i),{y:t.y-i.h}),e))){e._skipDown=e._skipDown||t.y>e.y;let c=O(se(O({},t),{y:i.y+i.h}),a);u=this._loading&&E.samePos(e,c)?!0:this.moveNode(e,c),(i.locked||this._loading)&&u?E.copyPos(t,e):!i.locked&&u&&r.pack&&(this._packNodes(),t.y=i.y+i.h,E.copyPos(e,t)),s=s||u}else u=this.moveNode(i,O(se(O({},i),{y:t.y+t.h,skip:e}),a));if(!u)return s;i=void 0}return s}collide(e,t=e,i){let r=e._id,o=i==null?void 0:i._id;return this.nodes.find(s=>s._id!==r&&s._id!==o&&E.isIntercepted(s,t))}collideAll(e,t=e,i){let r=e._id,o=i==null?void 0:i._id;return this.nodes.filter(s=>s._id!==r&&s._id!==o&&E.isIntercepted(s,t))}directionCollideCoverage(e,t,i){if(!t.rect||!e._rect)return;let r=e._rect,o=O({},t.rect);o.y>r.y?(o.h+=o.y-r.y,o.y=r.y):o.h+=r.y-o.y,o.x>r.x?(o.w+=o.x-r.x,o.x=r.x):o.w+=r.x-o.x;let s,a=.5;for(let l of i){if(l.locked||!l._rect)break;let u=l._rect,c=Number.MAX_VALUE,d=Number.MAX_VALUE;r.yu.y+u.h&&(c=(u.y+u.h-o.y)/u.h),r.xu.x+u.w&&(d=(u.x+u.w-o.x)/u.w);let p=Math.min(d,c);p>a&&(a=p,s=l)}return t.collide=s,s}cacheRects(e,t,i,r,o,s){return this.nodes.forEach(a=>a._rect={y:a.y*t+i,x:a.x*e+s,w:a.w*e-s-r,h:a.h*t-i-o}),this}swap(e,t){if(!t||t.locked||!e||e.locked)return!1;function i(){let o=t.x,s=t.y;return t.x=e.x,t.y=e.y,e.h!=t.h?(e.x=o,e.y=t.y+t.h):e.w!=t.w?(e.x=t.x+t.w,e.y=s):(e.x=o,e.y=s),e._dirty=t._dirty=!0,!0}let r;if(e.w===t.w&&e.h===t.h&&(e.x===t.x||e.y===t.y)&&(r=E.isTouching(e,t)))return i();if(r!==!1){if(e.w===t.w&&e.x===t.x&&(r||(r=E.isTouching(e,t)))){if(t.y{let u;s.locked||(s.autoPosition=!0,e==="list"&&a&&(u=l[a-1])),this.addNode(s,!1,u)}),r||delete this._inColumnResize,i||this.batchUpdate(!1),this}set float(e){this._float!==e&&(this._float=e||!1,e||this._packNodes()._notify())}get float(){return this._float||!1}sortNodes(e=1){return this.nodes=E.sort(this.nodes,e),this}_packNodes(){return this.batchMode?this:(this.sortNodes(),this.float?this.nodes.forEach(e=>{if(e._updating||e._orig===void 0||e.y===e._orig.y)return;let t=e.y;for(;t>e._orig.y;)--t,this.collide(e,{x:e.x,y:t,w:e.w,h:e.h})||(e._dirty=!0,e.y=t)}):this.nodes.forEach((e,t)=>{if(!e.locked)for(;e.y>0;){let i=t===0?0:e.y-1;if(!(t===0||!this.collide(e,{x:e.x,y:i,w:e.w,h:e.h})))break;e._dirty=e.y!==i,e.y=i}}),this)}prepareNode(e,t){var o;e._id=(o=e._id)!=null?o:n._idSeq++;let i=e.id;if(i){let s=1;for(;this.nodes.find(a=>a.id===e.id&&a!==e);)e.id=i+"_"+s++}(e.x===void 0||e.y===void 0||e.x===null||e.y===null)&&(e.autoPosition=!0);let r={x:0,y:0,w:1,h:1};return E.defaults(e,r),e.autoPosition||delete e.autoPosition,e.noResize||delete e.noResize,e.noMove||delete e.noMove,E.sanitizeMinMax(e),typeof e.x=="string"&&(e.x=Number(e.x)),typeof e.y=="string"&&(e.y=Number(e.y)),typeof e.w=="string"&&(e.w=Number(e.w)),typeof e.h=="string"&&(e.h=Number(e.h)),isNaN(e.x)&&(e.x=r.x,e.autoPosition=!0),isNaN(e.y)&&(e.y=r.y,e.autoPosition=!0),isNaN(e.w)&&(e.w=r.w),isNaN(e.h)&&(e.h=r.h),this.nodeBoundFix(e,t),e}nodeBoundFix(e,t){let i=e._orig||E.copyPos({},e);if(e.maxW&&(e.w=Math.min(e.w||1,e.maxW)),e.maxH&&(e.h=Math.min(e.h||1,e.maxH)),e.minW&&(e.w=Math.max(e.w||1,e.minW)),e.minH&&(e.h=Math.max(e.h||1,e.minH)),(e.x||0)+(e.w||1)>this.column&&this.columnthis.column?e.w=this.column:e.w<1&&(e.w=1),this.maxRow&&e.h>this.maxRow?e.h=this.maxRow:e.h<1&&(e.h=1),e.x<0&&(e.x=0),e.y<0&&(e.y=0),e.x+e.w>this.column&&(t?e.w=this.column-e.x:e.x=this.column-e.w),this.maxRow&&e.y+e.h>this.maxRow&&(t?e.h=this.maxRow-e.y:e.y=this.maxRow-e.h),E.samePos(e,i)||(e._dirty=!0),this}getDirtyNodes(e){return e?this.nodes.filter(t=>t._dirty&&!E.samePos(t,t._orig)):this.nodes.filter(t=>t._dirty)}_notify(e){if(this.batchMode||!this.onChange)return this;let t=(e||[]).concat(this.getDirtyNodes());return this.onChange(t),this}cleanNodes(){return this.batchMode?this:(this.nodes.forEach(e=>{delete e._dirty,delete e._lastTried}),this)}saveInitial(){return this.nodes.forEach(e=>{e._orig=E.copyPos({},e),delete e._dirty}),this._hasLocked=this.nodes.some(e=>e.locked),this}restoreInitial(){return this.nodes.forEach(e=>{!e._orig||E.samePos(e,e._orig)||(E.copyPos(e,e._orig),e._dirty=!0)}),this._notify(),this}findEmptyPosition(e,t=this.nodes,i=this.column,r){let o=r?r.y*i+(r.x+r.w):0,s=!1;for(let a=o;!s;++a){let l=a%i,u=Math.floor(a/i);if(l+e.w>i)continue;let c={x:l,y:u,w:e.w,h:e.h};t.find(d=>E.isIntercepted(c,d))||((e.x!==l||e.y!==u)&&(e._dirty=!0),e.x=l,e.y=u,delete e.autoPosition,s=!0)}return s}addNode(e,t=!1,i){let r=this.nodes.find(s=>s._id===e._id);if(r)return r;this._inColumnResize?this.nodeBoundFix(e):this.prepareNode(e),delete e._temporaryRemoved,delete e._removeDOM;let o;return e.autoPosition&&this.findEmptyPosition(e,this.nodes,this.column,i)&&(delete e.autoPosition,o=!0),this.nodes.push(e),t&&this.addedNodes.push(e),o||this._fixCollisions(e),this.batchMode||this._packNodes()._notify(),e}removeNode(e,t=!0,i=!1){return this.nodes.find(r=>r._id===e._id)?(i&&this.removedNodes.push(e),t&&(e._removeDOM=!0),this.nodes=this.nodes.filter(r=>r._id!==e._id),e._isAboutToRemove||this._packNodes(),this._notify([e]),this):this}removeAll(e=!0,t=!0){if(delete this._layouts,!this.nodes.length)return this;e&&this.nodes.forEach(r=>r._removeDOM=!0);let i=this.nodes;return this.removedNodes=t?i:[],this.nodes=[],this._notify(i)}moveNodeCheck(e,t){if(!this.changedPosConstrain(e,t))return!1;if(t.pack=!0,!this.maxRow)return this.moveNode(e,t);let i,r=new n({column:this.column,float:this.float,nodes:this.nodes.map(s=>s._id===e._id?(i=O({},s),i):O({},s))});if(!i)return!1;let o=r.moveNode(i,t)&&r.getRow()<=Math.max(this.getRow(),this.maxRow);if(!o&&!t.resizing&&t.collide){let s=t.collide.el.gridstackNode;if(this.swap(e,s))return this._notify(),!0}return o?(r.nodes.filter(s=>s._dirty).forEach(s=>{let a=this.nodes.find(l=>l._id===s._id);a&&(E.copyPos(a,s),a._dirty=!0)}),this._notify(),!0):!1}willItFit(e){if(delete e._willFitPos,!this.maxRow)return!0;let t=new n({column:this.column,float:this.float,nodes:this.nodes.map(r=>O({},r))}),i=O({},e);return this.cleanupNode(i),delete i.el,delete i._id,delete i.content,delete i.grid,t.addNode(i),t.getRow()<=this.maxRow?(e._willFitPos=E.copyPos({},i),!0):!1}changedPosConstrain(e,t){return t.w=t.w||e.w,t.h=t.h||e.h,e.x!==t.x||e.y!==t.y?!0:(e.maxW&&(t.w=Math.min(t.w,e.maxW)),e.maxH&&(t.h=Math.min(t.h,e.maxH)),e.minW&&(t.w=Math.max(t.w,e.minW)),e.minH&&(t.h=Math.max(t.h,e.minH)),e.w!==t.w||e.h!==t.h)}moveNode(e,t){var u,c;if(!e||!t)return!1;let i;t.pack===void 0&&!this.batchMode&&(i=t.pack=!0),typeof t.x!="number"&&(t.x=e.x),typeof t.y!="number"&&(t.y=e.y),typeof t.w!="number"&&(t.w=e.w),typeof t.h!="number"&&(t.h=e.h);let r=e.w!==t.w||e.h!==t.h,o=E.copyPos({},e,!0);if(E.copyPos(o,t),this.nodeBoundFix(o,r),E.copyPos(t,o),!t.forceCollide&&E.samePos(e,t))return!1;let s=E.copyPos({},e),a=this.collideAll(e,o,t.skip),l=!0;if(a.length){let d=e._moving&&!t.nested,p=d?this.directionCollideCoverage(e,t,a):a[0];if(d&&p&&((c=(u=e.grid)==null?void 0:u.opts)!=null&&c.subGridDynamic)&&!e.grid._isTemp){let y=E.areaIntercept(t.rect,p._rect),m=E.area(t.rect),g=E.area(p._rect);y/(m.8&&(p.grid.makeSubGrid(p.el,void 0,e),p=void 0)}p?l=!this._fixCollisions(e,o,p,t):(l=!1,i&&delete t.pack)}return l&&!E.samePos(e,o)&&(e._dirty=!0,E.copyPos(e,o)),t.pack&&this._packNodes()._notify(),!E.samePos(e,s)}getRow(){return this.nodes.reduce((e,t)=>Math.max(e,t.y+t.h),0)}beginUpdate(e){return e._updating||(e._updating=!0,delete e._skipDown,this.batchMode||this.saveInitial()),this}endUpdate(){let e=this.nodes.find(t=>t._updating);return e&&(delete e._updating,delete e._skipDown),this}save(e=!0,t,i){var a;let r=((a=this._layouts)==null?void 0:a.length)||0,o;r&&(i?i!==this.column&&(o=this._layouts[i]):this.column!==r-1&&(o=this._layouts[r-1]));let s=[];return this.sortNodes(),this.nodes.forEach(l=>{let u=o==null?void 0:o.find(d=>d._id===l._id),c=O(O({},l),u||{});E.removeInternalForSave(c,!e),t&&t(l,c),s.push(c)}),s}layoutsNodesChange(e){return!this._layouts||this._inColumnResize?this:(this._layouts.forEach((t,i)=>{if(!t||i===this.column)return this;if(i{if(!o._orig)return;let s=t.find(a=>a._id===o._id);s&&(s.y>=0&&o.y!==o._orig.y&&(s.y+=o.y-o._orig.y,s.y<0&&(s.y=0)),o.x!==o._orig.x&&(s.x=Math.round(o.x*r),s.x<0&&(s.x=0)),o.w!==o._orig.w&&(s.w=Math.round(o.w*r),s.w<1&&(s.w=1)))})}}),this)}columnChanged(e,t,i="moveScale"){var a;if(!this.nodes.length||!t||e===t)return this;let r=i==="compact"||i==="list";r&&this.sortNodes(1),te&&this._layouts){let l=this._layouts[t]||[],u=this._layouts.length-1;!l.length&&e!==u&&((a=this._layouts[u])!=null&&a.length)&&(e=u,this._layouts[u].forEach(c=>{var p,y,m;let d=s.find(g=>g._id===c._id);d&&(!r&&!c.autoPosition&&(d.x=(p=c.x)!=null?p:d.x,d.y=(y=c.y)!=null?y:d.y),d.w=(m=c.w)!=null?m:d.w,(c.x==null||c.y===void 0)&&(d.autoPosition=!0))})),l.forEach(c=>{var p,y,m;let d=s.findIndex(g=>g._id===c._id);if(d!==-1){let g=s[d];if(r){g.w=c.w;return}(c.autoPosition||isNaN(c.x)||isNaN(c.y))&&this.findEmptyPosition(c,o),c.autoPosition||(g.x=(p=c.x)!=null?p:g.x,g.y=(y=c.y)!=null?y:g.y,g.w=(m=c.w)!=null?m:g.w,o.push(g)),s.splice(d,1)}})}if(r)this.compact(i,!1);else{if(s.length)if(typeof i=="function")i(t,e,o,s);else{let l=r||i==="none"?1:t/e,u=i==="move"||i==="moveScale",c=i==="scale"||i==="moveScale";s.forEach(d=>{d.x=t===1?0:u?Math.round(d.x*l):Math.min(d.x,t-1),d.w=t===1||e===1?1:c?Math.round(d.w*l)||1:Math.min(d.w,t),o.push(d)}),s=[]}o=E.sort(o,-1),this._inColumnResize=!0,this.nodes=[],o.forEach(l=>{this.addNode(l,!1),delete l._orig})}return this.nodes.forEach(l=>delete l._orig),this.batchUpdate(!1,!r),delete this._inColumnResize,this}cacheLayout(e,t,i=!1){let r=[];return e.forEach((o,s)=>{var a;if(o._id===void 0){let l=o.id?this.nodes.find(u=>u.id===o.id):void 0;o._id=(a=l==null?void 0:l._id)!=null?a:n._idSeq++}r[s]={x:o.x,y:o.y,w:o.w,_id:o._id}}),this._layouts=i?[]:this._layouts||[],this._layouts[t]=r,this}cacheOneLayout(e,t){var o;e._id=(o=e._id)!=null?o:n._idSeq++;let i={x:e.x,y:e.y,w:e.w,_id:e._id};(e.autoPosition||e.x===void 0)&&(delete i.x,delete i.y,e.autoPosition&&(i.autoPosition=!0)),this._layouts=this._layouts||[],this._layouts[t]=this._layouts[t]||[];let r=this.findCacheLayout(e,t);return r===-1?this._layouts[t].push(i):this._layouts[t][r]=i,this}findCacheLayout(e,t){var i,r,o;return(o=(r=(i=this._layouts)==null?void 0:i[t])==null?void 0:r.findIndex(s=>s._id===e._id))!=null?o:-1}removeNodeFromLayoutCache(e){if(this._layouts)for(let t=0;t0||navigator.msMaxTouchPoints>0),Ae=class{};function Rr(n,e){n.touches.length>1||(n.cancelable&&n.preventDefault(),E.simulateMouseEvent(n.changedTouches[0],e))}function Nc(n,e){n.cancelable&&n.preventDefault(),E.simulateMouseEvent(n,e)}function Nn(n){Ae.touchHandled||(Ae.touchHandled=!0,Rr(n,"mousedown"))}function kn(n){Ae.touchHandled&&Rr(n,"mousemove")}function Rn(n){if(!Ae.touchHandled)return;Ae.pointerLeaveTimeout&&(window.clearTimeout(Ae.pointerLeaveTimeout),delete Ae.pointerLeaveTimeout);let e=!!F.dragElement;Rr(n,"mouseup"),e||Rr(n,"click"),Ae.touchHandled=!1}function In(n){n.pointerType!=="mouse"&&n.target.releasePointerCapture(n.pointerId)}function as(n){F.dragElement&&n.pointerType!=="mouse"&&Nc(n,"mouseenter")}function ls(n){F.dragElement&&n.pointerType!=="mouse"&&(Ae.pointerLeaveTimeout=window.setTimeout(()=>{delete Ae.pointerLeaveTimeout,Nc(n,"mouseleave")},10))}var yi=class n{constructor(e,t,i){this.host=e,this.dir=t,this.option=i,this.moving=!1,this._mouseDown=this._mouseDown.bind(this),this._mouseMove=this._mouseMove.bind(this),this._mouseUp=this._mouseUp.bind(this),this._keyEvent=this._keyEvent.bind(this),this._init()}_init(){if(this.option.element)try{this.el=this.option.element instanceof HTMLElement?this.option.element:this.host.querySelector(this.option.element)}catch(e){this.option.element=void 0,console.error("Query for resizeable handle failed, falling back",e)}return this.el||(this.el=document.createElement("div"),this.host.appendChild(this.el)),this.el.classList.add("ui-resizable-handle"),this.el.classList.add(`${n.prefix}${this.dir}`),this.el.style.zIndex="100",this.el.style.userSelect="none",this.el.addEventListener("mousedown",this._mouseDown),Re&&(this.el.addEventListener("touchstart",Nn),this.el.addEventListener("pointerdown",In)),this}destroy(){return this.moving&&this._mouseUp(this.mouseDownEvent),this.el.removeEventListener("mousedown",this._mouseDown),Re&&(this.el.removeEventListener("touchstart",Nn),this.el.removeEventListener("pointerdown",In)),this.option.element||this.host.removeChild(this.el),delete this.el,delete this.host,this}_mouseDown(e){this.mouseDownEvent=e,document.addEventListener("mousemove",this._mouseMove,{capture:!0,passive:!0}),document.addEventListener("mouseup",this._mouseUp,!0),Re&&(this.el.addEventListener("touchmove",kn),this.el.addEventListener("touchend",Rn)),e.stopPropagation(),e.preventDefault()}_mouseMove(e){let t=this.mouseDownEvent;this.moving?this._triggerEvent("move",e):Math.abs(e.x-t.x)+Math.abs(e.y-t.y)>2&&(this.moving=!0,this._triggerEvent("start",this.mouseDownEvent),this._triggerEvent("move",e),document.addEventListener("keydown",this._keyEvent)),e.stopPropagation()}_mouseUp(e){this.moving&&(this._triggerEvent("stop",e),document.removeEventListener("keydown",this._keyEvent)),document.removeEventListener("mousemove",this._mouseMove,!0),document.removeEventListener("mouseup",this._mouseUp,!0),Re&&(this.el.removeEventListener("touchmove",kn),this.el.removeEventListener("touchend",Rn)),delete this.moving,delete this.mouseDownEvent,e.stopPropagation(),e.preventDefault()}_keyEvent(e){var t,i;e.key==="Escape"&&((i=(t=this.host.gridstackNode)==null?void 0:t.grid)==null||i.engine.restoreInitial(),this._mouseUp(this.mouseDownEvent))}_triggerEvent(e,t){return this.option[e]&&this.option[e](t),this}};yi.prefix="ui-resizable-";var Ht=class{constructor(){this._eventRegister={}}get disabled(){return this._disabled}on(e,t){this._eventRegister[e]=t}off(e){delete this._eventRegister[e]}enable(){this._disabled=!1}disable(){this._disabled=!0}destroy(){delete this._eventRegister}triggerEvent(e,t){if(!this.disabled&&this._eventRegister&&this._eventRegister[e])return this._eventRegister[e](t)}};var Ei=class n extends Ht{constructor(e,t={}){super(),this.el=e,this.option=t,this.rectScale={x:1,y:1},this._ui=()=>{let r=this.el.parentElement.getBoundingClientRect(),o={width:this.originalRect.width,height:this.originalRect.height+this.scrolled,left:this.originalRect.left,right:this.originalRect.right,top:this.originalRect.top-this.scrolled},s=this.temporalRect||o;return{position:{left:this.option.rtl?(r.right-s.right)*this.rectScale.x:(s.left-r.left)*this.rectScale.x,top:(s.top-r.top)*this.rectScale.y},size:{width:s.width*this.rectScale.x,height:s.height*this.rectScale.y}}},this._mouseOver=this._mouseOver.bind(this),this._mouseOut=this._mouseOut.bind(this),this.enable(),this._setupAutoHide(this.option.autoHide),this._setupHandlers()}on(e,t){super.on(e,t)}off(e){super.off(e)}enable(){super.enable(),this.el.classList.remove("ui-resizable-disabled"),this._setupAutoHide(this.option.autoHide)}disable(){super.disable(),this.el.classList.add("ui-resizable-disabled"),this._setupAutoHide(!1)}destroy(){this._removeHandlers(),this._setupAutoHide(!1),delete this.el,super.destroy()}updateOption(e){let t=e.handles&&e.handles!==this.option.handles,i=e.autoHide&&e.autoHide!==this.option.autoHide;return Object.keys(e).forEach(r=>this.option[r]=e[r]),t&&(this._removeHandlers(),this._setupHandlers()),i&&this._setupAutoHide(this.option.autoHide),this}_setupAutoHide(e){return e?(this.el.classList.add("ui-resizable-autohide"),this.el.addEventListener("mouseover",this._mouseOver),this.el.addEventListener("mouseout",this._mouseOut)):(this.el.classList.remove("ui-resizable-autohide"),this.el.removeEventListener("mouseover",this._mouseOver),this.el.removeEventListener("mouseout",this._mouseOut),F.overResizeElement===this&&delete F.overResizeElement),this}_mouseOver(e){F.overResizeElement||F.dragElement||(F.overResizeElement=this,this.el.classList.remove("ui-resizable-autohide"))}_mouseOut(e){F.overResizeElement===this&&(delete F.overResizeElement,this.el.classList.add("ui-resizable-autohide"))}_setupHandlers(){return this.handlers=this.option.handles.split(",").map(e=>e.trim()).map(e=>new yi(this.el,e,{element:this.option.element,start:t=>this._resizeStart(t),stop:t=>this._resizeStop(t),move:t=>this._resizing(t,e)})),this}_resizeStart(e){this.sizeToContent=E.shouldSizeToContent(this.el.gridstackNode,!0),this.originalRect=this.el.getBoundingClientRect(),this.scrollEl=E.getScrollElement(this.el),this.scrollY=this.scrollEl.scrollTop,this.scrolled=0,this.startEvent=e,this._setupHelper(),this._applyChange();let t=E.initEvent(e,{type:"resizestart",target:this.el});return this.option.start&&this.option.start(t,this._ui()),this.el.classList.add("ui-resizable-resizing"),this.triggerEvent("resizestart",t),this}_resizing(e,t){this.scrolled=this.scrollEl.scrollTop-this.scrollY,this.temporalRect=this._getChange(e,t),this._applyChange();let i=E.initEvent(e,{type:"resize",target:this.el});return i.resizeDir=t,i.hasMovedX=this.option.rtl?t.includes("e"):t.includes("w"),i.hasMovedY=t.includes("n"),this.option.resize&&this.option.resize(i,this._ui()),this.triggerEvent("resize",i),this}_resizeStop(e){let t=E.initEvent(e,{type:"resizestop",target:this.el});return this._cleanHelper(),this.option.stop&&this.option.stop(t),this.el.classList.remove("ui-resizable-resizing"),this.triggerEvent("resizestop",t),delete this.startEvent,delete this.originalRect,delete this.temporalRect,delete this.scrollY,delete this.scrolled,this}_setupHelper(){this.elOriginStyleVal=n._originStyleProp.map(i=>this.el.style[i]),this.parentOriginStylePosition=this.el.parentElement.style.position;let e=this.el.parentElement,t=E.getValuesFromTransformedElement(e);return this.rectScale={x:t.xScale,y:t.yScale},getComputedStyle(this.el.parentElement).position.match(/static/)&&(this.el.parentElement.style.position="relative"),this.el.style.position="absolute",this.el.style.opacity="0.8",this}_cleanHelper(){return n._originStyleProp.forEach((e,t)=>{this.el.style[e]=this.elOriginStyleVal[t]||null}),this.el.parentElement.style.position=this.parentOriginStylePosition||null,this}_getChange(e,t){let i=this.startEvent,r={width:this.originalRect.width,height:this.originalRect.height+this.scrolled,left:this.originalRect.left,right:this.originalRect.right,top:this.originalRect.top-this.scrolled},o=e.clientX-i.clientX,s=this.sizeToContent?0:e.clientY-i.clientY,a,l,u=this.option.rtl;!u&&t.indexOf("e")>-1?r.width+=o:u&&t.indexOf("w")>-1?r.width-=o:!u&&t.indexOf("w")>-1?(r.width-=o,r.left+=o,a=!0):u&&t.indexOf("e")>-1&&(r.width+=o,r.right+=o,a=!0),t.indexOf("s")>-1?r.height+=s:t.indexOf("n")>-1&&(r.height-=s,r.top+=s,l=!0);let c=this._constrainSize(r.width,r.height,a,l);return Math.round(r.width)!==Math.round(c.width)&&(!u&&t.indexOf("w")>-1?r.left+=r.width-c.width:u&&t.indexOf("e")>-1&&(r.right-=r.width-c.width),r.width=c.width),Math.round(r.height)!==Math.round(c.height)&&(t.indexOf("n")>-1&&(r.top+=r.height-c.height),r.height=c.height),r}_constrainSize(e,t,i,r){let o=this.option,s=(i?o.maxWidthMoveLeft:o.maxWidth)||Number.MAX_SAFE_INTEGER,a=o.minWidth/this.rectScale.x||e,l=(r?o.maxHeightMoveUp:o.maxHeight)||Number.MAX_SAFE_INTEGER,u=o.minHeight/this.rectScale.y||t,c=Math.min(s,Math.max(a,e)),d=Math.min(l,Math.max(u,t));return{width:c,height:d}}_applyChange(){let e={left:0,right:0,top:0,width:0,height:0};if(this.el.style.position==="absolute"){let t=this.el.parentElement,{left:i,right:r,top:o}=t.getBoundingClientRect();e={left:i,right:r,top:o,width:0,height:0}}return this.temporalRect?(Object.entries(this.temporalRect).forEach(([t,i])=>{if(this.option.rtl?t==="left":t==="right")return;let r=t==="width"||t==="left"||t==="right"?this.rectScale.x:t==="height"||t==="top"?this.rectScale.y:1,o;t==="right"?o=(e.right-i)*this.rectScale.x+"px":o=(i-e[t])*r+"px",this.el.style[t]=o}),this):this}_removeHandlers(){return this.handlers.forEach(e=>e.destroy()),delete this.handlers,this}};Ei._originStyleProp=["width","height","position","left","right","top","opacity","zIndex"];var dv='input,textarea,button,select,option,[contenteditable="true"],.ui-resizable-handle',bi=class n extends Ht{constructor(e,t={}){var o;super(),this.el=e,this.option=t,this.dragTransform={xScale:1,yScale:1,xOffset:0,yOffset:0},this._autoScrollTick=()=>{let s=this.helper,a=this._autoScrollContainer;if(!s||!a){this._stopScrolling();return}let l=this._getClipping(s,a);if(l===0){this._stopScrolling();return}if(!this._autoScrollMaxSpeed){let y=window.innerHeight||document.documentElement.clientHeight;this._autoScrollMaxSpeed=Math.max(y/150,4)}let u=Math.abs(l),c=Math.min(u*.5,this._autoScrollMaxSpeed),d=l>0?c:-c,p=a.scrollTop;if(a.scrollTop+=d,a.scrollTop===p){this._stopScrolling();return}this.dragging&&this.lastDrag&&(this._dragFollow(this.lastDrag),this._callDrag(this.lastDrag)),this._autoScrollAnimId=requestAnimationFrame(this._autoScrollTick)};let i=(o=t==null?void 0:t.handle)==null?void 0:o.substring(1),r=e.gridstackNode;this.dragEls=!i||e.classList.contains(i)?[e]:r!=null&&r.subGrid?[e.querySelector(t.handle)||e]:this.getAllHandles(),this.dragEls.length===0&&(this.dragEls=[e]),this._mouseDown=this._mouseDown.bind(this),this._mouseMove=this._mouseMove.bind(this),this._mouseUp=this._mouseUp.bind(this),this._keyEvent=this._keyEvent.bind(this),this.enable()}getAllHandles(){return Array.from(this.el.querySelectorAll(this.option.handle)).filter(e=>{if(!(e instanceof HTMLElement))return!1;let t=e.closest(".grid-stack-item");return t===this.el||!t})}on(e,t){super.on(e,t)}off(e){super.off(e)}enable(){this.disabled!==!1&&(super.enable(),this.dragEls.forEach(e=>{e.addEventListener("mousedown",this._mouseDown),Re&&(e.addEventListener("touchstart",Nn),e.addEventListener("pointerdown",In))}),this.el.classList.remove("ui-draggable-disabled"))}disable(e=!1){this.disabled!==!0&&(super.disable(),this.dragEls.forEach(t=>{t.removeEventListener("mousedown",this._mouseDown),Re&&(t.removeEventListener("touchstart",Nn),t.removeEventListener("pointerdown",In))}),e||this.el.classList.add("ui-draggable-disabled"))}destroy(){this.dragTimeout&&window.clearTimeout(this.dragTimeout),delete this.dragTimeout,this.mouseDownEvent&&this._mouseUp(this.mouseDownEvent),this.disable(!0),delete this.el,delete this.helper,delete this.option,super.destroy()}updateOption(e){return Object.keys(e).forEach(t=>this.option[t]=e[t]),this}_mouseDown(e){if(Ae.touchHandled&&e.isTrusted&&(Ae.touchHandled=!1),!F.mouseHandled)return e.button!==0||!this.dragEls.find(t=>t===e.target)&&e.target.closest(dv)||this.option.cancel&&e.target.closest(this.option.cancel)||(this.mouseDownEvent=e,delete this.dragging,delete F.dragElement,delete F.dropElement,delete this._autoScrollMaxSpeed,delete this._autoScrollContainer,document.addEventListener("mousemove",this._mouseMove,{capture:!0,passive:!0}),document.addEventListener("mouseup",this._mouseUp,!0),Re&&(e.currentTarget.addEventListener("touchmove",kn),e.currentTarget.addEventListener("touchend",Rn)),e.preventDefault(),document.activeElement&&document.activeElement.blur(),F.mouseHandled=!0),!0}_callDrag(e){if(!this.dragging)return;let t=E.initEvent(e,{target:this.el,type:"drag"});this.option.drag&&this.option.drag(t,this.ui()),this.triggerEvent("drag",t)}_mouseMove(e){var i;let t=this.mouseDownEvent;if(this.lastDrag=e,this.dragging)if(this._dragFollow(e),F.pauseDrag){let r=Number.isInteger(F.pauseDrag)?F.pauseDrag:100;this.dragTimeout&&window.clearTimeout(this.dragTimeout),this.dragTimeout=window.setTimeout(()=>this._callDrag(e),r)}else this._callDrag(e);else if(Math.abs(e.x-t.x)+Math.abs(e.y-t.y)>3){this.dragging=!0,F.dragElement=this;let r=(i=this.el.gridstackNode)==null?void 0:i.grid;r?F.dropElement=r.el.ddElement.ddDroppable:delete F.dropElement,this.helper=this._createHelper(),this._setupHelperContainmentStyle(),this.dragTransform=E.getValuesFromTransformedElement(this.helperContainment),this.dragOffset=this._getDragOffset(e,this.el,this.helperContainment),this._setupHelperStyle(e);let o=E.initEvent(e,{target:this.el,type:"dragstart"});this.option.start&&this.option.start(o,this.ui()),this.triggerEvent("dragstart",o),document.addEventListener("keydown",this._keyEvent)}return!0}_mouseUp(e){var t,i;if(this._stopScrolling(),document.removeEventListener("mousemove",this._mouseMove,!0),document.removeEventListener("mouseup",this._mouseUp,!0),Re&&e.currentTarget&&(e.currentTarget.removeEventListener("touchmove",kn,!0),e.currentTarget.removeEventListener("touchend",Rn,!0)),this.dragging){delete this.dragging,(t=this.el.gridstackNode)==null||delete t._origRotate,document.removeEventListener("keydown",this._keyEvent),((i=F.dropElement)==null?void 0:i.el)===this.el.parentElement&&delete F.dropElement,this.helperContainment.style.position=this.parentOriginStylePosition||null,this.helper!==this.el&&this.helper.remove(),this._removeHelperStyle();let r=E.initEvent(e,{target:this.el,type:"dragstop"});this.option.stop&&this.option.stop(r),this.triggerEvent("dragstop",r),F.dropElement&&F.dropElement.drop(e)}delete this.helper,delete this.mouseDownEvent,delete F.dragElement,delete F.dropElement,delete F.mouseHandled,e.preventDefault()}_keyEvent(e){var r,o;let t=this.el.gridstackNode,i=(t==null?void 0:t.grid)||((o=(r=F.dropElement)==null?void 0:r.el)==null?void 0:o.gridstack);if(e.key==="Escape")t&&t._origRotate&&(t._orig=t._origRotate,delete t._origRotate),i==null||i.cancelDrag(),this._mouseUp(this.mouseDownEvent);else if(t&&i&&(e.key==="r"||e.key==="R")){if(!E.canBeRotated(t))return;t._origRotate=t._origRotate||O({},t._orig),delete t._moving,i.setAnimation(!1).rotate(t.el,{top:-this.dragOffset.offsetTop,left:-this.dragOffset.offsetX}).setAnimation(),t._moving=!0,this.dragOffset=this._getDragOffset(this.lastDrag,t.el,this.helperContainment),this.helper.style.width=this.dragOffset.width+"px",this.helper.style.height=this.dragOffset.height+"px",E.swap(t._orig,"w","h"),delete t._rect,this._mouseMove(this.lastDrag)}}_createHelper(){let e=this.el;return typeof this.option.helper=="function"?e=this.option.helper(this.el):this.option.helper==="clone"&&(e=E.cloneNode(this.el)),e.parentElement||E.appendTo(e,this.option.appendTo==="parent"?this.el.parentElement:this.option.appendTo),this.dragElementOriginStyle=n.originStyleProp.map(t=>this.el.style[t]),e}_setupHelperStyle(e){var i,r;this.helper.classList.add("ui-draggable-dragging"),(r=(i=this.el.gridstackNode)==null?void 0:i.grid)==null||r.el.classList.add("grid-stack-dragging");let t=this.helper.style;return t.pointerEvents="none",t.width=this.dragOffset.width+"px",t.height=this.dragOffset.height+"px",t.willChange="left, right, top",t.position="fixed",this._dragFollow(e),t.transition="none",setTimeout(()=>{this.helper&&(t.transition=null)},0),this}_removeHelperStyle(){var t,i,r;this.helper.classList.remove("ui-draggable-dragging"),(i=(t=this.el.gridstackNode)==null?void 0:t.grid)==null||i.el.classList.remove("grid-stack-dragging");let e=(r=this.helper)==null?void 0:r.gridstackNode;if(!(e!=null&&e._isAboutToRemove)&&this.dragElementOriginStyle){let o=this.helper,s=this.dragElementOriginStyle.transition||null;o.style.transition=this.dragElementOriginStyle.transition="none",n.originStyleProp.forEach(a=>o.style[a]=this.dragElementOriginStyle[a]||null),setTimeout(()=>o.style.transition=s,50)}return delete this.dragElementOriginStyle,this}_dragFollow(e){let t=this.helper.style,i=this.dragOffset;this.option.rtl?(t.right=(window.innerWidth-e.clientX+i.offsetX)*this.dragTransform.xScale+"px",t.left&&(t.left="")):(t.left=(e.clientX+i.offsetX)*this.dragTransform.xScale+"px",t.right&&(t.right="")),t.top=(e.clientY+i.offsetTop)*this.dragTransform.yScale+"px"}_setupHelperContainmentStyle(){return this.helperContainment=this.helper.parentElement,this.helper.style.position!=="fixed"&&(this.parentOriginStylePosition=this.helperContainment.style.position,getComputedStyle(this.helperContainment).position.match(/static/)&&(this.helperContainment.style.position="relative")),this}_getDragOffset(e,t,i){let r=0,o=0;i&&(r=this.dragTransform.xOffset,o=this.dragTransform.yOffset);let s=t.getBoundingClientRect(),a=this.option.rtl?s.right:s.left,l=this.option.rtl?e.clientX-s.right+r:-e.clientX+s.left-r;return{x:a,top:s.top,offsetX:l,offsetTop:-e.clientY+s.top-o,width:s.width*this.dragTransform.xScale,height:s.height*this.dragTransform.yScale}}updateScrollPosition(e){this._autoScrollContainer=E.getScrollElement(e),this._getClipping(this.helper,this._autoScrollContainer)===0?this._stopScrolling():this._autoScrollAnimId||(this._autoScrollAnimId=requestAnimationFrame(this._autoScrollTick))}_getClipping(e,t){let i=e.getBoundingClientRect(),r=t.getBoundingClientRect(),o=window.innerHeight||document.documentElement.clientHeight;if(i.bottomr.bottom)return 0;let s=i.bottom-Math.min(r.bottom,o),a=i.top-Math.max(r.top,0);return a<0?a:s>0?s:0}_stopScrolling(){this._autoScrollAnimId&&(cancelAnimationFrame(this._autoScrollAnimId),delete this._autoScrollAnimId)}ui(){let t=this.el.parentElement.getBoundingClientRect(),i=this.helper.getBoundingClientRect(),r=this.option.rtl?(t.right-i.right)*this.dragTransform.xScale:(i.left-t.left)*this.dragTransform.xScale;return{position:{top:(i.top-t.top)*this.dragTransform.yScale,left:r}}}};bi.originStyleProp=["width","height","transform","transform-origin","transition","pointerEvents","position","left","right","top","minWidth","willChange"];var Ir=class extends Ht{constructor(e,t={}){super(),this.el=e,this.option=t,this._mouseEnter=this._mouseEnter.bind(this),this._mouseLeave=this._mouseLeave.bind(this),this.enable(),this._setupAccept()}on(e,t){super.on(e,t)}off(e){super.off(e)}enable(){this.disabled!==!1&&(super.enable(),this.el.classList.add("ui-droppable"),this.el.classList.remove("ui-droppable-disabled"),this.el.addEventListener("mouseenter",this._mouseEnter),this.el.addEventListener("mouseleave",this._mouseLeave),Re&&(this.el.addEventListener("pointerenter",as),this.el.addEventListener("pointerleave",ls)))}disable(e=!1){this.disabled!==!0&&(super.disable(),this.el.classList.remove("ui-droppable"),e||this.el.classList.add("ui-droppable-disabled"),this.el.removeEventListener("mouseenter",this._mouseEnter),this.el.removeEventListener("mouseleave",this._mouseLeave),Re&&(this.el.removeEventListener("pointerenter",as),this.el.removeEventListener("pointerleave",ls)))}destroy(){this.disable(!0),this.el.classList.remove("ui-droppable"),this.el.classList.remove("ui-droppable-disabled"),super.destroy()}updateOption(e){return Object.keys(e).forEach(t=>this.option[t]=e[t]),this._setupAccept(),this}_mouseEnter(e){if(!F.dragElement||Ae.touchHandled&&e.isTrusted||!this._canDrop(F.dragElement.el))return;e.preventDefault(),e.stopPropagation(),F.dragElement._stopScrolling(),F.dropElement&&F.dropElement!==this&&F.dropElement._mouseLeave(e,!0),F.dropElement=this;let t=E.initEvent(e,{target:this.el,type:"dropover"});this.option.over&&this.option.over(t,this._ui(F.dragElement)),this.triggerEvent("dropover",t),this.el.classList.add("ui-droppable-over")}_mouseLeave(e,t=!1){var r;if(!F.dragElement||F.dropElement!==this)return;e.preventDefault(),e.stopPropagation(),t&&F.dragElement._stopScrolling();let i=E.initEvent(e,{target:this.el,type:"dropout"});if(this.option.out&&this.option.out(i,this._ui(F.dragElement)),this.triggerEvent("dropout",i),F.dropElement===this&&(delete F.dropElement,!t)){let o,s=this.el.parentElement;for(;!o&&s;)o=(r=s.ddElement)==null?void 0:r.ddDroppable,s=s.parentElement;o&&o._mouseEnter(e)}}drop(e){e.preventDefault();let t=E.initEvent(e,{target:this.el,type:"drop"});this.option.drop&&this.option.drop(t,this._ui(F.dragElement)),this.triggerEvent("drop",t)}_canDrop(e){return e&&(!this.accept||this.accept(e))}_setupAccept(){return this.option.accept?(typeof this.option.accept=="string"?this.accept=e=>e.classList.contains(this.option.accept)||e.matches(this.option.accept):this.accept=this.option.accept,this):this}_ui(e){return O({draggable:e.el},e.ui())}};var Hr=class n{static init(e){return e.ddElement||(e.ddElement=new n(e)),e.ddElement}constructor(e){this.el=e}on(e,t){return this.ddDraggable&&["drag","dragstart","dragstop"].indexOf(e)>-1?this.ddDraggable.on(e,t):this.ddDroppable&&["drop","dropover","dropout"].indexOf(e)>-1?this.ddDroppable.on(e,t):this.ddResizable&&["resizestart","resize","resizestop"].indexOf(e)>-1&&this.ddResizable.on(e,t),this}off(e){return this.ddDraggable&&["drag","dragstart","dragstop"].indexOf(e)>-1?this.ddDraggable.off(e):this.ddDroppable&&["drop","dropover","dropout"].indexOf(e)>-1?this.ddDroppable.off(e):this.ddResizable&&["resizestart","resize","resizestop"].indexOf(e)>-1&&this.ddResizable.off(e),this}setupDraggable(e){return this.ddDraggable?this.ddDraggable.updateOption(e):this.ddDraggable=new bi(this.el,e),this}cleanDraggable(){return this.ddDraggable&&(this.ddDraggable.destroy(),delete this.ddDraggable),this}setupResizable(e){return this.ddResizable?this.ddResizable.updateOption(e):this.ddResizable=new Ei(this.el,e),this}cleanResizable(){return this.ddResizable&&(this.ddResizable.destroy(),delete this.ddResizable),this}setupDroppable(e){return this.ddDroppable?this.ddDroppable.updateOption(e):this.ddDroppable=new Ir(this.el,e),this}cleanDroppable(){return this.ddDroppable&&(this.ddDroppable.destroy(),delete this.ddDroppable),this}};var Pr=class{resizable(e,t,i,r){return this._getDDElements(e,t).forEach(o=>{if(t==="disable"||t==="enable")o.ddResizable&&o.ddResizable[t]();else if(t==="destroy")o.ddResizable&&o.cleanResizable();else if(t==="option")o.setupResizable({[i]:r});else{let a=o.el.gridstackNode.grid,l=o.el.getAttribute("gs-resize-handles")||a.opts.resizable.handles||"e,s,se";l==="all"&&(l="n,e,s,w,se,sw,ne,nw");let u=!a.opts.alwaysShowResizeHandle;o.setupResizable(se(O({},a.opts.resizable),{handles:l,autoHide:u,start:t.start,stop:t.stop,resize:t.resize,rtl:t.rtl}))}}),this}draggable(e,t,i,r){return this._getDDElements(e,t).forEach(o=>{if(t==="disable"||t==="enable")o.ddDraggable&&o.ddDraggable[t]();else if(t==="destroy")o.ddDraggable&&o.cleanDraggable();else if(t==="option")o.setupDraggable({[i]:r});else{let s=o.el.gridstackNode.grid;o.setupDraggable(se(O({},s.opts.draggable),{start:t.start,stop:t.stop,drag:t.drag,rtl:t.rtl}))}}),this}dragIn(e,t){return this._getDDElements(e).forEach(i=>i.setupDraggable(t)),this}droppable(e,t,i,r){return typeof t.accept=="function"&&!t._accept&&(t._accept=t.accept,t.accept=o=>t._accept(o)),this._getDDElements(e,t).forEach(o=>{t==="disable"||t==="enable"?o.ddDroppable&&o.ddDroppable[t]():t==="destroy"?o.ddDroppable&&o.cleanDroppable():t==="option"?o.setupDroppable({[i]:r}):o.setupDroppable(t)}),this}isDroppable(e){var t;return!!((t=e==null?void 0:e.ddElement)!=null&&t.ddDroppable&&!e.ddElement.ddDroppable.disabled)}isDraggable(e){var t;return!!((t=e==null?void 0:e.ddElement)!=null&&t.ddDraggable&&!e.ddElement.ddDraggable.disabled)}isResizable(e){var t;return!!((t=e==null?void 0:e.ddElement)!=null&&t.ddResizable&&!e.ddElement.ddResizable.disabled)}on(e,t,i){return this._getDDElements(e).forEach(r=>r.on(t,o=>{i(o,F.dragElement?F.dragElement.el:o.target,F.dragElement?F.dragElement.helper:null)})),this}off(e,t){return this._getDDElements(e).forEach(i=>i.off(t)),this}_getDDElements(e,t){let i=e.gridstack||t!=="destroy"&&t!=="disable",r=E.getElements(e);return r.length?r.map(s=>s.ddElement||(i?Hr.init(s):null)).filter(s=>s):[]}};var Ie=new Pr,yt=class n{static init(e={},t=".grid-stack"){if(typeof document=="undefined")return null;let i=n.getGridElement(t);return i?(i.gridstack||(i.gridstack=new n(i,E.cloneDeep(e))),i.gridstack):(console.error(typeof t=="string"?'GridStack.initAll() no grid was found with selector "'+t+`" - element missing or wrong selector ? + `}}function q(){t.calendarContainer.classList.add("hasWeeks");var f=te("div","flatpickr-weekwrapper");f.appendChild(te("span","flatpickr-weekday",t.l10n.weekAbbreviation));var h=te("div","flatpickr-weeks");return f.appendChild(h),{weekWrapper:f,weekNumbers:h}}function M(f,h){h===void 0&&(h=!0);var v=h?f:f-t.currentMonth;v<0&&t._hidePrevMonthArrow===!0||v>0&&t._hideNextMonthArrow===!0||(t.currentMonth+=v,(t.currentMonth<0||t.currentMonth>11)&&(t.currentYear+=t.currentMonth>11?1:-1,t.currentMonth=(t.currentMonth+12)%12,ue("onYearChange"),Z()),Q(),ue("onMonthChange"),Ai())}function D(f,h){if(f===void 0&&(f=!0),h===void 0&&(h=!0),t.input.value="",t.altInput!==void 0&&(t.altInput.value=""),t.mobileInput!==void 0&&(t.mobileInput.value=""),t.selectedDates=[],t.latestSelectedDateObj=void 0,h===!0&&(t.currentYear=t._initialDate.getFullYear(),t.currentMonth=t._initialDate.getMonth()),t.config.enableTime===!0){var v=Nr(t.config),b=v.hours,S=v.minutes,N=v.seconds;y(b,S,N)}t.redraw(),f&&ue("onChange")}function B(){t.isOpen=!1,t.isMobile||(t.calendarContainer!==void 0&&t.calendarContainer.classList.remove("open"),t._input!==void 0&&t._input.classList.remove("active")),ue("onClose")}function V(){t.config!==void 0&&ue("onDestroy");for(var f=t._handlers.length;f--;)t._handlers[f].remove();if(t._handlers=[],t.mobileInput)t.mobileInput.parentNode&&t.mobileInput.parentNode.removeChild(t.mobileInput),t.mobileInput=void 0;else if(t.calendarContainer&&t.calendarContainer.parentNode)if(t.config.static&&t.calendarContainer.parentNode){var h=t.calendarContainer.parentNode;if(h.lastChild&&h.removeChild(h.lastChild),h.parentNode){for(;h.firstChild;)h.parentNode.insertBefore(h.firstChild,h);h.parentNode.removeChild(h)}}else t.calendarContainer.parentNode.removeChild(t.calendarContainer);t.altInput&&(t.input.type="text",t.altInput.parentNode&&t.altInput.parentNode.removeChild(t.altInput),delete t.altInput),t.input&&(t.input.type=t.input._type,t.input.classList.remove("flatpickr-input"),t.input.removeAttribute("readonly")),["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach(function(v){try{delete t[v]}catch(b){}})}function U(f){return t.calendarContainer.contains(f)}function Y(f){if(t.isOpen&&!t.config.inline){var h=Ve(f),v=U(h),b=h===t.input||h===t.altInput||t.element.contains(h)||f.path&&f.path.indexOf&&(~f.path.indexOf(t.input)||~f.path.indexOf(t.altInput)),S=!b&&!v&&!U(f.relatedTarget),N=!t.config.ignoredFocusElements.some(function(X){return X.contains(h)});S&&N&&(t.config.allowInput&&t.setDate(t._input.value,!1,t.config.altInput?t.config.altFormat:t.config.dateFormat),t.timeContainer!==void 0&&t.minuteElement!==void 0&&t.hourElement!==void 0&&t.input.value!==""&&t.input.value!==void 0&&l(),t.close(),t.config&&t.config.mode==="range"&&t.selectedDates.length===1&&t.clear(!1))}}function ee(f){if(!(!f||t.config.minDate&&ft.config.maxDate.getFullYear())){var h=f,v=t.currentYear!==h;t.currentYear=h||t.currentYear,t.config.maxDate&&t.currentYear===t.config.maxDate.getFullYear()?t.currentMonth=Math.min(t.config.maxDate.getMonth(),t.currentMonth):t.config.minDate&&t.currentYear===t.config.minDate.getFullYear()&&(t.currentMonth=Math.max(t.config.minDate.getMonth(),t.currentMonth)),v&&(t.redraw(),ue("onYearChange"),Z())}}function oe(f,h){var v;h===void 0&&(h=!0);var b=t.parseDate(f,void 0,h);if(t.config.minDate&&b&&ze(b,t.config.minDate,h!==void 0?h:!t.minDateHasTime)<0||t.config.maxDate&&b&&ze(b,t.config.maxDate,h!==void 0?h:!t.maxDateHasTime)>0)return!1;if(!t.config.enable&&t.config.disable.length===0)return!0;if(b===void 0)return!1;for(var S=!!t.config.enable,N=(v=t.config.enable)!==null&&v!==void 0?v:t.config.disable,X=0,P=void 0;X=P.from.getTime()&&b.getTime()<=P.to.getTime())return S}return!S}function Et(f){return t.daysContainer!==void 0?f.className.indexOf("hidden")===-1&&f.className.indexOf("flatpickr-disabled")===-1&&t.daysContainer.contains(f):!1}function Fr(f){var h=f.target===t._input,v=t._input.value.trimEnd()!==zr();h&&v&&!(f.relatedTarget&&U(f.relatedTarget))&&t.setDate(t._input.value,!0,f.target===t.altInput?t.config.altFormat:t.config.dateFormat)}function nn(f){var h=Ve(f),v=t.config.wrap?n.contains(h):h===t._input,b=t.config.allowInput,S=t.isOpen&&(!b||!v),N=t.config.inline&&v&&!b;if(f.keyCode===13&&v){if(b)return t.setDate(t._input.value,!0,h===t.altInput?t.config.altFormat:t.config.dateFormat),t.close(),h.blur();t.open()}else if(U(h)||S||N){var X=!!t.timeContainer&&t.timeContainer.contains(h);switch(f.keyCode){case 13:X?(f.preventDefault(),l(),an()):ln(f);break;case 27:f.preventDefault(),an();break;case 8:case 46:v&&!t.config.allowInput&&(f.preventDefault(),t.clear());break;case 37:case 39:if(!X&&!v){f.preventDefault();var P=o();if(t.daysContainer!==void 0&&(b===!1||P&&Et(P))){var J=f.keyCode===39?1:-1;f.ctrlKey?(f.stopPropagation(),M(J),W(I(1),0)):W(void 0,J)}}else t.hourElement&&t.hourElement.focus();break;case 38:case 40:f.preventDefault();var H=f.keyCode===40?1:-1;t.daysContainer&&h.$i!==void 0||h===t.input||h===t.altInput?f.ctrlKey?(f.stopPropagation(),ee(t.currentYear-H),W(I(1),0)):X||W(void 0,H*7):h===t.currentYearElement?ee(t.currentYear-H):t.config.enableTime&&(!X&&t.hourElement&&t.hourElement.focus(),l(f),t._debouncedChange());break;case 9:if(X){var K=[t.hourElement,t.minuteElement,t.secondElement,t.amPM].concat(t.pluginElements).filter(function(We){return We}),re=K.indexOf(h);if(re!==-1){var it=K[re+(f.shiftKey?-1:1)];f.preventDefault(),(it||t._input).focus()}}else!t.config.noCalendar&&t.daysContainer&&t.daysContainer.contains(h)&&f.shiftKey&&(f.preventDefault(),t._input.focus());break;default:break}}if(t.amPM!==void 0&&h===t.amPM)switch(f.key){case t.l10n.amPM[0].charAt(0):case t.l10n.amPM[0].charAt(0).toLowerCase():t.amPM.textContent=t.l10n.amPM[0],d(),st();break;case t.l10n.amPM[1].charAt(0):case t.l10n.amPM[1].charAt(0).toLowerCase():t.amPM.textContent=t.l10n.amPM[1],d(),st();break}(v||U(h))&&ue("onKeyDown",f)}function rn(f,h){if(h===void 0&&(h="flatpickr-day"),!(t.selectedDates.length!==1||f&&(!f.classList.contains(h)||f.classList.contains("flatpickr-disabled")))){for(var v=f?f.dateObj.getTime():t.days.firstElementChild.dateObj.getTime(),b=t.parseDate(t.selectedDates[0],void 0,!0).getTime(),S=Math.min(v,t.selectedDates[0].getTime()),N=Math.max(v,t.selectedDates[0].getTime()),X=!1,P=0,J=0,H=S;HS&&HP)?P=H:H>b&&(!J||H ."+h));K.forEach(function(re){var it=re.dateObj,We=it.getTime(),$n=P>0&&We0&&We>J;if($n){re.classList.add("notAllowed"),["inRange","startRange","endRange"].forEach(function(cn){re.classList.remove(cn)});return}else if(X&&!$n)return;["startRange","inRange","endRange","notAllowed"].forEach(function(cn){re.classList.remove(cn)}),f!==void 0&&(f.classList.add(v<=t.selectedDates[0].getTime()?"startRange":"endRange"),bv&&We===b&&re.classList.add("endRange"),We>=P&&(J===0||We<=J)&&Cc(We,b,v)&&re.classList.add("inRange"))})}}function _i(){t.isOpen&&!t.config.static&&!t.config.inline&&on()}function $r(f,h){if(h===void 0&&(h=t._positionElement),t.isMobile===!0){if(f){f.preventDefault();var v=Ve(f);v&&v.blur()}t.mobileInput!==void 0&&(t.mobileInput.focus(),t.mobileInput.click()),ue("onOpen");return}else if(t._input.disabled||t.config.inline)return;var b=t.isOpen;t.isOpen=!0,b||(t.calendarContainer.classList.add("open"),t._input.classList.add("active"),ue("onOpen"),on(h)),t.config.enableTime===!0&&t.config.noCalendar===!0&&t.config.allowInput===!1&&(f===void 0||!t.timeContainer.contains(f.relatedTarget))&&setTimeout(function(){return t.hourElement.select()},50)}function wi(f){return function(h){var v=t.config["_"+f+"Date"]=t.parseDate(h,t.config.dateFormat),b=t.config["_"+(f==="min"?"max":"min")+"Date"];v!==void 0&&(t[f==="min"?"minDateHasTime":"maxDateHasTime"]=v.getHours()>0||v.getMinutes()>0||v.getSeconds()>0),t.selectedDates&&(t.selectedDates=t.selectedDates.filter(function(S){return oe(S)}),!t.selectedDates.length&&f==="min"&&p(v),st()),t.daysContainer&&(Pn(),v!==void 0?t.currentYearElement[f]=v.getFullYear().toString():t.currentYearElement.removeAttribute(f),t.currentYearElement.disabled=!!b&&v!==void 0&&b.getFullYear()===v.getFullYear())}}function xi(){var f=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],h=Me(Me({},JSON.parse(JSON.stringify(n.dataset||{}))),e),v={};t.config.parseDate=h.parseDate,t.config.formatDate=h.formatDate,Object.defineProperty(t.config,"enable",{get:function(){return t.config._enable},set:function(K){t.config._enable=ds(K)}}),Object.defineProperty(t.config,"disable",{get:function(){return t.config._disable},set:function(K){t.config._disable=ds(K)}});var b=h.mode==="time";if(!h.dateFormat&&(h.enableTime||b)){var S=be.defaultConfig.dateFormat||It.dateFormat;v.dateFormat=h.noCalendar||b?"H:i"+(h.enableSeconds?":S":""):S+" H:i"+(h.enableSeconds?":S":"")}if(h.altInput&&(h.enableTime||b)&&!h.altFormat){var N=be.defaultConfig.altFormat||It.altFormat;v.altFormat=h.noCalendar||b?"h:i"+(h.enableSeconds?":S K":" K"):N+(" h:i"+(h.enableSeconds?":S":"")+" K")}Object.defineProperty(t.config,"minDate",{get:function(){return t.config._minDate},set:wi("min")}),Object.defineProperty(t.config,"maxDate",{get:function(){return t.config._maxDate},set:wi("max")});var X=function(K){return function(re){t.config[K==="min"?"_minTime":"_maxTime"]=t.parseDate(re,"H:i:S")}};Object.defineProperty(t.config,"minTime",{get:function(){return t.config._minTime},set:X("min")}),Object.defineProperty(t.config,"maxTime",{get:function(){return t.config._maxTime},set:X("max")}),h.mode==="time"&&(t.config.noCalendar=!0,t.config.enableTime=!0),Object.assign(t.config,v,h);for(var P=0;P-1?t.config[H]=Or(J[H]).map(s).concat(t.config[H]):typeof h[H]=="undefined"&&(t.config[H]=J[H])}h.altInputClass||(t.config.altInputClass=Hn().className+" "+t.config.altInputClass),ue("onParseConfig")}function Hn(){return t.config.wrap?n.querySelector("[data-input]"):n}function Ci(){typeof t.config.locale!="object"&&typeof be.l10ns[t.config.locale]=="undefined"&&t.config.errorHandler(new Error("flatpickr: invalid locale "+t.config.locale)),t.l10n=Me(Me({},be.l10ns.default),typeof t.config.locale=="object"?t.config.locale:t.config.locale!=="default"?be.l10ns[t.config.locale]:void 0),vt.D="("+t.l10n.weekdays.shorthand.join("|")+")",vt.l="("+t.l10n.weekdays.longhand.join("|")+")",vt.M="("+t.l10n.months.shorthand.join("|")+")",vt.F="("+t.l10n.months.longhand.join("|")+")",vt.K="("+t.l10n.amPM[0]+"|"+t.l10n.amPM[1]+"|"+t.l10n.amPM[0].toLowerCase()+"|"+t.l10n.amPM[1].toLowerCase()+")";var f=Me(Me({},e),JSON.parse(JSON.stringify(n.dataset||{})));f.time_24hr===void 0&&be.defaultConfig.time_24hr===void 0&&(t.config.time_24hr=t.l10n.time_24hr),t.formatDate=os(t),t.parseDate=Lr({config:t.config,l10n:t.l10n})}function on(f){if(typeof t.config.position=="function")return void t.config.position(t,f);if(t.calendarContainer!==void 0){ue("onPreCalendarPosition");var h=f||t._positionElement,v=Array.prototype.reduce.call(t.calendarContainer.children,(function(nu,iu){return nu+iu.offsetHeight}),0),b=t.calendarContainer.offsetWidth,S=t.config.position.split(" "),N=S[0],X=S.length>1?S[1]:null,P=h.getBoundingClientRect(),J=window.innerHeight-P.bottom,H=N==="above"||N!=="below"&&Jv,K=window.pageYOffset+P.top+(H?-v-2:h.offsetHeight+2);if(Le(t.calendarContainer,"arrowTop",!H),Le(t.calendarContainer,"arrowBottom",H),!t.config.inline){var re=window.pageXOffset+P.left,it=!1,We=!1;X==="center"?(re-=(b-P.width)/2,it=!0):X==="right"&&(re-=b-P.width,We=!0),Le(t.calendarContainer,"arrowLeft",!it&&!We),Le(t.calendarContainer,"arrowCenter",it),Le(t.calendarContainer,"arrowRight",We);var $n=window.document.body.offsetWidth-(window.pageXOffset+P.right),cn=re+b>window.document.body.offsetWidth,Kc=$n+b>window.document.body.offsetWidth;if(Le(t.calendarContainer,"rightMost",cn),!t.config.static)if(t.calendarContainer.style.top=K+"px",!cn)t.calendarContainer.style.left=re+"px",t.calendarContainer.style.right="auto";else if(!Kc)t.calendarContainer.style.left="auto",t.calendarContainer.style.right=$n+"px";else{var jr=ot();if(jr===void 0)return;var Xc=window.document.body.offsetWidth,Qc=Math.max(0,Xc/2-b/2),Jc=".flatpickr-calendar.centerMost:before",Zc=".flatpickr-calendar.centerMost:after",eu=jr.cssRules.length,tu="{left:"+P.left+"px;right:auto;}";Le(t.calendarContainer,"rightMost",!1),Le(t.calendarContainer,"centerMost",!0),jr.insertRule(Jc+","+Zc+tu,eu),t.calendarContainer.style.left=Qc+"px",t.calendarContainer.style.right="auto"}}}}function ot(){for(var f=null,h=0;ht.currentMonth+t.config.showMonths-1)&&t.config.mode!=="range";if(t.selectedDateElem=b,t.config.mode==="single")t.selectedDates=[S];else if(t.config.mode==="multiple"){var X=Vr(S);X?t.selectedDates.splice(parseInt(X),1):t.selectedDates.push(S)}else t.config.mode==="range"&&(t.selectedDates.length===2&&t.clear(!1,!1),t.latestSelectedDateObj=S,t.selectedDates.push(S),ze(S,t.selectedDates[0],!0)!==0&&t.selectedDates.sort(function(K,re){return K.getTime()-re.getTime()}));if(d(),N){var P=t.currentYear!==S.getFullYear();t.currentYear=S.getFullYear(),t.currentMonth=S.getMonth(),P&&(ue("onYearChange"),Z()),ue("onMonthChange")}if(Ai(),Q(),st(),!N&&t.config.mode!=="range"&&t.config.showMonths===1?k(b):t.selectedDateElem!==void 0&&t.hourElement===void 0&&t.selectedDateElem&&t.selectedDateElem.focus(),t.hourElement!==void 0&&t.hourElement!==void 0&&t.hourElement.focus(),t.config.closeOnSelect){var J=t.config.mode==="single"&&!t.config.enableTime,H=t.config.mode==="range"&&t.selectedDates.length===2&&!t.config.enableTime;(J||H)&&an()}_()}}var Pt={locale:[Ci,He],showMonths:[Te,a,Ue],minDate:[A],maxDate:[A],positionElement:[fs],clickOpens:[function(){t.config.clickOpens===!0?(g(t._input,"focus",t.open),g(t._input,"click",t.open)):(t._input.removeEventListener("focus",t.open),t._input.removeEventListener("click",t.open))}]};function Ti(f,h){if(f!==null&&typeof f=="object"){Object.assign(t.config,f);for(var v in f)Pt[v]!==void 0&&Pt[v].forEach(function(b){return b()})}else t.config[f]=h,Pt[f]!==void 0?Pt[f].forEach(function(b){return b()}):Sr.indexOf(f)>-1&&(t.config[f]=Or(h));t.redraw(),st(!0)}function Fn(f,h){var v=[];if(f instanceof Array)v=f.map(function(b){return t.parseDate(b,h)});else if(f instanceof Date||typeof f=="number")v=[t.parseDate(f,h)];else if(typeof f=="string")switch(t.config.mode){case"single":case"time":v=[t.parseDate(f,h)];break;case"multiple":v=f.split(t.config.conjunction).map(function(b){return t.parseDate(b,h)});break;case"range":v=f.split(t.l10n.rangeSeparator).map(function(b){return t.parseDate(b,h)});break;default:break}else t.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(f)));t.selectedDates=t.config.allowInvalidPreload?v:v.filter(function(b){return b instanceof Date&&oe(b,!1)}),t.config.mode==="range"&&t.selectedDates.sort(function(b,S){return b.getTime()-S.getTime()})}function Si(f,h,v){if(h===void 0&&(h=!1),v===void 0&&(v=t.config.dateFormat),f!==0&&!f||f instanceof Array&&f.length===0)return t.clear(h);Fn(f,v),t.latestSelectedDateObj=t.selectedDates[t.selectedDates.length-1],t.redraw(),A(void 0,h),p(),t.selectedDates.length===0&&t.clear(!1),st(h),h&&ue("onChange")}function ds(f){return f.slice().map(function(h){return typeof h=="string"||typeof h=="number"||h instanceof Date?t.parseDate(h,void 0,!0):h&&typeof h=="object"&&h.from&&h.to?{from:t.parseDate(h.from,void 0),to:t.parseDate(h.to,void 0)}:h}).filter(function(h){return h})}function zc(){t.selectedDates=[],t.now=t.parseDate(t.config.now)||new Date;var f=t.config.defaultDate||((t.input.nodeName==="INPUT"||t.input.nodeName==="TEXTAREA")&&t.input.placeholder&&t.input.value===t.input.placeholder?null:t.input.value);f&&Fn(f,t.config.dateFormat),t._initialDate=t.selectedDates.length>0?t.selectedDates[0]:t.config.minDate&&t.config.minDate.getTime()>t.now.getTime()?t.config.minDate:t.config.maxDate&&t.config.maxDate.getTime()0&&(t.latestSelectedDateObj=t.selectedDates[0]),t.config.minTime!==void 0&&(t.config.minTime=t.parseDate(t.config.minTime,"H:i")),t.config.maxTime!==void 0&&(t.config.maxTime=t.parseDate(t.config.maxTime,"H:i")),t.minDateHasTime=!!t.config.minDate&&(t.config.minDate.getHours()>0||t.config.minDate.getMinutes()>0||t.config.minDate.getSeconds()>0),t.maxDateHasTime=!!t.config.maxDate&&(t.config.maxDate.getHours()>0||t.config.maxDate.getMinutes()>0||t.config.maxDate.getSeconds()>0)}function jc(){if(t.input=Hn(),!t.input){t.config.errorHandler(new Error("Invalid input element specified"));return}t.input._type=t.input.type,t.input.type="text",t.input.classList.add("flatpickr-input"),t._input=t.input,t.config.altInput&&(t.altInput=te(t.input.nodeName,t.config.altInputClass),t._input=t.altInput,t.altInput.placeholder=t.input.placeholder,t.altInput.disabled=t.input.disabled,t.altInput.required=t.input.required,t.altInput.tabIndex=t.input.tabIndex,t.altInput.type="text",t.input.setAttribute("type","hidden"),!t.config.static&&t.input.parentNode&&t.input.parentNode.insertBefore(t.altInput,t.input.nextSibling)),t.config.allowInput||t._input.setAttribute("readonly","readonly"),fs()}function fs(){t._positionElement=t.config.positionElement||t._input}function Wc(){var f=t.config.enableTime?t.config.noCalendar?"time":"datetime-local":"date";t.mobileInput=te("input",t.input.className+" flatpickr-mobile"),t.mobileInput.tabIndex=1,t.mobileInput.type=f,t.mobileInput.disabled=t.input.disabled,t.mobileInput.required=t.input.required,t.mobileInput.placeholder=t.input.placeholder,t.mobileFormatStr=f==="datetime-local"?"Y-m-d\\TH:i:S":f==="date"?"Y-m-d":"H:i:S",t.selectedDates.length>0&&(t.mobileInput.defaultValue=t.mobileInput.value=t.formatDate(t.selectedDates[0],t.mobileFormatStr)),t.config.minDate&&(t.mobileInput.min=t.formatDate(t.config.minDate,"Y-m-d")),t.config.maxDate&&(t.mobileInput.max=t.formatDate(t.config.maxDate,"Y-m-d")),t.input.getAttribute("step")&&(t.mobileInput.step=String(t.input.getAttribute("step"))),t.input.type="hidden",t.altInput!==void 0&&(t.altInput.type="hidden");try{t.input.parentNode&&t.input.parentNode.insertBefore(t.mobileInput,t.input.nextSibling)}catch(h){}g(t.mobileInput,"change",function(h){t.setDate(Ve(h).value,!1,t.mobileFormatStr),ue("onChange"),ue("onClose")})}function qc(f){if(t.isOpen===!0)return t.close();t.open(f)}function ue(f,h){if(t.config!==void 0){var v=t.config[f];if(v!==void 0&&v.length>0)for(var b=0;v[b]&&b=0&&ze(f,t.selectedDates[1])<=0}function Ai(){t.config.noCalendar||t.isMobile||!t.monthNav||(t.yearElements.forEach(function(f,h){var v=new Date(t.currentYear,t.currentMonth,1);v.setMonth(t.currentMonth+h),t.config.showMonths>1||t.config.monthSelectorType==="static"?t.monthElements[h].textContent=vi(v.getMonth(),t.config.shorthandCurrentMonth,t.l10n)+" ":t.monthsDropdownContainer.value=v.getMonth().toString(),f.value=v.getFullYear().toString()}),t._hidePrevMonthArrow=t.config.minDate!==void 0&&(t.currentYear===t.config.minDate.getFullYear()?t.currentMonth<=t.config.minDate.getMonth():t.currentYeart.config.maxDate.getMonth():t.currentYear>t.config.maxDate.getFullYear()))}function zr(f){var h=f||(t.config.altInput?t.config.altFormat:t.config.dateFormat);return t.selectedDates.map(function(v){return t.formatDate(v,h)}).filter(function(v,b,S){return t.config.mode!=="range"||t.config.enableTime||S.indexOf(v)===b}).join(t.config.mode!=="range"?t.config.conjunction:t.l10n.rangeSeparator)}function st(f){f===void 0&&(f=!0),t.mobileInput!==void 0&&t.mobileFormatStr&&(t.mobileInput.value=t.latestSelectedDateObj!==void 0?t.formatDate(t.latestSelectedDateObj,t.mobileFormatStr):""),t.input.value=zr(t.config.dateFormat),t.altInput!==void 0&&(t.altInput.value=zr(t.config.altFormat)),f!==!1&&ue("onValueUpdate")}function Yc(f){var h=Ve(f),v=t.prevMonthNav.contains(h),b=t.nextMonthNav.contains(h);v||b?M(v?-1:1):t.yearElements.indexOf(h)>=0?h.select():h.classList.contains("arrowUp")?t.changeYear(t.currentYear+1):h.classList.contains("arrowDown")&&t.changeYear(t.currentYear-1)}function Gc(f){f.preventDefault();var h=f.type==="keydown",v=Ve(f),b=v;t.amPM!==void 0&&v===t.amPM&&(t.amPM.textContent=t.l10n.amPM[Be(t.amPM.textContent===t.l10n.amPM[0])]);var S=parseFloat(b.getAttribute("min")),N=parseFloat(b.getAttribute("max")),X=parseFloat(b.getAttribute("step")),P=parseInt(b.value,10),J=f.delta||(h?f.which===38?1:-1:0),H=P+X*J;if(typeof b.value!="undefined"&&b.value.length===2){var K=b===t.hourElement,re=b===t.minuteElement;HN&&(H=b===t.hourElement?H-N-Be(!t.amPM):S,re&&T(void 0,1,t.hourElement)),t.amPM&&K&&(X===1?H+P===23:Math.abs(H-P)>X)&&(t.amPM.textContent=t.l10n.amPM[Be(t.amPM.textContent===t.l10n.amPM[0])]),b.value=Oe(H)}}return r(),t}function Ln(n,e){for(var t=Array.prototype.slice.call(n).filter(function(s){return s instanceof HTMLElement}),i=[],r=0;r option"))if(e.selected){for(let t of R("#id_columns"))t.appendChild(e.cloneNode(!0));e.remove()}n.preventDefault()}function lv(n){for(let e of R("#id_columns > option"))if(e.selected){for(let t of R("#id_available_columns"))t.appendChild(e.cloneNode(!0));e.remove()}n.preventDefault()}function Oc(n,e){return at(this,null,function*(){return yield Dn(n,e)})}function cv(n){var l,u,c;n.preventDefault();let e=n.currentTarget,t=e.getAttribute("data-url");if(t==null){Nt("danger","Error Updating Table Configuration","No API path defined for configuration form.").show();return}let i=((l=document.activeElement)==null?void 0:l.getAttribute("value"))==="Reset",r=(c=(u=e.getAttribute("data-config-root"))==null?void 0:u.split("."))!=null?c:[];if(i){let d=r.reduceRight((p,y)=>({[y]:p}),{});Oc(t,d).then(p=>{Zt(p)?Nt("danger","Error Resetting Table Configuration",p.error).show():window.location.href=window.location.origin+window.location.pathname});return}let o=wl(e,"select[name=columns]"),s=Object.assign({},...o.map(d=>({[d.name]:d.options}))),a=r.reduceRight((d,p)=>({[p]:d}),s);Oc(t,a).then(d=>{Zt(d)?Nt("danger","Error Updating Table Configuration",d.error).show():window.location.href=window.location.origin+window.location.pathname})}function Lc(){for(let n of R("#add_columns"))n.addEventListener("click",av);for(let n of R("#remove_columns"))n.addEventListener("click",lv);for(let n of R("form.userconfigform"))n.addEventListener("submit",cv)}var uv="(min-width: 992px)",ss=class{constructor(e){le(this,"base");le(this,"state");this.base=e,this.state=new hi({pinned:!0},{persist:!0,key:"netbox-sidenav"}),this.init(),this.initLinks()}bodyHas(e){return document.body.hasAttribute(`data-sidenav-${e}`)}bodyRemove(...e){for(let t of e)document.body.removeAttribute(`data-sidenav-${t}`)}bodyAdd(...e){for(let t of e)document.body.setAttribute(`data-sidenav-${t}`,"")}init(){for(let t of this.base.querySelectorAll(".sidenav-toggle"))t.addEventListener("click",i=>this.onToggle(i));for(let t of R(".sidenav-toggle-mobile"))t.addEventListener("click",i=>this.onMobileToggle(i));let e=window.matchMedia(uv);this.setResponsiveState(e.matches),e.addEventListener("change",t=>{this.setResponsiveState(t.matches),this.initLinks()}),window.addEventListener("resize",()=>this.onResize()),this.base.addEventListener("mouseenter",()=>this.onEnter()),this.base.addEventListener("mouseleave",()=>this.onLeave())}setResponsiveState(e){this.bodyRemove("hide"),e&&this.state.get("pinned")?(this.bodyRemove("hidden"),this.bodyAdd("show","pinned")):(this.bodyRemove("show","pinned"),this.bodyAdd("hidden"))}initLinks(){for(let e of this.getActiveLinks())this.bodyHas("show")?this.activateLink(e,"expand"):this.bodyHas("hidden")&&this.activateLink(e,"collapse")}show(){this.bodyAdd("show"),this.bodyRemove("hidden","hide")}hide(){this.bodyAdd("hidden"),this.bodyRemove("pinned","show");for(let e of this.base.querySelectorAll(".collapse"))e.classList.remove("show")}pin(){this.bodyAdd("show","pinned"),this.bodyRemove("hidden"),this.state.set("pinned",!0)}unpin(){this.bodyRemove("pinned","show"),this.bodyAdd("hidden");for(let e of this.base.querySelectorAll(".collapse"))e.classList.remove("show");this.state.set("pinned",!1)}activateLink(e,t){var r;let i=e.closest(".dropdown-menu");if(hr(i)){let o=i.parentElement,s=(r=i.parentElement)==null?void 0:r.querySelector(".nav-link");if(hr(s)&&hr(o))switch(t){case"expand":s.setAttribute("aria-expanded","true"),s.classList.add("show"),o.classList.add("active"),i.classList.add("show"),e.classList.add("active");break;case"collapse":s.setAttribute("aria-expanded","false"),s.classList.remove("show"),o.classList.remove("active"),i.classList.remove("show"),e.classList.remove("active");break}}}*getActiveLinks(){for(let e of this.base.querySelectorAll("ul.navbar-nav .nav-item .dropdown-item")){let t=e.querySelector("a");if(t){let i=new RegExp(t.href,"gi");window.location.href.match(i)&&(yield e)}}}onEnter(){if(!this.bodyHas("pinned")){this.bodyRemove("hide","hidden"),this.bodyAdd("show");for(let e of this.getActiveLinks())this.activateLink(e,"expand")}}onLeave(){if(!this.bodyHas("pinned")){this.bodyRemove("show"),this.bodyAdd("hide");for(let e of this.getActiveLinks())this.activateLink(e,"collapse");this.bodyRemove("hide"),this.bodyAdd("hidden")}}onResize(){this.bodyHas("show")&&!this.bodyHas("pinned")&&(this.bodyRemove("show"),this.bodyAdd("hidden"))}onToggle(e){e.preventDefault(),this.state.get("pinned")?this.unpin():this.pin()}onMobileToggle(e){e.preventDefault(),this.bodyHas("hidden")?this.show():this.hide()}};function Mc(){for(let n of R(".navbar-vertical"))new ss(n)}var E=class n{static getElements(e,t=document){if(typeof e=="string"){let i="getElementById"in t?t:void 0;if(i&&!isNaN(+e[0])){let o=i.getElementById(e);return o?[o]:[]}let r=t.querySelectorAll(e);if(!r.length&&e[0]!=="."&&e[0]!=="#"&&(r=t.querySelectorAll("."+e),r.length||(r=t.querySelectorAll("#"+e)),!r.length)){let o=t.querySelector(`[gs-id="${e}"]`);return o?[o]:[]}return Array.from(r)}return[e]}static getElement(e,t=document){if(typeof e=="string"){let i="getElementById"in t?t:void 0;if(!e.length)return null;if(i&&e[0]==="#")return i.getElementById(e.substring(1));if(e[0]==="#"||e[0]==="."||e[0]==="[")return t.querySelector(e);if(i&&!isNaN(+e[0]))return i.getElementById(e);let r=t.querySelector(e);return i&&!r&&(r=i.getElementById(e)),r||(r=t.querySelector("."+e)),r}return e}static lazyLoad(e){var t,i;return e.lazyLoad||((i=(t=e.grid)==null?void 0:t.opts)==null?void 0:i.lazyLoad)&&e.lazyLoad!==!1}static createDiv(e,t){let i=document.createElement("div");return e.forEach(r=>{r&&i.classList.add(r)}),t==null||t.appendChild(i),i}static shouldSizeToContent(e,t=!1){return(e==null?void 0:e.grid)&&(t?e.sizeToContent===!0||e.grid.opts.sizeToContent===!0&&e.sizeToContent===void 0:!!e.sizeToContent||e.grid.opts.sizeToContent&&e.sizeToContent!==!1)}static isIntercepted(e,t){return!(e.y>=t.y+t.h||e.y+e.h<=t.y||e.x+e.w<=t.x||e.x>=t.x+t.w)}static isTouching(e,t){return n.isIntercepted(e,{x:t.x-.5,y:t.y-.5,w:t.w+1,h:t.h+1})}static areaIntercept(e,t){let i=e.x>t.x?e.x:t.x,r=e.x+e.wt.y?e.y:t.y,s=e.y+e.h{var a,l,u,c;let s=t*(((a=r.y)!=null?a:1e4)-((l=o.y)!=null?l:1e4));return s===0?t*(((u=r.x)!=null?u:1e4)-((c=o.x)!=null?c:1e4)):s})}static find(e,t){return t?e.find(i=>i.id===t):void 0}static toBool(e){return typeof e=="boolean"?e:typeof e=="string"?(e=e.toLowerCase(),!(e===""||e==="no"||e==="false"||e==="0")):!!e}static toNumber(e){return e===null||e.length===0?void 0:Number(e)}static parseHeight(e){let t,i="px";if(typeof e=="string")if(e==="auto"||e==="")t=0;else{let r=e.match(/^(-[0-9]+\.[0-9]+|[0-9]*\.[0-9]+|-[0-9]+|[0-9]+)(px|em|rem|vh|vw|%|cm|mm)?$/);if(!r)throw new Error(`Invalid height val = ${e}`);i=r[2]||"px",t=parseFloat(r[1])}else t=e;return{h:t,unit:i}}static defaults(e,...t){return t.forEach(i=>{for(let r in i){if(!i.hasOwnProperty(r))return;e[r]===null||e[r]===void 0?e[r]=i[r]:typeof i[r]=="object"&&typeof e[r]=="object"&&n.defaults(e[r],i[r])}}),e}static same(e,t){if(typeof e!="object")return e==t;if(typeof e!=typeof t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let i in e)if(e[i]!==t[i])return!1;return!0}static copyPos(e,t,i=!1){return t.x!==void 0&&(e.x=t.x),t.y!==void 0&&(e.y=t.y),t.w!==void 0&&(e.w=t.w),t.h!==void 0&&(e.h=t.h),i&&(t.minW&&(e.minW=t.minW),t.minH&&(e.minH=t.minH),t.maxW&&(e.maxW=t.maxW),t.maxH&&(e.maxH=t.maxH)),e}static samePos(e,t){return e&&t&&e.x===t.x&&e.y===t.y&&(e.w||1)===(t.w||1)&&(e.h||1)===(t.h||1)}static sanitizeMinMax(e){e.minW||delete e.minW,e.minH||delete e.minH,e.maxW||delete e.maxW,e.maxH||delete e.maxH}static removeInternalAndSame(e,t){if(!(typeof e!="object"||typeof t!="object")&&!(Array.isArray(e)||Array.isArray(t)))for(let i in e){let r=e[i],o=t[i];i[0]==="_"||r===o?delete e[i]:r&&typeof r=="object"&&o!==void 0&&(n.removeInternalAndSame(r,o),Object.keys(r).length||delete e[i])}}static removeInternalForSave(e,t=!0){for(let i in e)(i[0]==="_"||e[i]===null||e[i]===void 0)&&delete e[i];delete e.grid,t&&delete e.el,e.autoPosition||delete e.autoPosition,e.noResize||delete e.noResize,e.noMove||delete e.noMove,e.locked||delete e.locked,(e.w===1||e.w===e.minW)&&delete e.w,(e.h===1||e.h===e.minH)&&delete e.h}static throttle(e,t){let i=!1;return(...r)=>{i||(i=!0,setTimeout(()=>{e(...r),i=!1},t))}}static removePositioningStyles(e){let t=e.style;t.position&&t.removeProperty("position"),t.left&&t.removeProperty("left"),t.top&&t.removeProperty("top"),t.width&&t.removeProperty("width"),t.height&&t.removeProperty("height")}static getScrollElement(e){if(!e)return document.scrollingElement||document.documentElement;let t=getComputedStyle(e).overflowY;return(t==="auto"||t==="scroll")&&e.scrollHeight>e.clientHeight?e:n.getScrollElement(e.parentElement)}static updateScrollResize(e,t,i){let r=n.getScrollElement(t),o=r.clientHeight,s=r===n.getScrollElement()?0:r.getBoundingClientRect().top,a=e.clientY-s,l=ao-i;l?r.scrollBy({behavior:"smooth",top:a-i}):u&&r.scrollBy({behavior:"smooth",top:i-(o-a)})}static clone(e){return e==null||typeof e!="object"?e:e instanceof Array?[...e]:O({},e)}static cloneDeep(e){let t=["parentGrid","el","grid","subGrid","engine"],i=n.clone(e);for(let r in i)i.hasOwnProperty(r)&&typeof i[r]=="object"&&r.substring(0,2)!=="__"&&!t.find(o=>o===r)&&(i[r]=n.cloneDeep(e[r]));return i}static cloneNode(e){let t=e.cloneNode(!0);return t.removeAttribute("id"),t}static appendTo(e,t){let i;typeof t=="string"?i=n.getElement(t):i=t,i&&i.appendChild(e)}static addElStyles(e,t){if(t instanceof Object)for(let i in t)t.hasOwnProperty(i)&&(Array.isArray(t[i])?t[i].forEach(r=>{e.style[i]=r}):e.style[i]=t[i])}static initEvent(e,t){let i={type:t.type},r={button:0,which:0,buttons:1,bubbles:!0,cancelable:!0,target:t.target?t.target:e.target};return["altKey","ctrlKey","metaKey","shiftKey"].forEach(o=>i[o]=e[o]),["pageX","pageY","clientX","clientY","screenX","screenY"].forEach(o=>i[o]=e[o]),O(O({},i),r)}static simulateMouseEvent(e,t,i){var s,a,l,u;let r=e,o=new MouseEvent(t,{bubbles:!0,composed:!0,cancelable:!0,view:window,detail:1,screenX:e.screenX,screenY:e.screenY,clientX:e.clientX,clientY:e.clientY,ctrlKey:(s=r.ctrlKey)!=null?s:!1,altKey:(a=r.altKey)!=null?a:!1,shiftKey:(l=r.shiftKey)!=null?l:!1,metaKey:(u=r.metaKey)!=null?u:!1,button:0,relatedTarget:e.target});(i||e.target).dispatchEvent(o)}static getValuesFromTransformedElement(e){let t=document.createElement("div");n.addElStyles(t,{opacity:"0",position:"fixed",top:"0px",left:"0px",width:"1px",height:"1px",zIndex:"-999999"}),e.appendChild(t);let i=t.getBoundingClientRect();return e.removeChild(t),t.remove(),{xScale:1/i.width,yScale:1/i.height,xOffset:i.left,yOffset:i.top}}static swap(e,t,i){if(!e)return;let r=e[t];e[t]=e[i],e[i]=r}static canBeRotated(e){var t;return!(!e||e.w===e.h||e.locked||e.noResize||(t=e.grid)!=null&&t.opts.disableResize||e.minW&&e.minW===e.maxW||e.minH&&e.minH===e.maxH)}};var Mn=class n{constructor(e={}){this.addedNodes=[],this.removedNodes=[],this.defaultColumn=12,this.column=e.column||this.defaultColumn,this.column>this.defaultColumn&&(this.defaultColumn=this.column),this.maxRow=e.maxRow,this._float=e.float,this.nodes=e.nodes||[],this.onChange=e.onChange}batchUpdate(e=!0,t=!0){return!!this.batchMode===e?this:(this.batchMode=e,e?(this._prevFloat=this._float,this._float=!0,this.cleanNodes(),this.saveInitial()):(this._float=this._prevFloat,delete this._prevFloat,t&&this._packNodes(),this._notify()),this)}_useEntireRowArea(e,t){return(!this.float||this.batchMode&&!this._prevFloat)&&!this._hasLocked&&(!e._moving||e._skipDown||t.y<=e.y)}_fixCollisions(e,t=e,i,r={}){if(this.sortNodes(-1),i=i||this.collide(e,t),!i)return!1;if(e._moving&&!r.nested&&!this.float&&this.swap(e,i))return!0;let o=t;!this._loading&&this._useEntireRowArea(e,t)&&(o={x:0,w:this.column,y:t.y,h:t.h},i=this.collide(e,o,r.skip));let s=!1,a={nested:!0,pack:!1},l=0;for(;i=i||this.collide(e,o,r.skip);){if(l++>this.nodes.length*2)throw new Error("Infinite collide check");let u;if(i.locked||this._loading||e._moving&&!e._skipDown&&t.y>e.y&&!this.float&&(!this.collide(i,se(O({},i),{y:e.y}),e)||!this.collide(i,se(O({},i),{y:t.y-i.h}),e))){e._skipDown=e._skipDown||t.y>e.y;let c=O(se(O({},t),{y:i.y+i.h}),a);u=this._loading&&E.samePos(e,c)?!0:this.moveNode(e,c),(i.locked||this._loading)&&u?E.copyPos(t,e):!i.locked&&u&&r.pack&&(this._packNodes(),t.y=i.y+i.h,E.copyPos(e,t)),s=s||u}else u=this.moveNode(i,O(se(O({},i),{y:t.y+t.h,skip:e}),a));if(!u)return s;i=void 0}return s}collide(e,t=e,i){let r=e._id,o=i==null?void 0:i._id;return this.nodes.find(s=>s._id!==r&&s._id!==o&&E.isIntercepted(s,t))}collideAll(e,t=e,i){let r=e._id,o=i==null?void 0:i._id;return this.nodes.filter(s=>s._id!==r&&s._id!==o&&E.isIntercepted(s,t))}directionCollideCoverage(e,t,i){if(!t.rect||!e._rect)return;let r=e._rect,o=O({},t.rect);o.y>r.y?(o.h+=o.y-r.y,o.y=r.y):o.h+=r.y-o.y,o.x>r.x?(o.w+=o.x-r.x,o.x=r.x):o.w+=r.x-o.x;let s,a=.5;for(let l of i){if(l.locked||!l._rect)break;let u=l._rect,c=Number.MAX_VALUE,d=Number.MAX_VALUE;r.yu.y+u.h&&(c=(u.y+u.h-o.y)/u.h),r.xu.x+u.w&&(d=(u.x+u.w-o.x)/u.w);let p=Math.min(d,c);p>a&&(a=p,s=l)}return t.collide=s,s}cacheRects(e,t,i,r,o,s){return this.nodes.forEach(a=>a._rect={y:a.y*t+i,x:a.x*e+s,w:a.w*e-s-r,h:a.h*t-i-o}),this}swap(e,t){if(!t||t.locked||!e||e.locked)return!1;function i(){let o=t.x,s=t.y;return t.x=e.x,t.y=e.y,e.h!=t.h?(e.x=o,e.y=t.y+t.h):e.w!=t.w?(e.x=t.x+t.w,e.y=s):(e.x=o,e.y=s),e._dirty=t._dirty=!0,!0}let r;if(e.w===t.w&&e.h===t.h&&(e.x===t.x||e.y===t.y)&&(r=E.isTouching(e,t)))return i();if(r!==!1){if(e.w===t.w&&e.x===t.x&&(r||(r=E.isTouching(e,t)))){if(t.y{let u;s.locked||(s.autoPosition=!0,e==="list"&&a&&(u=l[a-1])),this.addNode(s,!1,u)}),r||delete this._inColumnResize,i||this.batchUpdate(!1),this}set float(e){this._float!==e&&(this._float=e||!1,e||this._packNodes()._notify())}get float(){return this._float||!1}sortNodes(e=1){return this.nodes=E.sort(this.nodes,e),this}_packNodes(){return this.batchMode?this:(this.sortNodes(),this.float?this.nodes.forEach(e=>{if(e._updating||e._orig===void 0||e.y===e._orig.y)return;let t=e.y;for(;t>e._orig.y;)--t,this.collide(e,{x:e.x,y:t,w:e.w,h:e.h})||(e._dirty=!0,e.y=t)}):this.nodes.forEach((e,t)=>{if(!e.locked)for(;e.y>0;){let i=t===0?0:e.y-1;if(!(t===0||!this.collide(e,{x:e.x,y:i,w:e.w,h:e.h})))break;e._dirty=e.y!==i,e.y=i}}),this)}prepareNode(e,t){var o;e._id=(o=e._id)!=null?o:n._idSeq++;let i=e.id;if(i){let s=1;for(;this.nodes.find(a=>a.id===e.id&&a!==e);)e.id=i+"_"+s++}(e.x===void 0||e.y===void 0||e.x===null||e.y===null)&&(e.autoPosition=!0);let r={x:0,y:0,w:1,h:1};return E.defaults(e,r),e.autoPosition||delete e.autoPosition,e.noResize||delete e.noResize,e.noMove||delete e.noMove,E.sanitizeMinMax(e),typeof e.x=="string"&&(e.x=Number(e.x)),typeof e.y=="string"&&(e.y=Number(e.y)),typeof e.w=="string"&&(e.w=Number(e.w)),typeof e.h=="string"&&(e.h=Number(e.h)),isNaN(e.x)&&(e.x=r.x,e.autoPosition=!0),isNaN(e.y)&&(e.y=r.y,e.autoPosition=!0),isNaN(e.w)&&(e.w=r.w),isNaN(e.h)&&(e.h=r.h),this.nodeBoundFix(e,t),e}nodeBoundFix(e,t){let i=e._orig||E.copyPos({},e);if(e.maxW&&(e.w=Math.min(e.w||1,e.maxW)),e.maxH&&(e.h=Math.min(e.h||1,e.maxH)),e.minW&&(e.w=Math.max(e.w||1,e.minW)),e.minH&&(e.h=Math.max(e.h||1,e.minH)),(e.x||0)+(e.w||1)>this.column&&this.columnthis.column?e.w=this.column:e.w<1&&(e.w=1),this.maxRow&&e.h>this.maxRow?e.h=this.maxRow:e.h<1&&(e.h=1),e.x<0&&(e.x=0),e.y<0&&(e.y=0),e.x+e.w>this.column&&(t?e.w=this.column-e.x:e.x=this.column-e.w),this.maxRow&&e.y+e.h>this.maxRow&&(t?e.h=this.maxRow-e.y:e.y=this.maxRow-e.h),E.samePos(e,i)||(e._dirty=!0),this}getDirtyNodes(e){return e?this.nodes.filter(t=>t._dirty&&!E.samePos(t,t._orig)):this.nodes.filter(t=>t._dirty)}_notify(e){if(this.batchMode||!this.onChange)return this;let t=(e||[]).concat(this.getDirtyNodes());return this.onChange(t),this}cleanNodes(){return this.batchMode?this:(this.nodes.forEach(e=>{delete e._dirty,delete e._lastTried}),this)}saveInitial(){return this.nodes.forEach(e=>{e._orig=E.copyPos({},e),delete e._dirty}),this._hasLocked=this.nodes.some(e=>e.locked),this}restoreInitial(){return this.nodes.forEach(e=>{!e._orig||E.samePos(e,e._orig)||(E.copyPos(e,e._orig),e._dirty=!0)}),this._notify(),this}findEmptyPosition(e,t=this.nodes,i=this.column,r){let o=r?r.y*i+(r.x+r.w):0,s=!1;for(let a=o;!s;++a){let l=a%i,u=Math.floor(a/i);if(l+e.w>i)continue;let c={x:l,y:u,w:e.w,h:e.h};t.find(d=>E.isIntercepted(c,d))||((e.x!==l||e.y!==u)&&(e._dirty=!0),e.x=l,e.y=u,delete e.autoPosition,s=!0)}return s}addNode(e,t=!1,i){let r=this.nodes.find(s=>s._id===e._id);if(r)return r;this._inColumnResize?this.nodeBoundFix(e):this.prepareNode(e),delete e._temporaryRemoved,delete e._removeDOM;let o;return e.autoPosition&&this.findEmptyPosition(e,this.nodes,this.column,i)&&(delete e.autoPosition,o=!0),this.nodes.push(e),t&&this.addedNodes.push(e),o||this._fixCollisions(e),this.batchMode||this._packNodes()._notify(),e}removeNode(e,t=!0,i=!1){return this.nodes.find(r=>r._id===e._id)?(i&&this.removedNodes.push(e),t&&(e._removeDOM=!0),this.nodes=this.nodes.filter(r=>r._id!==e._id),e._isAboutToRemove||this._packNodes(),this._notify([e]),this):this}removeAll(e=!0,t=!0){if(delete this._layouts,!this.nodes.length)return this;e&&this.nodes.forEach(r=>r._removeDOM=!0);let i=this.nodes;return this.removedNodes=t?i:[],this.nodes=[],this._notify(i)}moveNodeCheck(e,t){if(!this.changedPosConstrain(e,t))return!1;if(t.pack=!0,!this.maxRow)return this.moveNode(e,t);let i,r=new n({column:this.column,float:this.float,nodes:this.nodes.map(s=>s._id===e._id?(i=O({},s),i):O({},s))});if(!i)return!1;let o=r.moveNode(i,t)&&r.getRow()<=Math.max(this.getRow(),this.maxRow);if(!o&&!t.resizing&&t.collide){let s=t.collide.el.gridstackNode;if(this.swap(e,s))return this._notify(),!0}return o?(r.nodes.filter(s=>s._dirty).forEach(s=>{let a=this.nodes.find(l=>l._id===s._id);a&&(E.copyPos(a,s),a._dirty=!0)}),this._notify(),!0):!1}willItFit(e){if(delete e._willFitPos,!this.maxRow)return!0;let t=new n({column:this.column,float:this.float,nodes:this.nodes.map(r=>O({},r))}),i=O({},e);return this.cleanupNode(i),delete i.el,delete i._id,delete i.content,delete i.grid,t.addNode(i),t.getRow()<=this.maxRow?(e._willFitPos=E.copyPos({},i),!0):!1}changedPosConstrain(e,t){return t.w=t.w||e.w,t.h=t.h||e.h,e.x!==t.x||e.y!==t.y?!0:(e.maxW&&(t.w=Math.min(t.w,e.maxW)),e.maxH&&(t.h=Math.min(t.h,e.maxH)),e.minW&&(t.w=Math.max(t.w,e.minW)),e.minH&&(t.h=Math.max(t.h,e.minH)),e.w!==t.w||e.h!==t.h)}moveNode(e,t){var u,c;if(!e||!t)return!1;let i;t.pack===void 0&&!this.batchMode&&(i=t.pack=!0),typeof t.x!="number"&&(t.x=e.x),typeof t.y!="number"&&(t.y=e.y),typeof t.w!="number"&&(t.w=e.w),typeof t.h!="number"&&(t.h=e.h);let r=e.w!==t.w||e.h!==t.h,o=E.copyPos({},e,!0);if(E.copyPos(o,t),this.nodeBoundFix(o,r),E.copyPos(t,o),!t.forceCollide&&E.samePos(e,t))return!1;let s=E.copyPos({},e),a=this.collideAll(e,o,t.skip),l=!0;if(a.length){let d=e._moving&&!t.nested,p=d?this.directionCollideCoverage(e,t,a):a[0];if(d&&p&&((c=(u=e.grid)==null?void 0:u.opts)!=null&&c.subGridDynamic)&&!e.grid._isTemp){let y=E.areaIntercept(t.rect,p._rect),m=E.area(t.rect),g=E.area(p._rect);y/(m.8&&(p.grid.makeSubGrid(p.el,void 0,e),p=void 0)}p?l=!this._fixCollisions(e,o,p,t):(l=!1,i&&delete t.pack)}return l&&!E.samePos(e,o)&&(e._dirty=!0,E.copyPos(e,o)),t.pack&&this._packNodes()._notify(),!E.samePos(e,s)}getRow(){return this.nodes.reduce((e,t)=>Math.max(e,t.y+t.h),0)}beginUpdate(e){return e._updating||(e._updating=!0,delete e._skipDown,this.batchMode||this.saveInitial()),this}endUpdate(){let e=this.nodes.find(t=>t._updating);return e&&(delete e._updating,delete e._skipDown),this}save(e=!0,t,i){var a;let r=((a=this._layouts)==null?void 0:a.length)||0,o;r&&(i?i!==this.column&&(o=this._layouts[i]):this.column!==r-1&&(o=this._layouts[r-1]));let s=[];return this.sortNodes(),this.nodes.forEach(l=>{let u=o==null?void 0:o.find(d=>d._id===l._id),c=O(O({},l),u||{});E.removeInternalForSave(c,!e),t&&t(l,c),s.push(c)}),s}layoutsNodesChange(e){return!this._layouts||this._inColumnResize?this:(this._layouts.forEach((t,i)=>{if(!t||i===this.column)return this;if(i{if(!o._orig)return;let s=t.find(a=>a._id===o._id);s&&(s.y>=0&&o.y!==o._orig.y&&(s.y+=o.y-o._orig.y,s.y<0&&(s.y=0)),o.x!==o._orig.x&&(s.x=Math.round(o.x*r),s.x<0&&(s.x=0)),o.w!==o._orig.w&&(s.w=Math.round(o.w*r),s.w<1&&(s.w=1)))})}}),this)}columnChanged(e,t,i="moveScale"){var a;if(!this.nodes.length||!t||e===t)return this;let r=i==="compact"||i==="list";r&&this.sortNodes(1),te&&this._layouts){let l=this._layouts[t]||[],u=this._layouts.length-1;!l.length&&e!==u&&((a=this._layouts[u])!=null&&a.length)&&(e=u,this._layouts[u].forEach(c=>{var p,y,m;let d=s.find(g=>g._id===c._id);d&&(!r&&!c.autoPosition&&(d.x=(p=c.x)!=null?p:d.x,d.y=(y=c.y)!=null?y:d.y),d.w=(m=c.w)!=null?m:d.w,(c.x==null||c.y===void 0)&&(d.autoPosition=!0))})),l.forEach(c=>{var p,y,m;let d=s.findIndex(g=>g._id===c._id);if(d!==-1){let g=s[d];if(r){g.w=c.w;return}(c.autoPosition||isNaN(c.x)||isNaN(c.y))&&this.findEmptyPosition(c,o),c.autoPosition||(g.x=(p=c.x)!=null?p:g.x,g.y=(y=c.y)!=null?y:g.y,g.w=(m=c.w)!=null?m:g.w,o.push(g)),s.splice(d,1)}})}if(r)this.compact(i,!1);else{if(s.length)if(typeof i=="function")i(t,e,o,s);else{let l=r||i==="none"?1:t/e,u=i==="move"||i==="moveScale",c=i==="scale"||i==="moveScale";s.forEach(d=>{d.x=t===1?0:u?Math.round(d.x*l):Math.min(d.x,t-1),d.w=t===1||e===1?1:c?Math.round(d.w*l)||1:Math.min(d.w,t),o.push(d)}),s=[]}o=E.sort(o,-1),this._inColumnResize=!0,this.nodes=[],o.forEach(l=>{this.addNode(l,!1),delete l._orig})}return this.nodes.forEach(l=>delete l._orig),this.batchUpdate(!1,!r),delete this._inColumnResize,this}cacheLayout(e,t,i=!1){let r=[];return e.forEach((o,s)=>{var a;if(o._id===void 0){let l=o.id?this.nodes.find(u=>u.id===o.id):void 0;o._id=(a=l==null?void 0:l._id)!=null?a:n._idSeq++}r[s]={x:o.x,y:o.y,w:o.w,_id:o._id}}),this._layouts=i?[]:this._layouts||[],this._layouts[t]=r,this}cacheOneLayout(e,t){var o;e._id=(o=e._id)!=null?o:n._idSeq++;let i={x:e.x,y:e.y,w:e.w,_id:e._id};(e.autoPosition||e.x===void 0)&&(delete i.x,delete i.y,e.autoPosition&&(i.autoPosition=!0)),this._layouts=this._layouts||[],this._layouts[t]=this._layouts[t]||[];let r=this.findCacheLayout(e,t);return r===-1?this._layouts[t].push(i):this._layouts[t][r]=i,this}findCacheLayout(e,t){var i,r,o;return(o=(r=(i=this._layouts)==null?void 0:i[t])==null?void 0:r.findIndex(s=>s._id===e._id))!=null?o:-1}removeNodeFromLayoutCache(e){if(this._layouts)for(let t=0;t0||navigator.msMaxTouchPoints>0),Ae=class{};function Rr(n,e){n.touches.length>1||(n.cancelable&&n.preventDefault(),E.simulateMouseEvent(n.changedTouches[0],e))}function Nc(n,e){n.cancelable&&n.preventDefault(),E.simulateMouseEvent(n,e)}function Nn(n){Ae.touchHandled||(Ae.touchHandled=!0,Rr(n,"mousedown"))}function kn(n){Ae.touchHandled&&Rr(n,"mousemove")}function Rn(n){if(!Ae.touchHandled)return;Ae.pointerLeaveTimeout&&(window.clearTimeout(Ae.pointerLeaveTimeout),delete Ae.pointerLeaveTimeout);let e=!!F.dragElement;Rr(n,"mouseup"),e||Rr(n,"click"),Ae.touchHandled=!1}function In(n){n.pointerType!=="mouse"&&n.target.releasePointerCapture(n.pointerId)}function as(n){F.dragElement&&n.pointerType!=="mouse"&&Nc(n,"mouseenter")}function ls(n){F.dragElement&&n.pointerType!=="mouse"&&(Ae.pointerLeaveTimeout=window.setTimeout(()=>{delete Ae.pointerLeaveTimeout,Nc(n,"mouseleave")},10))}var yi=class n{constructor(e,t,i){this.host=e,this.dir=t,this.option=i,this.moving=!1,this._mouseDown=this._mouseDown.bind(this),this._mouseMove=this._mouseMove.bind(this),this._mouseUp=this._mouseUp.bind(this),this._keyEvent=this._keyEvent.bind(this),this._init()}_init(){if(this.option.element)try{this.el=this.option.element instanceof HTMLElement?this.option.element:this.host.querySelector(this.option.element)}catch(e){this.option.element=void 0,console.error("Query for resizeable handle failed, falling back",e)}return this.el||(this.el=document.createElement("div"),this.host.appendChild(this.el)),this.el.classList.add("ui-resizable-handle"),this.el.classList.add(`${n.prefix}${this.dir}`),this.el.style.zIndex="100",this.el.style.userSelect="none",this.el.addEventListener("mousedown",this._mouseDown),Re&&(this.el.addEventListener("touchstart",Nn),this.el.addEventListener("pointerdown",In)),this}destroy(){return this.moving&&this._mouseUp(this.mouseDownEvent),this.el.removeEventListener("mousedown",this._mouseDown),Re&&(this.el.removeEventListener("touchstart",Nn),this.el.removeEventListener("pointerdown",In)),this.option.element||this.host.removeChild(this.el),delete this.el,delete this.host,this}_mouseDown(e){this.mouseDownEvent=e,document.addEventListener("mousemove",this._mouseMove,{capture:!0,passive:!0}),document.addEventListener("mouseup",this._mouseUp,!0),Re&&(this.el.addEventListener("touchmove",kn),this.el.addEventListener("touchend",Rn)),e.stopPropagation(),e.preventDefault()}_mouseMove(e){let t=this.mouseDownEvent;this.moving?this._triggerEvent("move",e):Math.abs(e.x-t.x)+Math.abs(e.y-t.y)>2&&(this.moving=!0,this._triggerEvent("start",this.mouseDownEvent),this._triggerEvent("move",e),document.addEventListener("keydown",this._keyEvent)),e.stopPropagation()}_mouseUp(e){this.moving&&(this._triggerEvent("stop",e),document.removeEventListener("keydown",this._keyEvent)),document.removeEventListener("mousemove",this._mouseMove,!0),document.removeEventListener("mouseup",this._mouseUp,!0),Re&&(this.el.removeEventListener("touchmove",kn),this.el.removeEventListener("touchend",Rn)),delete this.moving,delete this.mouseDownEvent,e.stopPropagation(),e.preventDefault()}_keyEvent(e){var t,i;e.key==="Escape"&&((i=(t=this.host.gridstackNode)==null?void 0:t.grid)==null||i.engine.restoreInitial(),this._mouseUp(this.mouseDownEvent))}_triggerEvent(e,t){return this.option[e]&&this.option[e](t),this}};yi.prefix="ui-resizable-";var Ht=class{constructor(){this._eventRegister={}}get disabled(){return this._disabled}on(e,t){this._eventRegister[e]=t}off(e){delete this._eventRegister[e]}enable(){this._disabled=!1}disable(){this._disabled=!0}destroy(){delete this._eventRegister}triggerEvent(e,t){if(!this.disabled&&this._eventRegister&&this._eventRegister[e])return this._eventRegister[e](t)}};var Ei=class n extends Ht{constructor(e,t={}){super(),this.el=e,this.option=t,this.rectScale={x:1,y:1},this._ui=()=>{let r=this.el.parentElement.getBoundingClientRect(),o={width:this.originalRect.width,height:this.originalRect.height+this.scrolled,left:this.originalRect.left,right:this.originalRect.right,top:this.originalRect.top-this.scrolled},s=this.temporalRect||o;return{position:{left:this.option.rtl?(r.right-s.right)*this.rectScale.x:(s.left-r.left)*this.rectScale.x,top:(s.top-r.top)*this.rectScale.y},size:{width:s.width*this.rectScale.x,height:s.height*this.rectScale.y}}},this._mouseOver=this._mouseOver.bind(this),this._mouseOut=this._mouseOut.bind(this),this.enable(),this._setupAutoHide(this.option.autoHide),this._setupHandlers()}on(e,t){super.on(e,t)}off(e){super.off(e)}enable(){super.enable(),this.el.classList.remove("ui-resizable-disabled"),this._setupAutoHide(this.option.autoHide)}disable(){super.disable(),this.el.classList.add("ui-resizable-disabled"),this._setupAutoHide(!1)}destroy(){this._removeHandlers(),this._setupAutoHide(!1),delete this.el,super.destroy()}updateOption(e){let t=e.handles&&e.handles!==this.option.handles,i=e.autoHide&&e.autoHide!==this.option.autoHide;return Object.keys(e).forEach(r=>this.option[r]=e[r]),t&&(this._removeHandlers(),this._setupHandlers()),i&&this._setupAutoHide(this.option.autoHide),this}_setupAutoHide(e){return e?(this.el.classList.add("ui-resizable-autohide"),this.el.addEventListener("mouseover",this._mouseOver),this.el.addEventListener("mouseout",this._mouseOut)):(this.el.classList.remove("ui-resizable-autohide"),this.el.removeEventListener("mouseover",this._mouseOver),this.el.removeEventListener("mouseout",this._mouseOut),F.overResizeElement===this&&delete F.overResizeElement),this}_mouseOver(e){F.overResizeElement||F.dragElement||(F.overResizeElement=this,this.el.classList.remove("ui-resizable-autohide"))}_mouseOut(e){F.overResizeElement===this&&(delete F.overResizeElement,this.el.classList.add("ui-resizable-autohide"))}_setupHandlers(){return this.handlers=this.option.handles.split(",").map(e=>e.trim()).map(e=>new yi(this.el,e,{element:this.option.element,start:t=>this._resizeStart(t),stop:t=>this._resizeStop(t),move:t=>this._resizing(t,e)})),this}_resizeStart(e){this.sizeToContent=E.shouldSizeToContent(this.el.gridstackNode,!0),this.originalRect=this.el.getBoundingClientRect(),this.scrollEl=E.getScrollElement(this.el),this.scrollY=this.scrollEl.scrollTop,this.scrolled=0,this.startEvent=e,this._setupHelper(),this._applyChange();let t=E.initEvent(e,{type:"resizestart",target:this.el});return this.option.start&&this.option.start(t,this._ui()),this.el.classList.add("ui-resizable-resizing"),this.triggerEvent("resizestart",t),this}_resizing(e,t){this.scrolled=this.scrollEl.scrollTop-this.scrollY,this.temporalRect=this._getChange(e,t),this._applyChange();let i=E.initEvent(e,{type:"resize",target:this.el});return i.resizeDir=t,i.hasMovedX=this.option.rtl?t.includes("e"):t.includes("w"),i.hasMovedY=t.includes("n"),this.option.resize&&this.option.resize(i,this._ui()),this.triggerEvent("resize",i),this}_resizeStop(e){let t=E.initEvent(e,{type:"resizestop",target:this.el});return this._cleanHelper(),this.option.stop&&this.option.stop(t),this.el.classList.remove("ui-resizable-resizing"),this.triggerEvent("resizestop",t),delete this.startEvent,delete this.originalRect,delete this.temporalRect,delete this.scrollY,delete this.scrolled,this}_setupHelper(){this.elOriginStyleVal=n._originStyleProp.map(i=>this.el.style[i]),this.parentOriginStylePosition=this.el.parentElement.style.position;let e=this.el.parentElement,t=E.getValuesFromTransformedElement(e);return this.rectScale={x:t.xScale,y:t.yScale},getComputedStyle(this.el.parentElement).position.match(/static/)&&(this.el.parentElement.style.position="relative"),this.el.style.position="absolute",this.el.style.opacity="0.8",this}_cleanHelper(){return n._originStyleProp.forEach((e,t)=>{this.el.style[e]=this.elOriginStyleVal[t]||null}),this.el.parentElement.style.position=this.parentOriginStylePosition||null,this}_getChange(e,t){let i=this.startEvent,r={width:this.originalRect.width,height:this.originalRect.height+this.scrolled,left:this.originalRect.left,right:this.originalRect.right,top:this.originalRect.top-this.scrolled},o=e.clientX-i.clientX,s=this.sizeToContent?0:e.clientY-i.clientY,a,l,u=this.option.rtl;!u&&t.indexOf("e")>-1?r.width+=o:u&&t.indexOf("w")>-1?r.width-=o:!u&&t.indexOf("w")>-1?(r.width-=o,r.left+=o,a=!0):u&&t.indexOf("e")>-1&&(r.width+=o,r.right+=o,a=!0),t.indexOf("s")>-1?r.height+=s:t.indexOf("n")>-1&&(r.height-=s,r.top+=s,l=!0);let c=this._constrainSize(r.width,r.height,a,l);return Math.round(r.width)!==Math.round(c.width)&&(!u&&t.indexOf("w")>-1?r.left+=r.width-c.width:u&&t.indexOf("e")>-1&&(r.right-=r.width-c.width),r.width=c.width),Math.round(r.height)!==Math.round(c.height)&&(t.indexOf("n")>-1&&(r.top+=r.height-c.height),r.height=c.height),r}_constrainSize(e,t,i,r){let o=this.option,s=(i?o.maxWidthMoveLeft:o.maxWidth)||Number.MAX_SAFE_INTEGER,a=o.minWidth/this.rectScale.x||e,l=(r?o.maxHeightMoveUp:o.maxHeight)||Number.MAX_SAFE_INTEGER,u=o.minHeight/this.rectScale.y||t,c=Math.min(s,Math.max(a,e)),d=Math.min(l,Math.max(u,t));return{width:c,height:d}}_applyChange(){let e={left:0,right:0,top:0,width:0,height:0};if(this.el.style.position==="absolute"){let t=this.el.parentElement,{left:i,right:r,top:o}=t.getBoundingClientRect();e={left:i,right:r,top:o,width:0,height:0}}return this.temporalRect?(Object.entries(this.temporalRect).forEach(([t,i])=>{if(this.option.rtl?t==="left":t==="right")return;let r=t==="width"||t==="left"||t==="right"?this.rectScale.x:t==="height"||t==="top"?this.rectScale.y:1,o;t==="right"?o=(e.right-i)*this.rectScale.x+"px":o=(i-e[t])*r+"px",this.el.style[t]=o}),this):this}_removeHandlers(){return this.handlers.forEach(e=>e.destroy()),delete this.handlers,this}};Ei._originStyleProp=["width","height","position","left","right","top","opacity","zIndex"];var dv='input,textarea,button,select,option,[contenteditable="true"],.ui-resizable-handle',bi=class n extends Ht{constructor(e,t={}){var o;super(),this.el=e,this.option=t,this.dragTransform={xScale:1,yScale:1,xOffset:0,yOffset:0},this._autoScrollTick=()=>{let s=this.helper,a=this._autoScrollContainer;if(!s||!a){this._stopScrolling();return}let l=this._getClipping(s,a);if(l===0){this._stopScrolling();return}if(!this._autoScrollMaxSpeed){let y=window.innerHeight||document.documentElement.clientHeight;this._autoScrollMaxSpeed=Math.max(y/150,4)}let u=Math.abs(l),c=Math.min(u*.5,this._autoScrollMaxSpeed),d=l>0?c:-c,p=a.scrollTop;if(a.scrollTop+=d,a.scrollTop===p){this._stopScrolling();return}this.dragging&&this.lastDrag&&(this._dragFollow(this.lastDrag),this._callDrag(this.lastDrag)),this._autoScrollAnimId=requestAnimationFrame(this._autoScrollTick)};let i=(o=t==null?void 0:t.handle)==null?void 0:o.substring(1),r=e.gridstackNode;this.dragEls=!i||e.classList.contains(i)?[e]:r!=null&&r.subGrid?[e.querySelector(t.handle)||e]:this.getAllHandles(),this.dragEls.length===0&&(this.dragEls=[e]),this._mouseDown=this._mouseDown.bind(this),this._mouseMove=this._mouseMove.bind(this),this._mouseUp=this._mouseUp.bind(this),this._keyEvent=this._keyEvent.bind(this),this.enable()}getAllHandles(){return Array.from(this.el.querySelectorAll(this.option.handle)).filter(e=>{if(!(e instanceof HTMLElement))return!1;let t=e.closest(".grid-stack-item");return t===this.el||!t})}on(e,t){super.on(e,t)}off(e){super.off(e)}enable(){this.disabled!==!1&&(super.enable(),this.dragEls.forEach(e=>{e.addEventListener("mousedown",this._mouseDown),Re&&(e.addEventListener("touchstart",Nn),e.addEventListener("pointerdown",In))}),this.el.classList.remove("ui-draggable-disabled"))}disable(e=!1){this.disabled!==!0&&(super.disable(),this.dragEls.forEach(t=>{t.removeEventListener("mousedown",this._mouseDown),Re&&(t.removeEventListener("touchstart",Nn),t.removeEventListener("pointerdown",In))}),e||this.el.classList.add("ui-draggable-disabled"))}destroy(){this.dragTimeout&&window.clearTimeout(this.dragTimeout),delete this.dragTimeout,this.mouseDownEvent&&this._mouseUp(this.mouseDownEvent),this.disable(!0),delete this.el,delete this.helper,delete this.option,super.destroy()}updateOption(e){return Object.keys(e).forEach(t=>this.option[t]=e[t]),this}_mouseDown(e){if(Ae.touchHandled&&e.isTrusted&&(Ae.touchHandled=!1),!F.mouseHandled)return e.button!==0||!this.dragEls.find(t=>t===e.target)&&e.target.closest(dv)||this.option.cancel&&e.target.closest(this.option.cancel)||(this.mouseDownEvent=e,delete this.dragging,delete F.dragElement,delete F.dropElement,delete this._autoScrollMaxSpeed,delete this._autoScrollContainer,document.addEventListener("mousemove",this._mouseMove,{capture:!0,passive:!0}),document.addEventListener("mouseup",this._mouseUp,!0),Re&&(e.currentTarget.addEventListener("touchmove",kn),e.currentTarget.addEventListener("touchend",Rn)),e.preventDefault(),document.activeElement&&document.activeElement.blur(),F.mouseHandled=!0),!0}_callDrag(e){if(!this.dragging)return;let t=E.initEvent(e,{target:this.el,type:"drag"});this.option.drag&&this.option.drag(t,this.ui()),this.triggerEvent("drag",t)}_mouseMove(e){var i;let t=this.mouseDownEvent;if(this.lastDrag=e,this.dragging)if(this._dragFollow(e),F.pauseDrag){let r=Number.isInteger(F.pauseDrag)?F.pauseDrag:100;this.dragTimeout&&window.clearTimeout(this.dragTimeout),this.dragTimeout=window.setTimeout(()=>this._callDrag(e),r)}else this._callDrag(e);else if(Math.abs(e.x-t.x)+Math.abs(e.y-t.y)>3){this.dragging=!0,F.dragElement=this;let r=(i=this.el.gridstackNode)==null?void 0:i.grid;r?F.dropElement=r.el.ddElement.ddDroppable:delete F.dropElement,this.helper=this._createHelper(),this._setupHelperContainmentStyle(),this.dragTransform=E.getValuesFromTransformedElement(this.helperContainment),this.dragOffset=this._getDragOffset(e,this.el,this.helperContainment),this._setupHelperStyle(e);let o=E.initEvent(e,{target:this.el,type:"dragstart"});this.option.start&&this.option.start(o,this.ui()),this.triggerEvent("dragstart",o),document.addEventListener("keydown",this._keyEvent)}return!0}_mouseUp(e){var t,i;if(this._stopScrolling(),document.removeEventListener("mousemove",this._mouseMove,!0),document.removeEventListener("mouseup",this._mouseUp,!0),Re&&e.currentTarget&&(e.currentTarget.removeEventListener("touchmove",kn,!0),e.currentTarget.removeEventListener("touchend",Rn,!0)),this.dragging){delete this.dragging,(t=this.el.gridstackNode)==null||delete t._origRotate,document.removeEventListener("keydown",this._keyEvent),((i=F.dropElement)==null?void 0:i.el)===this.el.parentElement&&delete F.dropElement,this.helperContainment.style.position=this.parentOriginStylePosition||null,this.helper!==this.el&&this.helper.remove(),this._removeHelperStyle();let r=E.initEvent(e,{target:this.el,type:"dragstop"});this.option.stop&&this.option.stop(r),this.triggerEvent("dragstop",r),F.dropElement&&F.dropElement.drop(e)}delete this.helper,delete this.mouseDownEvent,delete F.dragElement,delete F.dropElement,delete F.mouseHandled,e.preventDefault()}_keyEvent(e){var r,o;let t=this.el.gridstackNode,i=(t==null?void 0:t.grid)||((o=(r=F.dropElement)==null?void 0:r.el)==null?void 0:o.gridstack);if(e.key==="Escape")t&&t._origRotate&&(t._orig=t._origRotate,delete t._origRotate),i==null||i.cancelDrag(),this._mouseUp(this.mouseDownEvent);else if(t&&i&&(e.key==="r"||e.key==="R")){if(!E.canBeRotated(t))return;t._origRotate=t._origRotate||O({},t._orig),delete t._moving,i.setAnimation(!1).rotate(t.el,{top:-this.dragOffset.offsetTop,left:-this.dragOffset.offsetX}).setAnimation(),t._moving=!0,this.dragOffset=this._getDragOffset(this.lastDrag,t.el,this.helperContainment),this.helper.style.width=this.dragOffset.width+"px",this.helper.style.height=this.dragOffset.height+"px",E.swap(t._orig,"w","h"),delete t._rect,this._mouseMove(this.lastDrag)}}_createHelper(){let e=this.el;return typeof this.option.helper=="function"?e=this.option.helper(this.el):this.option.helper==="clone"&&(e=E.cloneNode(this.el)),e.parentElement||E.appendTo(e,this.option.appendTo==="parent"?this.el.parentElement:this.option.appendTo),this.dragElementOriginStyle=n.originStyleProp.map(t=>this.el.style[t]),e}_setupHelperStyle(e){var i,r;this.helper.classList.add("ui-draggable-dragging"),(r=(i=this.el.gridstackNode)==null?void 0:i.grid)==null||r.el.classList.add("grid-stack-dragging");let t=this.helper.style;return t.pointerEvents="none",t.width=this.dragOffset.width+"px",t.height=this.dragOffset.height+"px",t.willChange="left, right, top",t.position="fixed",this._dragFollow(e),t.transition="none",setTimeout(()=>{this.helper&&(t.transition=null)},0),this}_removeHelperStyle(){var t,i,r;this.helper.classList.remove("ui-draggable-dragging"),(i=(t=this.el.gridstackNode)==null?void 0:t.grid)==null||i.el.classList.remove("grid-stack-dragging");let e=(r=this.helper)==null?void 0:r.gridstackNode;if(!(e!=null&&e._isAboutToRemove)&&this.dragElementOriginStyle){let o=this.helper,s=this.dragElementOriginStyle.transition||null;o.style.transition=this.dragElementOriginStyle.transition="none",n.originStyleProp.forEach(a=>o.style[a]=this.dragElementOriginStyle[a]||null),setTimeout(()=>o.style.transition=s,50)}return delete this.dragElementOriginStyle,this}_dragFollow(e){let t=this.helper.style,i=this.dragOffset;this.option.rtl?(t.right=(window.innerWidth-e.clientX+i.offsetX)*this.dragTransform.xScale+"px",t.left&&(t.left="")):(t.left=(e.clientX+i.offsetX)*this.dragTransform.xScale+"px",t.right&&(t.right="")),t.top=(e.clientY+i.offsetTop)*this.dragTransform.yScale+"px"}_setupHelperContainmentStyle(){return this.helperContainment=this.helper.parentElement,this.helper.style.position!=="fixed"&&(this.parentOriginStylePosition=this.helperContainment.style.position,getComputedStyle(this.helperContainment).position.match(/static/)&&(this.helperContainment.style.position="relative")),this}_getDragOffset(e,t,i){let r=0,o=0;i&&(r=this.dragTransform.xOffset,o=this.dragTransform.yOffset);let s=t.getBoundingClientRect(),a=this.option.rtl?s.right:s.left,l=this.option.rtl?e.clientX-s.right+r:-e.clientX+s.left-r;return{x:a,top:s.top,offsetX:l,offsetTop:-e.clientY+s.top-o,width:s.width*this.dragTransform.xScale,height:s.height*this.dragTransform.yScale}}updateScrollPosition(e){this._autoScrollContainer=E.getScrollElement(e),this._getClipping(this.helper,this._autoScrollContainer)===0?this._stopScrolling():this._autoScrollAnimId||(this._autoScrollAnimId=requestAnimationFrame(this._autoScrollTick))}_getClipping(e,t){let i=e.getBoundingClientRect(),r=t.getBoundingClientRect(),o=window.innerHeight||document.documentElement.clientHeight;if(i.bottomr.bottom)return 0;let s=i.bottom-Math.min(r.bottom,o),a=i.top-Math.max(r.top,0);return a<0?a:s>0?s:0}_stopScrolling(){this._autoScrollAnimId&&(cancelAnimationFrame(this._autoScrollAnimId),delete this._autoScrollAnimId)}ui(){let t=this.el.parentElement.getBoundingClientRect(),i=this.helper.getBoundingClientRect(),r=this.option.rtl?(t.right-i.right)*this.dragTransform.xScale:(i.left-t.left)*this.dragTransform.xScale;return{position:{top:(i.top-t.top)*this.dragTransform.yScale,left:r}}}};bi.originStyleProp=["width","height","transform","transform-origin","transition","pointerEvents","position","left","right","top","minWidth","willChange"];var Ir=class extends Ht{constructor(e,t={}){super(),this.el=e,this.option=t,this._mouseEnter=this._mouseEnter.bind(this),this._mouseLeave=this._mouseLeave.bind(this),this.enable(),this._setupAccept()}on(e,t){super.on(e,t)}off(e){super.off(e)}enable(){this.disabled!==!1&&(super.enable(),this.el.classList.add("ui-droppable"),this.el.classList.remove("ui-droppable-disabled"),this.el.addEventListener("mouseenter",this._mouseEnter),this.el.addEventListener("mouseleave",this._mouseLeave),Re&&(this.el.addEventListener("pointerenter",as),this.el.addEventListener("pointerleave",ls)))}disable(e=!1){this.disabled!==!0&&(super.disable(),this.el.classList.remove("ui-droppable"),e||this.el.classList.add("ui-droppable-disabled"),this.el.removeEventListener("mouseenter",this._mouseEnter),this.el.removeEventListener("mouseleave",this._mouseLeave),Re&&(this.el.removeEventListener("pointerenter",as),this.el.removeEventListener("pointerleave",ls)))}destroy(){this.disable(!0),this.el.classList.remove("ui-droppable"),this.el.classList.remove("ui-droppable-disabled"),super.destroy()}updateOption(e){return Object.keys(e).forEach(t=>this.option[t]=e[t]),this._setupAccept(),this}_mouseEnter(e){if(!F.dragElement||Ae.touchHandled&&e.isTrusted||!this._canDrop(F.dragElement.el))return;e.preventDefault(),e.stopPropagation(),F.dragElement._stopScrolling(),F.dropElement&&F.dropElement!==this&&F.dropElement._mouseLeave(e,!0),F.dropElement=this;let t=E.initEvent(e,{target:this.el,type:"dropover"});this.option.over&&this.option.over(t,this._ui(F.dragElement)),this.triggerEvent("dropover",t),this.el.classList.add("ui-droppable-over")}_mouseLeave(e,t=!1){var r;if(!F.dragElement||F.dropElement!==this)return;e.preventDefault(),e.stopPropagation(),t&&F.dragElement._stopScrolling();let i=E.initEvent(e,{target:this.el,type:"dropout"});if(this.option.out&&this.option.out(i,this._ui(F.dragElement)),this.triggerEvent("dropout",i),F.dropElement===this&&(delete F.dropElement,!t)){let o,s=this.el.parentElement;for(;!o&&s;)o=(r=s.ddElement)==null?void 0:r.ddDroppable,s=s.parentElement;o&&o._mouseEnter(e)}}drop(e){e.preventDefault();let t=E.initEvent(e,{target:this.el,type:"drop"});this.option.drop&&this.option.drop(t,this._ui(F.dragElement)),this.triggerEvent("drop",t)}_canDrop(e){return e&&(!this.accept||this.accept(e))}_setupAccept(){return this.option.accept?(typeof this.option.accept=="string"?this.accept=e=>e.classList.contains(this.option.accept)||e.matches(this.option.accept):this.accept=this.option.accept,this):this}_ui(e){return O({draggable:e.el},e.ui())}};var Hr=class n{static init(e){return e.ddElement||(e.ddElement=new n(e)),e.ddElement}constructor(e){this.el=e}on(e,t){return this.ddDraggable&&["drag","dragstart","dragstop"].indexOf(e)>-1?this.ddDraggable.on(e,t):this.ddDroppable&&["drop","dropover","dropout"].indexOf(e)>-1?this.ddDroppable.on(e,t):this.ddResizable&&["resizestart","resize","resizestop"].indexOf(e)>-1&&this.ddResizable.on(e,t),this}off(e){return this.ddDraggable&&["drag","dragstart","dragstop"].indexOf(e)>-1?this.ddDraggable.off(e):this.ddDroppable&&["drop","dropover","dropout"].indexOf(e)>-1?this.ddDroppable.off(e):this.ddResizable&&["resizestart","resize","resizestop"].indexOf(e)>-1&&this.ddResizable.off(e),this}setupDraggable(e){return this.ddDraggable?this.ddDraggable.updateOption(e):this.ddDraggable=new bi(this.el,e),this}cleanDraggable(){return this.ddDraggable&&(this.ddDraggable.destroy(),delete this.ddDraggable),this}setupResizable(e){return this.ddResizable?this.ddResizable.updateOption(e):this.ddResizable=new Ei(this.el,e),this}cleanResizable(){return this.ddResizable&&(this.ddResizable.destroy(),delete this.ddResizable),this}setupDroppable(e){return this.ddDroppable?this.ddDroppable.updateOption(e):this.ddDroppable=new Ir(this.el,e),this}cleanDroppable(){return this.ddDroppable&&(this.ddDroppable.destroy(),delete this.ddDroppable),this}};var Pr=class{resizable(e,t,i,r){return this._getDDElements(e,t).forEach(o=>{if(t==="disable"||t==="enable")o.ddResizable&&o.ddResizable[t]();else if(t==="destroy")o.ddResizable&&o.cleanResizable();else if(t==="option")o.setupResizable({[i]:r});else{let a=o.el.gridstackNode.grid,l=o.el.getAttribute("gs-resize-handles")||a.opts.resizable.handles||"e,s,se";l==="all"&&(l="n,e,s,w,se,sw,ne,nw");let u=!a.opts.alwaysShowResizeHandle;o.setupResizable(se(O({},a.opts.resizable),{handles:l,autoHide:u,start:t.start,stop:t.stop,resize:t.resize,rtl:t.rtl}))}}),this}draggable(e,t,i,r){return this._getDDElements(e,t).forEach(o=>{if(t==="disable"||t==="enable")o.ddDraggable&&o.ddDraggable[t]();else if(t==="destroy")o.ddDraggable&&o.cleanDraggable();else if(t==="option")o.setupDraggable({[i]:r});else{let s=o.el.gridstackNode.grid;o.setupDraggable(se(O({},s.opts.draggable),{start:t.start,stop:t.stop,drag:t.drag,rtl:t.rtl}))}}),this}dragIn(e,t){return this._getDDElements(e).forEach(i=>i.setupDraggable(t)),this}droppable(e,t,i,r){return typeof t.accept=="function"&&!t._accept&&(t._accept=t.accept,t.accept=o=>t._accept(o)),this._getDDElements(e,t).forEach(o=>{t==="disable"||t==="enable"?o.ddDroppable&&o.ddDroppable[t]():t==="destroy"?o.ddDroppable&&o.cleanDroppable():t==="option"?o.setupDroppable({[i]:r}):o.setupDroppable(t)}),this}isDroppable(e){var t;return!!((t=e==null?void 0:e.ddElement)!=null&&t.ddDroppable&&!e.ddElement.ddDroppable.disabled)}isDraggable(e){var t;return!!((t=e==null?void 0:e.ddElement)!=null&&t.ddDraggable&&!e.ddElement.ddDraggable.disabled)}isResizable(e){var t;return!!((t=e==null?void 0:e.ddElement)!=null&&t.ddResizable&&!e.ddElement.ddResizable.disabled)}on(e,t,i){return this._getDDElements(e).forEach(r=>r.on(t,o=>{i(o,F.dragElement?F.dragElement.el:o.target,F.dragElement?F.dragElement.helper:null)})),this}off(e,t){return this._getDDElements(e).forEach(i=>i.off(t)),this}_getDDElements(e,t){let i=e.gridstack||t!=="destroy"&&t!=="disable",r=E.getElements(e);return r.length?r.map(s=>s.ddElement||(i?Hr.init(s):null)).filter(s=>s):[]}};var Ie=new Pr,yt=class n{static init(e={},t=".grid-stack"){if(typeof document=="undefined")return null;let i=n.getGridElement(t);return i?(i.gridstack||(i.gridstack=new n(i,E.cloneDeep(e))),i.gridstack):(console.error(typeof t=="string"?'GridStack.initAll() no grid was found with selector "'+t+`" - element missing or wrong selector ? Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the default selector.`:"GridStack.init() no grid element was passed."),null)}static initAll(e={},t=".grid-stack"){let i=[];return typeof document=="undefined"||(n.getGridElements(t).forEach(r=>{r.gridstack||(r.gridstack=new n(r,E.cloneDeep(e))),i.push(r.gridstack)}),i.length===0&&console.error('GridStack.initAll() no grid was found with selector "'+t+`" - element missing or wrong selector ? Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the default selector.`)),i}static addGrid(e,t={}){if(!e)return null;let i=e;if(i.gridstack){let s=i.gridstack;return t&&(s.opts=O(O({},s.opts),t)),t.children!==void 0&&s.load(t.children),s}return(!e.classList.contains("grid-stack")||n.addRemoveCB)&&(n.addRemoveCB?i=n.addRemoveCB(e,t,!0,!0):i=E.createDiv(["grid-stack",t.class],e)),n.init(t,i)}static registerEngine(e){n.engineClass=e}get placeholder(){if(!this._placeholder){this._placeholder=E.createDiv([this.opts.placeholderClass,je.itemClass,this.opts.itemClass]);let e=E.createDiv(["placeholder-content"],this._placeholder);this.opts.placeholderText&&(e.textContent=this.opts.placeholderText)}return this._placeholder}constructor(e,t={}){var u;this.el=e,this.opts=t,this.animationDelay=310,this._gsEventHandler={},this._extraDragRow=0,this.dragTransform={xScale:1,yScale:1,xOffset:0,yOffset:0},e.gridstack=this,this.opts=t=t||{},e.classList.contains("grid-stack")||this.el.classList.add("grid-stack"),t.row&&(t.minRow=t.maxRow=t.row,delete t.row);let i=E.toNumber(e.getAttribute("gs-row"));t.column==="auto"&&delete t.column,t.alwaysShowResizeHandle!==void 0&&(t._alwaysShowResizeHandle=t.alwaysShowResizeHandle);let r=t.columnOpts;if(r){let c=r.breakpoints;!r.columnWidth&&!(c!=null&&c.length)?delete t.columnOpts:(r.columnMax=r.columnMax||12,(c==null?void 0:c.length)>1&&c.sort((d,p)=>(p.w||0)-(d.w||0)))}let o=se(O({},E.cloneDeep(je)),{column:E.toNumber(e.getAttribute("gs-column"))||je.column,minRow:i||E.toNumber(e.getAttribute("gs-min-row"))||je.minRow,maxRow:i||E.toNumber(e.getAttribute("gs-max-row"))||je.maxRow,staticGrid:E.toBool(e.getAttribute("gs-static"))||je.staticGrid,sizeToContent:E.toBool(e.getAttribute("gs-size-to-content"))||void 0,draggable:{handle:(t.handleClass?"."+t.handleClass:t.handle?t.handle:"")||je.draggable.handle},removableOptions:{accept:t.itemClass||je.removableOptions.accept,decline:je.removableOptions.decline}});e.getAttribute("gs-animate")&&(o.animate=E.toBool(e.getAttribute("gs-animate"))),t=E.defaults(t,o),this._initMargin(),this.checkDynamicColumn(),this._updateColumnVar(t),t.rtl==="auto"&&(t.rtl=e.style.direction==="rtl"),t.rtl&&this.el.classList.add("grid-stack-rtl");let s=this.el.closest("."+je.itemClass),a=s==null?void 0:s.gridstackNode;if(a&&(a.subGrid=this,this.parentGridNode=a,this.el.classList.add("grid-stack-nested"),a.el.classList.add("grid-stack-sub-grid")),this._isAutoCellHeight=t.cellHeight==="auto",this._isAutoCellHeight||t.cellHeight==="initial")this.cellHeight(void 0);else{typeof t.cellHeight=="number"&&t.cellHeightUnit&&t.cellHeightUnit!==je.cellHeightUnit&&(t.cellHeight=t.cellHeight+t.cellHeightUnit,delete t.cellHeightUnit);let c=t.cellHeight;delete t.cellHeight,this.cellHeight(c)}t.alwaysShowResizeHandle==="mobile"&&(t.alwaysShowResizeHandle=Re),this._setStaticClass();let l=t.engineClass||n.engineClass||Mn;if(this.engine=new l({column:this.getColumn(),float:t.float,maxRow:t.maxRow,onChange:c=>{c.forEach(d=>{let p=d.el;p&&(d._removeDOM?(p&&p.remove(),delete d._removeDOM):this._writePosAttr(p,d))}),this._updateContainerHeight()}}),t.auto&&(this.batchUpdate(),this.engine._loading=!0,this.getGridItems().forEach(c=>this._prepareElement(c)),delete this.engine._loading,this.batchUpdate(!1)),t.children){let c=t.children;delete t.children,c.length&&this.load(c)}this.setAnimation(),t.subGridDynamic&&!F.pauseDrag&&(F.pauseDrag=!0),((u=t.draggable)==null?void 0:u.pause)!==void 0&&(F.pauseDrag=t.draggable.pause),this._setupRemoveDrop(),this._setupAcceptWidget(),this._updateResizeEvent()}_updateColumnVar(e=this.opts){this.el.classList.add("gs-"+e.column),typeof e.column=="number"&&this.el.style.setProperty("--gs-column-width",`${100/e.column}%`)}addWidget(e){if(!e)return;if(typeof e=="string"){console.error("V11: GridStack.addWidget() does not support string anymore. see #2736");return}if(e.ELEMENT_NODE)return console.error("V11: GridStack.addWidget() does not support HTMLElement anymore. use makeWidget()"),this.makeWidget(e);let t,i=e;if(i.grid=this,i.el?t=i.el:n.addRemoveCB?t=n.addRemoveCB(this.el,e,!0,!1):t=this.createWidgetDivs(i),!t)return;if(i=t.gridstackNode,i&&t.parentElement===this.el&&this.engine.nodes.find(o=>o._id===i._id))return t;let r=this._readAttr(t);return E.defaults(e,r),this.engine.prepareNode(e),this.el.appendChild(t),this.makeWidget(t,e),t}createWidgetDivs(e){let t=E.createDiv(["grid-stack-item",this.opts.itemClass]),i=E.createDiv(["grid-stack-item-content"],t);return E.lazyLoad(e)?e.visibleObservable||(e.visibleObservable=new IntersectionObserver(([r])=>{var o,s;r.isIntersecting&&((o=e.visibleObservable)==null||o.disconnect(),delete e.visibleObservable,n.renderCB(i,e),(s=e.grid)==null||s.prepareDragDrop(e.el))}),window.setTimeout(()=>{var r;return(r=e.visibleObservable)==null?void 0:r.observe(t)})):n.renderCB(i,e),t}makeSubGrid(e,t,i,r=!0){var y,m,g;let o=e.gridstackNode;if(o||(o=this.makeWidget(e).gridstackNode),(y=o.subGrid)!=null&&y.el)return o.subGrid;let s,a=this;for(;a&&!s;)s=(m=a.opts)==null?void 0:m.subGridOpts,a=(g=a.parentGridNode)==null?void 0:g.grid;t=E.cloneDeep(O(O(se(O({},this.opts),{id:void 0,children:void 0,column:"auto",columnOpts:void 0,layout:"list",subGridOpts:void 0}),s||{}),t||o.subGridOpts||{})),o.subGridOpts=t;let l;t.column==="auto"&&(l=!0,t.column=Math.max(o.w||1,(i==null?void 0:i.w)||1),delete t.columnOpts);let u=o.el.querySelector(".grid-stack-item-content"),c,d;if(r&&(this._removeDD(o.el),d=se(O({},o),{x:0,y:0}),E.removeInternalForSave(d),delete d.subGridOpts,o.content&&(d.content=o.content,delete o.content),n.addRemoveCB?c=n.addRemoveCB(this.el,d,!0,!1):(c=E.createDiv(["grid-stack-item"]),c.appendChild(u),u=E.createDiv(["grid-stack-item-content"],o.el)),this.prepareDragDrop(o.el)),i){let _=l?t.column:o.w,x=o.h+i.h,A=o.el.style;A.transition="none",this.update(o.el,{w:_,h:x}),setTimeout(()=>A.transition=null)}let p=o.subGrid=n.addGrid(u,t);return i!=null&&i._moving&&(p._isTemp=!0),l&&(p._autoColumn=!0),r&&p.makeWidget(c,d),i&&(i._moving?window.setTimeout(()=>E.simulateMouseEvent(i._event,"mouseenter",p.el),0):p.makeWidget(o.el,o)),this.resizeToContentCheck(!1,o),p}removeAsSubGrid(e){var i;let t=(i=this.parentGridNode)==null?void 0:i.grid;t&&(t.batchUpdate(),t.removeWidget(this.parentGridNode.el,!0,!0),this.engine.nodes.forEach(r=>{r.x+=this.parentGridNode.x,r.y+=this.parentGridNode.y,t.makeWidget(r.el,r)}),t.batchUpdate(!1),this.parentGridNode&&delete this.parentGridNode.subGrid,delete this.parentGridNode,e&&window.setTimeout(()=>E.simulateMouseEvent(e._event,"mouseenter",t.el),0))}save(e=!0,t=!1,i=n.saveCB,r){let o=this.engine.save(e,i,r);if(o.forEach(s=>{var a;if(e&&s.el&&!s.subGrid&&!i){let l=s.el.querySelector(".grid-stack-item-content");s.content=l==null?void 0:l.innerHTML,s.content||delete s.content}else if(!e&&!i&&delete s.content,(a=s.subGrid)!=null&&a.el){let l=s.w||s.subGrid.getColumn(),u=s.subGrid.save(e,t,i,l);s.subGridOpts=t?u:{children:u},delete s.subGrid}delete s.el}),t){let s=E.cloneDeep(this.opts);s.marginBottom===s.marginTop&&s.marginRight===s.marginLeft&&s.marginTop===s.marginRight&&(s.margin=s.marginTop,delete s.marginTop,delete s.marginRight,delete s.marginBottom,delete s.marginLeft),s.rtl===(this.el.style.direction==="rtl")&&(s.rtl="auto"),this._isAutoCellHeight&&(s.cellHeight="auto"),this._autoColumn&&(s.column="auto");let a=s._alwaysShowResizeHandle;return delete s._alwaysShowResizeHandle,a!==void 0?s.alwaysShowResizeHandle=a:delete s.alwaysShowResizeHandle,E.removeInternalAndSame(s,je),s.children=o,s}return o}load(e,t=n.addRemoveCB||!0){e.forEach(c=>{c.w=c.w||c.minW||1,c.h=c.h||c.minH||1}),e=E.sort(e),this.engine.skipCacheUpdate=this._ignoreLayoutsNodeChange=!0;let i=0;e.forEach(c=>{i=Math.max(i,(c.x||0)+c.w)}),i>this.engine.defaultColumn&&(this.engine.defaultColumn=i);let r=this.getColumn();i>r&&(this.engine.nodes.length===0&&this.responseLayout?(this.engine.nodes=e,this.engine.columnChanged(i,r,this.responseLayout),e=this.engine.nodes,this.engine.nodes=[],delete this.responseLayout):this.engine.cacheLayout(e,i,!0));let o=n.addRemoveCB;typeof t=="function"&&(n.addRemoveCB=t);let s=[];this.batchUpdate();let a=!this.engine.nodes.length,l=a&&this.opts.animate;l&&this.setAnimation(!1),!a&&t&&[...this.engine.nodes].forEach(d=>{if(!d.id)return;E.find(e,d.id)||(n.addRemoveCB&&n.addRemoveCB(this.el,d,!1,!1),s.push(d),this.removeWidget(d.el,!0,!1))}),this.engine._loading=!0;let u=[];return this.engine.nodes=this.engine.nodes.filter(c=>E.find(e,c.id)?(u.push(c),!1):!0),e.forEach(c=>{var p;let d=E.find(u,c.id);if(d){if(E.shouldSizeToContent(d)&&(c.h=d.h),this.engine.nodeBoundFix(c),(c.autoPosition||c.x===void 0||c.y===void 0)&&(c.w=c.w||d.w,c.h=c.h||d.h,this.engine.findEmptyPosition(c)),this.engine.nodes.push(d),E.samePos(d,c)&&this.engine.nodes.length>1&&(this.moveNode(d,se(O({},c),{forceCollide:!0})),E.copyPos(c,d)),this.update(d.el,c),(p=c.subGridOpts)!=null&&p.children){let y=d.el.querySelector(".grid-stack");y&&y.gridstack&&y.gridstack.load(c.subGridOpts.children)}}else t&&this.addWidget(c)}),delete this.engine._loading,this.engine.removedNodes=s,this.batchUpdate(!1),delete this._ignoreLayoutsNodeChange,delete this.engine.skipCacheUpdate,o?n.addRemoveCB=o:delete n.addRemoveCB,l&&this.setAnimation(!0,!0),this}batchUpdate(e=!0){return this.engine.batchUpdate(e),e||(this._updateContainerHeight(),this._triggerRemoveEvent(),this._triggerAddEvent(),this._triggerChangeEvent()),this}getCellHeight(e=!1){if(this.opts.cellHeight&&this.opts.cellHeight!=="auto"&&(!e||!this.opts.cellHeightUnit||this.opts.cellHeightUnit==="px"))return this.opts.cellHeight;if(this.opts.cellHeightUnit==="rem")return this.opts.cellHeight*parseFloat(getComputedStyle(document.documentElement).fontSize);if(this.opts.cellHeightUnit==="em")return this.opts.cellHeight*parseFloat(getComputedStyle(this.el).fontSize);if(this.opts.cellHeightUnit==="cm")return this.opts.cellHeight*(96/2.54);if(this.opts.cellHeightUnit==="mm")return this.opts.cellHeight*(96/2.54)/10;let t=this.el.querySelector("."+this.opts.itemClass);if(t){let r=E.toNumber(t.getAttribute("gs-h"))||1;return Math.round(t.offsetHeight/r)}let i=parseInt(this.el.getAttribute("gs-current-row"));return i?Math.round(this.el.getBoundingClientRect().height/i):this.opts.cellHeight}cellHeight(e){if(e!==void 0&&this._isAutoCellHeight!==(e==="auto")&&(this._isAutoCellHeight=e==="auto",this._updateResizeEvent()),(e==="initial"||e==="auto")&&(e=void 0),e===void 0){let i=-this.opts.marginRight-this.opts.marginLeft+this.opts.marginTop+this.opts.marginBottom;e=this.cellWidth()+i}let t=E.parseHeight(e);return this.opts.cellHeightUnit===t.unit&&this.opts.cellHeight===t.h?this:(this.opts.cellHeightUnit=t.unit,this.opts.cellHeight=t.h,this.el.style.setProperty("--gs-cell-height",`${this.opts.cellHeight}${this.opts.cellHeightUnit}`),this._updateContainerHeight(),this.resizeToContentCheck(),this)}cellWidth(){return this._widthOrContainer()/this.getColumn()}_widthOrContainer(e=!1){var t;return e&&((t=this.opts.columnOpts)!=null&&t.breakpointForWindow)?window.innerWidth:this.el.clientWidth||this.el.parentElement.clientWidth||window.innerWidth}checkDynamicColumn(){var o,s;let e=this.opts.columnOpts;if(!e||!e.columnWidth&&!((o=e.breakpoints)!=null&&o.length))return!1;let t=this.getColumn(),i=t,r=this._widthOrContainer(!0);if(e.columnWidth)i=Math.min(Math.round(r/e.columnWidth)||1,e.columnMax);else{i=e.columnMax;let a=0;for(;al.c===i);return this.column(i,(a==null?void 0:a.layout)||e.layout),!0}return!1}compact(e="compact",t=!0){return this.engine.compact(e,t),this._triggerChangeEvent(),this}column(e,t="moveScale"){if(!e||e<1||this.opts.column===e)return this;let i=this.getColumn();return this.opts.column=e,this.engine?(this.engine.column=e,this.el.classList.remove("gs-"+i),this._updateColumnVar(),this.engine.columnChanged(i,e,t),this._isAutoCellHeight&&this.cellHeight(),this.resizeToContentCheck(!0),this._ignoreLayoutsNodeChange=!0,this._triggerChangeEvent(),delete this._ignoreLayoutsNodeChange,this):(this.responseLayout=t,this)}getColumn(){return this.opts.column}getGridItems(){return Array.from(this.el.children).filter(e=>e.matches("."+this.opts.itemClass)&&!e.matches("."+this.opts.placeholderClass))}isIgnoreChangeCB(){return this._ignoreLayoutsNodeChange}destroy(e=!0){var t;if(this.el)return this.offAll(),this._updateResizeEvent(!0),this.setStatic(!0,!1),this.setAnimation(!1),e?this.el.parentNode.removeChild(this.el):(this.removeAll(e),this.el.removeAttribute("gs-current-row")),this.parentGridNode&&delete this.parentGridNode.subGrid,delete this.parentGridNode,delete this.opts,(t=this._placeholder)==null||delete t.gridstackNode,delete this._placeholder,delete this.engine,delete this.el.gridstack,delete this.el,this}float(e){return this.opts.float!==e&&(this.opts.float=this.engine.float=e,this._triggerChangeEvent()),this}getFloat(){return this.engine.float}getCellFromPixel(e,t=!1){let i=this.el.getBoundingClientRect(),r;t?r={top:i.top+document.documentElement.scrollTop,left:i.left}:r={top:this.el.offsetTop,left:this.el.offsetLeft};let o=e.left-r.left,s=e.top-r.top,a=i.width/this.getColumn(),l=i.height/parseInt(this.el.getAttribute("gs-current-row"));return{x:Math.floor(o/a),y:Math.floor(s/l)}}getRow(){return Math.max(this.engine.getRow(),this.opts.minRow||0)}isAreaEmpty(e,t,i,r){return this.engine.isAreaEmpty(e,t,i,r)}makeWidget(e,t){let i=n.getElement(e);if(!i||i.gridstackNode)return i;i.parentElement||this.el.appendChild(i),this._prepareElement(i,!0,t);let r=i.gridstackNode;this._updateContainerHeight(),r.subGridOpts&&this.makeSubGrid(i,r.subGridOpts,void 0,!1);let o;return this.opts.column===1&&!this._ignoreLayoutsNodeChange&&(o=this._ignoreLayoutsNodeChange=!0),this._triggerAddEvent(),this._triggerChangeEvent(),o&&delete this._ignoreLayoutsNodeChange,i}on(e,t){return e.indexOf(" ")!==-1?(e.split(" ").forEach(r=>this.on(r,t)),this):(e==="change"||e==="added"||e==="removed"||e==="enable"||e==="disable"?(e==="enable"||e==="disable"?this._gsEventHandler[e]=r=>t(r):this._gsEventHandler[e]=r=>{r.detail&&t(r,r.detail)},this.el.addEventListener(e,this._gsEventHandler[e])):e==="drag"||e==="dragstart"||e==="dragstop"||e==="resizestart"||e==="resize"||e==="resizestop"||e==="dropped"||e==="resizecontent"?this._gsEventHandler[e]=t:console.error("GridStack.on("+e+") event not supported"),this)}off(e){return e.indexOf(" ")!==-1?(e.split(" ").forEach(i=>this.off(i)),this):((e==="change"||e==="added"||e==="removed"||e==="enable"||e==="disable")&&this._gsEventHandler[e]&&this.el.removeEventListener(e,this._gsEventHandler[e]),delete this._gsEventHandler[e],this)}offAll(){return Object.keys(this._gsEventHandler).forEach(e=>this.off(e)),this}removeWidget(e,t=!0,i=!0){return e?(n.getElements(e).forEach(r=>{if(r.parentElement&&r.parentElement!==this.el)return;let o=r.gridstackNode;o||(o=this.engine.nodes.find(s=>r===s.el)),o&&(t&&n.addRemoveCB&&n.addRemoveCB(this.el,o,!1,!1),delete r.gridstackNode,this._removeDD(r),this.engine.removeNode(o,t,i),t&&r.parentElement&&r.remove())}),i&&(this._triggerRemoveEvent(),this._triggerChangeEvent()),this):(console.error("Error: GridStack.removeWidget(undefined) called"),this)}removeAll(e=!0,t=!0){return this.engine.nodes.forEach(i=>{e&&n.addRemoveCB&&n.addRemoveCB(this.el,i,!1,!1),delete i.el.gridstackNode,this.opts.staticGrid||this._removeDD(i.el)}),this.engine.removeAll(e,t),t&&this._triggerRemoveEvent(),this}setAnimation(e=this.opts.animate,t){return t?setTimeout(()=>{this.opts&&this.setAnimation(e)}):e?this.el.classList.add("grid-stack-animate"):this.el.classList.remove("grid-stack-animate"),this.opts.animate=e,this}hasAnimationCSS(){return this.el.classList.contains("grid-stack-animate")}setStatic(e,t=!0,i=!0){return!!this.opts.staticGrid===e?this:(e?this.opts.staticGrid=!0:delete this.opts.staticGrid,this._setupRemoveDrop(),this._setupAcceptWidget(),this.engine.nodes.forEach(r=>{this.prepareDragDrop(r.el),r.subGrid&&i&&r.subGrid.setStatic(e,t,i)}),t&&this._setStaticClass(),this)}updateOptions(e){var i;let t=this.opts;if(e===t)return this;if(e.acceptWidgets!==void 0&&(t.acceptWidgets=e.acceptWidgets,this._setupAcceptWidget()),e.animate!==void 0&&this.setAnimation(e.animate),e.cellHeight&&this.cellHeight(e.cellHeight),e.class!==void 0&&e.class!==t.class&&(t.class&&this.el.classList.remove(t.class),e.class&&this.el.classList.add(e.class)),e.columnOpts){let r=!!this.opts.columnOpts;this.opts.columnOpts=e.columnOpts,r!==!!this.opts.columnOpts&&this._updateResizeEvent(),this.checkDynamicColumn()}else e.columnOpts===null&&this.opts.columnOpts?(delete this.opts.columnOpts,this._updateResizeEvent()):typeof e.column=="number"&&this.column(e.column);return e.margin!==void 0&&this.margin(e.margin),e.staticGrid!==void 0&&this.setStatic(e.staticGrid),e.disableDrag!==void 0&&!e.staticGrid&&this.enableMove(!e.disableDrag),e.disableResize!==void 0&&!e.staticGrid&&this.enableResize(!e.disableResize),e.float!==void 0&&this.float(e.float),e.row!==void 0?(t.minRow=t.maxRow=t.row=e.row,this._updateContainerHeight()):(e.minRow!==void 0&&(t.minRow=e.minRow,this._updateContainerHeight()),e.maxRow!==void 0&&(t.maxRow=this.engine.maxRow=e.maxRow)),e.lazyLoad!==void 0&&(t.lazyLoad=e.lazyLoad),(i=e.children)!=null&&i.length&&this.load(e.children),this}update(e,t){return n.getElements(e).forEach(i=>{var c;let r=i==null?void 0:i.gridstackNode;if(!r)return;let o=O(O({},E.copyPos({},r)),E.cloneDeep(t));this.engine.nodeBoundFix(o),delete o.autoPosition;let s=["x","y","w","h"],a;if(s.some(d=>o[d]!==void 0&&o[d]!==r[d])&&(a={},s.forEach(d=>{a[d]=o[d]!==void 0?o[d]:r[d],delete o[d]})),!a&&(o.minW||o.minH||o.maxW||o.maxH)&&(a={}),o.content!==void 0){let d=i.querySelector(".grid-stack-item-content");d&&d.textContent!==o.content&&(r.content=o.content,n.renderCB(d,o),(c=r.subGrid)!=null&&c.el&&(d.appendChild(r.subGrid.el),r.subGrid._updateContainerHeight())),delete o.content}let l=!1,u=!1;for(let d in o)d[0]!=="_"&&r[d]!==o[d]&&(r[d]=o[d],l=!0,u=u||!this.opts.staticGrid&&(d==="noResize"||d==="noMove"||d==="locked"));if(E.sanitizeMinMax(r),a){let d=a.w!==void 0&&a.w!==r.w;this.moveNode(r,a),d&&r.subGrid?r.subGrid.onResize(this.hasAnimationCSS()?r.w:void 0):this.resizeToContentCheck(d,r),delete r._orig}(a||l)&&this._writeAttr(i,r),u&&this.prepareDragDrop(r.el),n.updateCB&&n.updateCB(r)}),this}moveNode(e,t){let i=e._updating;i||this.engine.cleanNodes().beginUpdate(e),this.engine.moveNode(e,t),this._updateContainerHeight(),i||(this._triggerChangeEvent(),this.engine.endUpdate())}resizeToContent(e){var p,y;if(!e||(e.classList.remove("size-to-content-max"),!e.clientHeight))return;let t=e.gridstackNode;if(!t)return;let i=t.grid;if(!i||e.parentElement!==i.el)return;let r=i.getCellHeight(!0);if(!r)return;let o=t.h?t.h*r:e.clientHeight,s;if(t.resizeToContentParent&&(s=e.querySelector(t.resizeToContentParent)),s||(s=e.querySelector(n.resizeToContentParent)),!s)return;let a=e.clientHeight-s.clientHeight,l=t.h?t.h*r-a:s.clientHeight,u;if(t.subGrid){u=t.subGrid.getRow()*t.subGrid.getCellHeight(!0);let m=t.subGrid.el.getBoundingClientRect(),g=e.getBoundingClientRect();u+=m.top-g.top}else{if((y=(p=t.subGridOpts)==null?void 0:p.children)!=null&&y.length)return;{let m=s.firstElementChild;if(!m){console.error(`Error: GridStack.resizeToContent() widget id:${t.id} '${n.resizeToContentParent}'.firstElementChild is null, make sure to have a div like container. Skipping sizing.`);return}u=m.getBoundingClientRect().height||l}}if(l===u)return;o+=u-l;let c=Math.ceil(o/r),d=Number.isInteger(t.sizeToContent)?t.sizeToContent:0;d&&c>d&&(c=d,e.classList.add("size-to-content-max")),t.minH&&ct.maxH&&(c=t.maxH),c!==t.h&&(i._ignoreLayoutsNodeChange=!0,i.moveNode(t,{h:c}),delete i._ignoreLayoutsNodeChange)}resizeToContentCBCheck(e){n.resizeToContentCB?n.resizeToContentCB(e):this.resizeToContent(e)}rotate(e,t){return n.getElements(e).forEach(i=>{let r=i.gridstackNode;if(!E.canBeRotated(r))return;let o={w:r.h,h:r.w,minH:r.minW,minW:r.minH,maxH:r.maxW,maxW:r.maxH};if(t){let a=t.left>0?Math.floor(t.left/this.cellWidth()):0,l=t.top>0?Math.floor(t.top/this.opts.cellHeight):0;o.x=r.x+a-(r.h-(l+1)),o.y=r.y+l-a}Object.keys(o).forEach(a=>{o[a]===void 0&&delete o[a]});let s=r._orig;this.update(i,o),r._orig=s}),this}margin(e){if(!(typeof e=="string"&&e.split(" ").length>1)){let i=E.parseHeight(e);if(this.opts.marginUnit===i.unit&&this.opts.margin===i.h)return}return this.opts.margin=e,this.opts.marginTop=this.opts.marginBottom=this.opts.marginLeft=this.opts.marginRight=void 0,this._initMargin(),this}getMargin(){return this.opts.margin}willItFit(e){return this.engine.willItFit(e)}_triggerChangeEvent(){if(this.engine.batchMode)return this;let e=this.engine.getDirtyNodes(!0);return e&&e.length&&(this._ignoreLayoutsNodeChange||this.engine.layoutsNodesChange(e),this._triggerEvent("change",e)),this.engine.saveInitial(),this}_triggerAddEvent(){var e;if(this.engine.batchMode)return this;if((e=this.engine.addedNodes)!=null&&e.length){this._ignoreLayoutsNodeChange||this.engine.layoutsNodesChange(this.engine.addedNodes),this.engine.addedNodes.forEach(i=>{delete i._dirty});let t=[...this.engine.addedNodes];this.engine.addedNodes=[],this._triggerEvent("added",t)}return this}_triggerRemoveEvent(){var e;if(this.engine.batchMode)return this;if((e=this.engine.removedNodes)!=null&&e.length){let t=[...this.engine.removedNodes];this.engine.removedNodes=[],this._triggerEvent("removed",t)}return this}_triggerEvent(e,t){let i=t?new CustomEvent(e,{bubbles:!1,detail:t}):new Event(e),r=this;for(;r.parentGridNode;)r=r.parentGridNode.grid;return r.el.dispatchEvent(i),this}_updateContainerHeight(){if(!this.engine||this.engine.batchMode)return this;let e=this.parentGridNode,t=this.getRow()+this._extraDragRow,i=this.opts.cellHeight,r=this.opts.cellHeightUnit;if(!i)return this;if(!e&&!this.opts.minRow){let o=E.parseHeight(getComputedStyle(this.el).minHeight);if(o.h>0&&o.unit===r){let s=Math.floor(o.h/i);t1?`calc(${t.w} * var(--gs-column-width))`:null,e.style.height=t.h>1?`calc(${t.h} * var(--gs-cell-height))`:null}return e.setAttribute("gs-x",String(t.x)),e.setAttribute("gs-y",String(t.y)),t.w>1?e.setAttribute("gs-w",String(t.w)):e.removeAttribute("gs-w"),t.h>1?e.setAttribute("gs-h",String(t.h)):e.removeAttribute("gs-h"),this}_writeAttr(e,t){if(!t)return this;this._writePosAttr(e,t);let i={noResize:"gs-no-resize",noMove:"gs-no-move",locked:"gs-locked",id:"gs-id",sizeToContent:"gs-size-to-content"};for(let r in i)t[r]?e.setAttribute(i[r],String(t[r])):e.removeAttribute(i[r]);return this}_readAttr(e,t=!0){let i={};i.x=E.toNumber(e.getAttribute("gs-x")),i.y=E.toNumber(e.getAttribute("gs-y")),i.w=E.toNumber(e.getAttribute("gs-w")),i.h=E.toNumber(e.getAttribute("gs-h")),i.autoPosition=E.toBool(e.getAttribute("gs-auto-position")),i.noResize=E.toBool(e.getAttribute("gs-no-resize")),i.noMove=E.toBool(e.getAttribute("gs-no-move")),i.locked=E.toBool(e.getAttribute("gs-locked"));let r=e.getAttribute("gs-size-to-content");r&&(r==="true"||r==="false"?i.sizeToContent=E.toBool(r):i.sizeToContent=parseInt(r,10)),i.id=e.getAttribute("gs-id"),i.maxW=E.toNumber(e.getAttribute("gs-max-w")),i.minW=E.toNumber(e.getAttribute("gs-min-w")),i.maxH=E.toNumber(e.getAttribute("gs-max-h")),i.minH=E.toNumber(e.getAttribute("gs-min-h")),t&&(i.w===1&&e.removeAttribute("gs-w"),i.h===1&&e.removeAttribute("gs-h"),i.maxW&&e.removeAttribute("gs-max-w"),i.minW&&e.removeAttribute("gs-min-w"),i.maxH&&e.removeAttribute("gs-max-h"),i.minH&&e.removeAttribute("gs-min-h"));for(let o in i){if(!i.hasOwnProperty(o))return;!i[o]&&i[o]!==0&&o!=="sizeToContent"&&delete i[o]}return i}_setStaticClass(){let e=["grid-stack-static"];return this.opts.staticGrid?(this.el.classList.add(...e),this.el.setAttribute("gs-static","true")):(this.el.classList.remove(...e),this.el.removeAttribute("gs-static")),this}onResize(e=(t=>(t=this.el)==null?void 0:t.clientWidth)()){if(!e||this.prevWidth===e)return;this.prevWidth=e,this.batchUpdate();let i=!1;return this._autoColumn&&this.parentGridNode?this.opts.column!==this.parentGridNode.w&&(this.column(this.parentGridNode.w,this.opts.layout||"list"),i=!0):i=this.checkDynamicColumn(),this._isAutoCellHeight&&this.cellHeight(),this.engine.nodes.forEach(r=>{r.subGrid&&r.subGrid.onResize()}),this._skipInitialResize||this.resizeToContentCheck(i),delete this._skipInitialResize,this.batchUpdate(!1),this}resizeToContentCheck(e=!1,t=void 0){if(this.engine){if(e&&this.hasAnimationCSS())return setTimeout(()=>this.resizeToContentCheck(!1,t),this.animationDelay);if(t)E.shouldSizeToContent(t)&&this.resizeToContentCBCheck(t.el);else if(this.engine.nodes.some(i=>E.shouldSizeToContent(i))){let i=[...this.engine.nodes];this.batchUpdate(),i.forEach(r=>{E.shouldSizeToContent(r)&&this.resizeToContentCBCheck(r.el)}),this._ignoreLayoutsNodeChange=!0,this.batchUpdate(!1),this._ignoreLayoutsNodeChange=!1}this._gsEventHandler.resizecontent&&this._gsEventHandler.resizecontent(null,t?[t]:this.engine.nodes)}}_updateResizeEvent(e=!1){let t=!this.parentGridNode&&(this._isAutoCellHeight||this.opts.sizeToContent||this.opts.columnOpts||this.engine.nodes.find(i=>i.sizeToContent));return!e&&t&&!this.resizeObserver?(this._sizeThrottle=E.throttle(()=>this.onResize(),this.opts.cellHeightThrottle),this.resizeObserver=new ResizeObserver(()=>this._sizeThrottle()),this.resizeObserver.observe(this.el),this._skipInitialResize=!0):(e||!t)&&this.resizeObserver&&(this.resizeObserver.disconnect(),delete this.resizeObserver,delete this._sizeThrottle),this}static getElement(e=".grid-stack-item"){return E.getElement(e)}static getElements(e=".grid-stack-item"){return E.getElements(e)}static getGridElement(e){return n.getElement(e)}static getGridElements(e){return E.getElements(e)}_initMargin(){let e,t=0,i=[];typeof this.opts.margin=="string"&&(i=this.opts.margin.split(" ")),i.length===2?(this.opts.marginTop=this.opts.marginBottom=i[0],this.opts.marginLeft=this.opts.marginRight=i[1]):i.length===4?(this.opts.marginTop=i[0],this.opts.marginRight=i[1],this.opts.marginBottom=i[2],this.opts.marginLeft=i[3]):(e=E.parseHeight(this.opts.margin),this.opts.marginUnit=e.unit,t=this.opts.margin=e.h),["marginTop","marginRight","marginBottom","marginLeft"].forEach(s=>{this.opts[s]===void 0?this.opts[s]=t:(e=E.parseHeight(this.opts[s]),this.opts[s]=e.h,delete this.opts.margin)}),this.opts.marginUnit=e.unit,this.opts.marginTop===this.opts.marginBottom&&this.opts.marginLeft===this.opts.marginRight&&this.opts.marginTop===this.opts.marginRight&&(this.opts.margin=this.opts.marginTop);let o=this.el.style;return o.setProperty("--gs-item-margin-top",`${this.opts.marginTop}${this.opts.marginUnit}`),o.setProperty("--gs-item-margin-bottom",`${this.opts.marginBottom}${this.opts.marginUnit}`),o.setProperty("--gs-item-margin-right",`${this.opts.marginRight}${this.opts.marginUnit}`),o.setProperty("--gs-item-margin-left",`${this.opts.marginLeft}${this.opts.marginUnit}`),this}static getDD(){return Ie}static setupDragIn(e,t,i,r=document){(t==null?void 0:t.pause)!==void 0&&(F.pauseDrag=t.pause),t=O({appendTo:"body",helper:"clone"},t||{}),(typeof e=="string"?E.getElements(e,r):e).forEach((s,a)=>{Ie.isDraggable(s)||Ie.dragIn(s,t),i!=null&&i[a]&&(s.gridstackNode=i[a])})}movable(e,t){return this.opts.staticGrid?this:(n.getElements(e).forEach(i=>{let r=i.gridstackNode;r&&(t?delete r.noMove:r.noMove=!0,this.prepareDragDrop(r.el))}),this)}resizable(e,t){return this.opts.staticGrid?this:(n.getElements(e).forEach(i=>{let r=i.gridstackNode;r&&(t?delete r.noResize:r.noResize=!0,this.prepareDragDrop(r.el))}),this)}disable(e=!0){if(!this.opts.staticGrid)return this.enableMove(!1,e),this.enableResize(!1,e),this._triggerEvent("disable"),this}enable(e=!0){if(!this.opts.staticGrid)return this.enableMove(!0,e),this.enableResize(!0,e),this._triggerEvent("enable"),this}enableMove(e,t=!0){return this.opts.staticGrid?this:(e?delete this.opts.disableDrag:this.opts.disableDrag=!0,this.engine.nodes.forEach(i=>{this.prepareDragDrop(i.el),i.subGrid&&t&&i.subGrid.enableMove(e,t)}),this)}enableResize(e,t=!0){return this.opts.staticGrid?this:(e?delete this.opts.disableResize:this.opts.disableResize=!0,this.engine.nodes.forEach(i=>{this.prepareDragDrop(i.el),i.subGrid&&t&&i.subGrid.enableResize(e,t)}),this)}cancelDrag(){var t;let e=(t=this._placeholder)==null?void 0:t.gridstackNode;e&&(e._isExternal?(e._isAboutToRemove=!0,this.engine.removeNode(e)):e._isAboutToRemove&&n._itemRemoving(e.el,!1),this.engine.restoreInitial())}_removeDD(e){return Ie.draggable(e,"destroy").resizable(e,"destroy"),e.gridstackNode&&delete e.gridstackNode._initDD,delete e.ddElement,this}_setupAcceptWidget(){if(this.opts.staticGrid||!this.opts.acceptWidgets&&!this.opts.removable)return Ie.droppable(this.el,"destroy"),this;let e,t,i=(r,o,s)=>{var p;s=s||o;let a=s.gridstackNode;if(!a)return;if(!((p=a.grid)!=null&&p.el)){s.style.transform=`scale(${1/this.dragTransform.xScale},${1/this.dragTransform.yScale})`;let y=s.getBoundingClientRect();s.style.left=y.x+(this.dragTransform.xScale-1)*(r.clientX-y.x)/this.dragTransform.xScale+"px",s.style.top=y.y+(this.dragTransform.yScale-1)*(r.clientY-y.y)/this.dragTransform.yScale+"px",s.style.transformOrigin="0px 0px"}let{top:l,left:u}=s.getBoundingClientRect(),c=this.el.getBoundingClientRect();u-=c.left,l-=c.top;let d={position:{top:l*this.dragTransform.xScale,left:u*this.dragTransform.yScale}};if(a._temporaryRemoved){if(a.x=Math.max(0,Math.round(u/t)),a.y=Math.max(0,Math.round(l/e)),delete a.autoPosition,this.engine.nodeBoundFix(a),!this.engine.willItFit(a)){if(a.autoPosition=!0,!this.engine.willItFit(a)){Ie.off(o,"drag");return}a._willFitPos&&(E.copyPos(a,a._willFitPos),delete a._willFitPos)}this._onStartMoving(s,r,d,a,t,e)}else this._dragOrResize(s,r,d,a,t,e)};return Ie.droppable(this.el,{accept:r=>{let o=r.gridstackNode||this._readAttr(r,!1);if((o==null?void 0:o.grid)===this)return!0;if(!this.opts.acceptWidgets)return!1;let s=!0;if(typeof this.opts.acceptWidgets=="function")s=this.opts.acceptWidgets(r);else{let a=this.opts.acceptWidgets===!0?".grid-stack-item":this.opts.acceptWidgets;s=r.matches(a)}if(s&&o&&this.opts.maxRow){let a={w:o.w,h:o.h,minW:o.minW,minH:o.minH};s=this.engine.willItFit(a)}return s}}).on(this.el,"dropover",(r,o,s)=>{let a=(s==null?void 0:s.gridstackNode)||o.gridstackNode;if((a==null?void 0:a.grid)===this&&!a._temporaryRemoved)return!1;if(a!=null&&a._sidebarOrig&&(a.w=a._sidebarOrig.w,a.h=a._sidebarOrig.h),a!=null&&a.grid&&a.grid!==this&&!a._temporaryRemoved&&a.grid._leave(o,s),s=s||o,t=this.cellWidth(),e=this.getCellHeight(!0),!a){let c=s.getAttribute("data-gs-widget")||s.getAttribute("gridstacknode");if(c){try{a=JSON.parse(c)}catch(d){console.error("Gridstack dropover: Bad JSON format: ",c)}s.removeAttribute("data-gs-widget"),s.removeAttribute("gridstacknode")}a||(a=this._readAttr(s)),a._sidebarOrig={w:a.w,h:a.h}}a.grid||(a.el||(a=O({},a)),a._isExternal=!0,s.gridstackNode=a);let l=a.w||Math.round(s.offsetWidth/t)||1,u=a.h||Math.round(s.offsetHeight/e)||1;return a.grid&&a.grid!==this?(o._gridstackNodeOrig||(o._gridstackNodeOrig=a),o.gridstackNode=a=se(O({},a),{w:l,h:u,grid:this}),delete a.x,delete a.y,this.engine.cleanupNode(a).nodeBoundFix(a),a._initDD=a._isExternal=a._temporaryRemoved=!0):(a.w=l,a.h=u,a._temporaryRemoved=!0),n._itemRemoving(a.el,!1),Ie.on(o,"drag",i),i(r,o,s),!1}).on(this.el,"dropout",(r,o,s)=>{let a=(s==null?void 0:s.gridstackNode)||o.gridstackNode;return a&&(!a.grid||a.grid===this)&&(this._leave(o,s),this._isTemp&&this.removeAsSubGrid(a)),!1}).on(this.el,"drop",(r,o,s)=>{var p,y,m;let a=(s==null?void 0:s.gridstackNode)||o.gridstackNode;if((a==null?void 0:a.grid)===this&&!a._isExternal)return!1;let l=!!this.placeholder.parentElement,u=o!==s;this.placeholder.remove(),delete this.placeholder.gridstackNode,l&&this.opts.animate&&(this.setAnimation(!1),this.setAnimation(!0,!0));let c=o._gridstackNodeOrig;if(delete o._gridstackNodeOrig,l&&(c!=null&&c.grid)&&c.grid!==this){let g=c.grid;g.engine.removeNodeFromLayoutCache(c),g.engine.removedNodes.push(c),g._triggerRemoveEvent()._triggerChangeEvent(),g.parentGridNode&&!g.engine.nodes.length&&g.opts.subGridDynamic&&g.removeAsSubGrid()}if(!a||(l&&(this.engine.cleanupNode(a),a.grid=this),(p=a.grid)==null||delete p._isTemp,Ie.off(o,"drag"),s!==o?(s.remove(),o=s):o.remove(),this._removeDD(o),!l))return!1;let d=(m=(y=a.subGrid)==null?void 0:y.el)==null?void 0:m.gridstack;return E.copyPos(a,this._readAttr(this.placeholder)),E.removePositioningStyles(o),u&&(a.content||a.subGridOpts||n.addRemoveCB)?(delete a.el,o=this.addWidget(a)):(this._prepareElement(o,!0,a),this.el.appendChild(o),this.resizeToContentCheck(!1,a),d&&(d.parentGridNode=a),this._updateContainerHeight()),this.engine.addedNodes.push(a),this._triggerAddEvent(),this._triggerChangeEvent(),this.engine.endUpdate(),this._gsEventHandler.dropped&&this._gsEventHandler.dropped(se(O({},r),{type:"dropped"}),c&&c.grid?c:void 0,a),!1}),this}static _itemRemoving(e,t){if(!e)return;let i=e?e.gridstackNode:void 0;!(i!=null&&i.grid)||e.classList.contains(i.grid.opts.removableOptions.decline)||(t?i._isAboutToRemove=!0:delete i._isAboutToRemove,t?e.classList.add("grid-stack-item-removing"):e.classList.remove("grid-stack-item-removing"))}_setupRemoveDrop(){if(typeof this.opts.removable!="string")return this;let e=document.querySelector(this.opts.removable);return e?(!this.opts.staticGrid&&!Ie.isDroppable(e)&&Ie.droppable(e,this.opts.removableOptions).on(e,"dropover",(t,i)=>n._itemRemoving(i,!0)).on(e,"dropout",(t,i)=>n._itemRemoving(i,!1)),this):this}prepareDragDrop(e,t=!1){let i=e==null?void 0:e.gridstackNode;if(!i)return;let r=i.noMove||this.opts.disableDrag,o=i.noResize||this.opts.disableResize,s=this.opts.staticGrid||r&&o;if((t||s)&&(i._initDD&&(this._removeDD(e),delete i._initDD),s))return e.classList.add("ui-draggable-disabled","ui-resizable-disabled"),this;if(!i._initDD){let a,l,u=(p,y)=>{this.triggerEvent(p,p.target),a=this.cellWidth(),l=this.getCellHeight(!0),this._onStartMoving(e,p,y,i,a,l)},c=(p,y)=>{this._dragOrResize(e,p,y,i,a,l)},d=p=>{this.placeholder.remove(),delete this.placeholder.gridstackNode,delete i._moving,delete i._resizing,delete i._event,delete i._lastTried;let y=i.w!==i._orig.w,m=p.target;if(!(!m.gridstackNode||m.gridstackNode.grid!==this)){if(i.el=m,i._isAboutToRemove){let g=e.gridstackNode.grid;g._gsEventHandler[p.type]&&g._gsEventHandler[p.type](p,m),g.engine.nodes.push(i),g.removeWidget(e,!0,!0)}else E.removePositioningStyles(m),i._temporaryRemoved?(this._writePosAttr(m,i),this.engine.addNode(i)):this._writePosAttr(m,i),this.triggerEvent(p,m);this._extraDragRow=0,this._updateContainerHeight(),this._triggerChangeEvent(),this.engine.endUpdate(),p.type==="resizestop"&&(Number.isInteger(i.sizeToContent)&&(i.sizeToContent=i.h),this.resizeToContentCheck(y,i))}};Ie.draggable(e,{start:u,stop:d,drag:c,rtl:this.opts.rtl}).resizable(e,{start:u,stop:d,resize:c,rtl:this.opts.rtl}),i._initDD=!0}return Ie.draggable(e,r?"disable":"enable").resizable(e,o?"disable":"enable"),this}_onStartMoving(e,t,i,r,o,s){var a;if(this.engine.cleanNodes().beginUpdate(r),this._writePosAttr(this.placeholder,r),this.el.appendChild(this.placeholder),this.placeholder.gridstackNode=r,(a=r.grid)!=null&&a.el)this.dragTransform=E.getValuesFromTransformedElement(e);else if(this.placeholder&&this.placeholder.closest(".grid-stack")){let l=this.placeholder.closest(".grid-stack");this.dragTransform=E.getValuesFromTransformedElement(l)}else this.dragTransform={xScale:1,xOffset:0,yScale:1,yOffset:0};if(r.el=this.placeholder,r._lastUiPosition=i.position,r._prevYPix=i.position.top,r._moving=t.type==="dragstart",r._resizing=t.type==="resizestart",delete r._lastTried,t.type==="dropover"&&r._temporaryRemoved&&(this.engine.addNode(r),r._moving=!0),this.engine.cacheRects(o,s,this.opts.marginTop,this.opts.marginRight,this.opts.marginBottom,this.opts.marginLeft),t.type==="resizestart"){let l=this.getColumn()-r.x,u=(this.opts.maxRow||Number.MAX_SAFE_INTEGER)-r.y;Ie.resizable(e,"option","minWidth",o*Math.min(r.minW||1,l)).resizable(e,"option","minHeight",s*Math.min(r.minH||1,u)).resizable(e,"option","maxWidth",o*Math.min(r.maxW||Number.MAX_SAFE_INTEGER,l)).resizable(e,"option","maxWidthMoveLeft",o*Math.min(r.maxW||Number.MAX_SAFE_INTEGER,r.x+r.w)).resizable(e,"option","maxHeight",s*Math.min(r.maxH||Number.MAX_SAFE_INTEGER,u)).resizable(e,"option","maxHeightMoveUp",s*Math.min(r.maxH||Number.MAX_SAFE_INTEGER,r.y+r.h))}}_dragOrResize(e,t,i,r,o,s){var _;let a=O({},r._orig),l,u=this.opts.marginLeft,c=this.opts.marginRight,d=this.opts.marginTop,p=this.opts.marginBottom,y=Math.round(s*.1),m=Math.round(o*.1);if(u=Math.min(u,m),c=Math.min(c,m),d=Math.min(d,y),p=Math.min(p,y),t.type==="drag"){if(r._temporaryRemoved)return;r._prevYPix=i.position.top,this.opts.draggable.scroll!==!1&&((_=F.dragElement)==null||_.updateScrollPosition(this.el));let x=i.position.left+(i.position.left>r._lastUiPosition.left?-c:u),A=i.position.top+(i.position.top>r._lastUiPosition.top?-p:d);a.x=Math.round(x/o),a.y=Math.round(A/s);let w=this._extraDragRow;if(this.engine.collide(r,a)){let T=this.getRow(),$=Math.max(0,a.y+r.h-T);this.opts.maxRow&&T+$>this.opts.maxRow&&($=Math.max(0,this.opts.maxRow-T)),this._extraDragRow=$}else this._extraDragRow=0;if(this._extraDragRow!==w&&this._updateContainerHeight(),r.x===a.x&&r.y===a.y)return}else if(t.type==="resize"){if(a.x<0||(E.updateScrollResize(t,e,s),a.w=Math.round((i.size.width-u)/o),a.h=Math.round((i.size.height-d)/s),r.w===a.w&&r.h===a.h)||r._lastTried&&r._lastTried.w===a.w&&r._lastTried.h===a.h)return;if(t.hasMovedX){let x=i.position.left+u;a.x=Math.round(x/o)}if(t.hasMovedY){let x=i.position.top+d;a.y=Math.round(x/s)}l=!0}r._event=t,r._lastTried=a;let g={x:i.position.left+u,y:i.position.top+d,w:(i.size?i.size.width:r.w*o)-u-c,h:(i.size?i.size.height:r.h*s)-d-p};if(this.engine.moveNodeCheck(r,se(O({},a),{cellWidth:o,cellHeight:s,rect:g,resizing:l}))){r._lastUiPosition=i.position,this.engine.cacheRects(o,s,d,c,p,u),delete r._skipDown,l&&r.subGrid&&r.subGrid.onResize(),this._extraDragRow=0,this._updateContainerHeight();let x=t.target;r._sidebarOrig||this._writePosAttr(x,r),this.triggerEvent(t,x)}}triggerEvent(e,t){let i=this;for(;i.parentGridNode;)i=i.parentGridNode.grid;i._gsEventHandler[e.type]&&i._gsEventHandler[e.type](e,t)}_leave(e,t){t=t||e;let i=t.gridstackNode;if(!i||(t.style.transform=t.style.transformOrigin=null,Ie.off(e,"drag"),i._temporaryRemoved))return;i._temporaryRemoved=!0,this.engine.removeNode(i),i.el=i._isExternal&&t?t:e;let r=i._sidebarOrig;i._isExternal&&this.engine.cleanupNode(i),i._sidebarOrig=r,this.opts.removable===!0&&n._itemRemoving(e,!0),e._gridstackNodeOrig?(e.gridstackNode=e._gridstackNodeOrig,delete e._gridstackNodeOrig):i._isExternal&&this.engine.restoreInitial()}};yt.renderCB=(n,e)=>{n&&(e!=null&&e.content)&&(n.textContent=e.content)};yt.resizeToContentParent=".grid-stack-item-content";yt.Utils=E;yt.Engine=Mn;yt.GDRev="12.6.0";function fv(){let n=document.getElementById("dashboard");n&&n.gridstack.disable()}function hv(){let n=document.getElementById("dashboard");n&&n.gridstack.enable()}function pv(n,e){return at(this,null,function*(){return yield Dn(n,{layout:e})})}function kc(){if(document.getElementById("dashboard")==null)return;let e=yt.init({cellHeight:100,disableDrag:!0,disableResize:!0,draggable:{handle:".grid-stack-item-content .card-header",appendTo:"body",scroll:!0}}),t=document.getElementById("lock_dashboard");t&&t.addEventListener("click",()=>{fv()});let i=document.getElementById("unlock_dashboard");i&&i.addEventListener("click",()=>{hv()});let r=document.getElementById("save_dashboard");r!==null&&r.addEventListener("click",()=>{let o=r.getAttribute("data-url");if(o==null)return;let s=e.save(!1);pv(o,s).then(a=>{Zt(a)?Nt("danger","Error Saving Dashboard Config",a.error).show():location.reload()})})}function Rc(n,e){switch(n){case"images-and-labels":{cs("image.device-image",e),cs("text.device-image-label",e);break}case"images-only":{cs("image.device-image",e),us("text.device-image-label",e);break}case"labels-only":{us("image.device-image",e),us("text.device-image-label",e);break}}}function cs(n,e){var i;let t=(i=e.querySelectorAll(n))!=null?i:[];for(let r of t)r.classList.remove("hidden")}function us(n,e){var i;let t=(i=e.querySelectorAll(n))!=null?i:[];for(let r of t)r.classList.add("hidden")}function mv(n,e){e.set("view",n);for(let t of R(".rack_elevation"))Rc(n,t)}function Ic(){let n=Zo.get("view");for(let e of R("select.rack-view"))e.selectedIndex=[...e.options].findIndex(t=>t.value==n),e.addEventListener("change",t=>{mv(t.currentTarget.value,Zo)},!1);for(let e of R(".rack_elevation"))e.addEventListener("htmx:afterSettle",()=>{Rc(n,e)})}function gv(n){let e=document.getElementById("selector_results");if(e==null)return;let t=e.getAttribute("data-selector-target");if(t==null)return;let i=document.getElementById(t);if(i==null)return;let r=n.getAttribute("data-label"),o=n.getAttribute("data-value");i.tomselect.addOption({id:o,display:r}),i.tomselect.addItem(o)}function Hc(){for(let n of R("#selector_results a"))n.addEventListener("click",()=>gv(n))}function vv(){let n=document.getElementById("quick-add-object");if(n==null)return;let e=n.getAttribute("data-object-id");if(e==null)return;let t=n.getAttribute("data-object-repr");if(t==null)return;let i=n.getAttribute("data-target-id");if(i==null)return;let r=document.getElementById(i);if(r==null)return;r.tomselect.addOption({id:e,display:t}),r.tomselect.addItem(e);let o=document.getElementById("htmx-modal");if(o){let s=tt.getInstance(o);s&&s.hide()}}function Pc(){let n=document.getElementById("htmx-modal-content");n&&n.addEventListener("htmx:afterSwap",()=>vv())}function yv(){wr(),Tr(),mr(),_r(),Hc(),Pc(),gr(),Cr()}function Fc(){document.addEventListener("htmx:afterSettle",yv)}function Ev(n){let e=n.currentTarget,t=e.baseURI.split("?")[0],i="?",r=Array.from(e.options).filter(o=>o.selected).map(o=>`filter_id=${o.value}`).join("&");t+=`${i}${r}`,document.location.href=t}function $c(){let n=document.getElementById("results");if(ye(n)){let e=document.getElementById("saved-filter-select");ye(e)&&e.addEventListener("change",Ev)}}var bv={"/":_v};function _v(){let n=document.querySelector('header input[name="q"]');n&&n.focus()}function wv(n){if(n.target.matches("input, textarea, select")||document.body.classList.contains("modal-open"))return;let e=bv[n.key];e&&(n.preventDefault(),e())}function Bc(){document.addEventListener("keydown",wv)}function Vc(){for(let n of[gr,bc,Cr,mr,Ml,_r,Dc,wr,Tr,Lc,Mc,kc,Ic,Fc,$c,Bc])n()}function xv(){let n=document.forms;for(let t of n)t.method.toUpperCase()=="GET"&&t.addEventListener("formdata",function(i){let r=i.formData;for(let[o,s]of Array.from(r.entries()))s===""&&r.delete(o)});let e=document.querySelector(".content-container");e!==null&&e.focus()}window.addEventListener("load",xv);document.readyState!=="loading"?Vc():document.addEventListener("DOMContentLoaded",Vc);})(); /*! Bundled license information: diff --git a/netbox/project-static/dist/netbox.js.map b/netbox/project-static/dist/netbox.js.map index 1b0418603..9c41760e2 100644 --- a/netbox/project-static/dist/netbox.js.map +++ b/netbox/project-static/dist/netbox.js.map @@ -1,7 +1,7 @@ { "version": 3, "sources": ["../node_modules/clipboard/dist/clipboard.js", "../node_modules/@popperjs/core/lib/index.js", "../node_modules/@popperjs/core/lib/enums.js", "../node_modules/@popperjs/core/lib/dom-utils/getNodeName.js", "../node_modules/@popperjs/core/lib/dom-utils/getWindow.js", "../node_modules/@popperjs/core/lib/dom-utils/instanceOf.js", "../node_modules/@popperjs/core/lib/modifiers/applyStyles.js", "../node_modules/@popperjs/core/lib/utils/getBasePlacement.js", "../node_modules/@popperjs/core/lib/utils/math.js", "../node_modules/@popperjs/core/lib/utils/userAgent.js", "../node_modules/@popperjs/core/lib/dom-utils/isLayoutViewport.js", "../node_modules/@popperjs/core/lib/dom-utils/getBoundingClientRect.js", "../node_modules/@popperjs/core/lib/dom-utils/getLayoutRect.js", "../node_modules/@popperjs/core/lib/dom-utils/contains.js", "../node_modules/@popperjs/core/lib/dom-utils/getComputedStyle.js", "../node_modules/@popperjs/core/lib/dom-utils/isTableElement.js", "../node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.js", "../node_modules/@popperjs/core/lib/dom-utils/getParentNode.js", "../node_modules/@popperjs/core/lib/dom-utils/getOffsetParent.js", "../node_modules/@popperjs/core/lib/utils/getMainAxisFromPlacement.js", "../node_modules/@popperjs/core/lib/utils/within.js", "../node_modules/@popperjs/core/lib/utils/getFreshSideObject.js", "../node_modules/@popperjs/core/lib/utils/mergePaddingObject.js", "../node_modules/@popperjs/core/lib/utils/expandToHashMap.js", "../node_modules/@popperjs/core/lib/modifiers/arrow.js", "../node_modules/@popperjs/core/lib/utils/getVariation.js", "../node_modules/@popperjs/core/lib/modifiers/computeStyles.js", "../node_modules/@popperjs/core/lib/modifiers/eventListeners.js", "../node_modules/@popperjs/core/lib/utils/getOppositePlacement.js", "../node_modules/@popperjs/core/lib/utils/getOppositeVariationPlacement.js", "../node_modules/@popperjs/core/lib/dom-utils/getWindowScroll.js", "../node_modules/@popperjs/core/lib/dom-utils/getWindowScrollBarX.js", "../node_modules/@popperjs/core/lib/dom-utils/getViewportRect.js", "../node_modules/@popperjs/core/lib/dom-utils/getDocumentRect.js", "../node_modules/@popperjs/core/lib/dom-utils/isScrollParent.js", "../node_modules/@popperjs/core/lib/dom-utils/getScrollParent.js", "../node_modules/@popperjs/core/lib/dom-utils/listScrollParents.js", "../node_modules/@popperjs/core/lib/utils/rectToClientRect.js", "../node_modules/@popperjs/core/lib/dom-utils/getClippingRect.js", "../node_modules/@popperjs/core/lib/utils/computeOffsets.js", "../node_modules/@popperjs/core/lib/utils/detectOverflow.js", "../node_modules/@popperjs/core/lib/utils/computeAutoPlacement.js", "../node_modules/@popperjs/core/lib/modifiers/flip.js", "../node_modules/@popperjs/core/lib/modifiers/hide.js", "../node_modules/@popperjs/core/lib/modifiers/offset.js", "../node_modules/@popperjs/core/lib/modifiers/popperOffsets.js", "../node_modules/@popperjs/core/lib/utils/getAltAxis.js", "../node_modules/@popperjs/core/lib/modifiers/preventOverflow.js", "../node_modules/@popperjs/core/lib/dom-utils/getHTMLElementScroll.js", "../node_modules/@popperjs/core/lib/dom-utils/getNodeScroll.js", "../node_modules/@popperjs/core/lib/dom-utils/getCompositeRect.js", "../node_modules/@popperjs/core/lib/utils/orderModifiers.js", "../node_modules/@popperjs/core/lib/utils/debounce.js", "../node_modules/@popperjs/core/lib/utils/mergeByName.js", "../node_modules/@popperjs/core/lib/createPopper.js", "../node_modules/@popperjs/core/lib/popper-lite.js", "../node_modules/@popperjs/core/lib/popper.js", "../node_modules/bootstrap/js/src/dom/data.js", "../node_modules/bootstrap/js/src/util/index.js", "../node_modules/bootstrap/js/src/dom/event-handler.js", "../node_modules/bootstrap/js/src/dom/manipulator.js", "../node_modules/bootstrap/js/src/util/config.js", "../node_modules/bootstrap/js/src/base-component.js", "../node_modules/bootstrap/js/src/dom/selector-engine.js", "../node_modules/bootstrap/js/src/util/component-functions.js", "../node_modules/bootstrap/js/src/alert.js", "../node_modules/bootstrap/js/src/button.js", "../node_modules/bootstrap/js/src/util/swipe.js", "../node_modules/bootstrap/js/src/carousel.js", "../node_modules/bootstrap/js/src/collapse.js", "../node_modules/bootstrap/js/src/dropdown.js", "../node_modules/bootstrap/js/src/util/backdrop.js", "../node_modules/bootstrap/js/src/util/focustrap.js", "../node_modules/bootstrap/js/src/util/scrollbar.js", "../node_modules/bootstrap/js/src/modal.js", "../node_modules/bootstrap/js/src/offcanvas.js", "../node_modules/bootstrap/js/src/util/sanitizer.js", "../node_modules/bootstrap/js/src/util/template-factory.js", "../node_modules/bootstrap/js/src/tooltip.js", "../node_modules/bootstrap/js/src/popover.js", "../node_modules/bootstrap/js/src/scrollspy.js", "../node_modules/bootstrap/js/src/tab.js", "../node_modules/bootstrap/js/src/toast.js", "../node_modules/htmx.org/dist/htmx.esm.js", "../node_modules/tom-select/src/contrib/microevent.ts", "../node_modules/tom-select/src/contrib/microplugin.ts", "../node_modules/@orchidjs/unicode-variants/lib/regex.ts", "../node_modules/@orchidjs/unicode-variants/lib/strings.ts", "../node_modules/@orchidjs/unicode-variants/lib/index.ts", "../node_modules/@orchidjs/sifter/lib/utils.ts", "../node_modules/@orchidjs/sifter/lib/sifter.ts", "../node_modules/tom-select/src/utils.ts", "../node_modules/tom-select/src/vanilla.ts", "../node_modules/tom-select/src/contrib/highlight.ts", "../node_modules/tom-select/src/constants.ts", "../node_modules/tom-select/src/defaults.ts", "../node_modules/tom-select/src/getSettings.ts", "../node_modules/tom-select/src/tom-select.ts", "../node_modules/tom-select/src/utils.ts", "../node_modules/tom-select/src/plugins/change_listener/plugin.ts", "../node_modules/tom-select/src/utils.ts", "../node_modules/tom-select/src/vanilla.ts", "../node_modules/tom-select/src/plugins/checkbox_options/plugin.ts", "../node_modules/tom-select/src/vanilla.ts", "../node_modules/tom-select/src/plugins/clear_button/plugin.ts", "../node_modules/tom-select/src/utils.ts", "../node_modules/tom-select/src/vanilla.ts", "../node_modules/tom-select/src/plugins/drag_drop/plugin.ts", "../node_modules/tom-select/src/utils.ts", "../node_modules/tom-select/src/vanilla.ts", "../node_modules/tom-select/src/plugins/dropdown_header/plugin.ts", "../node_modules/tom-select/src/utils.ts", "../node_modules/tom-select/src/vanilla.ts", "../node_modules/tom-select/src/plugins/caret_position/plugin.ts", "../node_modules/tom-select/src/constants.ts", "../node_modules/tom-select/src/utils.ts", "../node_modules/tom-select/src/vanilla.ts", "../node_modules/tom-select/src/plugins/dropdown_input/plugin.ts", "../node_modules/tom-select/src/utils.ts", "../node_modules/tom-select/src/plugins/input_autogrow/plugin.ts", "../node_modules/tom-select/src/plugins/no_backspace_delete/plugin.ts", "../node_modules/tom-select/src/plugins/no_active_items/plugin.ts", "../node_modules/tom-select/src/constants.ts", "../node_modules/tom-select/src/vanilla.ts", "../node_modules/tom-select/src/plugins/optgroup_columns/plugin.ts", "../node_modules/tom-select/src/utils.ts", "../node_modules/tom-select/src/vanilla.ts", "../node_modules/tom-select/src/plugins/remove_button/plugin.ts", "../node_modules/tom-select/src/plugins/restore_on_backspace/plugin.ts", "../node_modules/tom-select/src/utils.ts", "../node_modules/tom-select/src/vanilla.ts", "../node_modules/tom-select/src/plugins/virtual_scroll/plugin.ts", "../node_modules/tom-select/src/tom-select.complete.ts", "../src/util.ts", "../src/forms/clearField.ts", "../src/forms/elements.ts", "../src/forms/filterModifiers.ts", "../src/forms/speedSelector.ts", "../src/forms/index.ts", "../src/bs.ts", "../src/search.ts", "../src/select/classes/netboxTomSelect.ts", "../src/select/config.ts", "../src/select/static.ts", "../node_modules/tom-select/src/utils.ts", "../node_modules/tom-select/src/vanilla.ts", "../node_modules/query-string/base.js", "../node_modules/decode-uri-component/index.js", "../node_modules/filter-obj/index.js", "../node_modules/split-on-first/index.js", "../node_modules/query-string/index.js", "../src/select/types.ts", "../src/select/classes/dynamicParamsMap.ts", "../src/select/classes/dynamicTomSelect.ts", "../src/select/dynamic.ts", "../src/select/index.ts", "../src/buttons/connectionToggle.ts", "../src/state/index.ts", "../src/stores/objectDepth.ts", "../src/stores/rackImages.ts", "../src/stores/previousPkCheck.ts", "../src/stores/secret.ts", "../src/buttons/depthToggle.ts", "../src/buttons/moveOptions.ts", "../src/buttons/reslug.ts", "../src/buttons/selectAll.ts", "../src/buttons/floatBulk.ts", "../src/buttons/selectMultiple.ts", "../src/buttons/markdownPreview.ts", "../src/buttons/secretToggle.ts", "../src/buttons/index.ts", "../src/colorMode.ts", "../src/messages.ts", "../src/clipboard.ts", "../node_modules/flatpickr/dist/esm/types/options.js", "../node_modules/flatpickr/dist/esm/l10n/default.js", "../node_modules/flatpickr/dist/esm/utils/index.js", "../node_modules/flatpickr/dist/esm/utils/dom.js", "../node_modules/flatpickr/dist/esm/utils/formatting.js", "../node_modules/flatpickr/dist/esm/utils/dates.js", "../node_modules/flatpickr/dist/esm/utils/polyfills.js", "../node_modules/flatpickr/dist/esm/index.js", "../src/dateSelector.ts", "../src/tableConfig.ts", "../src/sidenav.ts", "../node_modules/gridstack/src/utils.ts", "../node_modules/gridstack/src/gridstack-engine.ts", "../node_modules/gridstack/src/types.ts", "../node_modules/gridstack/src/dd-manager.ts", "../node_modules/gridstack/src/dd-touch.ts", "../node_modules/gridstack/src/dd-resizable-handle.ts", "../node_modules/gridstack/src/dd-base-impl.ts", "../node_modules/gridstack/src/dd-resizable.ts", "../node_modules/gridstack/src/dd-draggable.ts", "../node_modules/gridstack/src/dd-droppable.ts", "../node_modules/gridstack/src/dd-element.ts", "../node_modules/gridstack/src/dd-gridstack.ts", "../node_modules/gridstack/src/gridstack.ts", "../src/dashboard.ts", "../src/racks.ts", "../src/objectSelector.ts", "../src/quickAdd.ts", "../src/htmx.ts", "../src/forms/savedFiltersSelect.ts", "../src/hotkeys.ts", "../src/netbox.ts"], - "sourcesContent": ["/*!\n * clipboard.js v2.0.11\n * https://clipboardjs.com/\n *\n * Licensed MIT \u00A9 Zeno Rocha\n */\n(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"ClipboardJS\"] = factory();\n\telse\n\t\troot[\"ClipboardJS\"] = factory();\n})(this, function() {\nreturn /******/ (function() { // webpackBootstrap\n/******/ \tvar __webpack_modules__ = ({\n\n/***/ 686:\n/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n\n// EXPORTS\n__webpack_require__.d(__webpack_exports__, {\n \"default\": function() { return /* binding */ clipboard; }\n});\n\n// EXTERNAL MODULE: ./node_modules/tiny-emitter/index.js\nvar tiny_emitter = __webpack_require__(279);\nvar tiny_emitter_default = /*#__PURE__*/__webpack_require__.n(tiny_emitter);\n// EXTERNAL MODULE: ./node_modules/good-listener/src/listen.js\nvar listen = __webpack_require__(370);\nvar listen_default = /*#__PURE__*/__webpack_require__.n(listen);\n// EXTERNAL MODULE: ./node_modules/select/src/select.js\nvar src_select = __webpack_require__(817);\nvar select_default = /*#__PURE__*/__webpack_require__.n(src_select);\n;// CONCATENATED MODULE: ./src/common/command.js\n/**\n * Executes a given operation type.\n * @param {String} type\n * @return {Boolean}\n */\nfunction command(type) {\n try {\n return document.execCommand(type);\n } catch (err) {\n return false;\n }\n}\n;// CONCATENATED MODULE: ./src/actions/cut.js\n\n\n/**\n * Cut action wrapper.\n * @param {String|HTMLElement} target\n * @return {String}\n */\n\nvar ClipboardActionCut = function ClipboardActionCut(target) {\n var selectedText = select_default()(target);\n command('cut');\n return selectedText;\n};\n\n/* harmony default export */ var actions_cut = (ClipboardActionCut);\n;// CONCATENATED MODULE: ./src/common/create-fake-element.js\n/**\n * Creates a fake textarea element with a value.\n * @param {String} value\n * @return {HTMLElement}\n */\nfunction createFakeElement(value) {\n var isRTL = document.documentElement.getAttribute('dir') === 'rtl';\n var fakeElement = document.createElement('textarea'); // Prevent zooming on iOS\n\n fakeElement.style.fontSize = '12pt'; // Reset box model\n\n fakeElement.style.border = '0';\n fakeElement.style.padding = '0';\n fakeElement.style.margin = '0'; // Move element out of screen horizontally\n\n fakeElement.style.position = 'absolute';\n fakeElement.style[isRTL ? 'right' : 'left'] = '-9999px'; // Move element to the same position vertically\n\n var yPosition = window.pageYOffset || document.documentElement.scrollTop;\n fakeElement.style.top = \"\".concat(yPosition, \"px\");\n fakeElement.setAttribute('readonly', '');\n fakeElement.value = value;\n return fakeElement;\n}\n;// CONCATENATED MODULE: ./src/actions/copy.js\n\n\n\n/**\n * Create fake copy action wrapper using a fake element.\n * @param {String} target\n * @param {Object} options\n * @return {String}\n */\n\nvar fakeCopyAction = function fakeCopyAction(value, options) {\n var fakeElement = createFakeElement(value);\n options.container.appendChild(fakeElement);\n var selectedText = select_default()(fakeElement);\n command('copy');\n fakeElement.remove();\n return selectedText;\n};\n/**\n * Copy action wrapper.\n * @param {String|HTMLElement} target\n * @param {Object} options\n * @return {String}\n */\n\n\nvar ClipboardActionCopy = function ClipboardActionCopy(target) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {\n container: document.body\n };\n var selectedText = '';\n\n if (typeof target === 'string') {\n selectedText = fakeCopyAction(target, options);\n } else if (target instanceof HTMLInputElement && !['text', 'search', 'url', 'tel', 'password'].includes(target === null || target === void 0 ? void 0 : target.type)) {\n // If input type doesn't support `setSelectionRange`. Simulate it. https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/setSelectionRange\n selectedText = fakeCopyAction(target.value, options);\n } else {\n selectedText = select_default()(target);\n command('copy');\n }\n\n return selectedText;\n};\n\n/* harmony default export */ var actions_copy = (ClipboardActionCopy);\n;// CONCATENATED MODULE: ./src/actions/default.js\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\n\n\n/**\n * Inner function which performs selection from either `text` or `target`\n * properties and then executes copy or cut operations.\n * @param {Object} options\n */\n\nvar ClipboardActionDefault = function ClipboardActionDefault() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n // Defines base properties passed from constructor.\n var _options$action = options.action,\n action = _options$action === void 0 ? 'copy' : _options$action,\n container = options.container,\n target = options.target,\n text = options.text; // Sets the `action` to be performed which can be either 'copy' or 'cut'.\n\n if (action !== 'copy' && action !== 'cut') {\n throw new Error('Invalid \"action\" value, use either \"copy\" or \"cut\"');\n } // Sets the `target` property using an element that will be have its content copied.\n\n\n if (target !== undefined) {\n if (target && _typeof(target) === 'object' && target.nodeType === 1) {\n if (action === 'copy' && target.hasAttribute('disabled')) {\n throw new Error('Invalid \"target\" attribute. Please use \"readonly\" instead of \"disabled\" attribute');\n }\n\n if (action === 'cut' && (target.hasAttribute('readonly') || target.hasAttribute('disabled'))) {\n throw new Error('Invalid \"target\" attribute. You can\\'t cut text from elements with \"readonly\" or \"disabled\" attributes');\n }\n } else {\n throw new Error('Invalid \"target\" value, use a valid Element');\n }\n } // Define selection strategy based on `text` property.\n\n\n if (text) {\n return actions_copy(text, {\n container: container\n });\n } // Defines which selection strategy based on `target` property.\n\n\n if (target) {\n return action === 'cut' ? actions_cut(target) : actions_copy(target, {\n container: container\n });\n }\n};\n\n/* harmony default export */ var actions_default = (ClipboardActionDefault);\n;// CONCATENATED MODULE: ./src/clipboard.js\nfunction clipboard_typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { clipboard_typeof = function _typeof(obj) { return typeof obj; }; } else { clipboard_typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return clipboard_typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (clipboard_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\n\n\n\n\n\n/**\n * Helper function to retrieve attribute value.\n * @param {String} suffix\n * @param {Element} element\n */\n\nfunction getAttributeValue(suffix, element) {\n var attribute = \"data-clipboard-\".concat(suffix);\n\n if (!element.hasAttribute(attribute)) {\n return;\n }\n\n return element.getAttribute(attribute);\n}\n/**\n * Base class which takes one or more elements, adds event listeners to them,\n * and instantiates a new `ClipboardAction` on each click.\n */\n\n\nvar Clipboard = /*#__PURE__*/function (_Emitter) {\n _inherits(Clipboard, _Emitter);\n\n var _super = _createSuper(Clipboard);\n\n /**\n * @param {String|HTMLElement|HTMLCollection|NodeList} trigger\n * @param {Object} options\n */\n function Clipboard(trigger, options) {\n var _this;\n\n _classCallCheck(this, Clipboard);\n\n _this = _super.call(this);\n\n _this.resolveOptions(options);\n\n _this.listenClick(trigger);\n\n return _this;\n }\n /**\n * Defines if attributes would be resolved using internal setter functions\n * or custom functions that were passed in the constructor.\n * @param {Object} options\n */\n\n\n _createClass(Clipboard, [{\n key: \"resolveOptions\",\n value: function resolveOptions() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n this.action = typeof options.action === 'function' ? options.action : this.defaultAction;\n this.target = typeof options.target === 'function' ? options.target : this.defaultTarget;\n this.text = typeof options.text === 'function' ? options.text : this.defaultText;\n this.container = clipboard_typeof(options.container) === 'object' ? options.container : document.body;\n }\n /**\n * Adds a click event listener to the passed trigger.\n * @param {String|HTMLElement|HTMLCollection|NodeList} trigger\n */\n\n }, {\n key: \"listenClick\",\n value: function listenClick(trigger) {\n var _this2 = this;\n\n this.listener = listen_default()(trigger, 'click', function (e) {\n return _this2.onClick(e);\n });\n }\n /**\n * Defines a new `ClipboardAction` on each click event.\n * @param {Event} e\n */\n\n }, {\n key: \"onClick\",\n value: function onClick(e) {\n var trigger = e.delegateTarget || e.currentTarget;\n var action = this.action(trigger) || 'copy';\n var text = actions_default({\n action: action,\n container: this.container,\n target: this.target(trigger),\n text: this.text(trigger)\n }); // Fires an event based on the copy operation result.\n\n this.emit(text ? 'success' : 'error', {\n action: action,\n text: text,\n trigger: trigger,\n clearSelection: function clearSelection() {\n if (trigger) {\n trigger.focus();\n }\n\n window.getSelection().removeAllRanges();\n }\n });\n }\n /**\n * Default `action` lookup function.\n * @param {Element} trigger\n */\n\n }, {\n key: \"defaultAction\",\n value: function defaultAction(trigger) {\n return getAttributeValue('action', trigger);\n }\n /**\n * Default `target` lookup function.\n * @param {Element} trigger\n */\n\n }, {\n key: \"defaultTarget\",\n value: function defaultTarget(trigger) {\n var selector = getAttributeValue('target', trigger);\n\n if (selector) {\n return document.querySelector(selector);\n }\n }\n /**\n * Allow fire programmatically a copy action\n * @param {String|HTMLElement} target\n * @param {Object} options\n * @returns Text copied.\n */\n\n }, {\n key: \"defaultText\",\n\n /**\n * Default `text` lookup function.\n * @param {Element} trigger\n */\n value: function defaultText(trigger) {\n return getAttributeValue('text', trigger);\n }\n /**\n * Destroy lifecycle.\n */\n\n }, {\n key: \"destroy\",\n value: function destroy() {\n this.listener.destroy();\n }\n }], [{\n key: \"copy\",\n value: function copy(target) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {\n container: document.body\n };\n return actions_copy(target, options);\n }\n /**\n * Allow fire programmatically a cut action\n * @param {String|HTMLElement} target\n * @returns Text cutted.\n */\n\n }, {\n key: \"cut\",\n value: function cut(target) {\n return actions_cut(target);\n }\n /**\n * Returns the support of the given action, or all actions if no action is\n * given.\n * @param {String} [action]\n */\n\n }, {\n key: \"isSupported\",\n value: function isSupported() {\n var action = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ['copy', 'cut'];\n var actions = typeof action === 'string' ? [action] : action;\n var support = !!document.queryCommandSupported;\n actions.forEach(function (action) {\n support = support && !!document.queryCommandSupported(action);\n });\n return support;\n }\n }]);\n\n return Clipboard;\n}((tiny_emitter_default()));\n\n/* harmony default export */ var clipboard = (Clipboard);\n\n/***/ }),\n\n/***/ 828:\n/***/ (function(module) {\n\nvar DOCUMENT_NODE_TYPE = 9;\n\n/**\n * A polyfill for Element.matches()\n */\nif (typeof Element !== 'undefined' && !Element.prototype.matches) {\n var proto = Element.prototype;\n\n proto.matches = proto.matchesSelector ||\n proto.mozMatchesSelector ||\n proto.msMatchesSelector ||\n proto.oMatchesSelector ||\n proto.webkitMatchesSelector;\n}\n\n/**\n * Finds the closest parent that matches a selector.\n *\n * @param {Element} element\n * @param {String} selector\n * @return {Function}\n */\nfunction closest (element, selector) {\n while (element && element.nodeType !== DOCUMENT_NODE_TYPE) {\n if (typeof element.matches === 'function' &&\n element.matches(selector)) {\n return element;\n }\n element = element.parentNode;\n }\n}\n\nmodule.exports = closest;\n\n\n/***/ }),\n\n/***/ 438:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar closest = __webpack_require__(828);\n\n/**\n * Delegates event to a selector.\n *\n * @param {Element} element\n * @param {String} selector\n * @param {String} type\n * @param {Function} callback\n * @param {Boolean} useCapture\n * @return {Object}\n */\nfunction _delegate(element, selector, type, callback, useCapture) {\n var listenerFn = listener.apply(this, arguments);\n\n element.addEventListener(type, listenerFn, useCapture);\n\n return {\n destroy: function() {\n element.removeEventListener(type, listenerFn, useCapture);\n }\n }\n}\n\n/**\n * Delegates event to a selector.\n *\n * @param {Element|String|Array} [elements]\n * @param {String} selector\n * @param {String} type\n * @param {Function} callback\n * @param {Boolean} useCapture\n * @return {Object}\n */\nfunction delegate(elements, selector, type, callback, useCapture) {\n // Handle the regular Element usage\n if (typeof elements.addEventListener === 'function') {\n return _delegate.apply(null, arguments);\n }\n\n // Handle Element-less usage, it defaults to global delegation\n if (typeof type === 'function') {\n // Use `document` as the first parameter, then apply arguments\n // This is a short way to .unshift `arguments` without running into deoptimizations\n return _delegate.bind(null, document).apply(null, arguments);\n }\n\n // Handle Selector-based usage\n if (typeof elements === 'string') {\n elements = document.querySelectorAll(elements);\n }\n\n // Handle Array-like based usage\n return Array.prototype.map.call(elements, function (element) {\n return _delegate(element, selector, type, callback, useCapture);\n });\n}\n\n/**\n * Finds closest match and invokes callback.\n *\n * @param {Element} element\n * @param {String} selector\n * @param {String} type\n * @param {Function} callback\n * @return {Function}\n */\nfunction listener(element, selector, type, callback) {\n return function(e) {\n e.delegateTarget = closest(e.target, selector);\n\n if (e.delegateTarget) {\n callback.call(element, e);\n }\n }\n}\n\nmodule.exports = delegate;\n\n\n/***/ }),\n\n/***/ 879:\n/***/ (function(__unused_webpack_module, exports) {\n\n/**\n * Check if argument is a HTML element.\n *\n * @param {Object} value\n * @return {Boolean}\n */\nexports.node = function(value) {\n return value !== undefined\n && value instanceof HTMLElement\n && value.nodeType === 1;\n};\n\n/**\n * Check if argument is a list of HTML elements.\n *\n * @param {Object} value\n * @return {Boolean}\n */\nexports.nodeList = function(value) {\n var type = Object.prototype.toString.call(value);\n\n return value !== undefined\n && (type === '[object NodeList]' || type === '[object HTMLCollection]')\n && ('length' in value)\n && (value.length === 0 || exports.node(value[0]));\n};\n\n/**\n * Check if argument is a string.\n *\n * @param {Object} value\n * @return {Boolean}\n */\nexports.string = function(value) {\n return typeof value === 'string'\n || value instanceof String;\n};\n\n/**\n * Check if argument is a function.\n *\n * @param {Object} value\n * @return {Boolean}\n */\nexports.fn = function(value) {\n var type = Object.prototype.toString.call(value);\n\n return type === '[object Function]';\n};\n\n\n/***/ }),\n\n/***/ 370:\n/***/ (function(module, __unused_webpack_exports, __webpack_require__) {\n\nvar is = __webpack_require__(879);\nvar delegate = __webpack_require__(438);\n\n/**\n * Validates all params and calls the right\n * listener function based on its target type.\n *\n * @param {String|HTMLElement|HTMLCollection|NodeList} target\n * @param {String} type\n * @param {Function} callback\n * @return {Object}\n */\nfunction listen(target, type, callback) {\n if (!target && !type && !callback) {\n throw new Error('Missing required arguments');\n }\n\n if (!is.string(type)) {\n throw new TypeError('Second argument must be a String');\n }\n\n if (!is.fn(callback)) {\n throw new TypeError('Third argument must be a Function');\n }\n\n if (is.node(target)) {\n return listenNode(target, type, callback);\n }\n else if (is.nodeList(target)) {\n return listenNodeList(target, type, callback);\n }\n else if (is.string(target)) {\n return listenSelector(target, type, callback);\n }\n else {\n throw new TypeError('First argument must be a String, HTMLElement, HTMLCollection, or NodeList');\n }\n}\n\n/**\n * Adds an event listener to a HTML element\n * and returns a remove listener function.\n *\n * @param {HTMLElement} node\n * @param {String} type\n * @param {Function} callback\n * @return {Object}\n */\nfunction listenNode(node, type, callback) {\n node.addEventListener(type, callback);\n\n return {\n destroy: function() {\n node.removeEventListener(type, callback);\n }\n }\n}\n\n/**\n * Add an event listener to a list of HTML elements\n * and returns a remove listener function.\n *\n * @param {NodeList|HTMLCollection} nodeList\n * @param {String} type\n * @param {Function} callback\n * @return {Object}\n */\nfunction listenNodeList(nodeList, type, callback) {\n Array.prototype.forEach.call(nodeList, function(node) {\n node.addEventListener(type, callback);\n });\n\n return {\n destroy: function() {\n Array.prototype.forEach.call(nodeList, function(node) {\n node.removeEventListener(type, callback);\n });\n }\n }\n}\n\n/**\n * Add an event listener to a selector\n * and returns a remove listener function.\n *\n * @param {String} selector\n * @param {String} type\n * @param {Function} callback\n * @return {Object}\n */\nfunction listenSelector(selector, type, callback) {\n return delegate(document.body, selector, type, callback);\n}\n\nmodule.exports = listen;\n\n\n/***/ }),\n\n/***/ 817:\n/***/ (function(module) {\n\nfunction select(element) {\n var selectedText;\n\n if (element.nodeName === 'SELECT') {\n element.focus();\n\n selectedText = element.value;\n }\n else if (element.nodeName === 'INPUT' || element.nodeName === 'TEXTAREA') {\n var isReadOnly = element.hasAttribute('readonly');\n\n if (!isReadOnly) {\n element.setAttribute('readonly', '');\n }\n\n element.select();\n element.setSelectionRange(0, element.value.length);\n\n if (!isReadOnly) {\n element.removeAttribute('readonly');\n }\n\n selectedText = element.value;\n }\n else {\n if (element.hasAttribute('contenteditable')) {\n element.focus();\n }\n\n var selection = window.getSelection();\n var range = document.createRange();\n\n range.selectNodeContents(element);\n selection.removeAllRanges();\n selection.addRange(range);\n\n selectedText = selection.toString();\n }\n\n return selectedText;\n}\n\nmodule.exports = select;\n\n\n/***/ }),\n\n/***/ 279:\n/***/ (function(module) {\n\nfunction E () {\n // Keep this empty so it's easier to inherit from\n // (via https://github.com/lipsmack from https://github.com/scottcorgan/tiny-emitter/issues/3)\n}\n\nE.prototype = {\n on: function (name, callback, ctx) {\n var e = this.e || (this.e = {});\n\n (e[name] || (e[name] = [])).push({\n fn: callback,\n ctx: ctx\n });\n\n return this;\n },\n\n once: function (name, callback, ctx) {\n var self = this;\n function listener () {\n self.off(name, listener);\n callback.apply(ctx, arguments);\n };\n\n listener._ = callback\n return this.on(name, listener, ctx);\n },\n\n emit: function (name) {\n var data = [].slice.call(arguments, 1);\n var evtArr = ((this.e || (this.e = {}))[name] || []).slice();\n var i = 0;\n var len = evtArr.length;\n\n for (i; i < len; i++) {\n evtArr[i].fn.apply(evtArr[i].ctx, data);\n }\n\n return this;\n },\n\n off: function (name, callback) {\n var e = this.e || (this.e = {});\n var evts = e[name];\n var liveEvents = [];\n\n if (evts && callback) {\n for (var i = 0, len = evts.length; i < len; i++) {\n if (evts[i].fn !== callback && evts[i].fn._ !== callback)\n liveEvents.push(evts[i]);\n }\n }\n\n // Remove event from queue to prevent memory leak\n // Suggested by https://github.com/lazd\n // Ref: https://github.com/scottcorgan/tiny-emitter/commit/c6ebfaa9bc973b33d110a84a307742b7cf94c953#commitcomment-5024910\n\n (liveEvents.length)\n ? e[name] = liveEvents\n : delete e[name];\n\n return this;\n }\n};\n\nmodule.exports = E;\nmodule.exports.TinyEmitter = E;\n\n\n/***/ })\n\n/******/ \t});\n/************************************************************************/\n/******/ \t// The module cache\n/******/ \tvar __webpack_module_cache__ = {};\n/******/ \t\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(__webpack_module_cache__[moduleId]) {\n/******/ \t\t\treturn __webpack_module_cache__[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = __webpack_module_cache__[moduleId] = {\n/******/ \t\t\t// no module.id needed\n/******/ \t\t\t// no module.loaded needed\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/ \t\n/******/ \t\t// Execute the module function\n/******/ \t\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n/******/ \t\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/ \t\n/************************************************************************/\n/******/ \t/* webpack/runtime/compat get default export */\n/******/ \t!function() {\n/******/ \t\t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t\t__webpack_require__.n = function(module) {\n/******/ \t\t\tvar getter = module && module.__esModule ?\n/******/ \t\t\t\tfunction() { return module['default']; } :\n/******/ \t\t\t\tfunction() { return module; };\n/******/ \t\t\t__webpack_require__.d(getter, { a: getter });\n/******/ \t\t\treturn getter;\n/******/ \t\t};\n/******/ \t}();\n/******/ \t\n/******/ \t/* webpack/runtime/define property getters */\n/******/ \t!function() {\n/******/ \t\t// define getter functions for harmony exports\n/******/ \t\t__webpack_require__.d = function(exports, definition) {\n/******/ \t\t\tfor(var key in definition) {\n/******/ \t\t\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n/******/ \t\t\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n/******/ \t\t\t\t}\n/******/ \t\t\t}\n/******/ \t\t};\n/******/ \t}();\n/******/ \t\n/******/ \t/* webpack/runtime/hasOwnProperty shorthand */\n/******/ \t!function() {\n/******/ \t\t__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }\n/******/ \t}();\n/******/ \t\n/************************************************************************/\n/******/ \t// module exports must be returned from runtime so entry inlining is disabled\n/******/ \t// startup\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(686);\n/******/ })()\n.default;\n});", "export * from \"./enums.js\";\nexport * from \"./modifiers/index.js\"; // eslint-disable-next-line import/no-unused-modules\n\nexport { popperGenerator, detectOverflow, createPopper as createPopperBase } from \"./createPopper.js\"; // eslint-disable-next-line import/no-unused-modules\n\nexport { createPopper } from \"./popper.js\"; // eslint-disable-next-line import/no-unused-modules\n\nexport { createPopper as createPopperLite } from \"./popper-lite.js\";", "export var top = 'top';\nexport var bottom = 'bottom';\nexport var right = 'right';\nexport var left = 'left';\nexport var auto = 'auto';\nexport var basePlacements = [top, bottom, right, left];\nexport var start = 'start';\nexport var end = 'end';\nexport var clippingParents = 'clippingParents';\nexport var viewport = 'viewport';\nexport var popper = 'popper';\nexport var reference = 'reference';\nexport var variationPlacements = /*#__PURE__*/basePlacements.reduce(function (acc, placement) {\n return acc.concat([placement + \"-\" + start, placement + \"-\" + end]);\n}, []);\nexport var placements = /*#__PURE__*/[].concat(basePlacements, [auto]).reduce(function (acc, placement) {\n return acc.concat([placement, placement + \"-\" + start, placement + \"-\" + end]);\n}, []); // modifiers that need to read the DOM\n\nexport var beforeRead = 'beforeRead';\nexport var read = 'read';\nexport var afterRead = 'afterRead'; // pure-logic modifiers\n\nexport var beforeMain = 'beforeMain';\nexport var main = 'main';\nexport var afterMain = 'afterMain'; // modifier with the purpose to write to the DOM (or write into a framework state)\n\nexport var beforeWrite = 'beforeWrite';\nexport var write = 'write';\nexport var afterWrite = 'afterWrite';\nexport var modifierPhases = [beforeRead, read, afterRead, beforeMain, main, afterMain, beforeWrite, write, afterWrite];", "export default function getNodeName(element) {\n return element ? (element.nodeName || '').toLowerCase() : null;\n}", "export default function getWindow(node) {\n if (node == null) {\n return window;\n }\n\n if (node.toString() !== '[object Window]') {\n var ownerDocument = node.ownerDocument;\n return ownerDocument ? ownerDocument.defaultView || window : window;\n }\n\n return node;\n}", "import getWindow from \"./getWindow.js\";\n\nfunction isElement(node) {\n var OwnElement = getWindow(node).Element;\n return node instanceof OwnElement || node instanceof Element;\n}\n\nfunction isHTMLElement(node) {\n var OwnElement = getWindow(node).HTMLElement;\n return node instanceof OwnElement || node instanceof HTMLElement;\n}\n\nfunction isShadowRoot(node) {\n // IE 11 has no ShadowRoot\n if (typeof ShadowRoot === 'undefined') {\n return false;\n }\n\n var OwnElement = getWindow(node).ShadowRoot;\n return node instanceof OwnElement || node instanceof ShadowRoot;\n}\n\nexport { isElement, isHTMLElement, isShadowRoot };", "import getNodeName from \"../dom-utils/getNodeName.js\";\nimport { isHTMLElement } from \"../dom-utils/instanceOf.js\"; // This modifier takes the styles prepared by the `computeStyles` modifier\n// and applies them to the HTMLElements such as popper and arrow\n\nfunction applyStyles(_ref) {\n var state = _ref.state;\n Object.keys(state.elements).forEach(function (name) {\n var style = state.styles[name] || {};\n var attributes = state.attributes[name] || {};\n var element = state.elements[name]; // arrow is optional + virtual elements\n\n if (!isHTMLElement(element) || !getNodeName(element)) {\n return;\n } // Flow doesn't support to extend this property, but it's the most\n // effective way to apply styles to an HTMLElement\n // $FlowFixMe[cannot-write]\n\n\n Object.assign(element.style, style);\n Object.keys(attributes).forEach(function (name) {\n var value = attributes[name];\n\n if (value === false) {\n element.removeAttribute(name);\n } else {\n element.setAttribute(name, value === true ? '' : value);\n }\n });\n });\n}\n\nfunction effect(_ref2) {\n var state = _ref2.state;\n var initialStyles = {\n popper: {\n position: state.options.strategy,\n left: '0',\n top: '0',\n margin: '0'\n },\n arrow: {\n position: 'absolute'\n },\n reference: {}\n };\n Object.assign(state.elements.popper.style, initialStyles.popper);\n state.styles = initialStyles;\n\n if (state.elements.arrow) {\n Object.assign(state.elements.arrow.style, initialStyles.arrow);\n }\n\n return function () {\n Object.keys(state.elements).forEach(function (name) {\n var element = state.elements[name];\n var attributes = state.attributes[name] || {};\n var styleProperties = Object.keys(state.styles.hasOwnProperty(name) ? state.styles[name] : initialStyles[name]); // Set all values to an empty string to unset them\n\n var style = styleProperties.reduce(function (style, property) {\n style[property] = '';\n return style;\n }, {}); // arrow is optional + virtual elements\n\n if (!isHTMLElement(element) || !getNodeName(element)) {\n return;\n }\n\n Object.assign(element.style, style);\n Object.keys(attributes).forEach(function (attribute) {\n element.removeAttribute(attribute);\n });\n });\n };\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'applyStyles',\n enabled: true,\n phase: 'write',\n fn: applyStyles,\n effect: effect,\n requires: ['computeStyles']\n};", "import { auto } from \"../enums.js\";\nexport default function getBasePlacement(placement) {\n return placement.split('-')[0];\n}", "export var max = Math.max;\nexport var min = Math.min;\nexport var round = Math.round;", "export default function getUAString() {\n var uaData = navigator.userAgentData;\n\n if (uaData != null && uaData.brands && Array.isArray(uaData.brands)) {\n return uaData.brands.map(function (item) {\n return item.brand + \"/\" + item.version;\n }).join(' ');\n }\n\n return navigator.userAgent;\n}", "import getUAString from \"../utils/userAgent.js\";\nexport default function isLayoutViewport() {\n return !/^((?!chrome|android).)*safari/i.test(getUAString());\n}", "import { isElement, isHTMLElement } from \"./instanceOf.js\";\nimport { round } from \"../utils/math.js\";\nimport getWindow from \"./getWindow.js\";\nimport isLayoutViewport from \"./isLayoutViewport.js\";\nexport default function getBoundingClientRect(element, includeScale, isFixedStrategy) {\n if (includeScale === void 0) {\n includeScale = false;\n }\n\n if (isFixedStrategy === void 0) {\n isFixedStrategy = false;\n }\n\n var clientRect = element.getBoundingClientRect();\n var scaleX = 1;\n var scaleY = 1;\n\n if (includeScale && isHTMLElement(element)) {\n scaleX = element.offsetWidth > 0 ? round(clientRect.width) / element.offsetWidth || 1 : 1;\n scaleY = element.offsetHeight > 0 ? round(clientRect.height) / element.offsetHeight || 1 : 1;\n }\n\n var _ref = isElement(element) ? getWindow(element) : window,\n visualViewport = _ref.visualViewport;\n\n var addVisualOffsets = !isLayoutViewport() && isFixedStrategy;\n var x = (clientRect.left + (addVisualOffsets && visualViewport ? visualViewport.offsetLeft : 0)) / scaleX;\n var y = (clientRect.top + (addVisualOffsets && visualViewport ? visualViewport.offsetTop : 0)) / scaleY;\n var width = clientRect.width / scaleX;\n var height = clientRect.height / scaleY;\n return {\n width: width,\n height: height,\n top: y,\n right: x + width,\n bottom: y + height,\n left: x,\n x: x,\n y: y\n };\n}", "import getBoundingClientRect from \"./getBoundingClientRect.js\"; // Returns the layout rect of an element relative to its offsetParent. Layout\n// means it doesn't take into account transforms.\n\nexport default function getLayoutRect(element) {\n var clientRect = getBoundingClientRect(element); // Use the clientRect sizes if it's not been transformed.\n // Fixes https://github.com/popperjs/popper-core/issues/1223\n\n var width = element.offsetWidth;\n var height = element.offsetHeight;\n\n if (Math.abs(clientRect.width - width) <= 1) {\n width = clientRect.width;\n }\n\n if (Math.abs(clientRect.height - height) <= 1) {\n height = clientRect.height;\n }\n\n return {\n x: element.offsetLeft,\n y: element.offsetTop,\n width: width,\n height: height\n };\n}", "import { isShadowRoot } from \"./instanceOf.js\";\nexport default function contains(parent, child) {\n var rootNode = child.getRootNode && child.getRootNode(); // First, attempt with faster native method\n\n if (parent.contains(child)) {\n return true;\n } // then fallback to custom implementation with Shadow DOM support\n else if (rootNode && isShadowRoot(rootNode)) {\n var next = child;\n\n do {\n if (next && parent.isSameNode(next)) {\n return true;\n } // $FlowFixMe[prop-missing]: need a better way to handle this...\n\n\n next = next.parentNode || next.host;\n } while (next);\n } // Give up, the result is false\n\n\n return false;\n}", "import getWindow from \"./getWindow.js\";\nexport default function getComputedStyle(element) {\n return getWindow(element).getComputedStyle(element);\n}", "import getNodeName from \"./getNodeName.js\";\nexport default function isTableElement(element) {\n return ['table', 'td', 'th'].indexOf(getNodeName(element)) >= 0;\n}", "import { isElement } from \"./instanceOf.js\";\nexport default function getDocumentElement(element) {\n // $FlowFixMe[incompatible-return]: assume body is always available\n return ((isElement(element) ? element.ownerDocument : // $FlowFixMe[prop-missing]\n element.document) || window.document).documentElement;\n}", "import getNodeName from \"./getNodeName.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport { isShadowRoot } from \"./instanceOf.js\";\nexport default function getParentNode(element) {\n if (getNodeName(element) === 'html') {\n return element;\n }\n\n return (// this is a quicker (but less type safe) way to save quite some bytes from the bundle\n // $FlowFixMe[incompatible-return]\n // $FlowFixMe[prop-missing]\n element.assignedSlot || // step into the shadow DOM of the parent of a slotted node\n element.parentNode || ( // DOM Element detected\n isShadowRoot(element) ? element.host : null) || // ShadowRoot detected\n // $FlowFixMe[incompatible-call]: HTMLElement is a Node\n getDocumentElement(element) // fallback\n\n );\n}", "import getWindow from \"./getWindow.js\";\nimport getNodeName from \"./getNodeName.js\";\nimport getComputedStyle from \"./getComputedStyle.js\";\nimport { isHTMLElement, isShadowRoot } from \"./instanceOf.js\";\nimport isTableElement from \"./isTableElement.js\";\nimport getParentNode from \"./getParentNode.js\";\nimport getUAString from \"../utils/userAgent.js\";\n\nfunction getTrueOffsetParent(element) {\n if (!isHTMLElement(element) || // https://github.com/popperjs/popper-core/issues/837\n getComputedStyle(element).position === 'fixed') {\n return null;\n }\n\n return element.offsetParent;\n} // `.offsetParent` reports `null` for fixed elements, while absolute elements\n// return the containing block\n\n\nfunction getContainingBlock(element) {\n var isFirefox = /firefox/i.test(getUAString());\n var isIE = /Trident/i.test(getUAString());\n\n if (isIE && isHTMLElement(element)) {\n // In IE 9, 10 and 11 fixed elements containing block is always established by the viewport\n var elementCss = getComputedStyle(element);\n\n if (elementCss.position === 'fixed') {\n return null;\n }\n }\n\n var currentNode = getParentNode(element);\n\n if (isShadowRoot(currentNode)) {\n currentNode = currentNode.host;\n }\n\n while (isHTMLElement(currentNode) && ['html', 'body'].indexOf(getNodeName(currentNode)) < 0) {\n var css = getComputedStyle(currentNode); // This is non-exhaustive but covers the most common CSS properties that\n // create a containing block.\n // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block\n\n if (css.transform !== 'none' || css.perspective !== 'none' || css.contain === 'paint' || ['transform', 'perspective'].indexOf(css.willChange) !== -1 || isFirefox && css.willChange === 'filter' || isFirefox && css.filter && css.filter !== 'none') {\n return currentNode;\n } else {\n currentNode = currentNode.parentNode;\n }\n }\n\n return null;\n} // Gets the closest ancestor positioned element. Handles some edge cases,\n// such as table ancestors and cross browser bugs.\n\n\nexport default function getOffsetParent(element) {\n var window = getWindow(element);\n var offsetParent = getTrueOffsetParent(element);\n\n while (offsetParent && isTableElement(offsetParent) && getComputedStyle(offsetParent).position === 'static') {\n offsetParent = getTrueOffsetParent(offsetParent);\n }\n\n if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle(offsetParent).position === 'static')) {\n return window;\n }\n\n return offsetParent || getContainingBlock(element) || window;\n}", "export default function getMainAxisFromPlacement(placement) {\n return ['top', 'bottom'].indexOf(placement) >= 0 ? 'x' : 'y';\n}", "import { max as mathMax, min as mathMin } from \"./math.js\";\nexport function within(min, value, max) {\n return mathMax(min, mathMin(value, max));\n}\nexport function withinMaxClamp(min, value, max) {\n var v = within(min, value, max);\n return v > max ? max : v;\n}", "export default function getFreshSideObject() {\n return {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0\n };\n}", "import getFreshSideObject from \"./getFreshSideObject.js\";\nexport default function mergePaddingObject(paddingObject) {\n return Object.assign({}, getFreshSideObject(), paddingObject);\n}", "export default function expandToHashMap(value, keys) {\n return keys.reduce(function (hashMap, key) {\n hashMap[key] = value;\n return hashMap;\n }, {});\n}", "import getBasePlacement from \"../utils/getBasePlacement.js\";\nimport getLayoutRect from \"../dom-utils/getLayoutRect.js\";\nimport contains from \"../dom-utils/contains.js\";\nimport getOffsetParent from \"../dom-utils/getOffsetParent.js\";\nimport getMainAxisFromPlacement from \"../utils/getMainAxisFromPlacement.js\";\nimport { within } from \"../utils/within.js\";\nimport mergePaddingObject from \"../utils/mergePaddingObject.js\";\nimport expandToHashMap from \"../utils/expandToHashMap.js\";\nimport { left, right, basePlacements, top, bottom } from \"../enums.js\"; // eslint-disable-next-line import/no-unused-modules\n\nvar toPaddingObject = function toPaddingObject(padding, state) {\n padding = typeof padding === 'function' ? padding(Object.assign({}, state.rects, {\n placement: state.placement\n })) : padding;\n return mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements));\n};\n\nfunction arrow(_ref) {\n var _state$modifiersData$;\n\n var state = _ref.state,\n name = _ref.name,\n options = _ref.options;\n var arrowElement = state.elements.arrow;\n var popperOffsets = state.modifiersData.popperOffsets;\n var basePlacement = getBasePlacement(state.placement);\n var axis = getMainAxisFromPlacement(basePlacement);\n var isVertical = [left, right].indexOf(basePlacement) >= 0;\n var len = isVertical ? 'height' : 'width';\n\n if (!arrowElement || !popperOffsets) {\n return;\n }\n\n var paddingObject = toPaddingObject(options.padding, state);\n var arrowRect = getLayoutRect(arrowElement);\n var minProp = axis === 'y' ? top : left;\n var maxProp = axis === 'y' ? bottom : right;\n var endDiff = state.rects.reference[len] + state.rects.reference[axis] - popperOffsets[axis] - state.rects.popper[len];\n var startDiff = popperOffsets[axis] - state.rects.reference[axis];\n var arrowOffsetParent = getOffsetParent(arrowElement);\n var clientSize = arrowOffsetParent ? axis === 'y' ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0;\n var centerToReference = endDiff / 2 - startDiff / 2; // Make sure the arrow doesn't overflow the popper if the center point is\n // outside of the popper bounds\n\n var min = paddingObject[minProp];\n var max = clientSize - arrowRect[len] - paddingObject[maxProp];\n var center = clientSize / 2 - arrowRect[len] / 2 + centerToReference;\n var offset = within(min, center, max); // Prevents breaking syntax highlighting...\n\n var axisProp = axis;\n state.modifiersData[name] = (_state$modifiersData$ = {}, _state$modifiersData$[axisProp] = offset, _state$modifiersData$.centerOffset = offset - center, _state$modifiersData$);\n}\n\nfunction effect(_ref2) {\n var state = _ref2.state,\n options = _ref2.options;\n var _options$element = options.element,\n arrowElement = _options$element === void 0 ? '[data-popper-arrow]' : _options$element;\n\n if (arrowElement == null) {\n return;\n } // CSS selector\n\n\n if (typeof arrowElement === 'string') {\n arrowElement = state.elements.popper.querySelector(arrowElement);\n\n if (!arrowElement) {\n return;\n }\n }\n\n if (!contains(state.elements.popper, arrowElement)) {\n return;\n }\n\n state.elements.arrow = arrowElement;\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'arrow',\n enabled: true,\n phase: 'main',\n fn: arrow,\n effect: effect,\n requires: ['popperOffsets'],\n requiresIfExists: ['preventOverflow']\n};", "export default function getVariation(placement) {\n return placement.split('-')[1];\n}", "import { top, left, right, bottom, end } from \"../enums.js\";\nimport getOffsetParent from \"../dom-utils/getOffsetParent.js\";\nimport getWindow from \"../dom-utils/getWindow.js\";\nimport getDocumentElement from \"../dom-utils/getDocumentElement.js\";\nimport getComputedStyle from \"../dom-utils/getComputedStyle.js\";\nimport getBasePlacement from \"../utils/getBasePlacement.js\";\nimport getVariation from \"../utils/getVariation.js\";\nimport { round } from \"../utils/math.js\"; // eslint-disable-next-line import/no-unused-modules\n\nvar unsetSides = {\n top: 'auto',\n right: 'auto',\n bottom: 'auto',\n left: 'auto'\n}; // Round the offsets to the nearest suitable subpixel based on the DPR.\n// Zooming can change the DPR, but it seems to report a value that will\n// cleanly divide the values into the appropriate subpixels.\n\nfunction roundOffsetsByDPR(_ref, win) {\n var x = _ref.x,\n y = _ref.y;\n var dpr = win.devicePixelRatio || 1;\n return {\n x: round(x * dpr) / dpr || 0,\n y: round(y * dpr) / dpr || 0\n };\n}\n\nexport function mapToStyles(_ref2) {\n var _Object$assign2;\n\n var popper = _ref2.popper,\n popperRect = _ref2.popperRect,\n placement = _ref2.placement,\n variation = _ref2.variation,\n offsets = _ref2.offsets,\n position = _ref2.position,\n gpuAcceleration = _ref2.gpuAcceleration,\n adaptive = _ref2.adaptive,\n roundOffsets = _ref2.roundOffsets,\n isFixed = _ref2.isFixed;\n var _offsets$x = offsets.x,\n x = _offsets$x === void 0 ? 0 : _offsets$x,\n _offsets$y = offsets.y,\n y = _offsets$y === void 0 ? 0 : _offsets$y;\n\n var _ref3 = typeof roundOffsets === 'function' ? roundOffsets({\n x: x,\n y: y\n }) : {\n x: x,\n y: y\n };\n\n x = _ref3.x;\n y = _ref3.y;\n var hasX = offsets.hasOwnProperty('x');\n var hasY = offsets.hasOwnProperty('y');\n var sideX = left;\n var sideY = top;\n var win = window;\n\n if (adaptive) {\n var offsetParent = getOffsetParent(popper);\n var heightProp = 'clientHeight';\n var widthProp = 'clientWidth';\n\n if (offsetParent === getWindow(popper)) {\n offsetParent = getDocumentElement(popper);\n\n if (getComputedStyle(offsetParent).position !== 'static' && position === 'absolute') {\n heightProp = 'scrollHeight';\n widthProp = 'scrollWidth';\n }\n } // $FlowFixMe[incompatible-cast]: force type refinement, we compare offsetParent with window above, but Flow doesn't detect it\n\n\n offsetParent = offsetParent;\n\n if (placement === top || (placement === left || placement === right) && variation === end) {\n sideY = bottom;\n var offsetY = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.height : // $FlowFixMe[prop-missing]\n offsetParent[heightProp];\n y -= offsetY - popperRect.height;\n y *= gpuAcceleration ? 1 : -1;\n }\n\n if (placement === left || (placement === top || placement === bottom) && variation === end) {\n sideX = right;\n var offsetX = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.width : // $FlowFixMe[prop-missing]\n offsetParent[widthProp];\n x -= offsetX - popperRect.width;\n x *= gpuAcceleration ? 1 : -1;\n }\n }\n\n var commonStyles = Object.assign({\n position: position\n }, adaptive && unsetSides);\n\n var _ref4 = roundOffsets === true ? roundOffsetsByDPR({\n x: x,\n y: y\n }, getWindow(popper)) : {\n x: x,\n y: y\n };\n\n x = _ref4.x;\n y = _ref4.y;\n\n if (gpuAcceleration) {\n var _Object$assign;\n\n return Object.assign({}, commonStyles, (_Object$assign = {}, _Object$assign[sideY] = hasY ? '0' : '', _Object$assign[sideX] = hasX ? '0' : '', _Object$assign.transform = (win.devicePixelRatio || 1) <= 1 ? \"translate(\" + x + \"px, \" + y + \"px)\" : \"translate3d(\" + x + \"px, \" + y + \"px, 0)\", _Object$assign));\n }\n\n return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + \"px\" : '', _Object$assign2[sideX] = hasX ? x + \"px\" : '', _Object$assign2.transform = '', _Object$assign2));\n}\n\nfunction computeStyles(_ref5) {\n var state = _ref5.state,\n options = _ref5.options;\n var _options$gpuAccelerat = options.gpuAcceleration,\n gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat,\n _options$adaptive = options.adaptive,\n adaptive = _options$adaptive === void 0 ? true : _options$adaptive,\n _options$roundOffsets = options.roundOffsets,\n roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets;\n var commonStyles = {\n placement: getBasePlacement(state.placement),\n variation: getVariation(state.placement),\n popper: state.elements.popper,\n popperRect: state.rects.popper,\n gpuAcceleration: gpuAcceleration,\n isFixed: state.options.strategy === 'fixed'\n };\n\n if (state.modifiersData.popperOffsets != null) {\n state.styles.popper = Object.assign({}, state.styles.popper, mapToStyles(Object.assign({}, commonStyles, {\n offsets: state.modifiersData.popperOffsets,\n position: state.options.strategy,\n adaptive: adaptive,\n roundOffsets: roundOffsets\n })));\n }\n\n if (state.modifiersData.arrow != null) {\n state.styles.arrow = Object.assign({}, state.styles.arrow, mapToStyles(Object.assign({}, commonStyles, {\n offsets: state.modifiersData.arrow,\n position: 'absolute',\n adaptive: false,\n roundOffsets: roundOffsets\n })));\n }\n\n state.attributes.popper = Object.assign({}, state.attributes.popper, {\n 'data-popper-placement': state.placement\n });\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'computeStyles',\n enabled: true,\n phase: 'beforeWrite',\n fn: computeStyles,\n data: {}\n};", "import getWindow from \"../dom-utils/getWindow.js\"; // eslint-disable-next-line import/no-unused-modules\n\nvar passive = {\n passive: true\n};\n\nfunction effect(_ref) {\n var state = _ref.state,\n instance = _ref.instance,\n options = _ref.options;\n var _options$scroll = options.scroll,\n scroll = _options$scroll === void 0 ? true : _options$scroll,\n _options$resize = options.resize,\n resize = _options$resize === void 0 ? true : _options$resize;\n var window = getWindow(state.elements.popper);\n var scrollParents = [].concat(state.scrollParents.reference, state.scrollParents.popper);\n\n if (scroll) {\n scrollParents.forEach(function (scrollParent) {\n scrollParent.addEventListener('scroll', instance.update, passive);\n });\n }\n\n if (resize) {\n window.addEventListener('resize', instance.update, passive);\n }\n\n return function () {\n if (scroll) {\n scrollParents.forEach(function (scrollParent) {\n scrollParent.removeEventListener('scroll', instance.update, passive);\n });\n }\n\n if (resize) {\n window.removeEventListener('resize', instance.update, passive);\n }\n };\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'eventListeners',\n enabled: true,\n phase: 'write',\n fn: function fn() {},\n effect: effect,\n data: {}\n};", "var hash = {\n left: 'right',\n right: 'left',\n bottom: 'top',\n top: 'bottom'\n};\nexport default function getOppositePlacement(placement) {\n return placement.replace(/left|right|bottom|top/g, function (matched) {\n return hash[matched];\n });\n}", "var hash = {\n start: 'end',\n end: 'start'\n};\nexport default function getOppositeVariationPlacement(placement) {\n return placement.replace(/start|end/g, function (matched) {\n return hash[matched];\n });\n}", "import getWindow from \"./getWindow.js\";\nexport default function getWindowScroll(node) {\n var win = getWindow(node);\n var scrollLeft = win.pageXOffset;\n var scrollTop = win.pageYOffset;\n return {\n scrollLeft: scrollLeft,\n scrollTop: scrollTop\n };\n}", "import getBoundingClientRect from \"./getBoundingClientRect.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport getWindowScroll from \"./getWindowScroll.js\";\nexport default function getWindowScrollBarX(element) {\n // If has a CSS width greater than the viewport, then this will be\n // incorrect for RTL.\n // Popper 1 is broken in this case and never had a bug report so let's assume\n // it's not an issue. I don't think anyone ever specifies width on \n // anyway.\n // Browsers where the left scrollbar doesn't cause an issue report `0` for\n // this (e.g. Edge 2019, IE11, Safari)\n return getBoundingClientRect(getDocumentElement(element)).left + getWindowScroll(element).scrollLeft;\n}", "import getWindow from \"./getWindow.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport getWindowScrollBarX from \"./getWindowScrollBarX.js\";\nimport isLayoutViewport from \"./isLayoutViewport.js\";\nexport default function getViewportRect(element, strategy) {\n var win = getWindow(element);\n var html = getDocumentElement(element);\n var visualViewport = win.visualViewport;\n var width = html.clientWidth;\n var height = html.clientHeight;\n var x = 0;\n var y = 0;\n\n if (visualViewport) {\n width = visualViewport.width;\n height = visualViewport.height;\n var layoutViewport = isLayoutViewport();\n\n if (layoutViewport || !layoutViewport && strategy === 'fixed') {\n x = visualViewport.offsetLeft;\n y = visualViewport.offsetTop;\n }\n }\n\n return {\n width: width,\n height: height,\n x: x + getWindowScrollBarX(element),\n y: y\n };\n}", "import getDocumentElement from \"./getDocumentElement.js\";\nimport getComputedStyle from \"./getComputedStyle.js\";\nimport getWindowScrollBarX from \"./getWindowScrollBarX.js\";\nimport getWindowScroll from \"./getWindowScroll.js\";\nimport { max } from \"../utils/math.js\"; // Gets the entire size of the scrollable document area, even extending outside\n// of the `` and `` rect bounds if horizontally scrollable\n\nexport default function getDocumentRect(element) {\n var _element$ownerDocumen;\n\n var html = getDocumentElement(element);\n var winScroll = getWindowScroll(element);\n var body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body;\n var width = max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);\n var height = max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);\n var x = -winScroll.scrollLeft + getWindowScrollBarX(element);\n var y = -winScroll.scrollTop;\n\n if (getComputedStyle(body || html).direction === 'rtl') {\n x += max(html.clientWidth, body ? body.clientWidth : 0) - width;\n }\n\n return {\n width: width,\n height: height,\n x: x,\n y: y\n };\n}", "import getComputedStyle from \"./getComputedStyle.js\";\nexport default function isScrollParent(element) {\n // Firefox wants us to check `-x` and `-y` variations as well\n var _getComputedStyle = getComputedStyle(element),\n overflow = _getComputedStyle.overflow,\n overflowX = _getComputedStyle.overflowX,\n overflowY = _getComputedStyle.overflowY;\n\n return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX);\n}", "import getParentNode from \"./getParentNode.js\";\nimport isScrollParent from \"./isScrollParent.js\";\nimport getNodeName from \"./getNodeName.js\";\nimport { isHTMLElement } from \"./instanceOf.js\";\nexport default function getScrollParent(node) {\n if (['html', 'body', '#document'].indexOf(getNodeName(node)) >= 0) {\n // $FlowFixMe[incompatible-return]: assume body is always available\n return node.ownerDocument.body;\n }\n\n if (isHTMLElement(node) && isScrollParent(node)) {\n return node;\n }\n\n return getScrollParent(getParentNode(node));\n}", "import getScrollParent from \"./getScrollParent.js\";\nimport getParentNode from \"./getParentNode.js\";\nimport getWindow from \"./getWindow.js\";\nimport isScrollParent from \"./isScrollParent.js\";\n/*\ngiven a DOM element, return the list of all scroll parents, up the list of ancesors\nuntil we get to the top window object. This list is what we attach scroll listeners\nto, because if any of these parent elements scroll, we'll need to re-calculate the\nreference element's position.\n*/\n\nexport default function listScrollParents(element, list) {\n var _element$ownerDocumen;\n\n if (list === void 0) {\n list = [];\n }\n\n var scrollParent = getScrollParent(element);\n var isBody = scrollParent === ((_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body);\n var win = getWindow(scrollParent);\n var target = isBody ? [win].concat(win.visualViewport || [], isScrollParent(scrollParent) ? scrollParent : []) : scrollParent;\n var updatedList = list.concat(target);\n return isBody ? updatedList : // $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here\n updatedList.concat(listScrollParents(getParentNode(target)));\n}", "export default function rectToClientRect(rect) {\n return Object.assign({}, rect, {\n left: rect.x,\n top: rect.y,\n right: rect.x + rect.width,\n bottom: rect.y + rect.height\n });\n}", "import { viewport } from \"../enums.js\";\nimport getViewportRect from \"./getViewportRect.js\";\nimport getDocumentRect from \"./getDocumentRect.js\";\nimport listScrollParents from \"./listScrollParents.js\";\nimport getOffsetParent from \"./getOffsetParent.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport getComputedStyle from \"./getComputedStyle.js\";\nimport { isElement, isHTMLElement } from \"./instanceOf.js\";\nimport getBoundingClientRect from \"./getBoundingClientRect.js\";\nimport getParentNode from \"./getParentNode.js\";\nimport contains from \"./contains.js\";\nimport getNodeName from \"./getNodeName.js\";\nimport rectToClientRect from \"../utils/rectToClientRect.js\";\nimport { max, min } from \"../utils/math.js\";\n\nfunction getInnerBoundingClientRect(element, strategy) {\n var rect = getBoundingClientRect(element, false, strategy === 'fixed');\n rect.top = rect.top + element.clientTop;\n rect.left = rect.left + element.clientLeft;\n rect.bottom = rect.top + element.clientHeight;\n rect.right = rect.left + element.clientWidth;\n rect.width = element.clientWidth;\n rect.height = element.clientHeight;\n rect.x = rect.left;\n rect.y = rect.top;\n return rect;\n}\n\nfunction getClientRectFromMixedType(element, clippingParent, strategy) {\n return clippingParent === viewport ? rectToClientRect(getViewportRect(element, strategy)) : isElement(clippingParent) ? getInnerBoundingClientRect(clippingParent, strategy) : rectToClientRect(getDocumentRect(getDocumentElement(element)));\n} // A \"clipping parent\" is an overflowable container with the characteristic of\n// clipping (or hiding) overflowing elements with a position different from\n// `initial`\n\n\nfunction getClippingParents(element) {\n var clippingParents = listScrollParents(getParentNode(element));\n var canEscapeClipping = ['absolute', 'fixed'].indexOf(getComputedStyle(element).position) >= 0;\n var clipperElement = canEscapeClipping && isHTMLElement(element) ? getOffsetParent(element) : element;\n\n if (!isElement(clipperElement)) {\n return [];\n } // $FlowFixMe[incompatible-return]: https://github.com/facebook/flow/issues/1414\n\n\n return clippingParents.filter(function (clippingParent) {\n return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body';\n });\n} // Gets the maximum area that the element is visible in due to any number of\n// clipping parents\n\n\nexport default function getClippingRect(element, boundary, rootBoundary, strategy) {\n var mainClippingParents = boundary === 'clippingParents' ? getClippingParents(element) : [].concat(boundary);\n var clippingParents = [].concat(mainClippingParents, [rootBoundary]);\n var firstClippingParent = clippingParents[0];\n var clippingRect = clippingParents.reduce(function (accRect, clippingParent) {\n var rect = getClientRectFromMixedType(element, clippingParent, strategy);\n accRect.top = max(rect.top, accRect.top);\n accRect.right = min(rect.right, accRect.right);\n accRect.bottom = min(rect.bottom, accRect.bottom);\n accRect.left = max(rect.left, accRect.left);\n return accRect;\n }, getClientRectFromMixedType(element, firstClippingParent, strategy));\n clippingRect.width = clippingRect.right - clippingRect.left;\n clippingRect.height = clippingRect.bottom - clippingRect.top;\n clippingRect.x = clippingRect.left;\n clippingRect.y = clippingRect.top;\n return clippingRect;\n}", "import getBasePlacement from \"./getBasePlacement.js\";\nimport getVariation from \"./getVariation.js\";\nimport getMainAxisFromPlacement from \"./getMainAxisFromPlacement.js\";\nimport { top, right, bottom, left, start, end } from \"../enums.js\";\nexport default function computeOffsets(_ref) {\n var reference = _ref.reference,\n element = _ref.element,\n placement = _ref.placement;\n var basePlacement = placement ? getBasePlacement(placement) : null;\n var variation = placement ? getVariation(placement) : null;\n var commonX = reference.x + reference.width / 2 - element.width / 2;\n var commonY = reference.y + reference.height / 2 - element.height / 2;\n var offsets;\n\n switch (basePlacement) {\n case top:\n offsets = {\n x: commonX,\n y: reference.y - element.height\n };\n break;\n\n case bottom:\n offsets = {\n x: commonX,\n y: reference.y + reference.height\n };\n break;\n\n case right:\n offsets = {\n x: reference.x + reference.width,\n y: commonY\n };\n break;\n\n case left:\n offsets = {\n x: reference.x - element.width,\n y: commonY\n };\n break;\n\n default:\n offsets = {\n x: reference.x,\n y: reference.y\n };\n }\n\n var mainAxis = basePlacement ? getMainAxisFromPlacement(basePlacement) : null;\n\n if (mainAxis != null) {\n var len = mainAxis === 'y' ? 'height' : 'width';\n\n switch (variation) {\n case start:\n offsets[mainAxis] = offsets[mainAxis] - (reference[len] / 2 - element[len] / 2);\n break;\n\n case end:\n offsets[mainAxis] = offsets[mainAxis] + (reference[len] / 2 - element[len] / 2);\n break;\n\n default:\n }\n }\n\n return offsets;\n}", "import getClippingRect from \"../dom-utils/getClippingRect.js\";\nimport getDocumentElement from \"../dom-utils/getDocumentElement.js\";\nimport getBoundingClientRect from \"../dom-utils/getBoundingClientRect.js\";\nimport computeOffsets from \"./computeOffsets.js\";\nimport rectToClientRect from \"./rectToClientRect.js\";\nimport { clippingParents, reference, popper, bottom, top, right, basePlacements, viewport } from \"../enums.js\";\nimport { isElement } from \"../dom-utils/instanceOf.js\";\nimport mergePaddingObject from \"./mergePaddingObject.js\";\nimport expandToHashMap from \"./expandToHashMap.js\"; // eslint-disable-next-line import/no-unused-modules\n\nexport default function detectOverflow(state, options) {\n if (options === void 0) {\n options = {};\n }\n\n var _options = options,\n _options$placement = _options.placement,\n placement = _options$placement === void 0 ? state.placement : _options$placement,\n _options$strategy = _options.strategy,\n strategy = _options$strategy === void 0 ? state.strategy : _options$strategy,\n _options$boundary = _options.boundary,\n boundary = _options$boundary === void 0 ? clippingParents : _options$boundary,\n _options$rootBoundary = _options.rootBoundary,\n rootBoundary = _options$rootBoundary === void 0 ? viewport : _options$rootBoundary,\n _options$elementConte = _options.elementContext,\n elementContext = _options$elementConte === void 0 ? popper : _options$elementConte,\n _options$altBoundary = _options.altBoundary,\n altBoundary = _options$altBoundary === void 0 ? false : _options$altBoundary,\n _options$padding = _options.padding,\n padding = _options$padding === void 0 ? 0 : _options$padding;\n var paddingObject = mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements));\n var altContext = elementContext === popper ? reference : popper;\n var popperRect = state.rects.popper;\n var element = state.elements[altBoundary ? altContext : elementContext];\n var clippingClientRect = getClippingRect(isElement(element) ? element : element.contextElement || getDocumentElement(state.elements.popper), boundary, rootBoundary, strategy);\n var referenceClientRect = getBoundingClientRect(state.elements.reference);\n var popperOffsets = computeOffsets({\n reference: referenceClientRect,\n element: popperRect,\n strategy: 'absolute',\n placement: placement\n });\n var popperClientRect = rectToClientRect(Object.assign({}, popperRect, popperOffsets));\n var elementClientRect = elementContext === popper ? popperClientRect : referenceClientRect; // positive = overflowing the clipping rect\n // 0 or negative = within the clipping rect\n\n var overflowOffsets = {\n top: clippingClientRect.top - elementClientRect.top + paddingObject.top,\n bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom,\n left: clippingClientRect.left - elementClientRect.left + paddingObject.left,\n right: elementClientRect.right - clippingClientRect.right + paddingObject.right\n };\n var offsetData = state.modifiersData.offset; // Offsets can be applied only to the popper element\n\n if (elementContext === popper && offsetData) {\n var offset = offsetData[placement];\n Object.keys(overflowOffsets).forEach(function (key) {\n var multiply = [right, bottom].indexOf(key) >= 0 ? 1 : -1;\n var axis = [top, bottom].indexOf(key) >= 0 ? 'y' : 'x';\n overflowOffsets[key] += offset[axis] * multiply;\n });\n }\n\n return overflowOffsets;\n}", "import getVariation from \"./getVariation.js\";\nimport { variationPlacements, basePlacements, placements as allPlacements } from \"../enums.js\";\nimport detectOverflow from \"./detectOverflow.js\";\nimport getBasePlacement from \"./getBasePlacement.js\";\nexport default function computeAutoPlacement(state, options) {\n if (options === void 0) {\n options = {};\n }\n\n var _options = options,\n placement = _options.placement,\n boundary = _options.boundary,\n rootBoundary = _options.rootBoundary,\n padding = _options.padding,\n flipVariations = _options.flipVariations,\n _options$allowedAutoP = _options.allowedAutoPlacements,\n allowedAutoPlacements = _options$allowedAutoP === void 0 ? allPlacements : _options$allowedAutoP;\n var variation = getVariation(placement);\n var placements = variation ? flipVariations ? variationPlacements : variationPlacements.filter(function (placement) {\n return getVariation(placement) === variation;\n }) : basePlacements;\n var allowedPlacements = placements.filter(function (placement) {\n return allowedAutoPlacements.indexOf(placement) >= 0;\n });\n\n if (allowedPlacements.length === 0) {\n allowedPlacements = placements;\n } // $FlowFixMe[incompatible-type]: Flow seems to have problems with two array unions...\n\n\n var overflows = allowedPlacements.reduce(function (acc, placement) {\n acc[placement] = detectOverflow(state, {\n placement: placement,\n boundary: boundary,\n rootBoundary: rootBoundary,\n padding: padding\n })[getBasePlacement(placement)];\n return acc;\n }, {});\n return Object.keys(overflows).sort(function (a, b) {\n return overflows[a] - overflows[b];\n });\n}", "import getOppositePlacement from \"../utils/getOppositePlacement.js\";\nimport getBasePlacement from \"../utils/getBasePlacement.js\";\nimport getOppositeVariationPlacement from \"../utils/getOppositeVariationPlacement.js\";\nimport detectOverflow from \"../utils/detectOverflow.js\";\nimport computeAutoPlacement from \"../utils/computeAutoPlacement.js\";\nimport { bottom, top, start, right, left, auto } from \"../enums.js\";\nimport getVariation from \"../utils/getVariation.js\"; // eslint-disable-next-line import/no-unused-modules\n\nfunction getExpandedFallbackPlacements(placement) {\n if (getBasePlacement(placement) === auto) {\n return [];\n }\n\n var oppositePlacement = getOppositePlacement(placement);\n return [getOppositeVariationPlacement(placement), oppositePlacement, getOppositeVariationPlacement(oppositePlacement)];\n}\n\nfunction flip(_ref) {\n var state = _ref.state,\n options = _ref.options,\n name = _ref.name;\n\n if (state.modifiersData[name]._skip) {\n return;\n }\n\n var _options$mainAxis = options.mainAxis,\n checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis,\n _options$altAxis = options.altAxis,\n checkAltAxis = _options$altAxis === void 0 ? true : _options$altAxis,\n specifiedFallbackPlacements = options.fallbackPlacements,\n padding = options.padding,\n boundary = options.boundary,\n rootBoundary = options.rootBoundary,\n altBoundary = options.altBoundary,\n _options$flipVariatio = options.flipVariations,\n flipVariations = _options$flipVariatio === void 0 ? true : _options$flipVariatio,\n allowedAutoPlacements = options.allowedAutoPlacements;\n var preferredPlacement = state.options.placement;\n var basePlacement = getBasePlacement(preferredPlacement);\n var isBasePlacement = basePlacement === preferredPlacement;\n var fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipVariations ? [getOppositePlacement(preferredPlacement)] : getExpandedFallbackPlacements(preferredPlacement));\n var placements = [preferredPlacement].concat(fallbackPlacements).reduce(function (acc, placement) {\n return acc.concat(getBasePlacement(placement) === auto ? computeAutoPlacement(state, {\n placement: placement,\n boundary: boundary,\n rootBoundary: rootBoundary,\n padding: padding,\n flipVariations: flipVariations,\n allowedAutoPlacements: allowedAutoPlacements\n }) : placement);\n }, []);\n var referenceRect = state.rects.reference;\n var popperRect = state.rects.popper;\n var checksMap = new Map();\n var makeFallbackChecks = true;\n var firstFittingPlacement = placements[0];\n\n for (var i = 0; i < placements.length; i++) {\n var placement = placements[i];\n\n var _basePlacement = getBasePlacement(placement);\n\n var isStartVariation = getVariation(placement) === start;\n var isVertical = [top, bottom].indexOf(_basePlacement) >= 0;\n var len = isVertical ? 'width' : 'height';\n var overflow = detectOverflow(state, {\n placement: placement,\n boundary: boundary,\n rootBoundary: rootBoundary,\n altBoundary: altBoundary,\n padding: padding\n });\n var mainVariationSide = isVertical ? isStartVariation ? right : left : isStartVariation ? bottom : top;\n\n if (referenceRect[len] > popperRect[len]) {\n mainVariationSide = getOppositePlacement(mainVariationSide);\n }\n\n var altVariationSide = getOppositePlacement(mainVariationSide);\n var checks = [];\n\n if (checkMainAxis) {\n checks.push(overflow[_basePlacement] <= 0);\n }\n\n if (checkAltAxis) {\n checks.push(overflow[mainVariationSide] <= 0, overflow[altVariationSide] <= 0);\n }\n\n if (checks.every(function (check) {\n return check;\n })) {\n firstFittingPlacement = placement;\n makeFallbackChecks = false;\n break;\n }\n\n checksMap.set(placement, checks);\n }\n\n if (makeFallbackChecks) {\n // `2` may be desired in some cases \u2013 research later\n var numberOfChecks = flipVariations ? 3 : 1;\n\n var _loop = function _loop(_i) {\n var fittingPlacement = placements.find(function (placement) {\n var checks = checksMap.get(placement);\n\n if (checks) {\n return checks.slice(0, _i).every(function (check) {\n return check;\n });\n }\n });\n\n if (fittingPlacement) {\n firstFittingPlacement = fittingPlacement;\n return \"break\";\n }\n };\n\n for (var _i = numberOfChecks; _i > 0; _i--) {\n var _ret = _loop(_i);\n\n if (_ret === \"break\") break;\n }\n }\n\n if (state.placement !== firstFittingPlacement) {\n state.modifiersData[name]._skip = true;\n state.placement = firstFittingPlacement;\n state.reset = true;\n }\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'flip',\n enabled: true,\n phase: 'main',\n fn: flip,\n requiresIfExists: ['offset'],\n data: {\n _skip: false\n }\n};", "import { top, bottom, left, right } from \"../enums.js\";\nimport detectOverflow from \"../utils/detectOverflow.js\";\n\nfunction getSideOffsets(overflow, rect, preventedOffsets) {\n if (preventedOffsets === void 0) {\n preventedOffsets = {\n x: 0,\n y: 0\n };\n }\n\n return {\n top: overflow.top - rect.height - preventedOffsets.y,\n right: overflow.right - rect.width + preventedOffsets.x,\n bottom: overflow.bottom - rect.height + preventedOffsets.y,\n left: overflow.left - rect.width - preventedOffsets.x\n };\n}\n\nfunction isAnySideFullyClipped(overflow) {\n return [top, right, bottom, left].some(function (side) {\n return overflow[side] >= 0;\n });\n}\n\nfunction hide(_ref) {\n var state = _ref.state,\n name = _ref.name;\n var referenceRect = state.rects.reference;\n var popperRect = state.rects.popper;\n var preventedOffsets = state.modifiersData.preventOverflow;\n var referenceOverflow = detectOverflow(state, {\n elementContext: 'reference'\n });\n var popperAltOverflow = detectOverflow(state, {\n altBoundary: true\n });\n var referenceClippingOffsets = getSideOffsets(referenceOverflow, referenceRect);\n var popperEscapeOffsets = getSideOffsets(popperAltOverflow, popperRect, preventedOffsets);\n var isReferenceHidden = isAnySideFullyClipped(referenceClippingOffsets);\n var hasPopperEscaped = isAnySideFullyClipped(popperEscapeOffsets);\n state.modifiersData[name] = {\n referenceClippingOffsets: referenceClippingOffsets,\n popperEscapeOffsets: popperEscapeOffsets,\n isReferenceHidden: isReferenceHidden,\n hasPopperEscaped: hasPopperEscaped\n };\n state.attributes.popper = Object.assign({}, state.attributes.popper, {\n 'data-popper-reference-hidden': isReferenceHidden,\n 'data-popper-escaped': hasPopperEscaped\n });\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'hide',\n enabled: true,\n phase: 'main',\n requiresIfExists: ['preventOverflow'],\n fn: hide\n};", "import getBasePlacement from \"../utils/getBasePlacement.js\";\nimport { top, left, right, placements } from \"../enums.js\"; // eslint-disable-next-line import/no-unused-modules\n\nexport function distanceAndSkiddingToXY(placement, rects, offset) {\n var basePlacement = getBasePlacement(placement);\n var invertDistance = [left, top].indexOf(basePlacement) >= 0 ? -1 : 1;\n\n var _ref = typeof offset === 'function' ? offset(Object.assign({}, rects, {\n placement: placement\n })) : offset,\n skidding = _ref[0],\n distance = _ref[1];\n\n skidding = skidding || 0;\n distance = (distance || 0) * invertDistance;\n return [left, right].indexOf(basePlacement) >= 0 ? {\n x: distance,\n y: skidding\n } : {\n x: skidding,\n y: distance\n };\n}\n\nfunction offset(_ref2) {\n var state = _ref2.state,\n options = _ref2.options,\n name = _ref2.name;\n var _options$offset = options.offset,\n offset = _options$offset === void 0 ? [0, 0] : _options$offset;\n var data = placements.reduce(function (acc, placement) {\n acc[placement] = distanceAndSkiddingToXY(placement, state.rects, offset);\n return acc;\n }, {});\n var _data$state$placement = data[state.placement],\n x = _data$state$placement.x,\n y = _data$state$placement.y;\n\n if (state.modifiersData.popperOffsets != null) {\n state.modifiersData.popperOffsets.x += x;\n state.modifiersData.popperOffsets.y += y;\n }\n\n state.modifiersData[name] = data;\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'offset',\n enabled: true,\n phase: 'main',\n requires: ['popperOffsets'],\n fn: offset\n};", "import computeOffsets from \"../utils/computeOffsets.js\";\n\nfunction popperOffsets(_ref) {\n var state = _ref.state,\n name = _ref.name;\n // Offsets are the actual position the popper needs to have to be\n // properly positioned near its reference element\n // This is the most basic placement, and will be adjusted by\n // the modifiers in the next step\n state.modifiersData[name] = computeOffsets({\n reference: state.rects.reference,\n element: state.rects.popper,\n strategy: 'absolute',\n placement: state.placement\n });\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'popperOffsets',\n enabled: true,\n phase: 'read',\n fn: popperOffsets,\n data: {}\n};", "export default function getAltAxis(axis) {\n return axis === 'x' ? 'y' : 'x';\n}", "import { top, left, right, bottom, start } from \"../enums.js\";\nimport getBasePlacement from \"../utils/getBasePlacement.js\";\nimport getMainAxisFromPlacement from \"../utils/getMainAxisFromPlacement.js\";\nimport getAltAxis from \"../utils/getAltAxis.js\";\nimport { within, withinMaxClamp } from \"../utils/within.js\";\nimport getLayoutRect from \"../dom-utils/getLayoutRect.js\";\nimport getOffsetParent from \"../dom-utils/getOffsetParent.js\";\nimport detectOverflow from \"../utils/detectOverflow.js\";\nimport getVariation from \"../utils/getVariation.js\";\nimport getFreshSideObject from \"../utils/getFreshSideObject.js\";\nimport { min as mathMin, max as mathMax } from \"../utils/math.js\";\n\nfunction preventOverflow(_ref) {\n var state = _ref.state,\n options = _ref.options,\n name = _ref.name;\n var _options$mainAxis = options.mainAxis,\n checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis,\n _options$altAxis = options.altAxis,\n checkAltAxis = _options$altAxis === void 0 ? false : _options$altAxis,\n boundary = options.boundary,\n rootBoundary = options.rootBoundary,\n altBoundary = options.altBoundary,\n padding = options.padding,\n _options$tether = options.tether,\n tether = _options$tether === void 0 ? true : _options$tether,\n _options$tetherOffset = options.tetherOffset,\n tetherOffset = _options$tetherOffset === void 0 ? 0 : _options$tetherOffset;\n var overflow = detectOverflow(state, {\n boundary: boundary,\n rootBoundary: rootBoundary,\n padding: padding,\n altBoundary: altBoundary\n });\n var basePlacement = getBasePlacement(state.placement);\n var variation = getVariation(state.placement);\n var isBasePlacement = !variation;\n var mainAxis = getMainAxisFromPlacement(basePlacement);\n var altAxis = getAltAxis(mainAxis);\n var popperOffsets = state.modifiersData.popperOffsets;\n var referenceRect = state.rects.reference;\n var popperRect = state.rects.popper;\n var tetherOffsetValue = typeof tetherOffset === 'function' ? tetherOffset(Object.assign({}, state.rects, {\n placement: state.placement\n })) : tetherOffset;\n var normalizedTetherOffsetValue = typeof tetherOffsetValue === 'number' ? {\n mainAxis: tetherOffsetValue,\n altAxis: tetherOffsetValue\n } : Object.assign({\n mainAxis: 0,\n altAxis: 0\n }, tetherOffsetValue);\n var offsetModifierState = state.modifiersData.offset ? state.modifiersData.offset[state.placement] : null;\n var data = {\n x: 0,\n y: 0\n };\n\n if (!popperOffsets) {\n return;\n }\n\n if (checkMainAxis) {\n var _offsetModifierState$;\n\n var mainSide = mainAxis === 'y' ? top : left;\n var altSide = mainAxis === 'y' ? bottom : right;\n var len = mainAxis === 'y' ? 'height' : 'width';\n var offset = popperOffsets[mainAxis];\n var min = offset + overflow[mainSide];\n var max = offset - overflow[altSide];\n var additive = tether ? -popperRect[len] / 2 : 0;\n var minLen = variation === start ? referenceRect[len] : popperRect[len];\n var maxLen = variation === start ? -popperRect[len] : -referenceRect[len]; // We need to include the arrow in the calculation so the arrow doesn't go\n // outside the reference bounds\n\n var arrowElement = state.elements.arrow;\n var arrowRect = tether && arrowElement ? getLayoutRect(arrowElement) : {\n width: 0,\n height: 0\n };\n var arrowPaddingObject = state.modifiersData['arrow#persistent'] ? state.modifiersData['arrow#persistent'].padding : getFreshSideObject();\n var arrowPaddingMin = arrowPaddingObject[mainSide];\n var arrowPaddingMax = arrowPaddingObject[altSide]; // If the reference length is smaller than the arrow length, we don't want\n // to include its full size in the calculation. If the reference is small\n // and near the edge of a boundary, the popper can overflow even if the\n // reference is not overflowing as well (e.g. virtual elements with no\n // width or height)\n\n var arrowLen = within(0, referenceRect[len], arrowRect[len]);\n var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis : minLen - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis;\n var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis : maxLen + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis;\n var arrowOffsetParent = state.elements.arrow && getOffsetParent(state.elements.arrow);\n var clientOffset = arrowOffsetParent ? mainAxis === 'y' ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0;\n var offsetModifierValue = (_offsetModifierState$ = offsetModifierState == null ? void 0 : offsetModifierState[mainAxis]) != null ? _offsetModifierState$ : 0;\n var tetherMin = offset + minOffset - offsetModifierValue - clientOffset;\n var tetherMax = offset + maxOffset - offsetModifierValue;\n var preventedOffset = within(tether ? mathMin(min, tetherMin) : min, offset, tether ? mathMax(max, tetherMax) : max);\n popperOffsets[mainAxis] = preventedOffset;\n data[mainAxis] = preventedOffset - offset;\n }\n\n if (checkAltAxis) {\n var _offsetModifierState$2;\n\n var _mainSide = mainAxis === 'x' ? top : left;\n\n var _altSide = mainAxis === 'x' ? bottom : right;\n\n var _offset = popperOffsets[altAxis];\n\n var _len = altAxis === 'y' ? 'height' : 'width';\n\n var _min = _offset + overflow[_mainSide];\n\n var _max = _offset - overflow[_altSide];\n\n var isOriginSide = [top, left].indexOf(basePlacement) !== -1;\n\n var _offsetModifierValue = (_offsetModifierState$2 = offsetModifierState == null ? void 0 : offsetModifierState[altAxis]) != null ? _offsetModifierState$2 : 0;\n\n var _tetherMin = isOriginSide ? _min : _offset - referenceRect[_len] - popperRect[_len] - _offsetModifierValue + normalizedTetherOffsetValue.altAxis;\n\n var _tetherMax = isOriginSide ? _offset + referenceRect[_len] + popperRect[_len] - _offsetModifierValue - normalizedTetherOffsetValue.altAxis : _max;\n\n var _preventedOffset = tether && isOriginSide ? withinMaxClamp(_tetherMin, _offset, _tetherMax) : within(tether ? _tetherMin : _min, _offset, tether ? _tetherMax : _max);\n\n popperOffsets[altAxis] = _preventedOffset;\n data[altAxis] = _preventedOffset - _offset;\n }\n\n state.modifiersData[name] = data;\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'preventOverflow',\n enabled: true,\n phase: 'main',\n fn: preventOverflow,\n requiresIfExists: ['offset']\n};", "export default function getHTMLElementScroll(element) {\n return {\n scrollLeft: element.scrollLeft,\n scrollTop: element.scrollTop\n };\n}", "import getWindowScroll from \"./getWindowScroll.js\";\nimport getWindow from \"./getWindow.js\";\nimport { isHTMLElement } from \"./instanceOf.js\";\nimport getHTMLElementScroll from \"./getHTMLElementScroll.js\";\nexport default function getNodeScroll(node) {\n if (node === getWindow(node) || !isHTMLElement(node)) {\n return getWindowScroll(node);\n } else {\n return getHTMLElementScroll(node);\n }\n}", "import getBoundingClientRect from \"./getBoundingClientRect.js\";\nimport getNodeScroll from \"./getNodeScroll.js\";\nimport getNodeName from \"./getNodeName.js\";\nimport { isHTMLElement } from \"./instanceOf.js\";\nimport getWindowScrollBarX from \"./getWindowScrollBarX.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport isScrollParent from \"./isScrollParent.js\";\nimport { round } from \"../utils/math.js\";\n\nfunction isElementScaled(element) {\n var rect = element.getBoundingClientRect();\n var scaleX = round(rect.width) / element.offsetWidth || 1;\n var scaleY = round(rect.height) / element.offsetHeight || 1;\n return scaleX !== 1 || scaleY !== 1;\n} // Returns the composite rect of an element relative to its offsetParent.\n// Composite means it takes into account transforms as well as layout.\n\n\nexport default function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {\n if (isFixed === void 0) {\n isFixed = false;\n }\n\n var isOffsetParentAnElement = isHTMLElement(offsetParent);\n var offsetParentIsScaled = isHTMLElement(offsetParent) && isElementScaled(offsetParent);\n var documentElement = getDocumentElement(offsetParent);\n var rect = getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled, isFixed);\n var scroll = {\n scrollLeft: 0,\n scrollTop: 0\n };\n var offsets = {\n x: 0,\n y: 0\n };\n\n if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {\n if (getNodeName(offsetParent) !== 'body' || // https://github.com/popperjs/popper-core/issues/1078\n isScrollParent(documentElement)) {\n scroll = getNodeScroll(offsetParent);\n }\n\n if (isHTMLElement(offsetParent)) {\n offsets = getBoundingClientRect(offsetParent, true);\n offsets.x += offsetParent.clientLeft;\n offsets.y += offsetParent.clientTop;\n } else if (documentElement) {\n offsets.x = getWindowScrollBarX(documentElement);\n }\n }\n\n return {\n x: rect.left + scroll.scrollLeft - offsets.x,\n y: rect.top + scroll.scrollTop - offsets.y,\n width: rect.width,\n height: rect.height\n };\n}", "import { modifierPhases } from \"../enums.js\"; // source: https://stackoverflow.com/questions/49875255\n\nfunction order(modifiers) {\n var map = new Map();\n var visited = new Set();\n var result = [];\n modifiers.forEach(function (modifier) {\n map.set(modifier.name, modifier);\n }); // On visiting object, check for its dependencies and visit them recursively\n\n function sort(modifier) {\n visited.add(modifier.name);\n var requires = [].concat(modifier.requires || [], modifier.requiresIfExists || []);\n requires.forEach(function (dep) {\n if (!visited.has(dep)) {\n var depModifier = map.get(dep);\n\n if (depModifier) {\n sort(depModifier);\n }\n }\n });\n result.push(modifier);\n }\n\n modifiers.forEach(function (modifier) {\n if (!visited.has(modifier.name)) {\n // check for visited object\n sort(modifier);\n }\n });\n return result;\n}\n\nexport default function orderModifiers(modifiers) {\n // order based on dependencies\n var orderedModifiers = order(modifiers); // order based on phase\n\n return modifierPhases.reduce(function (acc, phase) {\n return acc.concat(orderedModifiers.filter(function (modifier) {\n return modifier.phase === phase;\n }));\n }, []);\n}", "export default function debounce(fn) {\n var pending;\n return function () {\n if (!pending) {\n pending = new Promise(function (resolve) {\n Promise.resolve().then(function () {\n pending = undefined;\n resolve(fn());\n });\n });\n }\n\n return pending;\n };\n}", "export default function mergeByName(modifiers) {\n var merged = modifiers.reduce(function (merged, current) {\n var existing = merged[current.name];\n merged[current.name] = existing ? Object.assign({}, existing, current, {\n options: Object.assign({}, existing.options, current.options),\n data: Object.assign({}, existing.data, current.data)\n }) : current;\n return merged;\n }, {}); // IE11 does not support Object.values\n\n return Object.keys(merged).map(function (key) {\n return merged[key];\n });\n}", "import getCompositeRect from \"./dom-utils/getCompositeRect.js\";\nimport getLayoutRect from \"./dom-utils/getLayoutRect.js\";\nimport listScrollParents from \"./dom-utils/listScrollParents.js\";\nimport getOffsetParent from \"./dom-utils/getOffsetParent.js\";\nimport orderModifiers from \"./utils/orderModifiers.js\";\nimport debounce from \"./utils/debounce.js\";\nimport mergeByName from \"./utils/mergeByName.js\";\nimport detectOverflow from \"./utils/detectOverflow.js\";\nimport { isElement } from \"./dom-utils/instanceOf.js\";\nvar DEFAULT_OPTIONS = {\n placement: 'bottom',\n modifiers: [],\n strategy: 'absolute'\n};\n\nfunction areValidElements() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return !args.some(function (element) {\n return !(element && typeof element.getBoundingClientRect === 'function');\n });\n}\n\nexport function popperGenerator(generatorOptions) {\n if (generatorOptions === void 0) {\n generatorOptions = {};\n }\n\n var _generatorOptions = generatorOptions,\n _generatorOptions$def = _generatorOptions.defaultModifiers,\n defaultModifiers = _generatorOptions$def === void 0 ? [] : _generatorOptions$def,\n _generatorOptions$def2 = _generatorOptions.defaultOptions,\n defaultOptions = _generatorOptions$def2 === void 0 ? DEFAULT_OPTIONS : _generatorOptions$def2;\n return function createPopper(reference, popper, options) {\n if (options === void 0) {\n options = defaultOptions;\n }\n\n var state = {\n placement: 'bottom',\n orderedModifiers: [],\n options: Object.assign({}, DEFAULT_OPTIONS, defaultOptions),\n modifiersData: {},\n elements: {\n reference: reference,\n popper: popper\n },\n attributes: {},\n styles: {}\n };\n var effectCleanupFns = [];\n var isDestroyed = false;\n var instance = {\n state: state,\n setOptions: function setOptions(setOptionsAction) {\n var options = typeof setOptionsAction === 'function' ? setOptionsAction(state.options) : setOptionsAction;\n cleanupModifierEffects();\n state.options = Object.assign({}, defaultOptions, state.options, options);\n state.scrollParents = {\n reference: isElement(reference) ? listScrollParents(reference) : reference.contextElement ? listScrollParents(reference.contextElement) : [],\n popper: listScrollParents(popper)\n }; // Orders the modifiers based on their dependencies and `phase`\n // properties\n\n var orderedModifiers = orderModifiers(mergeByName([].concat(defaultModifiers, state.options.modifiers))); // Strip out disabled modifiers\n\n state.orderedModifiers = orderedModifiers.filter(function (m) {\n return m.enabled;\n });\n runModifierEffects();\n return instance.update();\n },\n // Sync update \u2013 it will always be executed, even if not necessary. This\n // is useful for low frequency updates where sync behavior simplifies the\n // logic.\n // For high frequency updates (e.g. `resize` and `scroll` events), always\n // prefer the async Popper#update method\n forceUpdate: function forceUpdate() {\n if (isDestroyed) {\n return;\n }\n\n var _state$elements = state.elements,\n reference = _state$elements.reference,\n popper = _state$elements.popper; // Don't proceed if `reference` or `popper` are not valid elements\n // anymore\n\n if (!areValidElements(reference, popper)) {\n return;\n } // Store the reference and popper rects to be read by modifiers\n\n\n state.rects = {\n reference: getCompositeRect(reference, getOffsetParent(popper), state.options.strategy === 'fixed'),\n popper: getLayoutRect(popper)\n }; // Modifiers have the ability to reset the current update cycle. The\n // most common use case for this is the `flip` modifier changing the\n // placement, which then needs to re-run all the modifiers, because the\n // logic was previously ran for the previous placement and is therefore\n // stale/incorrect\n\n state.reset = false;\n state.placement = state.options.placement; // On each update cycle, the `modifiersData` property for each modifier\n // is filled with the initial data specified by the modifier. This means\n // it doesn't persist and is fresh on each update.\n // To ensure persistent data, use `${name}#persistent`\n\n state.orderedModifiers.forEach(function (modifier) {\n return state.modifiersData[modifier.name] = Object.assign({}, modifier.data);\n });\n\n for (var index = 0; index < state.orderedModifiers.length; index++) {\n if (state.reset === true) {\n state.reset = false;\n index = -1;\n continue;\n }\n\n var _state$orderedModifie = state.orderedModifiers[index],\n fn = _state$orderedModifie.fn,\n _state$orderedModifie2 = _state$orderedModifie.options,\n _options = _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2,\n name = _state$orderedModifie.name;\n\n if (typeof fn === 'function') {\n state = fn({\n state: state,\n options: _options,\n name: name,\n instance: instance\n }) || state;\n }\n }\n },\n // Async and optimistically optimized update \u2013 it will not be executed if\n // not necessary (debounced to run at most once-per-tick)\n update: debounce(function () {\n return new Promise(function (resolve) {\n instance.forceUpdate();\n resolve(state);\n });\n }),\n destroy: function destroy() {\n cleanupModifierEffects();\n isDestroyed = true;\n }\n };\n\n if (!areValidElements(reference, popper)) {\n return instance;\n }\n\n instance.setOptions(options).then(function (state) {\n if (!isDestroyed && options.onFirstUpdate) {\n options.onFirstUpdate(state);\n }\n }); // Modifiers have the ability to execute arbitrary code before the first\n // update cycle runs. They will be executed in the same order as the update\n // cycle. This is useful when a modifier adds some persistent data that\n // other modifiers need to use, but the modifier is run after the dependent\n // one.\n\n function runModifierEffects() {\n state.orderedModifiers.forEach(function (_ref) {\n var name = _ref.name,\n _ref$options = _ref.options,\n options = _ref$options === void 0 ? {} : _ref$options,\n effect = _ref.effect;\n\n if (typeof effect === 'function') {\n var cleanupFn = effect({\n state: state,\n name: name,\n instance: instance,\n options: options\n });\n\n var noopFn = function noopFn() {};\n\n effectCleanupFns.push(cleanupFn || noopFn);\n }\n });\n }\n\n function cleanupModifierEffects() {\n effectCleanupFns.forEach(function (fn) {\n return fn();\n });\n effectCleanupFns = [];\n }\n\n return instance;\n };\n}\nexport var createPopper = /*#__PURE__*/popperGenerator(); // eslint-disable-next-line import/no-unused-modules\n\nexport { detectOverflow };", "import { popperGenerator, detectOverflow } from \"./createPopper.js\";\nimport eventListeners from \"./modifiers/eventListeners.js\";\nimport popperOffsets from \"./modifiers/popperOffsets.js\";\nimport computeStyles from \"./modifiers/computeStyles.js\";\nimport applyStyles from \"./modifiers/applyStyles.js\";\nvar defaultModifiers = [eventListeners, popperOffsets, computeStyles, applyStyles];\nvar createPopper = /*#__PURE__*/popperGenerator({\n defaultModifiers: defaultModifiers\n}); // eslint-disable-next-line import/no-unused-modules\n\nexport { createPopper, popperGenerator, defaultModifiers, detectOverflow };", "import { popperGenerator, detectOverflow } from \"./createPopper.js\";\nimport eventListeners from \"./modifiers/eventListeners.js\";\nimport popperOffsets from \"./modifiers/popperOffsets.js\";\nimport computeStyles from \"./modifiers/computeStyles.js\";\nimport applyStyles from \"./modifiers/applyStyles.js\";\nimport offset from \"./modifiers/offset.js\";\nimport flip from \"./modifiers/flip.js\";\nimport preventOverflow from \"./modifiers/preventOverflow.js\";\nimport arrow from \"./modifiers/arrow.js\";\nimport hide from \"./modifiers/hide.js\";\nvar defaultModifiers = [eventListeners, popperOffsets, computeStyles, applyStyles, offset, flip, preventOverflow, arrow, hide];\nvar createPopper = /*#__PURE__*/popperGenerator({\n defaultModifiers: defaultModifiers\n}); // eslint-disable-next-line import/no-unused-modules\n\nexport { createPopper, popperGenerator, defaultModifiers, detectOverflow }; // eslint-disable-next-line import/no-unused-modules\n\nexport { createPopper as createPopperLite } from \"./popper-lite.js\"; // eslint-disable-next-line import/no-unused-modules\n\nexport * from \"./modifiers/index.js\";", "/**\n * --------------------------------------------------------------------------\n * Bootstrap dom/data.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n/**\n * Constants\n */\n\nconst elementMap = new Map()\n\nexport default {\n set(element, key, instance) {\n if (!elementMap.has(element)) {\n elementMap.set(element, new Map())\n }\n\n const instanceMap = elementMap.get(element)\n\n // make it clear we only want one instance per element\n // can be removed later when multiple key/instances are fine to be used\n if (!instanceMap.has(key) && instanceMap.size !== 0) {\n // eslint-disable-next-line no-console\n console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(instanceMap.keys())[0]}.`)\n return\n }\n\n instanceMap.set(key, instance)\n },\n\n get(element, key) {\n if (elementMap.has(element)) {\n return elementMap.get(element).get(key) || null\n }\n\n return null\n },\n\n remove(element, key) {\n if (!elementMap.has(element)) {\n return\n }\n\n const instanceMap = elementMap.get(element)\n\n instanceMap.delete(key)\n\n // free up element references if there are no instances left for an element\n if (instanceMap.size === 0) {\n elementMap.delete(element)\n }\n }\n}\n", "/**\n * --------------------------------------------------------------------------\n * Bootstrap util/index.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nconst MAX_UID = 1_000_000\nconst MILLISECONDS_MULTIPLIER = 1000\nconst TRANSITION_END = 'transitionend'\n\n/**\n * Properly escape IDs selectors to handle weird IDs\n * @param {string} selector\n * @returns {string}\n */\nconst parseSelector = selector => {\n if (selector && window.CSS && window.CSS.escape) {\n // document.querySelector needs escaping to handle IDs (html5+) containing for instance /\n selector = selector.replace(/#([^\\s\"#']+)/g, (match, id) => `#${CSS.escape(id)}`)\n }\n\n return selector\n}\n\n// Shout-out Angus Croll (https://goo.gl/pxwQGp)\nconst toType = object => {\n if (object === null || object === undefined) {\n return `${object}`\n }\n\n return Object.prototype.toString.call(object).match(/\\s([a-z]+)/i)[1].toLowerCase()\n}\n\n/**\n * Public Util API\n */\n\nconst getUID = prefix => {\n do {\n prefix += Math.floor(Math.random() * MAX_UID)\n } while (document.getElementById(prefix))\n\n return prefix\n}\n\nconst getTransitionDurationFromElement = element => {\n if (!element) {\n return 0\n }\n\n // Get transition-duration of the element\n let { transitionDuration, transitionDelay } = window.getComputedStyle(element)\n\n const floatTransitionDuration = Number.parseFloat(transitionDuration)\n const floatTransitionDelay = Number.parseFloat(transitionDelay)\n\n // Return 0 if element or transition duration is not found\n if (!floatTransitionDuration && !floatTransitionDelay) {\n return 0\n }\n\n // If multiple durations are defined, take the first\n transitionDuration = transitionDuration.split(',')[0]\n transitionDelay = transitionDelay.split(',')[0]\n\n return (Number.parseFloat(transitionDuration) + Number.parseFloat(transitionDelay)) * MILLISECONDS_MULTIPLIER\n}\n\nconst triggerTransitionEnd = element => {\n element.dispatchEvent(new Event(TRANSITION_END))\n}\n\nconst isElement = object => {\n if (!object || typeof object !== 'object') {\n return false\n }\n\n if (typeof object.jquery !== 'undefined') {\n object = object[0]\n }\n\n return typeof object.nodeType !== 'undefined'\n}\n\nconst getElement = object => {\n // it's a jQuery object or a node element\n if (isElement(object)) {\n return object.jquery ? object[0] : object\n }\n\n if (typeof object === 'string' && object.length > 0) {\n return document.querySelector(parseSelector(object))\n }\n\n return null\n}\n\nconst isVisible = element => {\n if (!isElement(element) || element.getClientRects().length === 0) {\n return false\n }\n\n const elementIsVisible = getComputedStyle(element).getPropertyValue('visibility') === 'visible'\n // Handle `details` element as its content may falsie appear visible when it is closed\n const closedDetails = element.closest('details:not([open])')\n\n if (!closedDetails) {\n return elementIsVisible\n }\n\n if (closedDetails !== element) {\n const summary = element.closest('summary')\n if (summary && summary.parentNode !== closedDetails) {\n return false\n }\n\n if (summary === null) {\n return false\n }\n }\n\n return elementIsVisible\n}\n\nconst isDisabled = element => {\n if (!element || element.nodeType !== Node.ELEMENT_NODE) {\n return true\n }\n\n if (element.classList.contains('disabled')) {\n return true\n }\n\n if (typeof element.disabled !== 'undefined') {\n return element.disabled\n }\n\n return element.hasAttribute('disabled') && element.getAttribute('disabled') !== 'false'\n}\n\nconst findShadowRoot = element => {\n if (!document.documentElement.attachShadow) {\n return null\n }\n\n // Can find the shadow root otherwise it'll return the document\n if (typeof element.getRootNode === 'function') {\n const root = element.getRootNode()\n return root instanceof ShadowRoot ? root : null\n }\n\n if (element instanceof ShadowRoot) {\n return element\n }\n\n // when we don't find a shadow root\n if (!element.parentNode) {\n return null\n }\n\n return findShadowRoot(element.parentNode)\n}\n\nconst noop = () => {}\n\n/**\n * Trick to restart an element's animation\n *\n * @param {HTMLElement} element\n * @return void\n *\n * @see https://www.harrytheo.com/blog/2021/02/restart-a-css-animation-with-javascript/#restarting-a-css-animation\n */\nconst reflow = element => {\n element.offsetHeight // eslint-disable-line no-unused-expressions\n}\n\nconst getjQuery = () => {\n if (window.jQuery && !document.body.hasAttribute('data-bs-no-jquery')) {\n return window.jQuery\n }\n\n return null\n}\n\nconst DOMContentLoadedCallbacks = []\n\nconst onDOMContentLoaded = callback => {\n if (document.readyState === 'loading') {\n // add listener on the first call when the document is in loading state\n if (!DOMContentLoadedCallbacks.length) {\n document.addEventListener('DOMContentLoaded', () => {\n for (const callback of DOMContentLoadedCallbacks) {\n callback()\n }\n })\n }\n\n DOMContentLoadedCallbacks.push(callback)\n } else {\n callback()\n }\n}\n\nconst isRTL = () => document.documentElement.dir === 'rtl'\n\nconst defineJQueryPlugin = plugin => {\n onDOMContentLoaded(() => {\n const $ = getjQuery()\n /* istanbul ignore if */\n if ($) {\n const name = plugin.NAME\n const JQUERY_NO_CONFLICT = $.fn[name]\n $.fn[name] = plugin.jQueryInterface\n $.fn[name].Constructor = plugin\n $.fn[name].noConflict = () => {\n $.fn[name] = JQUERY_NO_CONFLICT\n return plugin.jQueryInterface\n }\n }\n })\n}\n\nconst execute = (possibleCallback, args = [], defaultValue = possibleCallback) => {\n return typeof possibleCallback === 'function' ? possibleCallback.call(...args) : defaultValue\n}\n\nconst executeAfterTransition = (callback, transitionElement, waitForTransition = true) => {\n if (!waitForTransition) {\n execute(callback)\n return\n }\n\n const durationPadding = 5\n const emulatedDuration = getTransitionDurationFromElement(transitionElement) + durationPadding\n\n let called = false\n\n const handler = ({ target }) => {\n if (target !== transitionElement) {\n return\n }\n\n called = true\n transitionElement.removeEventListener(TRANSITION_END, handler)\n execute(callback)\n }\n\n transitionElement.addEventListener(TRANSITION_END, handler)\n setTimeout(() => {\n if (!called) {\n triggerTransitionEnd(transitionElement)\n }\n }, emulatedDuration)\n}\n\n/**\n * Return the previous/next element of a list.\n *\n * @param {array} list The list of elements\n * @param activeElement The active element\n * @param shouldGetNext Choose to get next or previous element\n * @param isCycleAllowed\n * @return {Element|elem} The proper element\n */\nconst getNextActiveElement = (list, activeElement, shouldGetNext, isCycleAllowed) => {\n const listLength = list.length\n let index = list.indexOf(activeElement)\n\n // if the element does not exist in the list return an element\n // depending on the direction and if cycle is allowed\n if (index === -1) {\n return !shouldGetNext && isCycleAllowed ? list[listLength - 1] : list[0]\n }\n\n index += shouldGetNext ? 1 : -1\n\n if (isCycleAllowed) {\n index = (index + listLength) % listLength\n }\n\n return list[Math.max(0, Math.min(index, listLength - 1))]\n}\n\nexport {\n defineJQueryPlugin,\n execute,\n executeAfterTransition,\n findShadowRoot,\n getElement,\n getjQuery,\n getNextActiveElement,\n getTransitionDurationFromElement,\n getUID,\n isDisabled,\n isElement,\n isRTL,\n isVisible,\n noop,\n onDOMContentLoaded,\n parseSelector,\n reflow,\n triggerTransitionEnd,\n toType\n}\n", "/**\n * --------------------------------------------------------------------------\n * Bootstrap dom/event-handler.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport { getjQuery } from '../util/index.js'\n\n/**\n * Constants\n */\n\nconst namespaceRegex = /[^.]*(?=\\..*)\\.|.*/\nconst stripNameRegex = /\\..*/\nconst stripUidRegex = /::\\d+$/\nconst eventRegistry = {} // Events storage\nlet uidEvent = 1\nconst customEvents = {\n mouseenter: 'mouseover',\n mouseleave: 'mouseout'\n}\n\nconst nativeEvents = new Set([\n 'click',\n 'dblclick',\n 'mouseup',\n 'mousedown',\n 'contextmenu',\n 'mousewheel',\n 'DOMMouseScroll',\n 'mouseover',\n 'mouseout',\n 'mousemove',\n 'selectstart',\n 'selectend',\n 'keydown',\n 'keypress',\n 'keyup',\n 'orientationchange',\n 'touchstart',\n 'touchmove',\n 'touchend',\n 'touchcancel',\n 'pointerdown',\n 'pointermove',\n 'pointerup',\n 'pointerleave',\n 'pointercancel',\n 'gesturestart',\n 'gesturechange',\n 'gestureend',\n 'focus',\n 'blur',\n 'change',\n 'reset',\n 'select',\n 'submit',\n 'focusin',\n 'focusout',\n 'load',\n 'unload',\n 'beforeunload',\n 'resize',\n 'move',\n 'DOMContentLoaded',\n 'readystatechange',\n 'error',\n 'abort',\n 'scroll'\n])\n\n/**\n * Private methods\n */\n\nfunction makeEventUid(element, uid) {\n return (uid && `${uid}::${uidEvent++}`) || element.uidEvent || uidEvent++\n}\n\nfunction getElementEvents(element) {\n const uid = makeEventUid(element)\n\n element.uidEvent = uid\n eventRegistry[uid] = eventRegistry[uid] || {}\n\n return eventRegistry[uid]\n}\n\nfunction bootstrapHandler(element, fn) {\n return function handler(event) {\n hydrateObj(event, { delegateTarget: element })\n\n if (handler.oneOff) {\n EventHandler.off(element, event.type, fn)\n }\n\n return fn.apply(element, [event])\n }\n}\n\nfunction bootstrapDelegationHandler(element, selector, fn) {\n return function handler(event) {\n const domElements = element.querySelectorAll(selector)\n\n for (let { target } = event; target && target !== this; target = target.parentNode) {\n for (const domElement of domElements) {\n if (domElement !== target) {\n continue\n }\n\n hydrateObj(event, { delegateTarget: target })\n\n if (handler.oneOff) {\n EventHandler.off(element, event.type, selector, fn)\n }\n\n return fn.apply(target, [event])\n }\n }\n }\n}\n\nfunction findHandler(events, callable, delegationSelector = null) {\n return Object.values(events)\n .find(event => event.callable === callable && event.delegationSelector === delegationSelector)\n}\n\nfunction normalizeParameters(originalTypeEvent, handler, delegationFunction) {\n const isDelegated = typeof handler === 'string'\n // TODO: tooltip passes `false` instead of selector, so we need to check\n const callable = isDelegated ? delegationFunction : (handler || delegationFunction)\n let typeEvent = getTypeEvent(originalTypeEvent)\n\n if (!nativeEvents.has(typeEvent)) {\n typeEvent = originalTypeEvent\n }\n\n return [isDelegated, callable, typeEvent]\n}\n\nfunction addHandler(element, originalTypeEvent, handler, delegationFunction, oneOff) {\n if (typeof originalTypeEvent !== 'string' || !element) {\n return\n }\n\n let [isDelegated, callable, typeEvent] = normalizeParameters(originalTypeEvent, handler, delegationFunction)\n\n // in case of mouseenter or mouseleave wrap the handler within a function that checks for its DOM position\n // this prevents the handler from being dispatched the same way as mouseover or mouseout does\n if (originalTypeEvent in customEvents) {\n const wrapFunction = fn => {\n return function (event) {\n if (!event.relatedTarget || (event.relatedTarget !== event.delegateTarget && !event.delegateTarget.contains(event.relatedTarget))) {\n return fn.call(this, event)\n }\n }\n }\n\n callable = wrapFunction(callable)\n }\n\n const events = getElementEvents(element)\n const handlers = events[typeEvent] || (events[typeEvent] = {})\n const previousFunction = findHandler(handlers, callable, isDelegated ? handler : null)\n\n if (previousFunction) {\n previousFunction.oneOff = previousFunction.oneOff && oneOff\n\n return\n }\n\n const uid = makeEventUid(callable, originalTypeEvent.replace(namespaceRegex, ''))\n const fn = isDelegated ?\n bootstrapDelegationHandler(element, handler, callable) :\n bootstrapHandler(element, callable)\n\n fn.delegationSelector = isDelegated ? handler : null\n fn.callable = callable\n fn.oneOff = oneOff\n fn.uidEvent = uid\n handlers[uid] = fn\n\n element.addEventListener(typeEvent, fn, isDelegated)\n}\n\nfunction removeHandler(element, events, typeEvent, handler, delegationSelector) {\n const fn = findHandler(events[typeEvent], handler, delegationSelector)\n\n if (!fn) {\n return\n }\n\n element.removeEventListener(typeEvent, fn, Boolean(delegationSelector))\n delete events[typeEvent][fn.uidEvent]\n}\n\nfunction removeNamespacedHandlers(element, events, typeEvent, namespace) {\n const storeElementEvent = events[typeEvent] || {}\n\n for (const [handlerKey, event] of Object.entries(storeElementEvent)) {\n if (handlerKey.includes(namespace)) {\n removeHandler(element, events, typeEvent, event.callable, event.delegationSelector)\n }\n }\n}\n\nfunction getTypeEvent(event) {\n // allow to get the native events from namespaced events ('click.bs.button' --> 'click')\n event = event.replace(stripNameRegex, '')\n return customEvents[event] || event\n}\n\nconst EventHandler = {\n on(element, event, handler, delegationFunction) {\n addHandler(element, event, handler, delegationFunction, false)\n },\n\n one(element, event, handler, delegationFunction) {\n addHandler(element, event, handler, delegationFunction, true)\n },\n\n off(element, originalTypeEvent, handler, delegationFunction) {\n if (typeof originalTypeEvent !== 'string' || !element) {\n return\n }\n\n const [isDelegated, callable, typeEvent] = normalizeParameters(originalTypeEvent, handler, delegationFunction)\n const inNamespace = typeEvent !== originalTypeEvent\n const events = getElementEvents(element)\n const storeElementEvent = events[typeEvent] || {}\n const isNamespace = originalTypeEvent.startsWith('.')\n\n if (typeof callable !== 'undefined') {\n // Simplest case: handler is passed, remove that listener ONLY.\n if (!Object.keys(storeElementEvent).length) {\n return\n }\n\n removeHandler(element, events, typeEvent, callable, isDelegated ? handler : null)\n return\n }\n\n if (isNamespace) {\n for (const elementEvent of Object.keys(events)) {\n removeNamespacedHandlers(element, events, elementEvent, originalTypeEvent.slice(1))\n }\n }\n\n for (const [keyHandlers, event] of Object.entries(storeElementEvent)) {\n const handlerKey = keyHandlers.replace(stripUidRegex, '')\n\n if (!inNamespace || originalTypeEvent.includes(handlerKey)) {\n removeHandler(element, events, typeEvent, event.callable, event.delegationSelector)\n }\n }\n },\n\n trigger(element, event, args) {\n if (typeof event !== 'string' || !element) {\n return null\n }\n\n const $ = getjQuery()\n const typeEvent = getTypeEvent(event)\n const inNamespace = event !== typeEvent\n\n let jQueryEvent = null\n let bubbles = true\n let nativeDispatch = true\n let defaultPrevented = false\n\n if (inNamespace && $) {\n jQueryEvent = $.Event(event, args)\n\n $(element).trigger(jQueryEvent)\n bubbles = !jQueryEvent.isPropagationStopped()\n nativeDispatch = !jQueryEvent.isImmediatePropagationStopped()\n defaultPrevented = jQueryEvent.isDefaultPrevented()\n }\n\n const evt = hydrateObj(new Event(event, { bubbles, cancelable: true }), args)\n\n if (defaultPrevented) {\n evt.preventDefault()\n }\n\n if (nativeDispatch) {\n element.dispatchEvent(evt)\n }\n\n if (evt.defaultPrevented && jQueryEvent) {\n jQueryEvent.preventDefault()\n }\n\n return evt\n }\n}\n\nfunction hydrateObj(obj, meta = {}) {\n for (const [key, value] of Object.entries(meta)) {\n try {\n obj[key] = value\n } catch {\n Object.defineProperty(obj, key, {\n configurable: true,\n get() {\n return value\n }\n })\n }\n }\n\n return obj\n}\n\nexport default EventHandler\n", "/**\n * --------------------------------------------------------------------------\n * Bootstrap dom/manipulator.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nfunction normalizeData(value) {\n if (value === 'true') {\n return true\n }\n\n if (value === 'false') {\n return false\n }\n\n if (value === Number(value).toString()) {\n return Number(value)\n }\n\n if (value === '' || value === 'null') {\n return null\n }\n\n if (typeof value !== 'string') {\n return value\n }\n\n try {\n return JSON.parse(decodeURIComponent(value))\n } catch {\n return value\n }\n}\n\nfunction normalizeDataKey(key) {\n return key.replace(/[A-Z]/g, chr => `-${chr.toLowerCase()}`)\n}\n\nconst Manipulator = {\n setDataAttribute(element, key, value) {\n element.setAttribute(`data-bs-${normalizeDataKey(key)}`, value)\n },\n\n removeDataAttribute(element, key) {\n element.removeAttribute(`data-bs-${normalizeDataKey(key)}`)\n },\n\n getDataAttributes(element) {\n if (!element) {\n return {}\n }\n\n const attributes = {}\n const bsKeys = Object.keys(element.dataset).filter(key => key.startsWith('bs') && !key.startsWith('bsConfig'))\n\n for (const key of bsKeys) {\n let pureKey = key.replace(/^bs/, '')\n pureKey = pureKey.charAt(0).toLowerCase() + pureKey.slice(1)\n attributes[pureKey] = normalizeData(element.dataset[key])\n }\n\n return attributes\n },\n\n getDataAttribute(element, key) {\n return normalizeData(element.getAttribute(`data-bs-${normalizeDataKey(key)}`))\n }\n}\n\nexport default Manipulator\n", "/**\n * --------------------------------------------------------------------------\n * Bootstrap util/config.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport Manipulator from '../dom/manipulator.js'\nimport { isElement, toType } from './index.js'\n\n/**\n * Class definition\n */\n\nclass Config {\n // Getters\n static get Default() {\n return {}\n }\n\n static get DefaultType() {\n return {}\n }\n\n static get NAME() {\n throw new Error('You have to implement the static method \"NAME\", for each component!')\n }\n\n _getConfig(config) {\n config = this._mergeConfigObj(config)\n config = this._configAfterMerge(config)\n this._typeCheckConfig(config)\n return config\n }\n\n _configAfterMerge(config) {\n return config\n }\n\n _mergeConfigObj(config, element) {\n const jsonConfig = isElement(element) ? Manipulator.getDataAttribute(element, 'config') : {} // try to parse\n\n return {\n ...this.constructor.Default,\n ...(typeof jsonConfig === 'object' ? jsonConfig : {}),\n ...(isElement(element) ? Manipulator.getDataAttributes(element) : {}),\n ...(typeof config === 'object' ? config : {})\n }\n }\n\n _typeCheckConfig(config, configTypes = this.constructor.DefaultType) {\n for (const [property, expectedTypes] of Object.entries(configTypes)) {\n const value = config[property]\n const valueType = isElement(value) ? 'element' : toType(value)\n\n if (!new RegExp(expectedTypes).test(valueType)) {\n throw new TypeError(\n `${this.constructor.NAME.toUpperCase()}: Option \"${property}\" provided type \"${valueType}\" but expected type \"${expectedTypes}\".`\n )\n }\n }\n }\n}\n\nexport default Config\n", "/**\n * --------------------------------------------------------------------------\n * Bootstrap base-component.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport Data from './dom/data.js'\nimport EventHandler from './dom/event-handler.js'\nimport Config from './util/config.js'\nimport { executeAfterTransition, getElement } from './util/index.js'\n\n/**\n * Constants\n */\n\nconst VERSION = '5.3.8'\n\n/**\n * Class definition\n */\n\nclass BaseComponent extends Config {\n constructor(element, config) {\n super()\n\n element = getElement(element)\n if (!element) {\n return\n }\n\n this._element = element\n this._config = this._getConfig(config)\n\n Data.set(this._element, this.constructor.DATA_KEY, this)\n }\n\n // Public\n dispose() {\n Data.remove(this._element, this.constructor.DATA_KEY)\n EventHandler.off(this._element, this.constructor.EVENT_KEY)\n\n for (const propertyName of Object.getOwnPropertyNames(this)) {\n this[propertyName] = null\n }\n }\n\n // Private\n _queueCallback(callback, element, isAnimated = true) {\n executeAfterTransition(callback, element, isAnimated)\n }\n\n _getConfig(config) {\n config = this._mergeConfigObj(config, this._element)\n config = this._configAfterMerge(config)\n this._typeCheckConfig(config)\n return config\n }\n\n // Static\n static getInstance(element) {\n return Data.get(getElement(element), this.DATA_KEY)\n }\n\n static getOrCreateInstance(element, config = {}) {\n return this.getInstance(element) || new this(element, typeof config === 'object' ? config : null)\n }\n\n static get VERSION() {\n return VERSION\n }\n\n static get DATA_KEY() {\n return `bs.${this.NAME}`\n }\n\n static get EVENT_KEY() {\n return `.${this.DATA_KEY}`\n }\n\n static eventName(name) {\n return `${name}${this.EVENT_KEY}`\n }\n}\n\nexport default BaseComponent\n", "/**\n * --------------------------------------------------------------------------\n * Bootstrap dom/selector-engine.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport { isDisabled, isVisible, parseSelector } from '../util/index.js'\n\nconst getSelector = element => {\n let selector = element.getAttribute('data-bs-target')\n\n if (!selector || selector === '#') {\n let hrefAttribute = element.getAttribute('href')\n\n // The only valid content that could double as a selector are IDs or classes,\n // so everything starting with `#` or `.`. If a \"real\" URL is used as the selector,\n // `document.querySelector` will rightfully complain it is invalid.\n // See https://github.com/twbs/bootstrap/issues/32273\n if (!hrefAttribute || (!hrefAttribute.includes('#') && !hrefAttribute.startsWith('.'))) {\n return null\n }\n\n // Just in case some CMS puts out a full URL with the anchor appended\n if (hrefAttribute.includes('#') && !hrefAttribute.startsWith('#')) {\n hrefAttribute = `#${hrefAttribute.split('#')[1]}`\n }\n\n selector = hrefAttribute && hrefAttribute !== '#' ? hrefAttribute.trim() : null\n }\n\n return selector ? selector.split(',').map(sel => parseSelector(sel)).join(',') : null\n}\n\nconst SelectorEngine = {\n find(selector, element = document.documentElement) {\n return [].concat(...Element.prototype.querySelectorAll.call(element, selector))\n },\n\n findOne(selector, element = document.documentElement) {\n return Element.prototype.querySelector.call(element, selector)\n },\n\n children(element, selector) {\n return [].concat(...element.children).filter(child => child.matches(selector))\n },\n\n parents(element, selector) {\n const parents = []\n let ancestor = element.parentNode.closest(selector)\n\n while (ancestor) {\n parents.push(ancestor)\n ancestor = ancestor.parentNode.closest(selector)\n }\n\n return parents\n },\n\n prev(element, selector) {\n let previous = element.previousElementSibling\n\n while (previous) {\n if (previous.matches(selector)) {\n return [previous]\n }\n\n previous = previous.previousElementSibling\n }\n\n return []\n },\n // TODO: this is now unused; remove later along with prev()\n next(element, selector) {\n let next = element.nextElementSibling\n\n while (next) {\n if (next.matches(selector)) {\n return [next]\n }\n\n next = next.nextElementSibling\n }\n\n return []\n },\n\n focusableChildren(element) {\n const focusables = [\n 'a',\n 'button',\n 'input',\n 'textarea',\n 'select',\n 'details',\n '[tabindex]',\n '[contenteditable=\"true\"]'\n ].map(selector => `${selector}:not([tabindex^=\"-\"])`).join(',')\n\n return this.find(focusables, element).filter(el => !isDisabled(el) && isVisible(el))\n },\n\n getSelectorFromElement(element) {\n const selector = getSelector(element)\n\n if (selector) {\n return SelectorEngine.findOne(selector) ? selector : null\n }\n\n return null\n },\n\n getElementFromSelector(element) {\n const selector = getSelector(element)\n\n return selector ? SelectorEngine.findOne(selector) : null\n },\n\n getMultipleElementsFromSelector(element) {\n const selector = getSelector(element)\n\n return selector ? SelectorEngine.find(selector) : []\n }\n}\n\nexport default SelectorEngine\n", "/**\n * --------------------------------------------------------------------------\n * Bootstrap util/component-functions.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport EventHandler from '../dom/event-handler.js'\nimport SelectorEngine from '../dom/selector-engine.js'\nimport { isDisabled } from './index.js'\n\nconst enableDismissTrigger = (component, method = 'hide') => {\n const clickEvent = `click.dismiss${component.EVENT_KEY}`\n const name = component.NAME\n\n EventHandler.on(document, clickEvent, `[data-bs-dismiss=\"${name}\"]`, function (event) {\n if (['A', 'AREA'].includes(this.tagName)) {\n event.preventDefault()\n }\n\n if (isDisabled(this)) {\n return\n }\n\n const target = SelectorEngine.getElementFromSelector(this) || this.closest(`.${name}`)\n const instance = component.getOrCreateInstance(target)\n\n // Method argument is left, for Alert and only, as it doesn't implement the 'hide' method\n instance[method]()\n })\n}\n\nexport {\n enableDismissTrigger\n}\n", "/**\n * --------------------------------------------------------------------------\n * Bootstrap alert.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport BaseComponent from './base-component.js'\nimport EventHandler from './dom/event-handler.js'\nimport { enableDismissTrigger } from './util/component-functions.js'\nimport { defineJQueryPlugin } from './util/index.js'\n\n/**\n * Constants\n */\n\nconst NAME = 'alert'\nconst DATA_KEY = 'bs.alert'\nconst EVENT_KEY = `.${DATA_KEY}`\n\nconst EVENT_CLOSE = `close${EVENT_KEY}`\nconst EVENT_CLOSED = `closed${EVENT_KEY}`\nconst CLASS_NAME_FADE = 'fade'\nconst CLASS_NAME_SHOW = 'show'\n\n/**\n * Class definition\n */\n\nclass Alert extends BaseComponent {\n // Getters\n static get NAME() {\n return NAME\n }\n\n // Public\n close() {\n const closeEvent = EventHandler.trigger(this._element, EVENT_CLOSE)\n\n if (closeEvent.defaultPrevented) {\n return\n }\n\n this._element.classList.remove(CLASS_NAME_SHOW)\n\n const isAnimated = this._element.classList.contains(CLASS_NAME_FADE)\n this._queueCallback(() => this._destroyElement(), this._element, isAnimated)\n }\n\n // Private\n _destroyElement() {\n this._element.remove()\n EventHandler.trigger(this._element, EVENT_CLOSED)\n this.dispose()\n }\n\n // Static\n static jQueryInterface(config) {\n return this.each(function () {\n const data = Alert.getOrCreateInstance(this)\n\n if (typeof config !== 'string') {\n return\n }\n\n if (data[config] === undefined || config.startsWith('_') || config === 'constructor') {\n throw new TypeError(`No method named \"${config}\"`)\n }\n\n data[config](this)\n })\n }\n}\n\n/**\n * Data API implementation\n */\n\nenableDismissTrigger(Alert, 'close')\n\n/**\n * jQuery\n */\n\ndefineJQueryPlugin(Alert)\n\nexport default Alert\n", "/**\n * --------------------------------------------------------------------------\n * Bootstrap button.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport BaseComponent from './base-component.js'\nimport EventHandler from './dom/event-handler.js'\nimport { defineJQueryPlugin } from './util/index.js'\n\n/**\n * Constants\n */\n\nconst NAME = 'button'\nconst DATA_KEY = 'bs.button'\nconst EVENT_KEY = `.${DATA_KEY}`\nconst DATA_API_KEY = '.data-api'\n\nconst CLASS_NAME_ACTIVE = 'active'\nconst SELECTOR_DATA_TOGGLE = '[data-bs-toggle=\"button\"]'\nconst EVENT_CLICK_DATA_API = `click${EVENT_KEY}${DATA_API_KEY}`\n\n/**\n * Class definition\n */\n\nclass Button extends BaseComponent {\n // Getters\n static get NAME() {\n return NAME\n }\n\n // Public\n toggle() {\n // Toggle class and sync the `aria-pressed` attribute with the return value of the `.toggle()` method\n this._element.setAttribute('aria-pressed', this._element.classList.toggle(CLASS_NAME_ACTIVE))\n }\n\n // Static\n static jQueryInterface(config) {\n return this.each(function () {\n const data = Button.getOrCreateInstance(this)\n\n if (config === 'toggle') {\n data[config]()\n }\n })\n }\n}\n\n/**\n * Data API implementation\n */\n\nEventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, event => {\n event.preventDefault()\n\n const button = event.target.closest(SELECTOR_DATA_TOGGLE)\n const data = Button.getOrCreateInstance(button)\n\n data.toggle()\n})\n\n/**\n * jQuery\n */\n\ndefineJQueryPlugin(Button)\n\nexport default Button\n", "/**\n * --------------------------------------------------------------------------\n * Bootstrap util/swipe.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport EventHandler from '../dom/event-handler.js'\nimport Config from './config.js'\nimport { execute } from './index.js'\n\n/**\n * Constants\n */\n\nconst NAME = 'swipe'\nconst EVENT_KEY = '.bs.swipe'\nconst EVENT_TOUCHSTART = `touchstart${EVENT_KEY}`\nconst EVENT_TOUCHMOVE = `touchmove${EVENT_KEY}`\nconst EVENT_TOUCHEND = `touchend${EVENT_KEY}`\nconst EVENT_POINTERDOWN = `pointerdown${EVENT_KEY}`\nconst EVENT_POINTERUP = `pointerup${EVENT_KEY}`\nconst POINTER_TYPE_TOUCH = 'touch'\nconst POINTER_TYPE_PEN = 'pen'\nconst CLASS_NAME_POINTER_EVENT = 'pointer-event'\nconst SWIPE_THRESHOLD = 40\n\nconst Default = {\n endCallback: null,\n leftCallback: null,\n rightCallback: null\n}\n\nconst DefaultType = {\n endCallback: '(function|null)',\n leftCallback: '(function|null)',\n rightCallback: '(function|null)'\n}\n\n/**\n * Class definition\n */\n\nclass Swipe extends Config {\n constructor(element, config) {\n super()\n this._element = element\n\n if (!element || !Swipe.isSupported()) {\n return\n }\n\n this._config = this._getConfig(config)\n this._deltaX = 0\n this._supportPointerEvents = Boolean(window.PointerEvent)\n this._initEvents()\n }\n\n // Getters\n static get Default() {\n return Default\n }\n\n static get DefaultType() {\n return DefaultType\n }\n\n static get NAME() {\n return NAME\n }\n\n // Public\n dispose() {\n EventHandler.off(this._element, EVENT_KEY)\n }\n\n // Private\n _start(event) {\n if (!this._supportPointerEvents) {\n this._deltaX = event.touches[0].clientX\n\n return\n }\n\n if (this._eventIsPointerPenTouch(event)) {\n this._deltaX = event.clientX\n }\n }\n\n _end(event) {\n if (this._eventIsPointerPenTouch(event)) {\n this._deltaX = event.clientX - this._deltaX\n }\n\n this._handleSwipe()\n execute(this._config.endCallback)\n }\n\n _move(event) {\n this._deltaX = event.touches && event.touches.length > 1 ?\n 0 :\n event.touches[0].clientX - this._deltaX\n }\n\n _handleSwipe() {\n const absDeltaX = Math.abs(this._deltaX)\n\n if (absDeltaX <= SWIPE_THRESHOLD) {\n return\n }\n\n const direction = absDeltaX / this._deltaX\n\n this._deltaX = 0\n\n if (!direction) {\n return\n }\n\n execute(direction > 0 ? this._config.rightCallback : this._config.leftCallback)\n }\n\n _initEvents() {\n if (this._supportPointerEvents) {\n EventHandler.on(this._element, EVENT_POINTERDOWN, event => this._start(event))\n EventHandler.on(this._element, EVENT_POINTERUP, event => this._end(event))\n\n this._element.classList.add(CLASS_NAME_POINTER_EVENT)\n } else {\n EventHandler.on(this._element, EVENT_TOUCHSTART, event => this._start(event))\n EventHandler.on(this._element, EVENT_TOUCHMOVE, event => this._move(event))\n EventHandler.on(this._element, EVENT_TOUCHEND, event => this._end(event))\n }\n }\n\n _eventIsPointerPenTouch(event) {\n return this._supportPointerEvents && (event.pointerType === POINTER_TYPE_PEN || event.pointerType === POINTER_TYPE_TOUCH)\n }\n\n // Static\n static isSupported() {\n return 'ontouchstart' in document.documentElement || navigator.maxTouchPoints > 0\n }\n}\n\nexport default Swipe\n", "/**\n * --------------------------------------------------------------------------\n * Bootstrap carousel.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport BaseComponent from './base-component.js'\nimport EventHandler from './dom/event-handler.js'\nimport Manipulator from './dom/manipulator.js'\nimport SelectorEngine from './dom/selector-engine.js'\nimport {\n defineJQueryPlugin,\n getNextActiveElement,\n isRTL,\n isVisible,\n reflow,\n triggerTransitionEnd\n} from './util/index.js'\nimport Swipe from './util/swipe.js'\n\n/**\n * Constants\n */\n\nconst NAME = 'carousel'\nconst DATA_KEY = 'bs.carousel'\nconst EVENT_KEY = `.${DATA_KEY}`\nconst DATA_API_KEY = '.data-api'\n\nconst ARROW_LEFT_KEY = 'ArrowLeft'\nconst ARROW_RIGHT_KEY = 'ArrowRight'\nconst TOUCHEVENT_COMPAT_WAIT = 500 // Time for mouse compat events to fire after touch\n\nconst ORDER_NEXT = 'next'\nconst ORDER_PREV = 'prev'\nconst DIRECTION_LEFT = 'left'\nconst DIRECTION_RIGHT = 'right'\n\nconst EVENT_SLIDE = `slide${EVENT_KEY}`\nconst EVENT_SLID = `slid${EVENT_KEY}`\nconst EVENT_KEYDOWN = `keydown${EVENT_KEY}`\nconst EVENT_MOUSEENTER = `mouseenter${EVENT_KEY}`\nconst EVENT_MOUSELEAVE = `mouseleave${EVENT_KEY}`\nconst EVENT_DRAG_START = `dragstart${EVENT_KEY}`\nconst EVENT_LOAD_DATA_API = `load${EVENT_KEY}${DATA_API_KEY}`\nconst EVENT_CLICK_DATA_API = `click${EVENT_KEY}${DATA_API_KEY}`\n\nconst CLASS_NAME_CAROUSEL = 'carousel'\nconst CLASS_NAME_ACTIVE = 'active'\nconst CLASS_NAME_SLIDE = 'slide'\nconst CLASS_NAME_END = 'carousel-item-end'\nconst CLASS_NAME_START = 'carousel-item-start'\nconst CLASS_NAME_NEXT = 'carousel-item-next'\nconst CLASS_NAME_PREV = 'carousel-item-prev'\n\nconst SELECTOR_ACTIVE = '.active'\nconst SELECTOR_ITEM = '.carousel-item'\nconst SELECTOR_ACTIVE_ITEM = SELECTOR_ACTIVE + SELECTOR_ITEM\nconst SELECTOR_ITEM_IMG = '.carousel-item img'\nconst SELECTOR_INDICATORS = '.carousel-indicators'\nconst SELECTOR_DATA_SLIDE = '[data-bs-slide], [data-bs-slide-to]'\nconst SELECTOR_DATA_RIDE = '[data-bs-ride=\"carousel\"]'\n\nconst KEY_TO_DIRECTION = {\n [ARROW_LEFT_KEY]: DIRECTION_RIGHT,\n [ARROW_RIGHT_KEY]: DIRECTION_LEFT\n}\n\nconst Default = {\n interval: 5000,\n keyboard: true,\n pause: 'hover',\n ride: false,\n touch: true,\n wrap: true\n}\n\nconst DefaultType = {\n interval: '(number|boolean)', // TODO:v6 remove boolean support\n keyboard: 'boolean',\n pause: '(string|boolean)',\n ride: '(boolean|string)',\n touch: 'boolean',\n wrap: 'boolean'\n}\n\n/**\n * Class definition\n */\n\nclass Carousel extends BaseComponent {\n constructor(element, config) {\n super(element, config)\n\n this._interval = null\n this._activeElement = null\n this._isSliding = false\n this.touchTimeout = null\n this._swipeHelper = null\n\n this._indicatorsElement = SelectorEngine.findOne(SELECTOR_INDICATORS, this._element)\n this._addEventListeners()\n\n if (this._config.ride === CLASS_NAME_CAROUSEL) {\n this.cycle()\n }\n }\n\n // Getters\n static get Default() {\n return Default\n }\n\n static get DefaultType() {\n return DefaultType\n }\n\n static get NAME() {\n return NAME\n }\n\n // Public\n next() {\n this._slide(ORDER_NEXT)\n }\n\n nextWhenVisible() {\n // FIXME TODO use `document.visibilityState`\n // Don't call next when the page isn't visible\n // or the carousel or its parent isn't visible\n if (!document.hidden && isVisible(this._element)) {\n this.next()\n }\n }\n\n prev() {\n this._slide(ORDER_PREV)\n }\n\n pause() {\n if (this._isSliding) {\n triggerTransitionEnd(this._element)\n }\n\n this._clearInterval()\n }\n\n cycle() {\n this._clearInterval()\n this._updateInterval()\n\n this._interval = setInterval(() => this.nextWhenVisible(), this._config.interval)\n }\n\n _maybeEnableCycle() {\n if (!this._config.ride) {\n return\n }\n\n if (this._isSliding) {\n EventHandler.one(this._element, EVENT_SLID, () => this.cycle())\n return\n }\n\n this.cycle()\n }\n\n to(index) {\n const items = this._getItems()\n if (index > items.length - 1 || index < 0) {\n return\n }\n\n if (this._isSliding) {\n EventHandler.one(this._element, EVENT_SLID, () => this.to(index))\n return\n }\n\n const activeIndex = this._getItemIndex(this._getActive())\n if (activeIndex === index) {\n return\n }\n\n const order = index > activeIndex ? ORDER_NEXT : ORDER_PREV\n\n this._slide(order, items[index])\n }\n\n dispose() {\n if (this._swipeHelper) {\n this._swipeHelper.dispose()\n }\n\n super.dispose()\n }\n\n // Private\n _configAfterMerge(config) {\n config.defaultInterval = config.interval\n return config\n }\n\n _addEventListeners() {\n if (this._config.keyboard) {\n EventHandler.on(this._element, EVENT_KEYDOWN, event => this._keydown(event))\n }\n\n if (this._config.pause === 'hover') {\n EventHandler.on(this._element, EVENT_MOUSEENTER, () => this.pause())\n EventHandler.on(this._element, EVENT_MOUSELEAVE, () => this._maybeEnableCycle())\n }\n\n if (this._config.touch && Swipe.isSupported()) {\n this._addTouchEventListeners()\n }\n }\n\n _addTouchEventListeners() {\n for (const img of SelectorEngine.find(SELECTOR_ITEM_IMG, this._element)) {\n EventHandler.on(img, EVENT_DRAG_START, event => event.preventDefault())\n }\n\n const endCallBack = () => {\n if (this._config.pause !== 'hover') {\n return\n }\n\n // If it's a touch-enabled device, mouseenter/leave are fired as\n // part of the mouse compatibility events on first tap - the carousel\n // would stop cycling until user tapped out of it;\n // here, we listen for touchend, explicitly pause the carousel\n // (as if it's the second time we tap on it, mouseenter compat event\n // is NOT fired) and after a timeout (to allow for mouse compatibility\n // events to fire) we explicitly restart cycling\n\n this.pause()\n if (this.touchTimeout) {\n clearTimeout(this.touchTimeout)\n }\n\n this.touchTimeout = setTimeout(() => this._maybeEnableCycle(), TOUCHEVENT_COMPAT_WAIT + this._config.interval)\n }\n\n const swipeConfig = {\n leftCallback: () => this._slide(this._directionToOrder(DIRECTION_LEFT)),\n rightCallback: () => this._slide(this._directionToOrder(DIRECTION_RIGHT)),\n endCallback: endCallBack\n }\n\n this._swipeHelper = new Swipe(this._element, swipeConfig)\n }\n\n _keydown(event) {\n if (/input|textarea/i.test(event.target.tagName)) {\n return\n }\n\n const direction = KEY_TO_DIRECTION[event.key]\n if (direction) {\n event.preventDefault()\n this._slide(this._directionToOrder(direction))\n }\n }\n\n _getItemIndex(element) {\n return this._getItems().indexOf(element)\n }\n\n _setActiveIndicatorElement(index) {\n if (!this._indicatorsElement) {\n return\n }\n\n const activeIndicator = SelectorEngine.findOne(SELECTOR_ACTIVE, this._indicatorsElement)\n\n activeIndicator.classList.remove(CLASS_NAME_ACTIVE)\n activeIndicator.removeAttribute('aria-current')\n\n const newActiveIndicator = SelectorEngine.findOne(`[data-bs-slide-to=\"${index}\"]`, this._indicatorsElement)\n\n if (newActiveIndicator) {\n newActiveIndicator.classList.add(CLASS_NAME_ACTIVE)\n newActiveIndicator.setAttribute('aria-current', 'true')\n }\n }\n\n _updateInterval() {\n const element = this._activeElement || this._getActive()\n\n if (!element) {\n return\n }\n\n const elementInterval = Number.parseInt(element.getAttribute('data-bs-interval'), 10)\n\n this._config.interval = elementInterval || this._config.defaultInterval\n }\n\n _slide(order, element = null) {\n if (this._isSliding) {\n return\n }\n\n const activeElement = this._getActive()\n const isNext = order === ORDER_NEXT\n const nextElement = element || getNextActiveElement(this._getItems(), activeElement, isNext, this._config.wrap)\n\n if (nextElement === activeElement) {\n return\n }\n\n const nextElementIndex = this._getItemIndex(nextElement)\n\n const triggerEvent = eventName => {\n return EventHandler.trigger(this._element, eventName, {\n relatedTarget: nextElement,\n direction: this._orderToDirection(order),\n from: this._getItemIndex(activeElement),\n to: nextElementIndex\n })\n }\n\n const slideEvent = triggerEvent(EVENT_SLIDE)\n\n if (slideEvent.defaultPrevented) {\n return\n }\n\n if (!activeElement || !nextElement) {\n // Some weirdness is happening, so we bail\n // TODO: change tests that use empty divs to avoid this check\n return\n }\n\n const isCycling = Boolean(this._interval)\n this.pause()\n\n this._isSliding = true\n\n this._setActiveIndicatorElement(nextElementIndex)\n this._activeElement = nextElement\n\n const directionalClassName = isNext ? CLASS_NAME_START : CLASS_NAME_END\n const orderClassName = isNext ? CLASS_NAME_NEXT : CLASS_NAME_PREV\n\n nextElement.classList.add(orderClassName)\n\n reflow(nextElement)\n\n activeElement.classList.add(directionalClassName)\n nextElement.classList.add(directionalClassName)\n\n const completeCallBack = () => {\n nextElement.classList.remove(directionalClassName, orderClassName)\n nextElement.classList.add(CLASS_NAME_ACTIVE)\n\n activeElement.classList.remove(CLASS_NAME_ACTIVE, orderClassName, directionalClassName)\n\n this._isSliding = false\n\n triggerEvent(EVENT_SLID)\n }\n\n this._queueCallback(completeCallBack, activeElement, this._isAnimated())\n\n if (isCycling) {\n this.cycle()\n }\n }\n\n _isAnimated() {\n return this._element.classList.contains(CLASS_NAME_SLIDE)\n }\n\n _getActive() {\n return SelectorEngine.findOne(SELECTOR_ACTIVE_ITEM, this._element)\n }\n\n _getItems() {\n return SelectorEngine.find(SELECTOR_ITEM, this._element)\n }\n\n _clearInterval() {\n if (this._interval) {\n clearInterval(this._interval)\n this._interval = null\n }\n }\n\n _directionToOrder(direction) {\n if (isRTL()) {\n return direction === DIRECTION_LEFT ? ORDER_PREV : ORDER_NEXT\n }\n\n return direction === DIRECTION_LEFT ? ORDER_NEXT : ORDER_PREV\n }\n\n _orderToDirection(order) {\n if (isRTL()) {\n return order === ORDER_PREV ? DIRECTION_LEFT : DIRECTION_RIGHT\n }\n\n return order === ORDER_PREV ? DIRECTION_RIGHT : DIRECTION_LEFT\n }\n\n // Static\n static jQueryInterface(config) {\n return this.each(function () {\n const data = Carousel.getOrCreateInstance(this, config)\n\n if (typeof config === 'number') {\n data.to(config)\n return\n }\n\n if (typeof config === 'string') {\n if (data[config] === undefined || config.startsWith('_') || config === 'constructor') {\n throw new TypeError(`No method named \"${config}\"`)\n }\n\n data[config]()\n }\n })\n }\n}\n\n/**\n * Data API implementation\n */\n\nEventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_SLIDE, function (event) {\n const target = SelectorEngine.getElementFromSelector(this)\n\n if (!target || !target.classList.contains(CLASS_NAME_CAROUSEL)) {\n return\n }\n\n event.preventDefault()\n\n const carousel = Carousel.getOrCreateInstance(target)\n const slideIndex = this.getAttribute('data-bs-slide-to')\n\n if (slideIndex) {\n carousel.to(slideIndex)\n carousel._maybeEnableCycle()\n return\n }\n\n if (Manipulator.getDataAttribute(this, 'slide') === 'next') {\n carousel.next()\n carousel._maybeEnableCycle()\n return\n }\n\n carousel.prev()\n carousel._maybeEnableCycle()\n})\n\nEventHandler.on(window, EVENT_LOAD_DATA_API, () => {\n const carousels = SelectorEngine.find(SELECTOR_DATA_RIDE)\n\n for (const carousel of carousels) {\n Carousel.getOrCreateInstance(carousel)\n }\n})\n\n/**\n * jQuery\n */\n\ndefineJQueryPlugin(Carousel)\n\nexport default Carousel\n", "/**\n * --------------------------------------------------------------------------\n * Bootstrap collapse.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport BaseComponent from './base-component.js'\nimport EventHandler from './dom/event-handler.js'\nimport SelectorEngine from './dom/selector-engine.js'\nimport {\n defineJQueryPlugin,\n getElement,\n reflow\n} from './util/index.js'\n\n/**\n * Constants\n */\n\nconst NAME = 'collapse'\nconst DATA_KEY = 'bs.collapse'\nconst EVENT_KEY = `.${DATA_KEY}`\nconst DATA_API_KEY = '.data-api'\n\nconst EVENT_SHOW = `show${EVENT_KEY}`\nconst EVENT_SHOWN = `shown${EVENT_KEY}`\nconst EVENT_HIDE = `hide${EVENT_KEY}`\nconst EVENT_HIDDEN = `hidden${EVENT_KEY}`\nconst EVENT_CLICK_DATA_API = `click${EVENT_KEY}${DATA_API_KEY}`\n\nconst CLASS_NAME_SHOW = 'show'\nconst CLASS_NAME_COLLAPSE = 'collapse'\nconst CLASS_NAME_COLLAPSING = 'collapsing'\nconst CLASS_NAME_COLLAPSED = 'collapsed'\nconst CLASS_NAME_DEEPER_CHILDREN = `:scope .${CLASS_NAME_COLLAPSE} .${CLASS_NAME_COLLAPSE}`\nconst CLASS_NAME_HORIZONTAL = 'collapse-horizontal'\n\nconst WIDTH = 'width'\nconst HEIGHT = 'height'\n\nconst SELECTOR_ACTIVES = '.collapse.show, .collapse.collapsing'\nconst SELECTOR_DATA_TOGGLE = '[data-bs-toggle=\"collapse\"]'\n\nconst Default = {\n parent: null,\n toggle: true\n}\n\nconst DefaultType = {\n parent: '(null|element)',\n toggle: 'boolean'\n}\n\n/**\n * Class definition\n */\n\nclass Collapse extends BaseComponent {\n constructor(element, config) {\n super(element, config)\n\n this._isTransitioning = false\n this._triggerArray = []\n\n const toggleList = SelectorEngine.find(SELECTOR_DATA_TOGGLE)\n\n for (const elem of toggleList) {\n const selector = SelectorEngine.getSelectorFromElement(elem)\n const filterElement = SelectorEngine.find(selector)\n .filter(foundElement => foundElement === this._element)\n\n if (selector !== null && filterElement.length) {\n this._triggerArray.push(elem)\n }\n }\n\n this._initializeChildren()\n\n if (!this._config.parent) {\n this._addAriaAndCollapsedClass(this._triggerArray, this._isShown())\n }\n\n if (this._config.toggle) {\n this.toggle()\n }\n }\n\n // Getters\n static get Default() {\n return Default\n }\n\n static get DefaultType() {\n return DefaultType\n }\n\n static get NAME() {\n return NAME\n }\n\n // Public\n toggle() {\n if (this._isShown()) {\n this.hide()\n } else {\n this.show()\n }\n }\n\n show() {\n if (this._isTransitioning || this._isShown()) {\n return\n }\n\n let activeChildren = []\n\n // find active children\n if (this._config.parent) {\n activeChildren = this._getFirstLevelChildren(SELECTOR_ACTIVES)\n .filter(element => element !== this._element)\n .map(element => Collapse.getOrCreateInstance(element, { toggle: false }))\n }\n\n if (activeChildren.length && activeChildren[0]._isTransitioning) {\n return\n }\n\n const startEvent = EventHandler.trigger(this._element, EVENT_SHOW)\n if (startEvent.defaultPrevented) {\n return\n }\n\n for (const activeInstance of activeChildren) {\n activeInstance.hide()\n }\n\n const dimension = this._getDimension()\n\n this._element.classList.remove(CLASS_NAME_COLLAPSE)\n this._element.classList.add(CLASS_NAME_COLLAPSING)\n\n this._element.style[dimension] = 0\n\n this._addAriaAndCollapsedClass(this._triggerArray, true)\n this._isTransitioning = true\n\n const complete = () => {\n this._isTransitioning = false\n\n this._element.classList.remove(CLASS_NAME_COLLAPSING)\n this._element.classList.add(CLASS_NAME_COLLAPSE, CLASS_NAME_SHOW)\n\n this._element.style[dimension] = ''\n\n EventHandler.trigger(this._element, EVENT_SHOWN)\n }\n\n const capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1)\n const scrollSize = `scroll${capitalizedDimension}`\n\n this._queueCallback(complete, this._element, true)\n this._element.style[dimension] = `${this._element[scrollSize]}px`\n }\n\n hide() {\n if (this._isTransitioning || !this._isShown()) {\n return\n }\n\n const startEvent = EventHandler.trigger(this._element, EVENT_HIDE)\n if (startEvent.defaultPrevented) {\n return\n }\n\n const dimension = this._getDimension()\n\n this._element.style[dimension] = `${this._element.getBoundingClientRect()[dimension]}px`\n\n reflow(this._element)\n\n this._element.classList.add(CLASS_NAME_COLLAPSING)\n this._element.classList.remove(CLASS_NAME_COLLAPSE, CLASS_NAME_SHOW)\n\n for (const trigger of this._triggerArray) {\n const element = SelectorEngine.getElementFromSelector(trigger)\n\n if (element && !this._isShown(element)) {\n this._addAriaAndCollapsedClass([trigger], false)\n }\n }\n\n this._isTransitioning = true\n\n const complete = () => {\n this._isTransitioning = false\n this._element.classList.remove(CLASS_NAME_COLLAPSING)\n this._element.classList.add(CLASS_NAME_COLLAPSE)\n EventHandler.trigger(this._element, EVENT_HIDDEN)\n }\n\n this._element.style[dimension] = ''\n\n this._queueCallback(complete, this._element, true)\n }\n\n // Private\n _isShown(element = this._element) {\n return element.classList.contains(CLASS_NAME_SHOW)\n }\n\n _configAfterMerge(config) {\n config.toggle = Boolean(config.toggle) // Coerce string values\n config.parent = getElement(config.parent)\n return config\n }\n\n _getDimension() {\n return this._element.classList.contains(CLASS_NAME_HORIZONTAL) ? WIDTH : HEIGHT\n }\n\n _initializeChildren() {\n if (!this._config.parent) {\n return\n }\n\n const children = this._getFirstLevelChildren(SELECTOR_DATA_TOGGLE)\n\n for (const element of children) {\n const selected = SelectorEngine.getElementFromSelector(element)\n\n if (selected) {\n this._addAriaAndCollapsedClass([element], this._isShown(selected))\n }\n }\n }\n\n _getFirstLevelChildren(selector) {\n const children = SelectorEngine.find(CLASS_NAME_DEEPER_CHILDREN, this._config.parent)\n // remove children if greater depth\n return SelectorEngine.find(selector, this._config.parent).filter(element => !children.includes(element))\n }\n\n _addAriaAndCollapsedClass(triggerArray, isOpen) {\n if (!triggerArray.length) {\n return\n }\n\n for (const element of triggerArray) {\n element.classList.toggle(CLASS_NAME_COLLAPSED, !isOpen)\n element.setAttribute('aria-expanded', isOpen)\n }\n }\n\n // Static\n static jQueryInterface(config) {\n const _config = {}\n if (typeof config === 'string' && /show|hide/.test(config)) {\n _config.toggle = false\n }\n\n return this.each(function () {\n const data = Collapse.getOrCreateInstance(this, _config)\n\n if (typeof config === 'string') {\n if (typeof data[config] === 'undefined') {\n throw new TypeError(`No method named \"${config}\"`)\n }\n\n data[config]()\n }\n })\n }\n}\n\n/**\n * Data API implementation\n */\n\nEventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) {\n // preventDefault only for elements (which change the URL) not inside the collapsible element\n if (event.target.tagName === 'A' || (event.delegateTarget && event.delegateTarget.tagName === 'A')) {\n event.preventDefault()\n }\n\n for (const element of SelectorEngine.getMultipleElementsFromSelector(this)) {\n Collapse.getOrCreateInstance(element, { toggle: false }).toggle()\n }\n})\n\n/**\n * jQuery\n */\n\ndefineJQueryPlugin(Collapse)\n\nexport default Collapse\n", "/**\n * --------------------------------------------------------------------------\n * Bootstrap dropdown.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport * as Popper from '@popperjs/core'\nimport BaseComponent from './base-component.js'\nimport EventHandler from './dom/event-handler.js'\nimport Manipulator from './dom/manipulator.js'\nimport SelectorEngine from './dom/selector-engine.js'\nimport {\n defineJQueryPlugin,\n execute,\n getElement,\n getNextActiveElement,\n isDisabled,\n isElement,\n isRTL,\n isVisible,\n noop\n} from './util/index.js'\n\n/**\n * Constants\n */\n\nconst NAME = 'dropdown'\nconst DATA_KEY = 'bs.dropdown'\nconst EVENT_KEY = `.${DATA_KEY}`\nconst DATA_API_KEY = '.data-api'\n\nconst ESCAPE_KEY = 'Escape'\nconst TAB_KEY = 'Tab'\nconst ARROW_UP_KEY = 'ArrowUp'\nconst ARROW_DOWN_KEY = 'ArrowDown'\nconst RIGHT_MOUSE_BUTTON = 2 // MouseEvent.button value for the secondary button, usually the right button\n\nconst EVENT_HIDE = `hide${EVENT_KEY}`\nconst EVENT_HIDDEN = `hidden${EVENT_KEY}`\nconst EVENT_SHOW = `show${EVENT_KEY}`\nconst EVENT_SHOWN = `shown${EVENT_KEY}`\nconst EVENT_CLICK_DATA_API = `click${EVENT_KEY}${DATA_API_KEY}`\nconst EVENT_KEYDOWN_DATA_API = `keydown${EVENT_KEY}${DATA_API_KEY}`\nconst EVENT_KEYUP_DATA_API = `keyup${EVENT_KEY}${DATA_API_KEY}`\n\nconst CLASS_NAME_SHOW = 'show'\nconst CLASS_NAME_DROPUP = 'dropup'\nconst CLASS_NAME_DROPEND = 'dropend'\nconst CLASS_NAME_DROPSTART = 'dropstart'\nconst CLASS_NAME_DROPUP_CENTER = 'dropup-center'\nconst CLASS_NAME_DROPDOWN_CENTER = 'dropdown-center'\n\nconst SELECTOR_DATA_TOGGLE = '[data-bs-toggle=\"dropdown\"]:not(.disabled):not(:disabled)'\nconst SELECTOR_DATA_TOGGLE_SHOWN = `${SELECTOR_DATA_TOGGLE}.${CLASS_NAME_SHOW}`\nconst SELECTOR_MENU = '.dropdown-menu'\nconst SELECTOR_NAVBAR = '.navbar'\nconst SELECTOR_NAVBAR_NAV = '.navbar-nav'\nconst SELECTOR_VISIBLE_ITEMS = '.dropdown-menu .dropdown-item:not(.disabled):not(:disabled)'\n\nconst PLACEMENT_TOP = isRTL() ? 'top-end' : 'top-start'\nconst PLACEMENT_TOPEND = isRTL() ? 'top-start' : 'top-end'\nconst PLACEMENT_BOTTOM = isRTL() ? 'bottom-end' : 'bottom-start'\nconst PLACEMENT_BOTTOMEND = isRTL() ? 'bottom-start' : 'bottom-end'\nconst PLACEMENT_RIGHT = isRTL() ? 'left-start' : 'right-start'\nconst PLACEMENT_LEFT = isRTL() ? 'right-start' : 'left-start'\nconst PLACEMENT_TOPCENTER = 'top'\nconst PLACEMENT_BOTTOMCENTER = 'bottom'\n\nconst Default = {\n autoClose: true,\n boundary: 'clippingParents',\n display: 'dynamic',\n offset: [0, 2],\n popperConfig: null,\n reference: 'toggle'\n}\n\nconst DefaultType = {\n autoClose: '(boolean|string)',\n boundary: '(string|element)',\n display: 'string',\n offset: '(array|string|function)',\n popperConfig: '(null|object|function)',\n reference: '(string|element|object)'\n}\n\n/**\n * Class definition\n */\n\nclass Dropdown extends BaseComponent {\n constructor(element, config) {\n super(element, config)\n\n this._popper = null\n this._parent = this._element.parentNode // dropdown wrapper\n // TODO: v6 revert #37011 & change markup https://getbootstrap.com/docs/5.3/forms/input-group/\n this._menu = SelectorEngine.next(this._element, SELECTOR_MENU)[0] ||\n SelectorEngine.prev(this._element, SELECTOR_MENU)[0] ||\n SelectorEngine.findOne(SELECTOR_MENU, this._parent)\n this._inNavbar = this._detectNavbar()\n }\n\n // Getters\n static get Default() {\n return Default\n }\n\n static get DefaultType() {\n return DefaultType\n }\n\n static get NAME() {\n return NAME\n }\n\n // Public\n toggle() {\n return this._isShown() ? this.hide() : this.show()\n }\n\n show() {\n if (isDisabled(this._element) || this._isShown()) {\n return\n }\n\n const relatedTarget = {\n relatedTarget: this._element\n }\n\n const showEvent = EventHandler.trigger(this._element, EVENT_SHOW, relatedTarget)\n\n if (showEvent.defaultPrevented) {\n return\n }\n\n this._createPopper()\n\n // If this is a touch-enabled device we add extra\n // empty mouseover listeners to the body's immediate children;\n // only needed because of broken event delegation on iOS\n // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html\n if ('ontouchstart' in document.documentElement && !this._parent.closest(SELECTOR_NAVBAR_NAV)) {\n for (const element of [].concat(...document.body.children)) {\n EventHandler.on(element, 'mouseover', noop)\n }\n }\n\n this._element.focus()\n this._element.setAttribute('aria-expanded', true)\n\n this._menu.classList.add(CLASS_NAME_SHOW)\n this._element.classList.add(CLASS_NAME_SHOW)\n EventHandler.trigger(this._element, EVENT_SHOWN, relatedTarget)\n }\n\n hide() {\n if (isDisabled(this._element) || !this._isShown()) {\n return\n }\n\n const relatedTarget = {\n relatedTarget: this._element\n }\n\n this._completeHide(relatedTarget)\n }\n\n dispose() {\n if (this._popper) {\n this._popper.destroy()\n }\n\n super.dispose()\n }\n\n update() {\n this._inNavbar = this._detectNavbar()\n if (this._popper) {\n this._popper.update()\n }\n }\n\n // Private\n _completeHide(relatedTarget) {\n const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE, relatedTarget)\n if (hideEvent.defaultPrevented) {\n return\n }\n\n // If this is a touch-enabled device we remove the extra\n // empty mouseover listeners we added for iOS support\n if ('ontouchstart' in document.documentElement) {\n for (const element of [].concat(...document.body.children)) {\n EventHandler.off(element, 'mouseover', noop)\n }\n }\n\n if (this._popper) {\n this._popper.destroy()\n }\n\n this._menu.classList.remove(CLASS_NAME_SHOW)\n this._element.classList.remove(CLASS_NAME_SHOW)\n this._element.setAttribute('aria-expanded', 'false')\n Manipulator.removeDataAttribute(this._menu, 'popper')\n EventHandler.trigger(this._element, EVENT_HIDDEN, relatedTarget)\n }\n\n _getConfig(config) {\n config = super._getConfig(config)\n\n if (typeof config.reference === 'object' && !isElement(config.reference) &&\n typeof config.reference.getBoundingClientRect !== 'function'\n ) {\n // Popper virtual elements require a getBoundingClientRect method\n throw new TypeError(`${NAME.toUpperCase()}: Option \"reference\" provided type \"object\" without a required \"getBoundingClientRect\" method.`)\n }\n\n return config\n }\n\n _createPopper() {\n if (typeof Popper === 'undefined') {\n throw new TypeError('Bootstrap\\'s dropdowns require Popper (https://popper.js.org/docs/v2/)')\n }\n\n let referenceElement = this._element\n\n if (this._config.reference === 'parent') {\n referenceElement = this._parent\n } else if (isElement(this._config.reference)) {\n referenceElement = getElement(this._config.reference)\n } else if (typeof this._config.reference === 'object') {\n referenceElement = this._config.reference\n }\n\n const popperConfig = this._getPopperConfig()\n this._popper = Popper.createPopper(referenceElement, this._menu, popperConfig)\n }\n\n _isShown() {\n return this._menu.classList.contains(CLASS_NAME_SHOW)\n }\n\n _getPlacement() {\n const parentDropdown = this._parent\n\n if (parentDropdown.classList.contains(CLASS_NAME_DROPEND)) {\n return PLACEMENT_RIGHT\n }\n\n if (parentDropdown.classList.contains(CLASS_NAME_DROPSTART)) {\n return PLACEMENT_LEFT\n }\n\n if (parentDropdown.classList.contains(CLASS_NAME_DROPUP_CENTER)) {\n return PLACEMENT_TOPCENTER\n }\n\n if (parentDropdown.classList.contains(CLASS_NAME_DROPDOWN_CENTER)) {\n return PLACEMENT_BOTTOMCENTER\n }\n\n // We need to trim the value because custom properties can also include spaces\n const isEnd = getComputedStyle(this._menu).getPropertyValue('--bs-position').trim() === 'end'\n\n if (parentDropdown.classList.contains(CLASS_NAME_DROPUP)) {\n return isEnd ? PLACEMENT_TOPEND : PLACEMENT_TOP\n }\n\n return isEnd ? PLACEMENT_BOTTOMEND : PLACEMENT_BOTTOM\n }\n\n _detectNavbar() {\n return this._element.closest(SELECTOR_NAVBAR) !== null\n }\n\n _getOffset() {\n const { offset } = this._config\n\n if (typeof offset === 'string') {\n return offset.split(',').map(value => Number.parseInt(value, 10))\n }\n\n if (typeof offset === 'function') {\n return popperData => offset(popperData, this._element)\n }\n\n return offset\n }\n\n _getPopperConfig() {\n const defaultBsPopperConfig = {\n placement: this._getPlacement(),\n modifiers: [{\n name: 'preventOverflow',\n options: {\n boundary: this._config.boundary\n }\n },\n {\n name: 'offset',\n options: {\n offset: this._getOffset()\n }\n }]\n }\n\n // Disable Popper if we have a static display or Dropdown is in Navbar\n if (this._inNavbar || this._config.display === 'static') {\n Manipulator.setDataAttribute(this._menu, 'popper', 'static') // TODO: v6 remove\n defaultBsPopperConfig.modifiers = [{\n name: 'applyStyles',\n enabled: false\n }]\n }\n\n return {\n ...defaultBsPopperConfig,\n ...execute(this._config.popperConfig, [undefined, defaultBsPopperConfig])\n }\n }\n\n _selectMenuItem({ key, target }) {\n const items = SelectorEngine.find(SELECTOR_VISIBLE_ITEMS, this._menu).filter(element => isVisible(element))\n\n if (!items.length) {\n return\n }\n\n // if target isn't included in items (e.g. when expanding the dropdown)\n // allow cycling to get the last item in case key equals ARROW_UP_KEY\n getNextActiveElement(items, target, key === ARROW_DOWN_KEY, !items.includes(target)).focus()\n }\n\n // Static\n static jQueryInterface(config) {\n return this.each(function () {\n const data = Dropdown.getOrCreateInstance(this, config)\n\n if (typeof config !== 'string') {\n return\n }\n\n if (typeof data[config] === 'undefined') {\n throw new TypeError(`No method named \"${config}\"`)\n }\n\n data[config]()\n })\n }\n\n static clearMenus(event) {\n if (event.button === RIGHT_MOUSE_BUTTON || (event.type === 'keyup' && event.key !== TAB_KEY)) {\n return\n }\n\n const openToggles = SelectorEngine.find(SELECTOR_DATA_TOGGLE_SHOWN)\n\n for (const toggle of openToggles) {\n const context = Dropdown.getInstance(toggle)\n if (!context || context._config.autoClose === false) {\n continue\n }\n\n const composedPath = event.composedPath()\n const isMenuTarget = composedPath.includes(context._menu)\n if (\n composedPath.includes(context._element) ||\n (context._config.autoClose === 'inside' && !isMenuTarget) ||\n (context._config.autoClose === 'outside' && isMenuTarget)\n ) {\n continue\n }\n\n // Tab navigation through the dropdown menu or events from contained inputs shouldn't close the menu\n if (context._menu.contains(event.target) && ((event.type === 'keyup' && event.key === TAB_KEY) || /input|select|option|textarea|form/i.test(event.target.tagName))) {\n continue\n }\n\n const relatedTarget = { relatedTarget: context._element }\n\n if (event.type === 'click') {\n relatedTarget.clickEvent = event\n }\n\n context._completeHide(relatedTarget)\n }\n }\n\n static dataApiKeydownHandler(event) {\n // If not an UP | DOWN | ESCAPE key => not a dropdown command\n // If input/textarea && if key is other than ESCAPE => not a dropdown command\n\n const isInput = /input|textarea/i.test(event.target.tagName)\n const isEscapeEvent = event.key === ESCAPE_KEY\n const isUpOrDownEvent = [ARROW_UP_KEY, ARROW_DOWN_KEY].includes(event.key)\n\n if (!isUpOrDownEvent && !isEscapeEvent) {\n return\n }\n\n if (isInput && !isEscapeEvent) {\n return\n }\n\n event.preventDefault()\n\n // TODO: v6 revert #37011 & change markup https://getbootstrap.com/docs/5.3/forms/input-group/\n const getToggleButton = this.matches(SELECTOR_DATA_TOGGLE) ?\n this :\n (SelectorEngine.prev(this, SELECTOR_DATA_TOGGLE)[0] ||\n SelectorEngine.next(this, SELECTOR_DATA_TOGGLE)[0] ||\n SelectorEngine.findOne(SELECTOR_DATA_TOGGLE, event.delegateTarget.parentNode))\n\n const instance = Dropdown.getOrCreateInstance(getToggleButton)\n\n if (isUpOrDownEvent) {\n event.stopPropagation()\n instance.show()\n instance._selectMenuItem(event)\n return\n }\n\n if (instance._isShown()) { // else is escape and we check if it is shown\n event.stopPropagation()\n instance.hide()\n getToggleButton.focus()\n }\n }\n}\n\n/**\n * Data API implementation\n */\n\nEventHandler.on(document, EVENT_KEYDOWN_DATA_API, SELECTOR_DATA_TOGGLE, Dropdown.dataApiKeydownHandler)\nEventHandler.on(document, EVENT_KEYDOWN_DATA_API, SELECTOR_MENU, Dropdown.dataApiKeydownHandler)\nEventHandler.on(document, EVENT_CLICK_DATA_API, Dropdown.clearMenus)\nEventHandler.on(document, EVENT_KEYUP_DATA_API, Dropdown.clearMenus)\nEventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) {\n event.preventDefault()\n Dropdown.getOrCreateInstance(this).toggle()\n})\n\n/**\n * jQuery\n */\n\ndefineJQueryPlugin(Dropdown)\n\nexport default Dropdown\n", "/**\n * --------------------------------------------------------------------------\n * Bootstrap util/backdrop.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport EventHandler from '../dom/event-handler.js'\nimport Config from './config.js'\nimport {\n execute, executeAfterTransition, getElement, reflow\n} from './index.js'\n\n/**\n * Constants\n */\n\nconst NAME = 'backdrop'\nconst CLASS_NAME_FADE = 'fade'\nconst CLASS_NAME_SHOW = 'show'\nconst EVENT_MOUSEDOWN = `mousedown.bs.${NAME}`\n\nconst Default = {\n className: 'modal-backdrop',\n clickCallback: null,\n isAnimated: false,\n isVisible: true, // if false, we use the backdrop helper without adding any element to the dom\n rootElement: 'body' // give the choice to place backdrop under different elements\n}\n\nconst DefaultType = {\n className: 'string',\n clickCallback: '(function|null)',\n isAnimated: 'boolean',\n isVisible: 'boolean',\n rootElement: '(element|string)'\n}\n\n/**\n * Class definition\n */\n\nclass Backdrop extends Config {\n constructor(config) {\n super()\n this._config = this._getConfig(config)\n this._isAppended = false\n this._element = null\n }\n\n // Getters\n static get Default() {\n return Default\n }\n\n static get DefaultType() {\n return DefaultType\n }\n\n static get NAME() {\n return NAME\n }\n\n // Public\n show(callback) {\n if (!this._config.isVisible) {\n execute(callback)\n return\n }\n\n this._append()\n\n const element = this._getElement()\n if (this._config.isAnimated) {\n reflow(element)\n }\n\n element.classList.add(CLASS_NAME_SHOW)\n\n this._emulateAnimation(() => {\n execute(callback)\n })\n }\n\n hide(callback) {\n if (!this._config.isVisible) {\n execute(callback)\n return\n }\n\n this._getElement().classList.remove(CLASS_NAME_SHOW)\n\n this._emulateAnimation(() => {\n this.dispose()\n execute(callback)\n })\n }\n\n dispose() {\n if (!this._isAppended) {\n return\n }\n\n EventHandler.off(this._element, EVENT_MOUSEDOWN)\n\n this._element.remove()\n this._isAppended = false\n }\n\n // Private\n _getElement() {\n if (!this._element) {\n const backdrop = document.createElement('div')\n backdrop.className = this._config.className\n if (this._config.isAnimated) {\n backdrop.classList.add(CLASS_NAME_FADE)\n }\n\n this._element = backdrop\n }\n\n return this._element\n }\n\n _configAfterMerge(config) {\n // use getElement() with the default \"body\" to get a fresh Element on each instantiation\n config.rootElement = getElement(config.rootElement)\n return config\n }\n\n _append() {\n if (this._isAppended) {\n return\n }\n\n const element = this._getElement()\n this._config.rootElement.append(element)\n\n EventHandler.on(element, EVENT_MOUSEDOWN, () => {\n execute(this._config.clickCallback)\n })\n\n this._isAppended = true\n }\n\n _emulateAnimation(callback) {\n executeAfterTransition(callback, this._getElement(), this._config.isAnimated)\n }\n}\n\nexport default Backdrop\n", "/**\n * --------------------------------------------------------------------------\n * Bootstrap util/focustrap.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport EventHandler from '../dom/event-handler.js'\nimport SelectorEngine from '../dom/selector-engine.js'\nimport Config from './config.js'\n\n/**\n * Constants\n */\n\nconst NAME = 'focustrap'\nconst DATA_KEY = 'bs.focustrap'\nconst EVENT_KEY = `.${DATA_KEY}`\nconst EVENT_FOCUSIN = `focusin${EVENT_KEY}`\nconst EVENT_KEYDOWN_TAB = `keydown.tab${EVENT_KEY}`\n\nconst TAB_KEY = 'Tab'\nconst TAB_NAV_FORWARD = 'forward'\nconst TAB_NAV_BACKWARD = 'backward'\n\nconst Default = {\n autofocus: true,\n trapElement: null // The element to trap focus inside of\n}\n\nconst DefaultType = {\n autofocus: 'boolean',\n trapElement: 'element'\n}\n\n/**\n * Class definition\n */\n\nclass FocusTrap extends Config {\n constructor(config) {\n super()\n this._config = this._getConfig(config)\n this._isActive = false\n this._lastTabNavDirection = null\n }\n\n // Getters\n static get Default() {\n return Default\n }\n\n static get DefaultType() {\n return DefaultType\n }\n\n static get NAME() {\n return NAME\n }\n\n // Public\n activate() {\n if (this._isActive) {\n return\n }\n\n if (this._config.autofocus) {\n this._config.trapElement.focus()\n }\n\n EventHandler.off(document, EVENT_KEY) // guard against infinite focus loop\n EventHandler.on(document, EVENT_FOCUSIN, event => this._handleFocusin(event))\n EventHandler.on(document, EVENT_KEYDOWN_TAB, event => this._handleKeydown(event))\n\n this._isActive = true\n }\n\n deactivate() {\n if (!this._isActive) {\n return\n }\n\n this._isActive = false\n EventHandler.off(document, EVENT_KEY)\n }\n\n // Private\n _handleFocusin(event) {\n const { trapElement } = this._config\n\n if (event.target === document || event.target === trapElement || trapElement.contains(event.target)) {\n return\n }\n\n const elements = SelectorEngine.focusableChildren(trapElement)\n\n if (elements.length === 0) {\n trapElement.focus()\n } else if (this._lastTabNavDirection === TAB_NAV_BACKWARD) {\n elements[elements.length - 1].focus()\n } else {\n elements[0].focus()\n }\n }\n\n _handleKeydown(event) {\n if (event.key !== TAB_KEY) {\n return\n }\n\n this._lastTabNavDirection = event.shiftKey ? TAB_NAV_BACKWARD : TAB_NAV_FORWARD\n }\n}\n\nexport default FocusTrap\n", "/**\n * --------------------------------------------------------------------------\n * Bootstrap util/scrollBar.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport Manipulator from '../dom/manipulator.js'\nimport SelectorEngine from '../dom/selector-engine.js'\nimport { isElement } from './index.js'\n\n/**\n * Constants\n */\n\nconst SELECTOR_FIXED_CONTENT = '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top'\nconst SELECTOR_STICKY_CONTENT = '.sticky-top'\nconst PROPERTY_PADDING = 'padding-right'\nconst PROPERTY_MARGIN = 'margin-right'\n\n/**\n * Class definition\n */\n\nclass ScrollBarHelper {\n constructor() {\n this._element = document.body\n }\n\n // Public\n getWidth() {\n // https://developer.mozilla.org/en-US/docs/Web/API/Window/innerWidth#usage_notes\n const documentWidth = document.documentElement.clientWidth\n return Math.abs(window.innerWidth - documentWidth)\n }\n\n hide() {\n const width = this.getWidth()\n this._disableOverFlow()\n // give padding to element to balance the hidden scrollbar width\n this._setElementAttributes(this._element, PROPERTY_PADDING, calculatedValue => calculatedValue + width)\n // trick: We adjust positive paddingRight and negative marginRight to sticky-top elements to keep showing fullwidth\n this._setElementAttributes(SELECTOR_FIXED_CONTENT, PROPERTY_PADDING, calculatedValue => calculatedValue + width)\n this._setElementAttributes(SELECTOR_STICKY_CONTENT, PROPERTY_MARGIN, calculatedValue => calculatedValue - width)\n }\n\n reset() {\n this._resetElementAttributes(this._element, 'overflow')\n this._resetElementAttributes(this._element, PROPERTY_PADDING)\n this._resetElementAttributes(SELECTOR_FIXED_CONTENT, PROPERTY_PADDING)\n this._resetElementAttributes(SELECTOR_STICKY_CONTENT, PROPERTY_MARGIN)\n }\n\n isOverflowing() {\n return this.getWidth() > 0\n }\n\n // Private\n _disableOverFlow() {\n this._saveInitialAttribute(this._element, 'overflow')\n this._element.style.overflow = 'hidden'\n }\n\n _setElementAttributes(selector, styleProperty, callback) {\n const scrollbarWidth = this.getWidth()\n const manipulationCallBack = element => {\n if (element !== this._element && window.innerWidth > element.clientWidth + scrollbarWidth) {\n return\n }\n\n this._saveInitialAttribute(element, styleProperty)\n const calculatedValue = window.getComputedStyle(element).getPropertyValue(styleProperty)\n element.style.setProperty(styleProperty, `${callback(Number.parseFloat(calculatedValue))}px`)\n }\n\n this._applyManipulationCallback(selector, manipulationCallBack)\n }\n\n _saveInitialAttribute(element, styleProperty) {\n const actualValue = element.style.getPropertyValue(styleProperty)\n if (actualValue) {\n Manipulator.setDataAttribute(element, styleProperty, actualValue)\n }\n }\n\n _resetElementAttributes(selector, styleProperty) {\n const manipulationCallBack = element => {\n const value = Manipulator.getDataAttribute(element, styleProperty)\n // We only want to remove the property if the value is `null`; the value can also be zero\n if (value === null) {\n element.style.removeProperty(styleProperty)\n return\n }\n\n Manipulator.removeDataAttribute(element, styleProperty)\n element.style.setProperty(styleProperty, value)\n }\n\n this._applyManipulationCallback(selector, manipulationCallBack)\n }\n\n _applyManipulationCallback(selector, callBack) {\n if (isElement(selector)) {\n callBack(selector)\n return\n }\n\n for (const sel of SelectorEngine.find(selector, this._element)) {\n callBack(sel)\n }\n }\n}\n\nexport default ScrollBarHelper\n", "/**\n * --------------------------------------------------------------------------\n * Bootstrap modal.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport BaseComponent from './base-component.js'\nimport EventHandler from './dom/event-handler.js'\nimport SelectorEngine from './dom/selector-engine.js'\nimport Backdrop from './util/backdrop.js'\nimport { enableDismissTrigger } from './util/component-functions.js'\nimport FocusTrap from './util/focustrap.js'\nimport {\n defineJQueryPlugin, isRTL, isVisible, reflow\n} from './util/index.js'\nimport ScrollBarHelper from './util/scrollbar.js'\n\n/**\n * Constants\n */\n\nconst NAME = 'modal'\nconst DATA_KEY = 'bs.modal'\nconst EVENT_KEY = `.${DATA_KEY}`\nconst DATA_API_KEY = '.data-api'\nconst ESCAPE_KEY = 'Escape'\n\nconst EVENT_HIDE = `hide${EVENT_KEY}`\nconst EVENT_HIDE_PREVENTED = `hidePrevented${EVENT_KEY}`\nconst EVENT_HIDDEN = `hidden${EVENT_KEY}`\nconst EVENT_SHOW = `show${EVENT_KEY}`\nconst EVENT_SHOWN = `shown${EVENT_KEY}`\nconst EVENT_RESIZE = `resize${EVENT_KEY}`\nconst EVENT_CLICK_DISMISS = `click.dismiss${EVENT_KEY}`\nconst EVENT_MOUSEDOWN_DISMISS = `mousedown.dismiss${EVENT_KEY}`\nconst EVENT_KEYDOWN_DISMISS = `keydown.dismiss${EVENT_KEY}`\nconst EVENT_CLICK_DATA_API = `click${EVENT_KEY}${DATA_API_KEY}`\n\nconst CLASS_NAME_OPEN = 'modal-open'\nconst CLASS_NAME_FADE = 'fade'\nconst CLASS_NAME_SHOW = 'show'\nconst CLASS_NAME_STATIC = 'modal-static'\n\nconst OPEN_SELECTOR = '.modal.show'\nconst SELECTOR_DIALOG = '.modal-dialog'\nconst SELECTOR_MODAL_BODY = '.modal-body'\nconst SELECTOR_DATA_TOGGLE = '[data-bs-toggle=\"modal\"]'\n\nconst Default = {\n backdrop: true,\n focus: true,\n keyboard: true\n}\n\nconst DefaultType = {\n backdrop: '(boolean|string)',\n focus: 'boolean',\n keyboard: 'boolean'\n}\n\n/**\n * Class definition\n */\n\nclass Modal extends BaseComponent {\n constructor(element, config) {\n super(element, config)\n\n this._dialog = SelectorEngine.findOne(SELECTOR_DIALOG, this._element)\n this._backdrop = this._initializeBackDrop()\n this._focustrap = this._initializeFocusTrap()\n this._isShown = false\n this._isTransitioning = false\n this._scrollBar = new ScrollBarHelper()\n\n this._addEventListeners()\n }\n\n // Getters\n static get Default() {\n return Default\n }\n\n static get DefaultType() {\n return DefaultType\n }\n\n static get NAME() {\n return NAME\n }\n\n // Public\n toggle(relatedTarget) {\n return this._isShown ? this.hide() : this.show(relatedTarget)\n }\n\n show(relatedTarget) {\n if (this._isShown || this._isTransitioning) {\n return\n }\n\n const showEvent = EventHandler.trigger(this._element, EVENT_SHOW, {\n relatedTarget\n })\n\n if (showEvent.defaultPrevented) {\n return\n }\n\n this._isShown = true\n this._isTransitioning = true\n\n this._scrollBar.hide()\n\n document.body.classList.add(CLASS_NAME_OPEN)\n\n this._adjustDialog()\n\n this._backdrop.show(() => this._showElement(relatedTarget))\n }\n\n hide() {\n if (!this._isShown || this._isTransitioning) {\n return\n }\n\n const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE)\n\n if (hideEvent.defaultPrevented) {\n return\n }\n\n this._isShown = false\n this._isTransitioning = true\n this._focustrap.deactivate()\n\n this._element.classList.remove(CLASS_NAME_SHOW)\n\n this._queueCallback(() => this._hideModal(), this._element, this._isAnimated())\n }\n\n dispose() {\n EventHandler.off(window, EVENT_KEY)\n EventHandler.off(this._dialog, EVENT_KEY)\n\n this._backdrop.dispose()\n this._focustrap.deactivate()\n\n super.dispose()\n }\n\n handleUpdate() {\n this._adjustDialog()\n }\n\n // Private\n _initializeBackDrop() {\n return new Backdrop({\n isVisible: Boolean(this._config.backdrop), // 'static' option will be translated to true, and booleans will keep their value,\n isAnimated: this._isAnimated()\n })\n }\n\n _initializeFocusTrap() {\n return new FocusTrap({\n trapElement: this._element\n })\n }\n\n _showElement(relatedTarget) {\n // try to append dynamic modal\n if (!document.body.contains(this._element)) {\n document.body.append(this._element)\n }\n\n this._element.style.display = 'block'\n this._element.removeAttribute('aria-hidden')\n this._element.setAttribute('aria-modal', true)\n this._element.setAttribute('role', 'dialog')\n this._element.scrollTop = 0\n\n const modalBody = SelectorEngine.findOne(SELECTOR_MODAL_BODY, this._dialog)\n if (modalBody) {\n modalBody.scrollTop = 0\n }\n\n reflow(this._element)\n\n this._element.classList.add(CLASS_NAME_SHOW)\n\n const transitionComplete = () => {\n if (this._config.focus) {\n this._focustrap.activate()\n }\n\n this._isTransitioning = false\n EventHandler.trigger(this._element, EVENT_SHOWN, {\n relatedTarget\n })\n }\n\n this._queueCallback(transitionComplete, this._dialog, this._isAnimated())\n }\n\n _addEventListeners() {\n EventHandler.on(this._element, EVENT_KEYDOWN_DISMISS, event => {\n if (event.key !== ESCAPE_KEY) {\n return\n }\n\n if (this._config.keyboard) {\n this.hide()\n return\n }\n\n this._triggerBackdropTransition()\n })\n\n EventHandler.on(window, EVENT_RESIZE, () => {\n if (this._isShown && !this._isTransitioning) {\n this._adjustDialog()\n }\n })\n\n EventHandler.on(this._element, EVENT_MOUSEDOWN_DISMISS, event => {\n // a bad trick to segregate clicks that may start inside dialog but end outside, and avoid listen to scrollbar clicks\n EventHandler.one(this._element, EVENT_CLICK_DISMISS, event2 => {\n if (this._element !== event.target || this._element !== event2.target) {\n return\n }\n\n if (this._config.backdrop === 'static') {\n this._triggerBackdropTransition()\n return\n }\n\n if (this._config.backdrop) {\n this.hide()\n }\n })\n })\n }\n\n _hideModal() {\n this._element.style.display = 'none'\n this._element.setAttribute('aria-hidden', true)\n this._element.removeAttribute('aria-modal')\n this._element.removeAttribute('role')\n this._isTransitioning = false\n\n this._backdrop.hide(() => {\n document.body.classList.remove(CLASS_NAME_OPEN)\n this._resetAdjustments()\n this._scrollBar.reset()\n EventHandler.trigger(this._element, EVENT_HIDDEN)\n })\n }\n\n _isAnimated() {\n return this._element.classList.contains(CLASS_NAME_FADE)\n }\n\n _triggerBackdropTransition() {\n const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE_PREVENTED)\n if (hideEvent.defaultPrevented) {\n return\n }\n\n const isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight\n const initialOverflowY = this._element.style.overflowY\n // return if the following background transition hasn't yet completed\n if (initialOverflowY === 'hidden' || this._element.classList.contains(CLASS_NAME_STATIC)) {\n return\n }\n\n if (!isModalOverflowing) {\n this._element.style.overflowY = 'hidden'\n }\n\n this._element.classList.add(CLASS_NAME_STATIC)\n this._queueCallback(() => {\n this._element.classList.remove(CLASS_NAME_STATIC)\n this._queueCallback(() => {\n this._element.style.overflowY = initialOverflowY\n }, this._dialog)\n }, this._dialog)\n\n this._element.focus()\n }\n\n /**\n * The following methods are used to handle overflowing modals\n */\n\n _adjustDialog() {\n const isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight\n const scrollbarWidth = this._scrollBar.getWidth()\n const isBodyOverflowing = scrollbarWidth > 0\n\n if (isBodyOverflowing && !isModalOverflowing) {\n const property = isRTL() ? 'paddingLeft' : 'paddingRight'\n this._element.style[property] = `${scrollbarWidth}px`\n }\n\n if (!isBodyOverflowing && isModalOverflowing) {\n const property = isRTL() ? 'paddingRight' : 'paddingLeft'\n this._element.style[property] = `${scrollbarWidth}px`\n }\n }\n\n _resetAdjustments() {\n this._element.style.paddingLeft = ''\n this._element.style.paddingRight = ''\n }\n\n // Static\n static jQueryInterface(config, relatedTarget) {\n return this.each(function () {\n const data = Modal.getOrCreateInstance(this, config)\n\n if (typeof config !== 'string') {\n return\n }\n\n if (typeof data[config] === 'undefined') {\n throw new TypeError(`No method named \"${config}\"`)\n }\n\n data[config](relatedTarget)\n })\n }\n}\n\n/**\n * Data API implementation\n */\n\nEventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) {\n const target = SelectorEngine.getElementFromSelector(this)\n\n if (['A', 'AREA'].includes(this.tagName)) {\n event.preventDefault()\n }\n\n EventHandler.one(target, EVENT_SHOW, showEvent => {\n if (showEvent.defaultPrevented) {\n // only register focus restorer if modal will actually get shown\n return\n }\n\n EventHandler.one(target, EVENT_HIDDEN, () => {\n if (isVisible(this)) {\n this.focus()\n }\n })\n })\n\n // avoid conflict when clicking modal toggler while another one is open\n const alreadyOpen = SelectorEngine.findOne(OPEN_SELECTOR)\n if (alreadyOpen) {\n Modal.getInstance(alreadyOpen).hide()\n }\n\n const data = Modal.getOrCreateInstance(target)\n\n data.toggle(this)\n})\n\nenableDismissTrigger(Modal)\n\n/**\n * jQuery\n */\n\ndefineJQueryPlugin(Modal)\n\nexport default Modal\n", "/**\n * --------------------------------------------------------------------------\n * Bootstrap offcanvas.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport BaseComponent from './base-component.js'\nimport EventHandler from './dom/event-handler.js'\nimport SelectorEngine from './dom/selector-engine.js'\nimport Backdrop from './util/backdrop.js'\nimport { enableDismissTrigger } from './util/component-functions.js'\nimport FocusTrap from './util/focustrap.js'\nimport {\n defineJQueryPlugin,\n isDisabled,\n isVisible\n} from './util/index.js'\nimport ScrollBarHelper from './util/scrollbar.js'\n\n/**\n * Constants\n */\n\nconst NAME = 'offcanvas'\nconst DATA_KEY = 'bs.offcanvas'\nconst EVENT_KEY = `.${DATA_KEY}`\nconst DATA_API_KEY = '.data-api'\nconst EVENT_LOAD_DATA_API = `load${EVENT_KEY}${DATA_API_KEY}`\nconst ESCAPE_KEY = 'Escape'\n\nconst CLASS_NAME_SHOW = 'show'\nconst CLASS_NAME_SHOWING = 'showing'\nconst CLASS_NAME_HIDING = 'hiding'\nconst CLASS_NAME_BACKDROP = 'offcanvas-backdrop'\nconst OPEN_SELECTOR = '.offcanvas.show'\n\nconst EVENT_SHOW = `show${EVENT_KEY}`\nconst EVENT_SHOWN = `shown${EVENT_KEY}`\nconst EVENT_HIDE = `hide${EVENT_KEY}`\nconst EVENT_HIDE_PREVENTED = `hidePrevented${EVENT_KEY}`\nconst EVENT_HIDDEN = `hidden${EVENT_KEY}`\nconst EVENT_RESIZE = `resize${EVENT_KEY}`\nconst EVENT_CLICK_DATA_API = `click${EVENT_KEY}${DATA_API_KEY}`\nconst EVENT_KEYDOWN_DISMISS = `keydown.dismiss${EVENT_KEY}`\n\nconst SELECTOR_DATA_TOGGLE = '[data-bs-toggle=\"offcanvas\"]'\n\nconst Default = {\n backdrop: true,\n keyboard: true,\n scroll: false\n}\n\nconst DefaultType = {\n backdrop: '(boolean|string)',\n keyboard: 'boolean',\n scroll: 'boolean'\n}\n\n/**\n * Class definition\n */\n\nclass Offcanvas extends BaseComponent {\n constructor(element, config) {\n super(element, config)\n\n this._isShown = false\n this._backdrop = this._initializeBackDrop()\n this._focustrap = this._initializeFocusTrap()\n this._addEventListeners()\n }\n\n // Getters\n static get Default() {\n return Default\n }\n\n static get DefaultType() {\n return DefaultType\n }\n\n static get NAME() {\n return NAME\n }\n\n // Public\n toggle(relatedTarget) {\n return this._isShown ? this.hide() : this.show(relatedTarget)\n }\n\n show(relatedTarget) {\n if (this._isShown) {\n return\n }\n\n const showEvent = EventHandler.trigger(this._element, EVENT_SHOW, { relatedTarget })\n\n if (showEvent.defaultPrevented) {\n return\n }\n\n this._isShown = true\n this._backdrop.show()\n\n if (!this._config.scroll) {\n new ScrollBarHelper().hide()\n }\n\n this._element.setAttribute('aria-modal', true)\n this._element.setAttribute('role', 'dialog')\n this._element.classList.add(CLASS_NAME_SHOWING)\n\n const completeCallBack = () => {\n if (!this._config.scroll || this._config.backdrop) {\n this._focustrap.activate()\n }\n\n this._element.classList.add(CLASS_NAME_SHOW)\n this._element.classList.remove(CLASS_NAME_SHOWING)\n EventHandler.trigger(this._element, EVENT_SHOWN, { relatedTarget })\n }\n\n this._queueCallback(completeCallBack, this._element, true)\n }\n\n hide() {\n if (!this._isShown) {\n return\n }\n\n const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE)\n\n if (hideEvent.defaultPrevented) {\n return\n }\n\n this._focustrap.deactivate()\n this._element.blur()\n this._isShown = false\n this._element.classList.add(CLASS_NAME_HIDING)\n this._backdrop.hide()\n\n const completeCallback = () => {\n this._element.classList.remove(CLASS_NAME_SHOW, CLASS_NAME_HIDING)\n this._element.removeAttribute('aria-modal')\n this._element.removeAttribute('role')\n\n if (!this._config.scroll) {\n new ScrollBarHelper().reset()\n }\n\n EventHandler.trigger(this._element, EVENT_HIDDEN)\n }\n\n this._queueCallback(completeCallback, this._element, true)\n }\n\n dispose() {\n this._backdrop.dispose()\n this._focustrap.deactivate()\n super.dispose()\n }\n\n // Private\n _initializeBackDrop() {\n const clickCallback = () => {\n if (this._config.backdrop === 'static') {\n EventHandler.trigger(this._element, EVENT_HIDE_PREVENTED)\n return\n }\n\n this.hide()\n }\n\n // 'static' option will be translated to true, and booleans will keep their value\n const isVisible = Boolean(this._config.backdrop)\n\n return new Backdrop({\n className: CLASS_NAME_BACKDROP,\n isVisible,\n isAnimated: true,\n rootElement: this._element.parentNode,\n clickCallback: isVisible ? clickCallback : null\n })\n }\n\n _initializeFocusTrap() {\n return new FocusTrap({\n trapElement: this._element\n })\n }\n\n _addEventListeners() {\n EventHandler.on(this._element, EVENT_KEYDOWN_DISMISS, event => {\n if (event.key !== ESCAPE_KEY) {\n return\n }\n\n if (this._config.keyboard) {\n this.hide()\n return\n }\n\n EventHandler.trigger(this._element, EVENT_HIDE_PREVENTED)\n })\n }\n\n // Static\n static jQueryInterface(config) {\n return this.each(function () {\n const data = Offcanvas.getOrCreateInstance(this, config)\n\n if (typeof config !== 'string') {\n return\n }\n\n if (data[config] === undefined || config.startsWith('_') || config === 'constructor') {\n throw new TypeError(`No method named \"${config}\"`)\n }\n\n data[config](this)\n })\n }\n}\n\n/**\n * Data API implementation\n */\n\nEventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) {\n const target = SelectorEngine.getElementFromSelector(this)\n\n if (['A', 'AREA'].includes(this.tagName)) {\n event.preventDefault()\n }\n\n if (isDisabled(this)) {\n return\n }\n\n EventHandler.one(target, EVENT_HIDDEN, () => {\n // focus on trigger when it is closed\n if (isVisible(this)) {\n this.focus()\n }\n })\n\n // avoid conflict when clicking a toggler of an offcanvas, while another is open\n const alreadyOpen = SelectorEngine.findOne(OPEN_SELECTOR)\n if (alreadyOpen && alreadyOpen !== target) {\n Offcanvas.getInstance(alreadyOpen).hide()\n }\n\n const data = Offcanvas.getOrCreateInstance(target)\n data.toggle(this)\n})\n\nEventHandler.on(window, EVENT_LOAD_DATA_API, () => {\n for (const selector of SelectorEngine.find(OPEN_SELECTOR)) {\n Offcanvas.getOrCreateInstance(selector).show()\n }\n})\n\nEventHandler.on(window, EVENT_RESIZE, () => {\n for (const element of SelectorEngine.find('[aria-modal][class*=show][class*=offcanvas-]')) {\n if (getComputedStyle(element).position !== 'fixed') {\n Offcanvas.getOrCreateInstance(element).hide()\n }\n }\n})\n\nenableDismissTrigger(Offcanvas)\n\n/**\n * jQuery\n */\n\ndefineJQueryPlugin(Offcanvas)\n\nexport default Offcanvas\n", "/**\n * --------------------------------------------------------------------------\n * Bootstrap util/sanitizer.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n// js-docs-start allow-list\nconst ARIA_ATTRIBUTE_PATTERN = /^aria-[\\w-]*$/i\n\nexport const DefaultAllowlist = {\n // Global attributes allowed on any supplied element below.\n '*': ['class', 'dir', 'id', 'lang', 'role', ARIA_ATTRIBUTE_PATTERN],\n a: ['target', 'href', 'title', 'rel'],\n area: [],\n b: [],\n br: [],\n col: [],\n code: [],\n dd: [],\n div: [],\n dl: [],\n dt: [],\n em: [],\n hr: [],\n h1: [],\n h2: [],\n h3: [],\n h4: [],\n h5: [],\n h6: [],\n i: [],\n img: ['src', 'srcset', 'alt', 'title', 'width', 'height'],\n li: [],\n ol: [],\n p: [],\n pre: [],\n s: [],\n small: [],\n span: [],\n sub: [],\n sup: [],\n strong: [],\n u: [],\n ul: []\n}\n// js-docs-end allow-list\n\nconst uriAttributes = new Set([\n 'background',\n 'cite',\n 'href',\n 'itemtype',\n 'longdesc',\n 'poster',\n 'src',\n 'xlink:href'\n])\n\n/**\n * A pattern that recognizes URLs that are safe wrt. XSS in URL navigation\n * contexts.\n *\n * Shout-out to Angular https://github.com/angular/angular/blob/15.2.8/packages/core/src/sanitization/url_sanitizer.ts#L38\n */\nconst SAFE_URL_PATTERN = /^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:/?#]*(?:[/?#]|$))/i\n\nconst allowedAttribute = (attribute, allowedAttributeList) => {\n const attributeName = attribute.nodeName.toLowerCase()\n\n if (allowedAttributeList.includes(attributeName)) {\n if (uriAttributes.has(attributeName)) {\n return Boolean(SAFE_URL_PATTERN.test(attribute.nodeValue))\n }\n\n return true\n }\n\n // Check if a regular expression validates the attribute.\n return allowedAttributeList.filter(attributeRegex => attributeRegex instanceof RegExp)\n .some(regex => regex.test(attributeName))\n}\n\nexport function sanitizeHtml(unsafeHtml, allowList, sanitizeFunction) {\n if (!unsafeHtml.length) {\n return unsafeHtml\n }\n\n if (sanitizeFunction && typeof sanitizeFunction === 'function') {\n return sanitizeFunction(unsafeHtml)\n }\n\n const domParser = new window.DOMParser()\n const createdDocument = domParser.parseFromString(unsafeHtml, 'text/html')\n const elements = [].concat(...createdDocument.body.querySelectorAll('*'))\n\n for (const element of elements) {\n const elementName = element.nodeName.toLowerCase()\n\n if (!Object.keys(allowList).includes(elementName)) {\n element.remove()\n continue\n }\n\n const attributeList = [].concat(...element.attributes)\n const allowedAttributes = [].concat(allowList['*'] || [], allowList[elementName] || [])\n\n for (const attribute of attributeList) {\n if (!allowedAttribute(attribute, allowedAttributes)) {\n element.removeAttribute(attribute.nodeName)\n }\n }\n }\n\n return createdDocument.body.innerHTML\n}\n", "/**\n * --------------------------------------------------------------------------\n * Bootstrap util/template-factory.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport SelectorEngine from '../dom/selector-engine.js'\nimport Config from './config.js'\nimport { DefaultAllowlist, sanitizeHtml } from './sanitizer.js'\nimport { execute, getElement, isElement } from './index.js'\n\n/**\n * Constants\n */\n\nconst NAME = 'TemplateFactory'\n\nconst Default = {\n allowList: DefaultAllowlist,\n content: {}, // { selector : text , selector2 : text2 , }\n extraClass: '',\n html: false,\n sanitize: true,\n sanitizeFn: null,\n template: '
'\n}\n\nconst DefaultType = {\n allowList: 'object',\n content: 'object',\n extraClass: '(string|function)',\n html: 'boolean',\n sanitize: 'boolean',\n sanitizeFn: '(null|function)',\n template: 'string'\n}\n\nconst DefaultContentType = {\n entry: '(string|element|function|null)',\n selector: '(string|element)'\n}\n\n/**\n * Class definition\n */\n\nclass TemplateFactory extends Config {\n constructor(config) {\n super()\n this._config = this._getConfig(config)\n }\n\n // Getters\n static get Default() {\n return Default\n }\n\n static get DefaultType() {\n return DefaultType\n }\n\n static get NAME() {\n return NAME\n }\n\n // Public\n getContent() {\n return Object.values(this._config.content)\n .map(config => this._resolvePossibleFunction(config))\n .filter(Boolean)\n }\n\n hasContent() {\n return this.getContent().length > 0\n }\n\n changeContent(content) {\n this._checkContent(content)\n this._config.content = { ...this._config.content, ...content }\n return this\n }\n\n toHtml() {\n const templateWrapper = document.createElement('div')\n templateWrapper.innerHTML = this._maybeSanitize(this._config.template)\n\n for (const [selector, text] of Object.entries(this._config.content)) {\n this._setContent(templateWrapper, text, selector)\n }\n\n const template = templateWrapper.children[0]\n const extraClass = this._resolvePossibleFunction(this._config.extraClass)\n\n if (extraClass) {\n template.classList.add(...extraClass.split(' '))\n }\n\n return template\n }\n\n // Private\n _typeCheckConfig(config) {\n super._typeCheckConfig(config)\n this._checkContent(config.content)\n }\n\n _checkContent(arg) {\n for (const [selector, content] of Object.entries(arg)) {\n super._typeCheckConfig({ selector, entry: content }, DefaultContentType)\n }\n }\n\n _setContent(template, content, selector) {\n const templateElement = SelectorEngine.findOne(selector, template)\n\n if (!templateElement) {\n return\n }\n\n content = this._resolvePossibleFunction(content)\n\n if (!content) {\n templateElement.remove()\n return\n }\n\n if (isElement(content)) {\n this._putElementInTemplate(getElement(content), templateElement)\n return\n }\n\n if (this._config.html) {\n templateElement.innerHTML = this._maybeSanitize(content)\n return\n }\n\n templateElement.textContent = content\n }\n\n _maybeSanitize(arg) {\n return this._config.sanitize ? sanitizeHtml(arg, this._config.allowList, this._config.sanitizeFn) : arg\n }\n\n _resolvePossibleFunction(arg) {\n return execute(arg, [undefined, this])\n }\n\n _putElementInTemplate(element, templateElement) {\n if (this._config.html) {\n templateElement.innerHTML = ''\n templateElement.append(element)\n return\n }\n\n templateElement.textContent = element.textContent\n }\n}\n\nexport default TemplateFactory\n", "/**\n * --------------------------------------------------------------------------\n * Bootstrap tooltip.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport * as Popper from '@popperjs/core'\nimport BaseComponent from './base-component.js'\nimport EventHandler from './dom/event-handler.js'\nimport Manipulator from './dom/manipulator.js'\nimport {\n defineJQueryPlugin, execute, findShadowRoot, getElement, getUID, isRTL, noop\n} from './util/index.js'\nimport { DefaultAllowlist } from './util/sanitizer.js'\nimport TemplateFactory from './util/template-factory.js'\n\n/**\n * Constants\n */\n\nconst NAME = 'tooltip'\nconst DISALLOWED_ATTRIBUTES = new Set(['sanitize', 'allowList', 'sanitizeFn'])\n\nconst CLASS_NAME_FADE = 'fade'\nconst CLASS_NAME_MODAL = 'modal'\nconst CLASS_NAME_SHOW = 'show'\n\nconst SELECTOR_TOOLTIP_INNER = '.tooltip-inner'\nconst SELECTOR_MODAL = `.${CLASS_NAME_MODAL}`\n\nconst EVENT_MODAL_HIDE = 'hide.bs.modal'\n\nconst TRIGGER_HOVER = 'hover'\nconst TRIGGER_FOCUS = 'focus'\nconst TRIGGER_CLICK = 'click'\nconst TRIGGER_MANUAL = 'manual'\n\nconst EVENT_HIDE = 'hide'\nconst EVENT_HIDDEN = 'hidden'\nconst EVENT_SHOW = 'show'\nconst EVENT_SHOWN = 'shown'\nconst EVENT_INSERTED = 'inserted'\nconst EVENT_CLICK = 'click'\nconst EVENT_FOCUSIN = 'focusin'\nconst EVENT_FOCUSOUT = 'focusout'\nconst EVENT_MOUSEENTER = 'mouseenter'\nconst EVENT_MOUSELEAVE = 'mouseleave'\n\nconst AttachmentMap = {\n AUTO: 'auto',\n TOP: 'top',\n RIGHT: isRTL() ? 'left' : 'right',\n BOTTOM: 'bottom',\n LEFT: isRTL() ? 'right' : 'left'\n}\n\nconst Default = {\n allowList: DefaultAllowlist,\n animation: true,\n boundary: 'clippingParents',\n container: false,\n customClass: '',\n delay: 0,\n fallbackPlacements: ['top', 'right', 'bottom', 'left'],\n html: false,\n offset: [0, 6],\n placement: 'top',\n popperConfig: null,\n sanitize: true,\n sanitizeFn: null,\n selector: false,\n template: '
' +\n '
' +\n '
' +\n '
',\n title: '',\n trigger: 'hover focus'\n}\n\nconst DefaultType = {\n allowList: 'object',\n animation: 'boolean',\n boundary: '(string|element)',\n container: '(string|element|boolean)',\n customClass: '(string|function)',\n delay: '(number|object)',\n fallbackPlacements: 'array',\n html: 'boolean',\n offset: '(array|string|function)',\n placement: '(string|function)',\n popperConfig: '(null|object|function)',\n sanitize: 'boolean',\n sanitizeFn: '(null|function)',\n selector: '(string|boolean)',\n template: 'string',\n title: '(string|element|function)',\n trigger: 'string'\n}\n\n/**\n * Class definition\n */\n\nclass Tooltip extends BaseComponent {\n constructor(element, config) {\n if (typeof Popper === 'undefined') {\n throw new TypeError('Bootstrap\\'s tooltips require Popper (https://popper.js.org/docs/v2/)')\n }\n\n super(element, config)\n\n // Private\n this._isEnabled = true\n this._timeout = 0\n this._isHovered = null\n this._activeTrigger = {}\n this._popper = null\n this._templateFactory = null\n this._newContent = null\n\n // Protected\n this.tip = null\n\n this._setListeners()\n\n if (!this._config.selector) {\n this._fixTitle()\n }\n }\n\n // Getters\n static get Default() {\n return Default\n }\n\n static get DefaultType() {\n return DefaultType\n }\n\n static get NAME() {\n return NAME\n }\n\n // Public\n enable() {\n this._isEnabled = true\n }\n\n disable() {\n this._isEnabled = false\n }\n\n toggleEnabled() {\n this._isEnabled = !this._isEnabled\n }\n\n toggle() {\n if (!this._isEnabled) {\n return\n }\n\n if (this._isShown()) {\n this._leave()\n return\n }\n\n this._enter()\n }\n\n dispose() {\n clearTimeout(this._timeout)\n\n EventHandler.off(this._element.closest(SELECTOR_MODAL), EVENT_MODAL_HIDE, this._hideModalHandler)\n\n if (this._element.getAttribute('data-bs-original-title')) {\n this._element.setAttribute('title', this._element.getAttribute('data-bs-original-title'))\n }\n\n this._disposePopper()\n super.dispose()\n }\n\n show() {\n if (this._element.style.display === 'none') {\n throw new Error('Please use show on visible elements')\n }\n\n if (!(this._isWithContent() && this._isEnabled)) {\n return\n }\n\n const showEvent = EventHandler.trigger(this._element, this.constructor.eventName(EVENT_SHOW))\n const shadowRoot = findShadowRoot(this._element)\n const isInTheDom = (shadowRoot || this._element.ownerDocument.documentElement).contains(this._element)\n\n if (showEvent.defaultPrevented || !isInTheDom) {\n return\n }\n\n // TODO: v6 remove this or make it optional\n this._disposePopper()\n\n const tip = this._getTipElement()\n\n this._element.setAttribute('aria-describedby', tip.getAttribute('id'))\n\n const { container } = this._config\n\n if (!this._element.ownerDocument.documentElement.contains(this.tip)) {\n container.append(tip)\n EventHandler.trigger(this._element, this.constructor.eventName(EVENT_INSERTED))\n }\n\n this._popper = this._createPopper(tip)\n\n tip.classList.add(CLASS_NAME_SHOW)\n\n // If this is a touch-enabled device we add extra\n // empty mouseover listeners to the body's immediate children;\n // only needed because of broken event delegation on iOS\n // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html\n if ('ontouchstart' in document.documentElement) {\n for (const element of [].concat(...document.body.children)) {\n EventHandler.on(element, 'mouseover', noop)\n }\n }\n\n const complete = () => {\n EventHandler.trigger(this._element, this.constructor.eventName(EVENT_SHOWN))\n\n if (this._isHovered === false) {\n this._leave()\n }\n\n this._isHovered = false\n }\n\n this._queueCallback(complete, this.tip, this._isAnimated())\n }\n\n hide() {\n if (!this._isShown()) {\n return\n }\n\n const hideEvent = EventHandler.trigger(this._element, this.constructor.eventName(EVENT_HIDE))\n if (hideEvent.defaultPrevented) {\n return\n }\n\n const tip = this._getTipElement()\n tip.classList.remove(CLASS_NAME_SHOW)\n\n // If this is a touch-enabled device we remove the extra\n // empty mouseover listeners we added for iOS support\n if ('ontouchstart' in document.documentElement) {\n for (const element of [].concat(...document.body.children)) {\n EventHandler.off(element, 'mouseover', noop)\n }\n }\n\n this._activeTrigger[TRIGGER_CLICK] = false\n this._activeTrigger[TRIGGER_FOCUS] = false\n this._activeTrigger[TRIGGER_HOVER] = false\n this._isHovered = null // it is a trick to support manual triggering\n\n const complete = () => {\n if (this._isWithActiveTrigger()) {\n return\n }\n\n if (!this._isHovered) {\n this._disposePopper()\n }\n\n this._element.removeAttribute('aria-describedby')\n EventHandler.trigger(this._element, this.constructor.eventName(EVENT_HIDDEN))\n }\n\n this._queueCallback(complete, this.tip, this._isAnimated())\n }\n\n update() {\n if (this._popper) {\n this._popper.update()\n }\n }\n\n // Protected\n _isWithContent() {\n return Boolean(this._getTitle())\n }\n\n _getTipElement() {\n if (!this.tip) {\n this.tip = this._createTipElement(this._newContent || this._getContentForTemplate())\n }\n\n return this.tip\n }\n\n _createTipElement(content) {\n const tip = this._getTemplateFactory(content).toHtml()\n\n // TODO: remove this check in v6\n if (!tip) {\n return null\n }\n\n tip.classList.remove(CLASS_NAME_FADE, CLASS_NAME_SHOW)\n // TODO: v6 the following can be achieved with CSS only\n tip.classList.add(`bs-${this.constructor.NAME}-auto`)\n\n const tipId = getUID(this.constructor.NAME).toString()\n\n tip.setAttribute('id', tipId)\n\n if (this._isAnimated()) {\n tip.classList.add(CLASS_NAME_FADE)\n }\n\n return tip\n }\n\n setContent(content) {\n this._newContent = content\n if (this._isShown()) {\n this._disposePopper()\n this.show()\n }\n }\n\n _getTemplateFactory(content) {\n if (this._templateFactory) {\n this._templateFactory.changeContent(content)\n } else {\n this._templateFactory = new TemplateFactory({\n ...this._config,\n // the `content` var has to be after `this._config`\n // to override config.content in case of popover\n content,\n extraClass: this._resolvePossibleFunction(this._config.customClass)\n })\n }\n\n return this._templateFactory\n }\n\n _getContentForTemplate() {\n return {\n [SELECTOR_TOOLTIP_INNER]: this._getTitle()\n }\n }\n\n _getTitle() {\n return this._resolvePossibleFunction(this._config.title) || this._element.getAttribute('data-bs-original-title')\n }\n\n // Private\n _initializeOnDelegatedTarget(event) {\n return this.constructor.getOrCreateInstance(event.delegateTarget, this._getDelegateConfig())\n }\n\n _isAnimated() {\n return this._config.animation || (this.tip && this.tip.classList.contains(CLASS_NAME_FADE))\n }\n\n _isShown() {\n return this.tip && this.tip.classList.contains(CLASS_NAME_SHOW)\n }\n\n _createPopper(tip) {\n const placement = execute(this._config.placement, [this, tip, this._element])\n const attachment = AttachmentMap[placement.toUpperCase()]\n return Popper.createPopper(this._element, tip, this._getPopperConfig(attachment))\n }\n\n _getOffset() {\n const { offset } = this._config\n\n if (typeof offset === 'string') {\n return offset.split(',').map(value => Number.parseInt(value, 10))\n }\n\n if (typeof offset === 'function') {\n return popperData => offset(popperData, this._element)\n }\n\n return offset\n }\n\n _resolvePossibleFunction(arg) {\n return execute(arg, [this._element, this._element])\n }\n\n _getPopperConfig(attachment) {\n const defaultBsPopperConfig = {\n placement: attachment,\n modifiers: [\n {\n name: 'flip',\n options: {\n fallbackPlacements: this._config.fallbackPlacements\n }\n },\n {\n name: 'offset',\n options: {\n offset: this._getOffset()\n }\n },\n {\n name: 'preventOverflow',\n options: {\n boundary: this._config.boundary\n }\n },\n {\n name: 'arrow',\n options: {\n element: `.${this.constructor.NAME}-arrow`\n }\n },\n {\n name: 'preSetPlacement',\n enabled: true,\n phase: 'beforeMain',\n fn: data => {\n // Pre-set Popper's placement attribute in order to read the arrow sizes properly.\n // Otherwise, Popper mixes up the width and height dimensions since the initial arrow style is for top placement\n this._getTipElement().setAttribute('data-popper-placement', data.state.placement)\n }\n }\n ]\n }\n\n return {\n ...defaultBsPopperConfig,\n ...execute(this._config.popperConfig, [undefined, defaultBsPopperConfig])\n }\n }\n\n _setListeners() {\n const triggers = this._config.trigger.split(' ')\n\n for (const trigger of triggers) {\n if (trigger === 'click') {\n EventHandler.on(this._element, this.constructor.eventName(EVENT_CLICK), this._config.selector, event => {\n const context = this._initializeOnDelegatedTarget(event)\n context._activeTrigger[TRIGGER_CLICK] = !(context._isShown() && context._activeTrigger[TRIGGER_CLICK])\n context.toggle()\n })\n } else if (trigger !== TRIGGER_MANUAL) {\n const eventIn = trigger === TRIGGER_HOVER ?\n this.constructor.eventName(EVENT_MOUSEENTER) :\n this.constructor.eventName(EVENT_FOCUSIN)\n const eventOut = trigger === TRIGGER_HOVER ?\n this.constructor.eventName(EVENT_MOUSELEAVE) :\n this.constructor.eventName(EVENT_FOCUSOUT)\n\n EventHandler.on(this._element, eventIn, this._config.selector, event => {\n const context = this._initializeOnDelegatedTarget(event)\n context._activeTrigger[event.type === 'focusin' ? TRIGGER_FOCUS : TRIGGER_HOVER] = true\n context._enter()\n })\n EventHandler.on(this._element, eventOut, this._config.selector, event => {\n const context = this._initializeOnDelegatedTarget(event)\n context._activeTrigger[event.type === 'focusout' ? TRIGGER_FOCUS : TRIGGER_HOVER] =\n context._element.contains(event.relatedTarget)\n\n context._leave()\n })\n }\n }\n\n this._hideModalHandler = () => {\n if (this._element) {\n this.hide()\n }\n }\n\n EventHandler.on(this._element.closest(SELECTOR_MODAL), EVENT_MODAL_HIDE, this._hideModalHandler)\n }\n\n _fixTitle() {\n const title = this._element.getAttribute('title')\n\n if (!title) {\n return\n }\n\n if (!this._element.getAttribute('aria-label') && !this._element.textContent.trim()) {\n this._element.setAttribute('aria-label', title)\n }\n\n this._element.setAttribute('data-bs-original-title', title) // DO NOT USE IT. Is only for backwards compatibility\n this._element.removeAttribute('title')\n }\n\n _enter() {\n if (this._isShown() || this._isHovered) {\n this._isHovered = true\n return\n }\n\n this._isHovered = true\n\n this._setTimeout(() => {\n if (this._isHovered) {\n this.show()\n }\n }, this._config.delay.show)\n }\n\n _leave() {\n if (this._isWithActiveTrigger()) {\n return\n }\n\n this._isHovered = false\n\n this._setTimeout(() => {\n if (!this._isHovered) {\n this.hide()\n }\n }, this._config.delay.hide)\n }\n\n _setTimeout(handler, timeout) {\n clearTimeout(this._timeout)\n this._timeout = setTimeout(handler, timeout)\n }\n\n _isWithActiveTrigger() {\n return Object.values(this._activeTrigger).includes(true)\n }\n\n _getConfig(config) {\n const dataAttributes = Manipulator.getDataAttributes(this._element)\n\n for (const dataAttribute of Object.keys(dataAttributes)) {\n if (DISALLOWED_ATTRIBUTES.has(dataAttribute)) {\n delete dataAttributes[dataAttribute]\n }\n }\n\n config = {\n ...dataAttributes,\n ...(typeof config === 'object' && config ? config : {})\n }\n config = this._mergeConfigObj(config)\n config = this._configAfterMerge(config)\n this._typeCheckConfig(config)\n return config\n }\n\n _configAfterMerge(config) {\n config.container = config.container === false ? document.body : getElement(config.container)\n\n if (typeof config.delay === 'number') {\n config.delay = {\n show: config.delay,\n hide: config.delay\n }\n }\n\n if (typeof config.title === 'number') {\n config.title = config.title.toString()\n }\n\n if (typeof config.content === 'number') {\n config.content = config.content.toString()\n }\n\n return config\n }\n\n _getDelegateConfig() {\n const config = {}\n\n for (const [key, value] of Object.entries(this._config)) {\n if (this.constructor.Default[key] !== value) {\n config[key] = value\n }\n }\n\n config.selector = false\n config.trigger = 'manual'\n\n // In the future can be replaced with:\n // const keysWithDifferentValues = Object.entries(this._config).filter(entry => this.constructor.Default[entry[0]] !== this._config[entry[0]])\n // `Object.fromEntries(keysWithDifferentValues)`\n return config\n }\n\n _disposePopper() {\n if (this._popper) {\n this._popper.destroy()\n this._popper = null\n }\n\n if (this.tip) {\n this.tip.remove()\n this.tip = null\n }\n }\n\n // Static\n static jQueryInterface(config) {\n return this.each(function () {\n const data = Tooltip.getOrCreateInstance(this, config)\n\n if (typeof config !== 'string') {\n return\n }\n\n if (typeof data[config] === 'undefined') {\n throw new TypeError(`No method named \"${config}\"`)\n }\n\n data[config]()\n })\n }\n}\n\n/**\n * jQuery\n */\n\ndefineJQueryPlugin(Tooltip)\n\nexport default Tooltip\n", "/**\n * --------------------------------------------------------------------------\n * Bootstrap popover.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport Tooltip from './tooltip.js'\nimport { defineJQueryPlugin } from './util/index.js'\n\n/**\n * Constants\n */\n\nconst NAME = 'popover'\n\nconst SELECTOR_TITLE = '.popover-header'\nconst SELECTOR_CONTENT = '.popover-body'\n\nconst Default = {\n ...Tooltip.Default,\n content: '',\n offset: [0, 8],\n placement: 'right',\n template: '
' +\n '
' +\n '

' +\n '
' +\n '
',\n trigger: 'click'\n}\n\nconst DefaultType = {\n ...Tooltip.DefaultType,\n content: '(null|string|element|function)'\n}\n\n/**\n * Class definition\n */\n\nclass Popover extends Tooltip {\n // Getters\n static get Default() {\n return Default\n }\n\n static get DefaultType() {\n return DefaultType\n }\n\n static get NAME() {\n return NAME\n }\n\n // Overrides\n _isWithContent() {\n return this._getTitle() || this._getContent()\n }\n\n // Private\n _getContentForTemplate() {\n return {\n [SELECTOR_TITLE]: this._getTitle(),\n [SELECTOR_CONTENT]: this._getContent()\n }\n }\n\n _getContent() {\n return this._resolvePossibleFunction(this._config.content)\n }\n\n // Static\n static jQueryInterface(config) {\n return this.each(function () {\n const data = Popover.getOrCreateInstance(this, config)\n\n if (typeof config !== 'string') {\n return\n }\n\n if (typeof data[config] === 'undefined') {\n throw new TypeError(`No method named \"${config}\"`)\n }\n\n data[config]()\n })\n }\n}\n\n/**\n * jQuery\n */\n\ndefineJQueryPlugin(Popover)\n\nexport default Popover\n", "/**\n * --------------------------------------------------------------------------\n * Bootstrap scrollspy.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport BaseComponent from './base-component.js'\nimport EventHandler from './dom/event-handler.js'\nimport SelectorEngine from './dom/selector-engine.js'\nimport {\n defineJQueryPlugin, getElement, isDisabled, isVisible\n} from './util/index.js'\n\n/**\n * Constants\n */\n\nconst NAME = 'scrollspy'\nconst DATA_KEY = 'bs.scrollspy'\nconst EVENT_KEY = `.${DATA_KEY}`\nconst DATA_API_KEY = '.data-api'\n\nconst EVENT_ACTIVATE = `activate${EVENT_KEY}`\nconst EVENT_CLICK = `click${EVENT_KEY}`\nconst EVENT_LOAD_DATA_API = `load${EVENT_KEY}${DATA_API_KEY}`\n\nconst CLASS_NAME_DROPDOWN_ITEM = 'dropdown-item'\nconst CLASS_NAME_ACTIVE = 'active'\n\nconst SELECTOR_DATA_SPY = '[data-bs-spy=\"scroll\"]'\nconst SELECTOR_TARGET_LINKS = '[href]'\nconst SELECTOR_NAV_LIST_GROUP = '.nav, .list-group'\nconst SELECTOR_NAV_LINKS = '.nav-link'\nconst SELECTOR_NAV_ITEMS = '.nav-item'\nconst SELECTOR_LIST_ITEMS = '.list-group-item'\nconst SELECTOR_LINK_ITEMS = `${SELECTOR_NAV_LINKS}, ${SELECTOR_NAV_ITEMS} > ${SELECTOR_NAV_LINKS}, ${SELECTOR_LIST_ITEMS}`\nconst SELECTOR_DROPDOWN = '.dropdown'\nconst SELECTOR_DROPDOWN_TOGGLE = '.dropdown-toggle'\n\nconst Default = {\n offset: null, // TODO: v6 @deprecated, keep it for backwards compatibility reasons\n rootMargin: '0px 0px -25%',\n smoothScroll: false,\n target: null,\n threshold: [0.1, 0.5, 1]\n}\n\nconst DefaultType = {\n offset: '(number|null)', // TODO v6 @deprecated, keep it for backwards compatibility reasons\n rootMargin: 'string',\n smoothScroll: 'boolean',\n target: 'element',\n threshold: 'array'\n}\n\n/**\n * Class definition\n */\n\nclass ScrollSpy extends BaseComponent {\n constructor(element, config) {\n super(element, config)\n\n // this._element is the observablesContainer and config.target the menu links wrapper\n this._targetLinks = new Map()\n this._observableSections = new Map()\n this._rootElement = getComputedStyle(this._element).overflowY === 'visible' ? null : this._element\n this._activeTarget = null\n this._observer = null\n this._previousScrollData = {\n visibleEntryTop: 0,\n parentScrollTop: 0\n }\n this.refresh() // initialize\n }\n\n // Getters\n static get Default() {\n return Default\n }\n\n static get DefaultType() {\n return DefaultType\n }\n\n static get NAME() {\n return NAME\n }\n\n // Public\n refresh() {\n this._initializeTargetsAndObservables()\n this._maybeEnableSmoothScroll()\n\n if (this._observer) {\n this._observer.disconnect()\n } else {\n this._observer = this._getNewObserver()\n }\n\n for (const section of this._observableSections.values()) {\n this._observer.observe(section)\n }\n }\n\n dispose() {\n this._observer.disconnect()\n super.dispose()\n }\n\n // Private\n _configAfterMerge(config) {\n // TODO: on v6 target should be given explicitly & remove the {target: 'ss-target'} case\n config.target = getElement(config.target) || document.body\n\n // TODO: v6 Only for backwards compatibility reasons. Use rootMargin only\n config.rootMargin = config.offset ? `${config.offset}px 0px -30%` : config.rootMargin\n\n if (typeof config.threshold === 'string') {\n config.threshold = config.threshold.split(',').map(value => Number.parseFloat(value))\n }\n\n return config\n }\n\n _maybeEnableSmoothScroll() {\n if (!this._config.smoothScroll) {\n return\n }\n\n // unregister any previous listeners\n EventHandler.off(this._config.target, EVENT_CLICK)\n\n EventHandler.on(this._config.target, EVENT_CLICK, SELECTOR_TARGET_LINKS, event => {\n const observableSection = this._observableSections.get(event.target.hash)\n if (observableSection) {\n event.preventDefault()\n const root = this._rootElement || window\n const height = observableSection.offsetTop - this._element.offsetTop\n if (root.scrollTo) {\n root.scrollTo({ top: height, behavior: 'smooth' })\n return\n }\n\n // Chrome 60 doesn't support `scrollTo`\n root.scrollTop = height\n }\n })\n }\n\n _getNewObserver() {\n const options = {\n root: this._rootElement,\n threshold: this._config.threshold,\n rootMargin: this._config.rootMargin\n }\n\n return new IntersectionObserver(entries => this._observerCallback(entries), options)\n }\n\n // The logic of selection\n _observerCallback(entries) {\n const targetElement = entry => this._targetLinks.get(`#${entry.target.id}`)\n const activate = entry => {\n this._previousScrollData.visibleEntryTop = entry.target.offsetTop\n this._process(targetElement(entry))\n }\n\n const parentScrollTop = (this._rootElement || document.documentElement).scrollTop\n const userScrollsDown = parentScrollTop >= this._previousScrollData.parentScrollTop\n this._previousScrollData.parentScrollTop = parentScrollTop\n\n for (const entry of entries) {\n if (!entry.isIntersecting) {\n this._activeTarget = null\n this._clearActiveClass(targetElement(entry))\n\n continue\n }\n\n const entryIsLowerThanPrevious = entry.target.offsetTop >= this._previousScrollData.visibleEntryTop\n // if we are scrolling down, pick the bigger offsetTop\n if (userScrollsDown && entryIsLowerThanPrevious) {\n activate(entry)\n // if parent isn't scrolled, let's keep the first visible item, breaking the iteration\n if (!parentScrollTop) {\n return\n }\n\n continue\n }\n\n // if we are scrolling up, pick the smallest offsetTop\n if (!userScrollsDown && !entryIsLowerThanPrevious) {\n activate(entry)\n }\n }\n }\n\n _initializeTargetsAndObservables() {\n this._targetLinks = new Map()\n this._observableSections = new Map()\n\n const targetLinks = SelectorEngine.find(SELECTOR_TARGET_LINKS, this._config.target)\n\n for (const anchor of targetLinks) {\n // ensure that the anchor has an id and is not disabled\n if (!anchor.hash || isDisabled(anchor)) {\n continue\n }\n\n const observableSection = SelectorEngine.findOne(decodeURI(anchor.hash), this._element)\n\n // ensure that the observableSection exists & is visible\n if (isVisible(observableSection)) {\n this._targetLinks.set(decodeURI(anchor.hash), anchor)\n this._observableSections.set(anchor.hash, observableSection)\n }\n }\n }\n\n _process(target) {\n if (this._activeTarget === target) {\n return\n }\n\n this._clearActiveClass(this._config.target)\n this._activeTarget = target\n target.classList.add(CLASS_NAME_ACTIVE)\n this._activateParents(target)\n\n EventHandler.trigger(this._element, EVENT_ACTIVATE, { relatedTarget: target })\n }\n\n _activateParents(target) {\n // Activate dropdown parents\n if (target.classList.contains(CLASS_NAME_DROPDOWN_ITEM)) {\n SelectorEngine.findOne(SELECTOR_DROPDOWN_TOGGLE, target.closest(SELECTOR_DROPDOWN))\n .classList.add(CLASS_NAME_ACTIVE)\n return\n }\n\n for (const listGroup of SelectorEngine.parents(target, SELECTOR_NAV_LIST_GROUP)) {\n // Set triggered links parents as active\n // With both
    and