@vireo-ai/trellis-ui 0.1.52 → 0.1.54
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +23 -1
- package/package.json +2 -2
- package/packages/client/src/components/keybinding/styles.css +18 -2
- package/packages/client/src/components/link/styles.css +42 -0
- package/packages/client/src/components/tooltip/styles.css +3 -8
- package/packages/client/src/styles/components.css +2 -0
- package/packages/client/src/styles/generated/theme-fonts.css +1 -1
- package/packages/client/src/styles/generated/theme-palette.css +5 -1
- package/packages/client/src/styles/generated/theme-runtime.css +425 -6
- package/packages/client/src/styles/generated-sources.css +1 -1
- package/packages/client/src/styles/layout-participation.css +17 -0
- package/packages/client/src/styles/recipes/intent.css +3 -3
- package/packages/client/types/assets/bridge.d.ts +2 -1
- package/packages/client/types/capabilities/sortable.d.ts +2 -2
- package/packages/client/types/component-api.d.ts +1 -1
- package/packages/client/types/components/box/contract.d.ts +19 -19
- package/packages/client/types/components/button/contract.d.ts +1 -1
- package/packages/client/types/components/checkbox/machine.d.ts +0 -3
- package/packages/client/types/components/common.d.ts +23 -2
- package/packages/client/types/components/container/contract.d.ts +11 -11
- package/packages/client/types/components/file-upload/contract.d.ts +1 -1
- package/packages/client/types/components/file-upload/machine.d.ts +10 -12
- package/packages/client/types/components/flex/contract.d.ts +9 -9
- package/packages/client/types/components/frame/contract.d.ts +27 -26
- package/packages/client/types/components/grid/contract.d.ts +9 -9
- package/packages/client/types/components/heading/contract.d.ts +2 -2
- package/packages/client/types/components/input/contract.d.ts +1 -1
- package/packages/client/types/components/keybinding/contract.d.ts +5 -2
- package/packages/client/types/components/layout.d.ts +303 -149
- package/packages/client/types/components/link/contract.d.ts +30 -0
- package/packages/client/types/components/link/index.d.ts +2 -0
- package/packages/client/types/components/menu/contract.d.ts +17 -4
- package/packages/client/types/components/panels/contract.d.ts +1 -1
- package/packages/client/types/components/panels/machine.d.ts +17 -10
- package/packages/client/types/components/runtime.d.ts +1 -1
- package/packages/client/types/components/section/contract.d.ts +9 -9
- package/packages/client/types/components/select/contract.d.ts +1 -1
- package/packages/client/types/components/select/machine.d.ts +8 -7
- package/packages/client/types/components/stack/contract.d.ts +9 -9
- package/packages/client/types/components/switch/machine.d.ts +1 -5
- package/packages/client/types/components/text/contract.d.ts +4 -4
- package/packages/client/types/components/toast/index.d.ts +0 -2
- package/packages/client/types/components/toast/machine.d.ts +6 -5
- package/packages/client/types/components/virtualizer/cursor.d.ts +1 -1
- package/packages/client/types/components/virtualizer/index.d.ts +1 -1
- package/packages/client/types/core.d.ts +2 -2
- package/packages/client/types/directives/sortable.d.ts +2 -1
- package/packages/client/types/motion/owned.d.ts +5 -3
- package/packages/client/types/runtime/alpine-data.d.ts +3 -1
- package/packages/client/types/runtime/cursor-data-source.d.ts +14 -19
- package/packages/client/types/runtime/drag-and-drop/index.d.ts +2 -2
- package/packages/client/types/runtime/drag-and-drop/sortable/contract.d.ts +12 -12
- package/packages/client/types/runtime/drag-and-drop/sortable/feedback.d.ts +3 -3
- package/packages/client/types/runtime/drag-and-drop/sortable/index.d.ts +2 -2
- package/packages/client/types/runtime/drag-and-drop/sortable/placement.d.ts +7 -7
- package/packages/client/types/runtime/drag-and-drop/sortable/registry.d.ts +9 -5
- package/packages/client/types/runtime/engine/navigation.d.ts +2 -1
- package/packages/client/types/runtime/engine/request.d.ts +29 -5
- package/packages/client/types/runtime/engine/stream.d.ts +6 -2
- package/packages/client/types/runtime/index.d.ts +4 -4
- package/packages/client/types/runtime/manifest.d.ts +31 -8
- package/packages/client/types/runtime/scroll-lock.d.ts +2 -3
- package/packages/client/types/runtime/theme.d.ts +2 -2
- package/packages/client/types/runtime/ui.d.ts +3 -3
- package/packages/client/types/runtime/virtualizer-fragment.d.ts +1 -1
- package/packages/client/types/runtime/virtualizer.d.ts +1 -1
- package/packages/client/types/utils/dom.d.ts +3 -3
- package/packages/client/types/utils/index.d.ts +2 -2
- package/packages/client/types/utils/object.d.ts +2 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/css/trellis.css +464 -26
- package/packages/server/trellis_ui/static/trellis_ui/assets/css/trellis.min.css +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/bridge.js +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/build-metadata.json +518 -489
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/capabilities/motion.js +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/capabilities/resizable.js +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/capabilities/sortable.js +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/capabilities/sortable.js.map +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/alpine-data-Dvc_bXq6.js +2 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/alpine-data-Dvc_bXq6.js.map +1 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/alpine-machine-9HwatUrm.js +2 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/alpine-machine-9HwatUrm.js.map +1 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{anchored-popover-BXEMsLrA.js → anchored-popover-CSBqS_MK.js} +2 -2
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{anchored-popover-BXEMsLrA.js.map → anchored-popover-CSBqS_MK.js.map} +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/bridge-TcE7HSvq.js +2 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/bridge-TcE7HSvq.js.map +1 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/capability-motion-DAUyPPWa.js +2 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{capability-motion-DQitxnHn.js.map → capability-motion-DAUyPPWa.js.map} +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/capability-resizable-BQgJCSHn.js +2 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{capability-resizable-Bga8TngJ.js.map → capability-resizable-BQgJCSHn.js.map} +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/capability-sortable-BLyIVEh9.js +3 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/capability-sortable-BLyIVEh9.js.map +1 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{alpine-data-CytyCyfk.js → cleanup-manager-D9QiZF_Q.js} +2 -2
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/cleanup-manager-D9QiZF_Q.js.map +1 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/common-De1R7Xh6.js +2 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/common-De1R7Xh6.js.map +1 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/controller-CzqwFGEd.js +2 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/controller-CzqwFGEd.js.map +1 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/core-CogF8tNb.js +2 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/core-CogF8tNb.js.map +1 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/cursor-data-source-B2mQNyzN.js +2 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/cursor-data-source-B2mQNyzN.js.map +1 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/dom-DiTFTWeR.js +2 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/dom-DiTFTWeR.js.map +1 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/drag-and-drop-cns3DNcf.js +2 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{drag-and-drop-DHq3udf7.js.map → drag-and-drop-cns3DNcf.js.map} +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-B1wGmQth.js +2 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-B1wGmQth.js.map +1 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-B3hMqvMn.js +2 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-B3hMqvMn.js.map +1 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-BBuJrkhp.js +2 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-BBuJrkhp.js.map +1 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-BCTWp6Xu.js +2 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-BCTWp6Xu.js.map +1 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-BMLdOzZs.js +2 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-BMLdOzZs.js.map +1 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-BMeqWpPy.js +2 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-BMeqWpPy.js.map +1 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-BOk2j8j3.js +2 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-BOk2j8j3.js.map +1 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-BhINWOfZ.js +2 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-BhINWOfZ.js.map +1 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-AFRarPro.js → entry.generated-Bqy0wCWo.js} +2 -2
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-AFRarPro.js.map → entry.generated-Bqy0wCWo.js.map} +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-C-4OkQdv.js +2 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-C-4OkQdv.js.map +1 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-CfkH92RS.js +2 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-CfkH92RS.js.map +1 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-CmvKWs0J.js +2 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-BqEMECZx.js.map → entry.generated-CmvKWs0J.js.map} +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-CnFggOc8.js +2 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-CnFggOc8.js.map +1 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-CnY5J5bD.js +2 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-CnY5J5bD.js.map +1 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-CuZffmX3.js +2 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-CuZffmX3.js.map +1 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-DTRN8-Ks.js +2 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-DTRN8-Ks.js.map +1 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-QspMEPHx.js → entry.generated-Da6pELhK.js} +2 -2
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-QspMEPHx.js.map → entry.generated-Da6pELhK.js.map} +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-De9SwKec.js +2 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-De9SwKec.js.map +1 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-DvvVMsQo.js → entry.generated-QV-az1in.js} +2 -2
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry.generated-DvvVMsQo.js.map → entry.generated-QV-az1in.js.map} +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-sKnD2JaT.js +2 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-sKnD2JaT.js.map +1 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-x0moHcUM.js +2 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-x0moHcUM.js.map +1 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry2.generated-Bu7BMlbI.js +2 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry2.generated-Bu7BMlbI.js.map +1 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry2.generated-Bxu-sgBm.js +2 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry2.generated-Bxu-sgBm.js.map +1 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{entry2.generated-DXDHgDsN.js → entry2.generated-dkzHCN26.js} +2 -2
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry2.generated-dkzHCN26.js.map +1 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry2.generated-g1AVE90L.js +2 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry2.generated-g1AVE90L.js.map +1 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{form-control-DjbUb602.js → form-control-DL1Hkox3.js} +2 -2
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{form-control-DjbUb602.js.map → form-control-DL1Hkox3.js.map} +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{fragment-Bl3Rq38L.js → fragment-BzHC-hAJ.js} +2 -2
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{fragment-Bl3Rq38L.js.map → fragment-BzHC-hAJ.js.map} +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/machine-DQfpKM3w.js +2 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/machine-DQfpKM3w.js.map +1 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/motion-mw9QhBgu.js +3 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/motion-mw9QhBgu.js.map +1 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/object-SRW-YaCA.js +2 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/object-SRW-YaCA.js.map +1 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/scroll-lock-C5dQtr4Y.js +2 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/scroll-lock-C5dQtr4Y.js.map +1 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/semantic-observer-CIoriWtV.js +2 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{semantic-observer-CdRbZHir.js.map → semantic-observer-CIoriWtV.js.map} +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{styles-CpTCQjY5.js → styles-BstOueoe.js} +2 -2
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/{styles-CpTCQjY5.js.map → styles-BstOueoe.js.map} +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/ui-BGfrCghL.js +4 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/ui-BGfrCghL.js.map +1 -0
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/accordion.js +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/checkbox.js +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/data-grid.js +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/date-picker.js +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/direct-upload.js +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/dropdown.js +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/field.js +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/file-upload.js +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/formset.js +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/import-mapper.js +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/index.js +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/index.js.map +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/input.js +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/keybinding.js +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/modal.js +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/panels.js +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/radio.js +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/scroll-area.js +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/select.js +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/sidebar.js +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/slider.js +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/switch.js +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/table.js +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/tabs.js +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/toast.js +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/tooltip.js +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/components/virtualizer.js +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/core.js +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/index.js +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/index.js.map +1 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/logical-entry-manifest.json +397 -339
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/trellis.js +9 -9
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/trellis.min.js +9 -9
- package/packages/client/types/motion/registry.d.ts +0 -13
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/alpine-data-CytyCyfk.js.map +0 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/alpine-machine-BTDXpEr6.js +0 -2
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/alpine-machine-BTDXpEr6.js.map +0 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/bridge-B4S_D6hV.js +0 -2
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/bridge-B4S_D6hV.js.map +0 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/capability-motion-DQitxnHn.js +0 -2
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/capability-resizable-Bga8TngJ.js +0 -2
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/capability-sortable-Dzv1zWaL.js +0 -3
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/capability-sortable-Dzv1zWaL.js.map +0 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/common-Dfj6NCjU.js +0 -2
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/common-Dfj6NCjU.js.map +0 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/controller-xDNH-xzt.js +0 -2
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/controller-xDNH-xzt.js.map +0 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/core-DMbnlSdM.js +0 -2
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/core-DMbnlSdM.js.map +0 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/cursor-data-source-DvHNTjt1.js +0 -2
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/cursor-data-source-DvHNTjt1.js.map +0 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/dom-qAeVl7dc.js +0 -2
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/dom-qAeVl7dc.js.map +0 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/drag-and-drop-DHq3udf7.js +0 -2
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-2QEJDMe-.js +0 -2
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-2QEJDMe-.js.map +0 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-BB7wWQfT.js +0 -2
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-BB7wWQfT.js.map +0 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-BqEMECZx.js +0 -2
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-C07Tn0r-.js +0 -2
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-C07Tn0r-.js.map +0 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-C2gP0OfV.js +0 -2
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-C2gP0OfV.js.map +0 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-CRj4-Ef1.js +0 -2
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-CRj4-Ef1.js.map +0 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-CirM6w9Q.js +0 -2
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-CirM6w9Q.js.map +0 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-CvcufWkj.js +0 -2
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-CvcufWkj.js.map +0 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-D3w3QaSO.js +0 -2
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-D3w3QaSO.js.map +0 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-DCLIvEtJ.js +0 -2
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-DCLIvEtJ.js.map +0 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-DVQaci6w.js +0 -2
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-DVQaci6w.js.map +0 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-D_FlEfdN.js +0 -2
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-D_FlEfdN.js.map +0 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-DwYIFLsE.js +0 -2
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-DwYIFLsE.js.map +0 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-Rx9NofFi.js +0 -2
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-Rx9NofFi.js.map +0 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-gxr2-89M.js +0 -2
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-gxr2-89M.js.map +0 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-oz1RCU1b.js +0 -2
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-oz1RCU1b.js.map +0 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-payXlXhL.js +0 -2
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-payXlXhL.js.map +0 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-wEt8LYAv.js +0 -2
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry.generated-wEt8LYAv.js.map +0 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry2.generated-CpoK52gE.js +0 -2
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry2.generated-CpoK52gE.js.map +0 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry2.generated-D1X0sDop.js +0 -2
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry2.generated-D1X0sDop.js.map +0 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry2.generated-DXDHgDsN.js.map +0 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry2.generated-_UPpJlWp.js +0 -2
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/entry2.generated-_UPpJlWp.js.map +0 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/machine-Dqut4h89.js +0 -2
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/machine-Dqut4h89.js.map +0 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/motion-BDQdr83d.js +0 -3
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/motion-BDQdr83d.js.map +0 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/scroll-lock-DOw7dmi1.js +0 -2
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/scroll-lock-DOw7dmi1.js.map +0 -1
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/semantic-observer-CdRbZHir.js +0 -2
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/ui-SdoiMWig.js +0 -4
- package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/ui-SdoiMWig.js.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{t as e}from"../chunks/motion-
|
|
1
|
+
import{t as e}from"../chunks/motion-mw9QhBgu.js";import{n as t,t as n}from"../chunks/capability-motion-DAUyPPWa.js";var r=n;export{r as default,e as motion,t as registerBoundsDirective,n as registerMotionCapability};
|
|
2
2
|
//# sourceMappingURL=motion.js.map
|
package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/capabilities/resizable.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{t as e}from"../chunks/drag-and-drop-
|
|
1
|
+
import{t as e}from"../chunks/drag-and-drop-cns3DNcf.js";import{t}from"../chunks/capability-resizable-BQgJCSHn.js";var n=t;export{e as createResizable,n as default,t as registerResizableCapability};
|
|
2
2
|
//# sourceMappingURL=resizable.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{n as e,r as t,t as n}from"../chunks/capability-sortable-BLyIVEh9.js";var r=n;export{t as createSortableRegistry,r as default,n as registerSortableCapability,e as registerSortableDirective};
|
|
2
2
|
//# sourceMappingURL=sortable.js.map
|
package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/capabilities/sortable.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sortable.js","names":[],"sources":["../../../../../../../../client/src/capabilities/sortable.entry.generated.ts"],"sourcesContent":["// Generated by scripts/generate_component_entries.mjs from packages/client/component-entries.json.\n// Do not edit by hand.\nimport {registerSortableCapability} from './sortable';\n\nexport default registerSortableCapability;\nexport * from './sortable';\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"sortable.js","names":[],"sources":["../../../../../../../../client/src/capabilities/sortable.entry.generated.ts"],"sourcesContent":["// Generated by scripts/generate_component_entries.mjs from packages/client/component-entries.json.\n// Do not edit by hand.\nimport {registerSortableCapability} from './sortable';\n\nexport default registerSortableCapability;\nexport * from './sortable';\n"],"mappings":"4EAIA,IAAA,EAAe"}
|
package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/alpine-data-Dvc_bXq6.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{t as e}from"./cleanup-manager-D9QiZF_Q.js";var t=Symbol(`trellis-ui.cleanup-owner`),n=n=>{let r=Reflect.get(n,t);if(r)return r();let i=new e,a=Reflect.get(n,`destroy`);return Reflect.defineProperty(n,t,{value:()=>i,configurable:!0}),i.add(()=>a?.call(n)),Reflect.set(n,`destroy`,()=>i.run()),i},r=(e,n)=>{let r=n.parentElement;if(r)return e.closestDataStack(r).map(e=>Reflect.get(e,t)?.()).find(e=>e!==void 0)},i=(n,i)=>a=>{a.data(n,function(...n){let o=i.apply(this,n),s=new e,c=o.init,l=o.destroy;return Reflect.defineProperty(o,t,{value:()=>s,configurable:!0}),o.init=function(){r(a,Reflect.get(this,`$el`))?.addChild(s),s.add(()=>l?.call(this)),c?.call(this)},o.destroy=function(){s.run()},o})};export{i as n,n as t};
|
|
2
|
+
//# sourceMappingURL=alpine-data-Dvc_bXq6.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alpine-data-Dvc_bXq6.js","names":[],"sources":["../../../../../../../../client/src/runtime/alpine-data.ts"],"sourcesContent":["import type Alpine from 'alpinejs';\n\nimport {CleanupManager} from './cleanup-manager';\n\ntype AlpineDataFactory<T, TArgs extends unknown[] = []> = (\n ...args: TArgs\n) => Alpine.AlpineComponent<T>;\ntype AlpineDataRegistrar = (AlpineInstance: Alpine.Alpine) => void;\n\nconst cleanupOwner = Symbol('trellis-ui.cleanup-owner');\ntype CleanupOwner = () => CleanupManager;\n\nconst cleanupManagerFor = (component: object): CleanupManager => {\n const owner = Reflect.get(component, cleanupOwner) as CleanupOwner | undefined;\n if (owner) return owner();\n\n const cleanup = new CleanupManager();\n const destroy = Reflect.get(component, 'destroy') as ((this: unknown) => void) | undefined;\n Reflect.defineProperty(component, cleanupOwner, {value: () => cleanup, configurable: true});\n cleanup.add(() => destroy?.call(component));\n Reflect.set(component, 'destroy', () => cleanup.run());\n return cleanup;\n};\n\nconst findParentCleanup = (\n AlpineInstance: Alpine.Alpine,\n el: Alpine.ElementWithXAttributes,\n): CleanupManager | undefined => {\n const parent = el.parentElement as Alpine.ElementWithXAttributes | null;\n if (!parent) return undefined;\n return AlpineInstance.closestDataStack(parent)\n .map((data) => (Reflect.get(data, cleanupOwner) as CleanupOwner | undefined)?.())\n .find((cleanup) => cleanup !== undefined);\n};\n\nconst defineAlpineData = <T, TArgs extends unknown[] = []>(\n name: string,\n factory: AlpineDataFactory<T, TArgs>,\n): AlpineDataRegistrar => (\n AlpineInstance,\n) => {\n AlpineInstance.data(name, function(this: unknown, ...args: TArgs) {\n const component = factory.apply(this, args);\n const cleanup = new CleanupManager();\n const init = component.init;\n const destroy = component.destroy;\n\n Reflect.defineProperty(component, cleanupOwner, {value: () => cleanup, configurable: true});\n component.init = function(): void {\n const el = Reflect.get(this, '$el') as Alpine.ElementWithXAttributes;\n findParentCleanup(AlpineInstance, el)?.addChild(cleanup);\n cleanup.add(() => destroy?.call(this));\n init?.call(this);\n };\n component.destroy = function(): void {\n cleanup.run();\n };\n return component;\n });\n};\n\nexport {cleanupManagerFor, defineAlpineData};\nexport type {AlpineDataFactory, AlpineDataRegistrar};\n"],"mappings":"kDASA,IAAM,EAAe,OAAO,0BAA0B,EAGhD,EAAqB,GAAsC,CAC7D,IAAM,EAAQ,QAAQ,IAAI,EAAW,CAAY,EACjD,GAAI,EAAO,OAAO,EAAM,EAExB,IAAM,EAAU,IAAI,EACd,EAAU,QAAQ,IAAI,EAAW,SAAS,EAIhD,OAHA,QAAQ,eAAe,EAAW,EAAc,CAAC,UAAa,EAAS,aAAc,EAAI,CAAC,EAC1F,EAAQ,QAAU,GAAS,KAAK,CAAS,CAAC,EAC1C,QAAQ,IAAI,EAAW,cAAiB,EAAQ,IAAI,CAAC,EAC9C,CACX,EAEM,GACF,EACA,IAC6B,CAC7B,IAAM,EAAS,EAAG,cACb,KACL,OAAO,EAAe,iBAAiB,CAAM,EACxC,IAAK,GAAU,QAAQ,IAAI,EAAM,CAAY,IAAiC,CAAC,EAC/E,KAAM,GAAY,IAAY,IAAA,EAAS,CAChD,EAEM,GACF,EACA,IAEA,GACC,CACD,EAAe,KAAK,EAAM,SAAwB,GAAG,EAAa,CAC9D,IAAM,EAAY,EAAQ,MAAM,KAAM,CAAI,EACpC,EAAU,IAAI,EACd,EAAO,EAAU,KACjB,EAAU,EAAU,QAY1B,OAVA,QAAQ,eAAe,EAAW,EAAc,CAAC,UAAa,EAAS,aAAc,EAAI,CAAC,EAC1F,EAAU,KAAO,UAAiB,CAE9B,EAAkB,EADP,QAAQ,IAAI,KAAM,KACK,CAAE,GAAG,SAAS,CAAO,EACvD,EAAQ,QAAU,GAAS,KAAK,IAAI,CAAC,EACrC,GAAM,KAAK,IAAI,CACnB,EACA,EAAU,QAAU,UAAiB,CACjC,EAAQ,IAAI,CAChB,EACO,CACX,CAAC,CACL"}
|
package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/alpine-machine-9HwatUrm.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{i as e,r as t,t as n}from"./object-SRW-YaCA.js";import{a as r,i}from"./codecs-Cb1ns_47.js";var a=(e=>{if(e.project===void 0==(e.projectEach===void 0))throw Error(`Transition hook ${e.name} requires exactly one projection.`);return Object.freeze(e)}),o=e=>typeof e==`string`?[e]:e,s=(e,t)=>{let n=e.split(`.`),r=t.split(`.`),i=0;for(;n[i]!==void 0&&n[i]===r[i];)i+=1;return i},c=(e,t)=>[...o(e)].sort((e,n)=>s(n,t)-s(e,t))[0]??t,l=({machine:e,hooks:r,root:i,resolveElement:a})=>{let o=new Map(r.map(e=>[e.name,e])),s=new Map,l=new Map,u=new Set,d=!1;if(o.size!==r.length)throw Error(`Transition hook names must be unique.`);r.forEach(e=>{let t=s.get(e.state)??[],n=t[0];if(n&&(n.onDone!==e.onDone||n.onError!==e.onError))throw Error(`Transition hooks sharing ${e.state} must use the same continuations.`);t.push(e),s.set(e.state,t)});let f=t=>!d&&e.getSnapshot().generations[t.path]===t.generation,p=(t,n,r={})=>{e.send({type:n,...r,__state:t.path,__generation:t.generation})},m=(e,t)=>e.projectEach?.(t)??[e.project?.(t)],h=(r,o,s,l,u,d=0)=>{for(let p=d;p<l.length;p+=1){if(!f(r))return;let d=l[p],m=i??d.el,g=a?.({name:o.name,data:s,root:m,registrationEl:d.el});if(g===null)return;let _=g??d.el,v=e.send.bind(e);Object.entries(o.sends??{}).forEach(([t,n])=>{v[t]=(...t)=>e.send(n(...t))});let y=Object.freeze({el:_,root:m,from:c(r.from,r.path),to:r.path,event:Object.freeze({...r.event}),props:n(r.snapshot.props),data:n(s),send:v,signal:u}),b=d.callback(y);if(t(b))return Promise.resolve(b).then(()=>h(r,o,s,l,u,p+1))}},g=e=>{let n=s.get(e.path);if(!n)return;let r=[],i=[],a=new AbortController,o={entry:e,controller:a};u.add(o),n.forEach(t=>{let n=[...l.get(t.name)??[]];if(n.length===0){t.required&&i.push(Error(`Transition hook ${t.name} requires a registered callback.`));return}m(t,e.snapshot).forEach(o=>{try{r.push(h(e,t,o,n,a.signal))}catch(e){i.push(e)}})});let c=n[0],d=(t=[])=>{if(u.delete(o),!f(e))return;let n=[...i,...t][0];n===void 0?p(e,c.onDone):p(e,c.onError,{error:n})},g=r.filter(t);if(g.length===0){d();return}Promise.allSettled(g).then(e=>d(e.flatMap(e=>e.status===`rejected`?[e.reason]:[])))},_=e.subscribeEntries(e=>{g(e)}),v=e.subscribe(()=>{u.forEach(e=>{f(e.entry)||(e.controller.abort(),u.delete(e))})});return{register({name:e,el:t,callback:n}){if(d)throw Error(`Transition coordinator has been destroyed.`);if(!o.has(e))throw Error(`Unknown transition hook: ${e}`);let r={name:e,el:t,callback:n},i=l.get(e)??[];return i.push(r),l.set(e,i),()=>{let t=l.get(e);if(!t)return;let n=t.indexOf(r);n>=0&&t.splice(n,1),t.length===0&&l.delete(e)}},destroy(){d||(d=!0,_(),v(),u.forEach(e=>e.controller.abort()),u.clear(),l.clear())}}},u=Symbol.for(`trellis-ui.alpine-machine-owner`),d=new WeakMap,f=(e,t)=>{let n=(typeof e.closestDataStack==`function`?e.closestDataStack(t):[]).find(e=>Reflect.get(e,u)===!0);if(n)return n;let r=e.findClosest(t,e=>d.has(e));return r?d.get(r):void 0},p=({schema:t,hooks:n,createMachine:a,resolveTransitionElement:o})=>{let s={current:null},c=s,f=[],p=null,m=null,h=null,g=null,_=null,v=!1,y=()=>{if(!m)throw Error(`Alpine machine has not been initialized.`);return m},b=e=>{!h||!p||!e.active||(e.unregister=h.register({name:e.name,el:e.el??p,callback:e.callback}))},x={snapshot:s,invalidateDom(){v||!m||m.send(`DOM_INVALIDATED`)},connect(u,y=s){if(v)throw Error(`Alpine machine has been destroyed.`);if(m)return;p=u,c=y;let S=r({el:p,schema:t}),C=a({el:p,props:S}),w;try{w=l({machine:C,hooks:n,root:p,...o?{resolveElement:o}:{}})}catch(e){throw C.stop(),p=null,e}m=C,h=w,c.current=m.getSnapshot(),_=m.subscribe(e=>{c.current=e}),d.set(p,x),f.forEach(b);let T=new Map(Object.entries(t).flatMap(([e,t])=>t.meta.attribute?[[i(e,t),e]]:[]));g=new MutationObserver(n=>{if(!p||!m)return;let i=new Set(n.flatMap(({attributeName:e})=>{let t=e?T.get(e):void 0;return t?[t]:[]})),a=r({el:p,schema:t}),o=Object.keys(a).flatMap(t=>{let n=t;return!i.has(n)&&e(S[n],a[n])?[]:[{key:n,previous:S[n],value:a[n],source:`attribute`}]});o.length!==0&&(S=a,m.send({type:`PROPS_CHANGED`,props:a,changes:o}))}),g.observe(p,{attributes:!0,attributeFilter:Object.entries(t).map(([e,t])=>i(e,t))})},disconnect(){v||(v=!0,g?.disconnect(),g=null,_?.(),_=null,h?.destroy(),h=null,m?.stop(),m=null,p&&d.delete(p),Reflect.deleteProperty(x,u),p=null,f.splice(0).forEach(e=>e.unregister?.()),c.current=null,c=s)},getSnapshot(){let e=c.current;if(!e)throw Error(`Alpine machine has not been initialized.`);return e},getCommittedSnapshot(){return y().getSnapshot()},send(e){y().send(e)},matches(e){return y().matches(e)},hasTag(e){return y().hasTag(e)},onTransition(e,t,n){if(v)throw Error(`Alpine machine has been destroyed.`);let r={name:e,callback:t,active:!0};return n&&(r.el=n),f.push(r),b(r),()=>{if(!r.active)return;r.active=!1,r.unregister?.(),delete r.unregister;let e=f.indexOf(r);e>=0&&f.splice(e,1)}}};return Reflect.defineProperty(x,u,{value:!0,configurable:!0}),x};export{a as i,f as n,l as r,p as t};
|
|
2
|
+
//# sourceMappingURL=alpine-machine-9HwatUrm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alpine-machine-9HwatUrm.js","names":[],"sources":["../../../../../../../../client/src/runtime/transition-coordinator.ts","../../../../../../../../client/src/runtime/alpine-machine.ts"],"sourcesContent":["import type {\n Machine,\n MachineEntry,\n MachineEvent,\n MachineEventObject,\n MachineSnapshot,\n MachineStateValue,\n} from './state-machine';\nimport {cloneSerializable, isPromiseLike} from '../utils';\n\ntype TransitionEventCreator = (...args: never[]) => MachineEvent;\ntype TransitionSend<\n TSends extends Record<string, TransitionEventCreator> = Record<string, TransitionEventCreator>,\n> = ((event: MachineEvent) => void) & (\n string extends keyof TSends\n ? {[name: string]: ((...args: unknown[]) => void) | undefined}\n : {[TName in keyof TSends]: (...args: Parameters<TSends[TName]>) => void}\n);\n\ntype TransitionHookDefinition<\n TContext,\n TProps,\n TData,\n TName extends string = string,\n TSends extends Record<string, TransitionEventCreator> = Record<string, TransitionEventCreator>,\n> = Readonly<{\n name: TName;\n state: string;\n onDone: string;\n onError: string;\n required?: boolean;\n sends?: TSends;\n project?: (snapshot: MachineSnapshot<TContext, TProps>) => TData;\n projectEach?: (snapshot: MachineSnapshot<TContext, TProps>) => readonly TData[];\n}>;\n\ntype AnyTransitionHook<TContext, TProps> = TransitionHookDefinition<TContext, TProps, unknown>;\n\ntype TransitionHookShape = Readonly<{\n name: string;\n state: string;\n onDone: string;\n onError: string;\n required?: boolean;\n sends?: Record<string, TransitionEventCreator>;\n project?: (...args: never[]) => unknown;\n projectEach?: (...args: never[]) => readonly unknown[];\n}>;\n\ntype TransitionContext<\n TProps,\n TData,\n TElement = unknown,\n TSends extends Record<string, TransitionEventCreator> = Record<string, TransitionEventCreator>,\n> = Readonly<{\n el: TElement;\n root: TElement;\n from: string;\n to: string;\n event: MachineEventObject;\n props: TProps;\n data: TData;\n send: TransitionSend<TSends>;\n signal: AbortSignal;\n}>;\n\ntype TransitionCallback<\n TProps,\n TData,\n TElement = unknown,\n TSends extends Record<string, TransitionEventCreator> = Record<string, TransitionEventCreator>,\n> = (\n transition: TransitionContext<TProps, TData, TElement, TSends>,\n) => unknown | Promise<unknown>;\n\ntype HookProjection<THook> = THook extends {project: (snapshot: infer TSnapshot) => infer TData}\n ? {snapshot: TSnapshot; data: TData}\n : THook extends {projectEach: (snapshot: infer TSnapshot) => readonly (infer TData)[]}\n ? {snapshot: TSnapshot; data: TData}\n : never;\ntype HookSends<THook> = THook extends {\n sends: infer TSends extends Record<string, TransitionEventCreator>;\n} ? TSends : Record<never, TransitionEventCreator>;\ntype TransitionForHook<THook, TElement = unknown> = THook extends unknown\n ? HookProjection<THook> extends {\n snapshot: MachineSnapshot<infer _TContext, infer TProps>;\n data: infer TData;\n } ? TransitionContext<TProps, TData, TElement, HookSends<THook>> : never\n : never;\n\ntype TransitionRegistration<TProps, TElement> = {\n name: string;\n el: TElement;\n callback: TransitionCallback<TProps, unknown, TElement>;\n};\n\ntype TransitionCoordinatorOptions<TContext, TProps, TElement> = {\n machine: Machine<TContext, TProps>;\n hooks: readonly AnyTransitionHook<TContext, TProps>[];\n root?: TElement;\n resolveElement?: TransitionElementResolver<TElement>;\n};\n\ntype TransitionElementResolver<TElement> = (scope: Readonly<{\n name: string;\n data: unknown;\n root: TElement;\n registrationEl: TElement;\n}>) => TElement | null | undefined;\n\ntype TransitionCoordinator<TProps, TElement = unknown> = {\n register<TData>(registration: {\n name: string;\n el: TElement;\n callback: TransitionCallback<TProps, TData, TElement>;\n }): () => void;\n destroy(): void;\n};\n\ntype DefineHook = {\n <const TDefinition extends TransitionHookShape>(definition: TDefinition): TDefinition;\n <\n TContext,\n TProps,\n TData,\n const TName extends string,\n const TSends extends Record<string, TransitionEventCreator> = Record<string, TransitionEventCreator>,\n >(definition: TransitionHookDefinition<TContext, TProps, TData, TName, TSends>): typeof definition;\n};\n\nconst defineHook = ((definition: TransitionHookShape): TransitionHookShape => {\n if ((definition.project === undefined) === (definition.projectEach === undefined)) {\n throw new Error(`Transition hook ${definition.name} requires exactly one projection.`);\n }\n return Object.freeze(definition);\n}) as DefineHook;\n\nconst statePaths = (value: MachineStateValue): readonly string[] => (\n typeof value === 'string' ? [value] : value\n);\n\nconst commonPrefixLength = (left: string, right: string): number => {\n const leftParts = left.split('.');\n const rightParts = right.split('.');\n let index = 0;\n while (leftParts[index] !== undefined && leftParts[index] === rightParts[index]) index += 1;\n return index;\n};\n\nconst closestStatePath = (value: MachineStateValue, enteredPath: string): string => {\n const paths = statePaths(value);\n return [...paths].sort((left, right) => (\n commonPrefixLength(right, enteredPath) - commonPrefixLength(left, enteredPath)\n ))[0] ?? enteredPath;\n};\n\nconst createTransitionCoordinator = <TContext, TProps, TElement = unknown>({\n machine,\n hooks,\n root: ownerRoot,\n resolveElement,\n}: TransitionCoordinatorOptions<TContext, TProps, TElement>): TransitionCoordinator<TProps, TElement> => {\n const hooksByName = new Map(hooks.map((hook) => [hook.name, hook]));\n const hooksByState = new Map<string, AnyTransitionHook<TContext, TProps>[]>();\n const registrations = new Map<string, TransitionRegistration<TProps, TElement>[]>();\n const activeRuns = new Set<{entry: MachineEntry<TContext, TProps>; controller: AbortController}>();\n let destroyed = false;\n\n if (hooksByName.size !== hooks.length) throw new Error('Transition hook names must be unique.');\n hooks.forEach((hook) => {\n const grouped = hooksByState.get(hook.state) ?? [];\n const first = grouped[0];\n if (first && (first.onDone !== hook.onDone || first.onError !== hook.onError)) {\n throw new Error(`Transition hooks sharing ${hook.state} must use the same continuations.`);\n }\n grouped.push(hook);\n hooksByState.set(hook.state, grouped);\n });\n\n const isActive = (entry: MachineEntry<TContext, TProps>): boolean => (\n !destroyed && machine.getSnapshot().generations[entry.path] === entry.generation\n );\n\n const continuation = (\n entry: MachineEntry<TContext, TProps>,\n type: string,\n detail: Record<string, unknown> = {},\n ): void => {\n machine.send({\n type,\n ...detail,\n __state: entry.path,\n __generation: entry.generation,\n });\n };\n\n const projections = (\n hook: AnyTransitionHook<TContext, TProps>,\n snapshot: MachineSnapshot<TContext, TProps>,\n ): readonly unknown[] => hook.projectEach?.(snapshot) ?? [hook.project?.(snapshot)];\n\n const runQueue = (\n entry: MachineEntry<TContext, TProps>,\n hook: AnyTransitionHook<TContext, TProps>,\n data: unknown,\n queue: TransitionRegistration<TProps, TElement>[],\n signal: AbortSignal,\n index = 0,\n ): void | Promise<void> => {\n for (let cursor = index; cursor < queue.length; cursor += 1) {\n if (!isActive(entry)) return;\n const registration = queue[cursor] as TransitionRegistration<TProps, TElement>;\n const root = ownerRoot ?? registration.el;\n const resolved = resolveElement?.({\n name: hook.name,\n data,\n root,\n registrationEl: registration.el,\n });\n if (resolved === null) return;\n const el = resolved ?? registration.el;\n const send = machine.send.bind(machine) as TransitionSend;\n Object.entries(hook.sends ?? {}).forEach(([name, createEvent]) => {\n send[name] = (...args: unknown[]) => machine.send(createEvent(...args as never[]));\n });\n const transition = Object.freeze({\n el,\n root,\n from: closestStatePath(entry.from, entry.path),\n to: entry.path,\n event: Object.freeze({...entry.event}),\n props: cloneSerializable(entry.snapshot.props),\n data: cloneSerializable(data),\n send,\n signal,\n }) as TransitionContext<TProps, unknown, TElement>;\n const result = registration.callback(transition);\n if (isPromiseLike(result)) {\n return Promise.resolve(result).then(() => runQueue(entry, hook, data, queue, signal, cursor + 1));\n }\n }\n };\n\n const runEntry = (entry: MachineEntry<TContext, TProps>): void => {\n const groupedHooks = hooksByState.get(entry.path);\n if (!groupedHooks) return;\n const results: Array<void | Promise<void>> = [];\n const errors: unknown[] = [];\n const controller = new AbortController();\n const activeRun = {entry, controller};\n activeRuns.add(activeRun);\n\n groupedHooks.forEach((hook) => {\n const queue = [...registrations.get(hook.name) ?? []];\n if (queue.length === 0) {\n if (hook.required) errors.push(new Error(`Transition hook ${hook.name} requires a registered callback.`));\n return;\n }\n projections(hook, entry.snapshot).forEach((data) => {\n try {\n results.push(runQueue(entry, hook, data, queue, controller.signal));\n } catch (error) {\n errors.push(error);\n }\n });\n });\n\n const first = groupedHooks[0] as AnyTransitionHook<TContext, TProps>;\n const finish = (asyncErrors: unknown[] = []): void => {\n activeRuns.delete(activeRun);\n if (!isActive(entry)) return;\n const failure = [...errors, ...asyncErrors][0];\n if (failure !== undefined) {\n continuation(entry, first.onError, {error: failure});\n } else {\n continuation(entry, first.onDone);\n }\n };\n const pending = results.filter(isPromiseLike);\n if (pending.length === 0) {\n finish();\n return;\n }\n void Promise.allSettled(pending).then((settled) => finish(settled.flatMap((result) => (\n result.status === 'rejected' ? [result.reason] : []\n ))));\n };\n\n const unsubscribe = machine.subscribeEntries((entry) => {\n runEntry(entry);\n });\n const unsubscribeSnapshot = machine.subscribe(() => {\n activeRuns.forEach((run) => {\n if (isActive(run.entry)) return;\n run.controller.abort();\n activeRuns.delete(run);\n });\n });\n\n return {\n register<TData>({name, el, callback}: {\n name: string;\n el: TElement;\n callback: TransitionCallback<TProps, TData, TElement>;\n }): () => void {\n if (destroyed) throw new Error('Transition coordinator has been destroyed.');\n if (!hooksByName.has(name)) throw new Error(`Unknown transition hook: ${name}`);\n\n const registration: TransitionRegistration<TProps, TElement> = {\n name,\n el,\n callback: callback as TransitionCallback<TProps, unknown, TElement>,\n };\n const queue = registrations.get(name) ?? [];\n queue.push(registration);\n registrations.set(name, queue);\n\n return () => {\n const current = registrations.get(name);\n if (!current) return;\n const index = current.indexOf(registration);\n if (index >= 0) current.splice(index, 1);\n if (current.length === 0) registrations.delete(name);\n };\n },\n destroy(): void {\n if (destroyed) return;\n destroyed = true;\n unsubscribe();\n unsubscribeSnapshot();\n activeRuns.forEach((run) => run.controller.abort());\n activeRuns.clear();\n registrations.clear();\n },\n };\n};\n\nexport {createTransitionCoordinator, defineHook};\nexport type {\n AnyTransitionHook,\n TransitionCallback,\n TransitionContext,\n TransitionCoordinator,\n TransitionCoordinatorOptions,\n TransitionEventCreator,\n TransitionForHook,\n TransitionSend,\n TransitionElementResolver,\n TransitionHookDefinition,\n};\n","import type Alpine from 'alpinejs';\n\nimport {\n decodeProps,\n dataAttributeForSchemaProp,\n type CodecFn,\n type PropChange,\n type SchemaToProps,\n} from './codecs';\nimport {\n createTransitionCoordinator,\n type AnyTransitionHook,\n type TransitionCallback,\n type TransitionCoordinator,\n type TransitionForHook,\n} from './transition-coordinator';\nimport type {Machine, MachineEvent, MachineSnapshot} from './state-machine';\nimport {isSerializableEqual} from '../utils';\n\ntype MachineElement = HTMLElement & Alpine.ElementWithXAttributes;\ntype MachineSchema = Record<string, CodecFn<unknown>>;\ntype MachineProps<TSchema extends MachineSchema> = SchemaToProps<TSchema>;\ntype TransitionHookLike = {\n name: string;\n state: string;\n project?: (...args: never[]) => unknown;\n projectEach?: (...args: never[]) => readonly unknown[];\n onDone: string;\n onError: string;\n};\ntype HookName<THooks extends readonly {name: string}[]> = THooks[number]['name'];\ntype HookForName<THooks, TName> = Extract<THooks extends readonly unknown[] ? THooks[number] : never, {name: TName}>;\n\ntype AlpinePropsChangedEvent<TSchema extends MachineSchema> = {\n type: 'PROPS_CHANGED';\n props: MachineProps<TSchema>;\n changes: Array<PropChange<TSchema>>;\n};\n\ntype MachineFactoryScope<TSchema extends MachineSchema> = {\n el: MachineElement;\n props: MachineProps<TSchema>;\n};\n\ntype CreateAlpineMachineOptions<\n TContext,\n TSchema extends MachineSchema,\n THooks extends readonly TransitionHookLike[],\n> = {\n schema: TSchema;\n hooks: THooks;\n createMachine(scope: MachineFactoryScope<TSchema>): Machine<TContext, MachineProps<TSchema>>;\n resolveTransitionElement?(scope: Readonly<{\n name: string;\n data: unknown;\n root: MachineElement;\n registrationEl: MachineElement;\n }>): MachineElement | null | undefined;\n};\n\ntype AlpineMachineOwner<TProps = unknown> = {\n invalidateDom(): void;\n onTransition<TData>(\n name: string,\n callback: TransitionCallback<TProps, TData, MachineElement>,\n el?: MachineElement,\n ): () => void;\n};\n\ntype AlpineMachine<\n TContext,\n TProps,\n THooks extends readonly TransitionHookLike[],\n> = Omit<AlpineMachineOwner<TProps>, 'onTransition'> & {\n snapshot: {current: MachineSnapshot<TContext, TProps> | null};\n connect(\n el: MachineElement,\n snapshot?: {current: MachineSnapshot<TContext, TProps> | null},\n ): void;\n disconnect(): void;\n getSnapshot(): MachineSnapshot<TContext, TProps>;\n getCommittedSnapshot(): MachineSnapshot<TContext, TProps>;\n send(event: MachineEvent): void;\n matches(state: string): boolean;\n hasTag(tag: string): boolean;\n onTransition<TName extends HookName<THooks>>(\n name: TName,\n callback: (transition: TransitionForHook<HookForName<THooks, TName>, MachineElement>) => unknown | Promise<unknown>,\n el?: MachineElement,\n ): () => void;\n};\n\ntype PendingTransition<TProps> = {\n name: string;\n callback: TransitionCallback<TProps, unknown, MachineElement>;\n el?: MachineElement;\n unregister?: () => void;\n active: boolean;\n};\n\nconst alpineMachineOwner = Symbol.for('trellis-ui.alpine-machine-owner');\nconst owners = new WeakMap<Element, AlpineMachineOwner>();\n\nconst findAlpineMachineOwner = (\n AlpineInstance: Alpine.Alpine,\n el: Element,\n): AlpineMachineOwner | undefined => {\n const dataStack = typeof AlpineInstance.closestDataStack === 'function'\n ? AlpineInstance.closestDataStack(el as Alpine.ElementWithXAttributes)\n : [];\n const scopedOwner = dataStack.find((scope) => Reflect.get(scope, alpineMachineOwner) === true);\n if (scopedOwner) return scopedOwner as AlpineMachineOwner;\n\n const owner = AlpineInstance.findClosest(el, (candidate) => owners.has(candidate));\n return owner ? owners.get(owner) : undefined;\n};\n\nconst createAlpineMachine = <\n TContext,\n TSchema extends MachineSchema,\n const THooks extends readonly TransitionHookLike[],\n>({\n schema,\n hooks,\n createMachine: machineFactory,\n resolveTransitionElement,\n}: CreateAlpineMachineOptions<TContext, TSchema, THooks>): AlpineMachine<TContext, MachineProps<TSchema>, THooks> => {\n type TProps = MachineProps<TSchema>;\n\n const snapshot: {current: MachineSnapshot<TContext, TProps> | null} = {current: null};\n let snapshotMirror = snapshot;\n const pending: PendingTransition<TProps>[] = [];\n let root: MachineElement | null = null;\n let machine: Machine<TContext, TProps> | null = null;\n let coordinator: TransitionCoordinator<TProps, MachineElement> | null = null;\n let observer: MutationObserver | null = null;\n let unsubscribeSnapshot: (() => void) | null = null;\n let destroyed = false;\n\n const requireMachine = (): Machine<TContext, TProps> => {\n if (!machine) throw new Error('Alpine machine has not been initialized.');\n return machine;\n };\n\n const registerPending = (registration: PendingTransition<TProps>): void => {\n if (!coordinator || !root || !registration.active) return;\n registration.unregister = coordinator.register({\n name: registration.name,\n el: registration.el ?? root,\n callback: registration.callback,\n });\n };\n\n const component: AlpineMachine<TContext, TProps, THooks> = {\n snapshot,\n invalidateDom(): void {\n if (destroyed || !machine) return;\n machine.send('DOM_INVALIDATED');\n },\n connect(el, reactiveSnapshot = snapshot): void {\n if (destroyed) throw new Error('Alpine machine has been destroyed.');\n if (machine) return;\n\n root = el;\n snapshotMirror = reactiveSnapshot;\n let props = decodeProps({el: root, schema});\n const createdMachine = machineFactory({el: root, props});\n let createdCoordinator: TransitionCoordinator<TProps, MachineElement>;\n try {\n createdCoordinator = createTransitionCoordinator<TContext, TProps, MachineElement>({\n machine: createdMachine,\n hooks: hooks as unknown as readonly AnyTransitionHook<TContext, TProps>[],\n root,\n ...(resolveTransitionElement ? {resolveElement: resolveTransitionElement} : {}),\n });\n } catch (error) {\n createdMachine.stop();\n root = null;\n throw error;\n }\n machine = createdMachine;\n coordinator = createdCoordinator;\n snapshotMirror.current = machine.getSnapshot();\n unsubscribeSnapshot = machine.subscribe((nextSnapshot) => {\n snapshotMirror.current = nextSnapshot;\n });\n owners.set(root, component as unknown as AlpineMachineOwner);\n pending.forEach(registerPending);\n\n const authoritativePropByAttribute = new Map(Object.entries(schema).flatMap(([key, codec]) => codec.meta.attribute ? [[\n dataAttributeForSchemaProp(key, codec),\n key as keyof TProps & string,\n ] as const] : []));\n observer = new MutationObserver((mutations) => {\n if (!root || !machine) return;\n const touched = new Set(mutations.flatMap(({attributeName}) => {\n const key = attributeName ? authoritativePropByAttribute.get(attributeName) : undefined;\n return key ? [key] : [];\n }));\n const nextProps = decodeProps({el: root, schema});\n const changes = Object.keys(nextProps).flatMap((key) => {\n const typedKey = key as keyof TProps & string;\n if (!touched.has(typedKey) && isSerializableEqual(props[typedKey], nextProps[typedKey])) return [];\n return [{\n key: typedKey,\n previous: props[typedKey],\n value: nextProps[typedKey],\n source: 'attribute' as const,\n } as PropChange<TSchema>];\n });\n if (changes.length === 0) return;\n props = nextProps;\n machine.send({type: 'PROPS_CHANGED', props: nextProps, changes});\n });\n observer.observe(root, {\n attributes: true,\n attributeFilter: Object.entries(schema).map(([key, codec]) => dataAttributeForSchemaProp(key, codec)),\n });\n },\n disconnect(): void {\n if (destroyed) return;\n destroyed = true;\n observer?.disconnect();\n observer = null;\n unsubscribeSnapshot?.();\n unsubscribeSnapshot = null;\n coordinator?.destroy();\n coordinator = null;\n machine?.stop();\n machine = null;\n if (root) owners.delete(root);\n Reflect.deleteProperty(component, alpineMachineOwner);\n root = null;\n pending.splice(0).forEach((registration) => registration.unregister?.());\n snapshotMirror.current = null;\n snapshotMirror = snapshot;\n },\n getSnapshot(): MachineSnapshot<TContext, TProps> {\n const current = snapshotMirror.current;\n if (!current) throw new Error('Alpine machine has not been initialized.');\n return current;\n },\n getCommittedSnapshot(): MachineSnapshot<TContext, TProps> {\n return requireMachine().getSnapshot();\n },\n send(event): void {\n requireMachine().send(event);\n },\n matches(state): boolean {\n return requireMachine().matches(state);\n },\n hasTag(tag): boolean {\n return requireMachine().hasTag(tag);\n },\n onTransition<TName extends HookName<THooks>>(\n name: TName,\n callback: (transition: TransitionForHook<HookForName<THooks, TName>, MachineElement>) => unknown | Promise<unknown>,\n el?: MachineElement,\n ): () => void {\n if (destroyed) throw new Error('Alpine machine has been destroyed.');\n const registration: PendingTransition<TProps> = {\n name,\n callback: callback as TransitionCallback<TProps, unknown, MachineElement>,\n active: true,\n };\n if (el) registration.el = el;\n pending.push(registration);\n registerPending(registration);\n\n return () => {\n if (!registration.active) return;\n registration.active = false;\n registration.unregister?.();\n delete registration.unregister;\n const index = pending.indexOf(registration);\n if (index >= 0) pending.splice(index, 1);\n };\n },\n };\n\n Reflect.defineProperty(component, alpineMachineOwner, {\n value: true,\n configurable: true,\n });\n return component;\n};\n\nexport {createAlpineMachine, findAlpineMachineOwner};\nexport type {\n AlpineMachine,\n AlpineMachineOwner,\n AlpinePropsChangedEvent,\n CreateAlpineMachineOptions,\n MachineFactoryScope,\n};\n"],"mappings":"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"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var e=Math.min,t=Math.max,n=Math.round,r=Math.floor,i=e=>({x:e,y:e}),a={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function o(n,r,i){return t(n,e(r,i))}function s(e,t){return typeof e==`function`?e(t):e}function c(e){return e.split(`-`)[0]}function l(e){return e.split(`-`)[1]}function u(e){return e===`x`?`y`:`x`}function d(e){return e===`y`?`height`:`width`}function f(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function p(e){return u(f(e))}function m(e,t,n){n===void 0&&(n=!1);let r=l(e),i=p(e),a=d(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=C(o)),[o,C(o)]}function h(e){let t=C(e);return[g(e),t,g(t)]}function g(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var _=[`left`,`right`],v=[`right`,`left`],y=[`top`,`bottom`],b=[`bottom`,`top`];function x(e,t,n){switch(e){case`top`:case`bottom`:return n?t?v:_:t?_:v;case`left`:case`right`:return t?y:b;default:return[]}}function S(e,t,n,r){let i=l(e),a=x(c(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(g)))),a}function C(e){let t=c(e);return a[t]+e.slice(t.length)}function w(e){return{top:0,right:0,bottom:0,left:0,...e}}function T(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:w(e)}function E(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function D(e,t,n){let{reference:r,floating:i}=e,a=f(t),o=p(t),s=d(o),u=c(t),m=a===`y`,h=r.x+r.width/2-i.width/2,g=r.y+r.height/2-i.height/2,_=r[s]/2-i[s]/2,v;switch(u){case`top`:v={x:h,y:r.y-i.height};break;case`bottom`:v={x:h,y:r.y+r.height};break;case`right`:v={x:r.x+r.width,y:g};break;case`left`:v={x:r.x-i.width,y:g};break;default:v={x:r.x,y:r.y}}switch(l(t)){case`start`:v[o]-=_*(n&&m?-1:1);break;case`end`:v[o]+=_*(n&&m?-1:1);break}return v}async function O(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:c}=e,{boundary:l=`clippingAncestors`,rootBoundary:u=`viewport`,elementContext:d=`floating`,altBoundary:f=!1,padding:p=0}=s(t,e),m=T(p),h=o[f?d===`floating`?`reference`:`floating`:d],g=E(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(h))??!0?h:h.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:l,rootBoundary:u,strategy:c})),_=d===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,v=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),y=await(i.isElement==null?void 0:i.isElement(v))&&await(i.getScale==null?void 0:i.getScale(v))||{x:1,y:1},b=E(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:_,offsetParent:v,strategy:c}):_);return{top:(g.top-b.top+m.top)/y.y,bottom:(b.bottom-g.bottom+m.bottom)/y.y,left:(g.left-b.left+m.left)/y.x,right:(b.right-g.right+m.right)/y.x}}var k=50,A=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:O},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=D(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<k&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=D(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},j=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:l,elements:u}=t,{mainAxis:d=!0,crossAxis:p=!0,fallbackPlacements:g,fallbackStrategy:_=`bestFit`,fallbackAxisSideDirection:v=`none`,flipAlignment:y=!0,...b}=s(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let x=c(r),w=f(o),T=c(o)===o,E=await(l.isRTL==null?void 0:l.isRTL(u.floating)),D=g||(T||!y?[C(o)]:h(o)),O=v!==`none`;!g&&O&&D.push(...S(o,y,v,E));let k=[o,...D],A=await l.detectOverflow(t,b),j=[],M=i.flip?.overflows||[];if(d&&j.push(A[x]),p){let e=m(r,a,E);j.push(A[e[0]],A[e[1]])}if(M=[...M,{placement:r,overflows:j}],!j.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=k[e];if(t&&(!(p===`alignment`&&w!==f(t))||M.every(e=>f(e.placement)===w?e.overflows[0]>0:!0)))return{data:{index:e,overflows:M},reset:{placement:t}};let n=M.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(_){case`bestFit`:{let e=M.filter(e=>{if(O){let t=f(e.placement);return t===w||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}},M=new Set([`left`,`top`]);async function ee(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=c(n),u=l(n),d=f(n)===`y`,p=M.has(o)?-1:1,m=a&&d?-1:1,h=s(t,e),{mainAxis:g,crossAxis:_,alignmentAxis:v}=typeof h==`number`?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return u&&typeof v==`number`&&(_=u===`end`?v*-1:v),d?{x:_*m,y:g*p}:{x:g*p,y:_*m}}var te=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await ee(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},ne=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:l=!0,crossAxis:d=!1,limiter:p={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...m}=s(e,t),h={x:n,y:r},g=await a.detectOverflow(t,m),_=f(c(i)),v=u(_),y=h[v],b=h[_];if(l){let e=v===`y`?`top`:`left`,t=v===`y`?`bottom`:`right`,n=y+g[e],r=y-g[t];y=o(n,y,r)}if(d){let e=_===`y`?`top`:`left`,t=_===`y`?`bottom`:`right`,n=b+g[e],r=b-g[t];b=o(n,b,r)}let x=p.fn({...t,[v]:y,[_]:b});return{...x,data:{x:x.x-n,y:x.y-r,enabled:{[v]:l,[_]:d}}}}}},re=function(n){return n===void 0&&(n={}),{name:`size`,options:n,async fn(r){var i,a;let{placement:o,rects:u,platform:d,elements:p}=r,{apply:m=()=>{},...h}=s(n,r),g=await d.detectOverflow(r,h),_=c(o),v=l(o),y=f(o)===`y`,{width:b,height:x}=u.floating,S,C;_===`top`||_===`bottom`?(S=_,C=v===(await(d.isRTL==null?void 0:d.isRTL(p.floating))?`start`:`end`)?`left`:`right`):(C=_,S=v===`end`?`top`:`bottom`);let w=x-g.top-g.bottom,T=b-g.left-g.right,E=e(x-g[S],w),D=e(b-g[C],T),O=!r.middlewareData.shift,k=E,A=D;if((i=r.middlewareData.shift)!=null&&i.enabled.x&&(A=T),(a=r.middlewareData.shift)!=null&&a.enabled.y&&(k=w),O&&!v){let e=t(g.left,0),n=t(g.right,0),r=t(g.top,0),i=t(g.bottom,0);y?A=b-2*(e!==0||n!==0?e+n:t(g.left,g.right)):k=x-2*(r!==0||i!==0?r+i:t(g.top,g.bottom))}await m({...r,availableWidth:A,availableHeight:k});let j=await d.getDimensions(p.floating);return b!==j.width||x!==j.height?{reset:{rects:!0}}:{}}}};function N(){return typeof window<`u`}function P(e){return ie(e)?(e.nodeName||``).toLowerCase():`#document`}function F(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function I(e){return((ie(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function ie(e){return N()?e instanceof Node||e instanceof F(e).Node:!1}function L(e){return N()?e instanceof Element||e instanceof F(e).Element:!1}function R(e){return N()?e instanceof HTMLElement||e instanceof F(e).HTMLElement:!1}function ae(e){return!N()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof F(e).ShadowRoot}function z(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=G(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function oe(e){return/^(table|td|th)$/.test(P(e))}function B(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var se=/transform|translate|scale|rotate|perspective|filter/,ce=/paint|layout|strict|content/,V=e=>!!e&&e!==`none`,le;function H(e){let t=L(e)?G(e):e;return V(t.transform)||V(t.translate)||V(t.scale)||V(t.rotate)||V(t.perspective)||!U()&&(V(t.backdropFilter)||V(t.filter))||se.test(t.willChange||``)||ce.test(t.contain||``)}function ue(e){let t=q(e);for(;R(t)&&!W(t);){if(H(t))return t;if(B(t))return null;t=q(t)}return null}function U(){return le??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),le}function W(e){return/^(html|body|#document)$/.test(P(e))}function G(e){return F(e).getComputedStyle(e)}function K(e){return L(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function q(e){if(P(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||ae(e)&&e.host||I(e);return ae(t)?t.host:t}function de(e){let t=q(e);return W(t)?e.ownerDocument?e.ownerDocument.body:e.body:R(t)&&z(t)?t:de(t)}function J(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=de(e),i=r===e.ownerDocument?.body,a=F(r);if(i){let e=Y(a);return t.concat(a,a.visualViewport||[],z(r)?r:[],e&&n?J(e):[])}else return t.concat(r,J(r,[],n))}function Y(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function fe(e){let t=G(e),r=parseFloat(t.width)||0,i=parseFloat(t.height)||0,a=R(e),o=a?e.offsetWidth:r,s=a?e.offsetHeight:i,c=n(r)!==o||n(i)!==s;return c&&(r=o,i=s),{width:r,height:i,$:c}}function X(e){return L(e)?e:e.contextElement}function Z(e){let t=X(e);if(!R(t))return i(1);let r=t.getBoundingClientRect(),{width:a,height:o,$:s}=fe(t),c=(s?n(r.width):r.width)/a,l=(s?n(r.height):r.height)/o;return(!c||!Number.isFinite(c))&&(c=1),(!l||!Number.isFinite(l))&&(l=1),{x:c,y:l}}var pe=i(0);function me(e){let t=F(e);return!U()||!t.visualViewport?pe:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function he(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==F(e)?!1:t}function Q(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let a=e.getBoundingClientRect(),o=X(e),s=i(1);t&&(r?L(r)&&(s=Z(r)):s=Z(e));let c=he(o,n,r)?me(o):i(0),l=(a.left+c.x)/s.x,u=(a.top+c.y)/s.y,d=a.width/s.x,f=a.height/s.y;if(o){let e=F(o),t=r&&L(r)?F(r):r,n=e,i=Y(n);for(;i&&r&&t!==n;){let e=Z(i),t=i.getBoundingClientRect(),r=G(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;l*=e.x,u*=e.y,d*=e.x,f*=e.y,l+=a,u+=o,n=F(i),i=Y(n)}}return E({width:d,height:f,x:l,y:u})}function $(e,t){let n=K(e).scrollLeft;return t?t.left+n:Q(I(e)).left+n}function ge(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-$(e,n),y:n.top+t.scrollTop}}function _e(e){let{elements:t,rect:n,offsetParent:r,strategy:a}=e,o=a===`fixed`,s=I(r),c=t?B(t.floating):!1;if(r===s||c&&o)return n;let l={scrollLeft:0,scrollTop:0},u=i(1),d=i(0),f=R(r);if((f||!f&&!o)&&((P(r)!==`body`||z(s))&&(l=K(r)),f)){let e=Q(r);u=Z(r),d.x=e.x+r.clientLeft,d.y=e.y+r.clientTop}let p=s&&!f&&!o?ge(s,l):i(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+d.x+p.x,y:n.y*u.y-l.scrollTop*u.y+d.y+p.y}}function ve(e){return Array.from(e.getClientRects())}function ye(e){let n=I(e),r=K(e),i=e.ownerDocument.body,a=t(n.scrollWidth,n.clientWidth,i.scrollWidth,i.clientWidth),o=t(n.scrollHeight,n.clientHeight,i.scrollHeight,i.clientHeight),s=-r.scrollLeft+$(e),c=-r.scrollTop;return G(i).direction===`rtl`&&(s+=t(n.clientWidth,i.clientWidth)-a),{width:a,height:o,x:s,y:c}}var be=25;function xe(e,t){let n=F(e),r=I(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=U();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=$(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=be&&(a-=o)}else l<=be&&(a+=l);return{width:a,height:o,x:s,y:c}}function Se(e,t){let n=Q(e,!0,t===`fixed`),r=n.top+e.clientTop,a=n.left+e.clientLeft,o=R(e)?Z(e):i(1);return{width:e.clientWidth*o.x,height:e.clientHeight*o.y,x:a*o.x,y:r*o.y}}function Ce(e,t,n){let r;if(t===`viewport`)r=xe(e,n);else if(t===`document`)r=ye(I(e));else if(L(t))r=Se(t,n);else{let n=me(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return E(r)}function we(e,t){let n=q(e);return n===t||!L(n)||W(n)?!1:G(n).position===`fixed`||we(n,t)}function Te(e,t){let n=t.get(e);if(n)return n;let r=J(e,[],!1).filter(e=>L(e)&&P(e)!==`body`),i=null,a=G(e).position===`fixed`,o=a?q(e):e;for(;L(o)&&!W(o);){let t=G(o),n=H(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||z(o)&&!n&&we(e,o))?r=r.filter(e=>e!==o):i=t,o=q(o)}return t.set(e,r),r}function Ee(n){let{element:r,boundary:i,rootBoundary:a,strategy:o}=n,s=[...i===`clippingAncestors`?B(r)?[]:Te(r,this._c):[].concat(i),a],c=Ce(r,s[0],o),l=c.top,u=c.right,d=c.bottom,f=c.left;for(let n=1;n<s.length;n++){let i=Ce(r,s[n],o);l=t(i.top,l),u=e(i.right,u),d=e(i.bottom,d),f=t(i.left,f)}return{width:u-f,height:d-l,x:f,y:l}}function De(e){let{width:t,height:n}=fe(e);return{width:t,height:n}}function Oe(e,t,n){let r=R(t),a=I(t),o=n===`fixed`,s=Q(e,!0,o,t),c={scrollLeft:0,scrollTop:0},l=i(0);function u(){l.x=$(a)}if(r||!r&&!o)if((P(t)!==`body`||z(a))&&(c=K(t)),r){let e=Q(t,!0,o,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else a&&u();o&&!r&&a&&u();let d=a&&!r&&!o?ge(a,c):i(0);return{x:s.left+c.scrollLeft-l.x-d.x,y:s.top+c.scrollTop-l.y-d.y,width:s.width,height:s.height}}function ke(e){return G(e).position===`static`}function Ae(e,t){if(!R(e)||G(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return I(e)===n&&(n=n.ownerDocument.body),n}function je(e,t){let n=F(e);if(B(e))return n;if(!R(e)){let t=q(e);for(;t&&!W(t);){if(L(t)&&!ke(t))return t;t=q(t)}return n}let r=Ae(e,t);for(;r&&oe(r)&&ke(r);)r=Ae(r,t);return r&&W(r)&&ke(r)&&!H(r)?n:r||ue(e)||n}var Me=async function(e){let t=this.getOffsetParent||je,n=this.getDimensions,r=await n(e.floating);return{reference:Oe(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Ne(e){return G(e).direction===`rtl`}var Pe={convertOffsetParentRelativeRectToViewportRelativeRect:_e,getDocumentElement:I,getClippingRect:Ee,getOffsetParent:je,getElementRects:Me,getClientRects:ve,getDimensions:De,getScale:Z,isElement:L,isRTL:Ne};function Fe(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Ie(n,i){let a=null,o,s=I(n);function c(){var e;clearTimeout(o),(e=a)==null||e.disconnect(),a=null}function l(u,d){u===void 0&&(u=!1),d===void 0&&(d=1),c();let f=n.getBoundingClientRect(),{left:p,top:m,width:h,height:g}=f;if(u||i(),!h||!g)return;let _=r(m),v=r(s.clientWidth-(p+h)),y=r(s.clientHeight-(m+g)),b=r(p),x={rootMargin:-_+`px `+-v+`px `+-y+`px `+-b+`px`,threshold:t(0,e(1,d))||1},S=!0;function C(e){let t=e[0].intersectionRatio;if(t!==d){if(!S)return l();t?l(!1,t):o=setTimeout(()=>{l(!1,1e-7)},1e3)}t===1&&!Fe(f,n.getBoundingClientRect())&&l(),S=!1}try{a=new IntersectionObserver(C,{...x,root:s.ownerDocument})}catch{a=new IntersectionObserver(C,x)}a.observe(n)}return l(!0),c}function Le(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=X(e),u=i||a?[...l?J(l):[],...t?J(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?Ie(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?Q(e):null;c&&g();function g(){let t=Q(e);h&&!Fe(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var Re=te,ze=ne,Be=j,Ve=re,He=(e,t,n)=>{let r=new Map,i={platform:Pe,...n},a={...i.platform,_c:r};return A(e,t,{...i,platform:a})},Ue=(e,t)=>t===`center`?e:`${e}-${t}`,We=(e,t)=>`${e===`left`?`right`:e===`right`?`left`:t===`end`?`right`:t===`start`?`left`:`center`} ${e===`top`?`bottom`:e===`bottom`?`top`:`center`}`,Ge=({reference:e,floating:t,position:n,align:r,gap:i,offset:a,matchReferenceWidth:o=!1})=>{let s=null,c=!1,l=0,u=0,d=e=>`${e.getBoundingClientRect().width}px`,f=()=>{let s=e(),f=t(),p=l,m=++u;o&&(f.style.width=d(s)),He(s,f,{placement:Ue(n(),r()),middleware:[Re({mainAxis:i(),crossAxis:a()}),Be(),ze({padding:5}),Ve({padding:5,apply({availableHeight:e,elements:t}){let n=`${Math.max(0,e)}px`;t.floating.style.maxHeight=n,t.floating.style.setProperty(`--ui-popover-available-height`,n)}})]}).then(({x:e,y:t,strategy:n,placement:r})=>{if(!c||l!==p||u!==m)return;let[i=`bottom`,a=`center`]=r.split(`-`);Object.assign(f.style,{position:n,inset:`${t}px auto auto ${e}px`,transformOrigin:We(i,a),...o?{width:d(s)}:{}}),f.dataset.side=i,f.dataset.align=a})};return{mounted(){return s!==null},mount(){if(s){f();return}c=!0,l+=1,s=Le(e(),t(),f)},unmount(){c=!1,l+=1,s?.(),s=null},sync(){this.unmount(),this.mount()}}},Ke=e=>{let t=Ge(e),n=!1,r=()=>{if(!n){n=!0;try{e.floating().showPopover()}catch{}t.mount()}},i=()=>{if(n){n=!1;try{e.floating().hidePopover()}catch{}t.unmount()}};return{opened:()=>n,open:r,close:i,sync(){n&&t.sync()},destroy:i}};export{Ke as n,Ge as t};
|
|
2
|
-
//# sourceMappingURL=anchored-popover-
|
|
1
|
+
var e=Math.min,t=Math.max,n=Math.round,r=Math.floor,i=e=>({x:e,y:e}),a={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function o(n,r,i){return t(n,e(r,i))}function s(e,t){return typeof e==`function`?e(t):e}function c(e){return e.split(`-`)[0]}function l(e){return e.split(`-`)[1]}function u(e){return e===`x`?`y`:`x`}function d(e){return e===`y`?`height`:`width`}function f(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function p(e){return u(f(e))}function m(e,t,n){n===void 0&&(n=!1);let r=l(e),i=p(e),a=d(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=C(o)),[o,C(o)]}function h(e){let t=C(e);return[g(e),t,g(t)]}function g(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var _=[`left`,`right`],v=[`right`,`left`],y=[`top`,`bottom`],b=[`bottom`,`top`];function x(e,t,n){switch(e){case`top`:case`bottom`:return n?t?v:_:t?_:v;case`left`:case`right`:return t?y:b;default:return[]}}function S(e,t,n,r){let i=l(e),a=x(c(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(g)))),a}function C(e){let t=c(e);return a[t]+e.slice(t.length)}function w(e){return{top:0,right:0,bottom:0,left:0,...e}}function T(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:w(e)}function E(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function D(e,t,n){let{reference:r,floating:i}=e,a=f(t),o=p(t),s=d(o),u=c(t),m=a===`y`,h=r.x+r.width/2-i.width/2,g=r.y+r.height/2-i.height/2,_=r[s]/2-i[s]/2,v;switch(u){case`top`:v={x:h,y:r.y-i.height};break;case`bottom`:v={x:h,y:r.y+r.height};break;case`right`:v={x:r.x+r.width,y:g};break;case`left`:v={x:r.x-i.width,y:g};break;default:v={x:r.x,y:r.y}}switch(l(t)){case`start`:v[o]-=_*(n&&m?-1:1);break;case`end`:v[o]+=_*(n&&m?-1:1);break}return v}async function O(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:c}=e,{boundary:l=`clippingAncestors`,rootBoundary:u=`viewport`,elementContext:d=`floating`,altBoundary:f=!1,padding:p=0}=s(t,e),m=T(p),h=o[f?d===`floating`?`reference`:`floating`:d],g=E(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(h))??!0?h:h.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:l,rootBoundary:u,strategy:c})),_=d===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,v=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),y=await(i.isElement==null?void 0:i.isElement(v))&&await(i.getScale==null?void 0:i.getScale(v))||{x:1,y:1},b=E(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:_,offsetParent:v,strategy:c}):_);return{top:(g.top-b.top+m.top)/y.y,bottom:(b.bottom-g.bottom+m.bottom)/y.y,left:(g.left-b.left+m.left)/y.x,right:(b.right-g.right+m.right)/y.x}}var k=50,A=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:O},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=D(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<k&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=D(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},j=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:l,elements:u}=t,{mainAxis:d=!0,crossAxis:p=!0,fallbackPlacements:g,fallbackStrategy:_=`bestFit`,fallbackAxisSideDirection:v=`none`,flipAlignment:y=!0,...b}=s(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let x=c(r),w=f(o),T=c(o)===o,E=await(l.isRTL==null?void 0:l.isRTL(u.floating)),D=g||(T||!y?[C(o)]:h(o)),O=v!==`none`;!g&&O&&D.push(...S(o,y,v,E));let k=[o,...D],A=await l.detectOverflow(t,b),j=[],M=i.flip?.overflows||[];if(d&&j.push(A[x]),p){let e=m(r,a,E);j.push(A[e[0]],A[e[1]])}if(M=[...M,{placement:r,overflows:j}],!j.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=k[e];if(t&&(!(p===`alignment`&&w!==f(t))||M.every(e=>f(e.placement)===w?e.overflows[0]>0:!0)))return{data:{index:e,overflows:M},reset:{placement:t}};let n=M.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(_){case`bestFit`:{let e=M.filter(e=>{if(O){let t=f(e.placement);return t===w||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}},M=new Set([`left`,`top`]);async function ee(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=c(n),u=l(n),d=f(n)===`y`,p=M.has(o)?-1:1,m=a&&d?-1:1,h=s(t,e),{mainAxis:g,crossAxis:_,alignmentAxis:v}=typeof h==`number`?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return u&&typeof v==`number`&&(_=u===`end`?v*-1:v),d?{x:_*m,y:g*p}:{x:g*p,y:_*m}}var te=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await ee(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},ne=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:l=!0,crossAxis:d=!1,limiter:p={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...m}=s(e,t),h={x:n,y:r},g=await a.detectOverflow(t,m),_=f(c(i)),v=u(_),y=h[v],b=h[_];if(l){let e=v===`y`?`top`:`left`,t=v===`y`?`bottom`:`right`,n=y+g[e],r=y-g[t];y=o(n,y,r)}if(d){let e=_===`y`?`top`:`left`,t=_===`y`?`bottom`:`right`,n=b+g[e],r=b-g[t];b=o(n,b,r)}let x=p.fn({...t,[v]:y,[_]:b});return{...x,data:{x:x.x-n,y:x.y-r,enabled:{[v]:l,[_]:d}}}}}},re=function(n){return n===void 0&&(n={}),{name:`size`,options:n,async fn(r){var i,a;let{placement:o,rects:u,platform:d,elements:p}=r,{apply:m=()=>{},...h}=s(n,r),g=await d.detectOverflow(r,h),_=c(o),v=l(o),y=f(o)===`y`,{width:b,height:x}=u.floating,S,C;_===`top`||_===`bottom`?(S=_,C=v===(await(d.isRTL==null?void 0:d.isRTL(p.floating))?`start`:`end`)?`left`:`right`):(C=_,S=v===`end`?`top`:`bottom`);let w=x-g.top-g.bottom,T=b-g.left-g.right,E=e(x-g[S],w),D=e(b-g[C],T),O=!r.middlewareData.shift,k=E,A=D;if((i=r.middlewareData.shift)!=null&&i.enabled.x&&(A=T),(a=r.middlewareData.shift)!=null&&a.enabled.y&&(k=w),O&&!v){let e=t(g.left,0),n=t(g.right,0),r=t(g.top,0),i=t(g.bottom,0);y?A=b-2*(e!==0||n!==0?e+n:t(g.left,g.right)):k=x-2*(r!==0||i!==0?r+i:t(g.top,g.bottom))}await m({...r,availableWidth:A,availableHeight:k});let j=await d.getDimensions(p.floating);return b!==j.width||x!==j.height?{reset:{rects:!0}}:{}}}};function N(){return typeof window<`u`}function P(e){return ie(e)?(e.nodeName||``).toLowerCase():`#document`}function F(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function I(e){return((ie(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function ie(e){return N()?e instanceof Node||e instanceof F(e).Node:!1}function L(e){return N()?e instanceof Element||e instanceof F(e).Element:!1}function R(e){return N()?e instanceof HTMLElement||e instanceof F(e).HTMLElement:!1}function ae(e){return!N()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof F(e).ShadowRoot}function z(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=G(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function oe(e){return/^(table|td|th)$/.test(P(e))}function B(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var se=/transform|translate|scale|rotate|perspective|filter/,ce=/paint|layout|strict|content/,V=e=>!!e&&e!==`none`,le;function H(e){let t=L(e)?G(e):e;return V(t.transform)||V(t.translate)||V(t.scale)||V(t.rotate)||V(t.perspective)||!U()&&(V(t.backdropFilter)||V(t.filter))||se.test(t.willChange||``)||ce.test(t.contain||``)}function ue(e){let t=q(e);for(;R(t)&&!W(t);){if(H(t))return t;if(B(t))return null;t=q(t)}return null}function U(){return le??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),le}function W(e){return/^(html|body|#document)$/.test(P(e))}function G(e){return F(e).getComputedStyle(e)}function K(e){return L(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function q(e){if(P(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||ae(e)&&e.host||I(e);return ae(t)?t.host:t}function de(e){let t=q(e);return W(t)?e.ownerDocument?e.ownerDocument.body:e.body:R(t)&&z(t)?t:de(t)}function J(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=de(e),i=r===e.ownerDocument?.body,a=F(r);if(i){let e=Y(a);return t.concat(a,a.visualViewport||[],z(r)?r:[],e&&n?J(e):[])}else return t.concat(r,J(r,[],n))}function Y(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function fe(e){let t=G(e),r=parseFloat(t.width)||0,i=parseFloat(t.height)||0,a=R(e),o=a?e.offsetWidth:r,s=a?e.offsetHeight:i,c=n(r)!==o||n(i)!==s;return c&&(r=o,i=s),{width:r,height:i,$:c}}function X(e){return L(e)?e:e.contextElement}function Z(e){let t=X(e);if(!R(t))return i(1);let r=t.getBoundingClientRect(),{width:a,height:o,$:s}=fe(t),c=(s?n(r.width):r.width)/a,l=(s?n(r.height):r.height)/o;return(!c||!Number.isFinite(c))&&(c=1),(!l||!Number.isFinite(l))&&(l=1),{x:c,y:l}}var pe=i(0);function me(e){let t=F(e);return!U()||!t.visualViewport?pe:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function he(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==F(e)?!1:t}function Q(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let a=e.getBoundingClientRect(),o=X(e),s=i(1);t&&(r?L(r)&&(s=Z(r)):s=Z(e));let c=he(o,n,r)?me(o):i(0),l=(a.left+c.x)/s.x,u=(a.top+c.y)/s.y,d=a.width/s.x,f=a.height/s.y;if(o){let e=F(o),t=r&&L(r)?F(r):r,n=e,i=Y(n);for(;i&&r&&t!==n;){let e=Z(i),t=i.getBoundingClientRect(),r=G(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;l*=e.x,u*=e.y,d*=e.x,f*=e.y,l+=a,u+=o,n=F(i),i=Y(n)}}return E({width:d,height:f,x:l,y:u})}function $(e,t){let n=K(e).scrollLeft;return t?t.left+n:Q(I(e)).left+n}function ge(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-$(e,n),y:n.top+t.scrollTop}}function _e(e){let{elements:t,rect:n,offsetParent:r,strategy:a}=e,o=a===`fixed`,s=I(r),c=t?B(t.floating):!1;if(r===s||c&&o)return n;let l={scrollLeft:0,scrollTop:0},u=i(1),d=i(0),f=R(r);if((f||!f&&!o)&&((P(r)!==`body`||z(s))&&(l=K(r)),f)){let e=Q(r);u=Z(r),d.x=e.x+r.clientLeft,d.y=e.y+r.clientTop}let p=s&&!f&&!o?ge(s,l):i(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+d.x+p.x,y:n.y*u.y-l.scrollTop*u.y+d.y+p.y}}function ve(e){return Array.from(e.getClientRects())}function ye(e){let n=I(e),r=K(e),i=e.ownerDocument.body,a=t(n.scrollWidth,n.clientWidth,i.scrollWidth,i.clientWidth),o=t(n.scrollHeight,n.clientHeight,i.scrollHeight,i.clientHeight),s=-r.scrollLeft+$(e),c=-r.scrollTop;return G(i).direction===`rtl`&&(s+=t(n.clientWidth,i.clientWidth)-a),{width:a,height:o,x:s,y:c}}var be=25;function xe(e,t){let n=F(e),r=I(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=U();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=$(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=be&&(a-=o)}else l<=be&&(a+=l);return{width:a,height:o,x:s,y:c}}function Se(e,t){let n=Q(e,!0,t===`fixed`),r=n.top+e.clientTop,a=n.left+e.clientLeft,o=R(e)?Z(e):i(1);return{width:e.clientWidth*o.x,height:e.clientHeight*o.y,x:a*o.x,y:r*o.y}}function Ce(e,t,n){let r;if(t===`viewport`)r=xe(e,n);else if(t===`document`)r=ye(I(e));else if(L(t))r=Se(t,n);else{let n=me(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return E(r)}function we(e,t){let n=q(e);return n===t||!L(n)||W(n)?!1:G(n).position===`fixed`||we(n,t)}function Te(e,t){let n=t.get(e);if(n)return n;let r=J(e,[],!1).filter(e=>L(e)&&P(e)!==`body`),i=null,a=G(e).position===`fixed`,o=a?q(e):e;for(;L(o)&&!W(o);){let t=G(o),n=H(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||z(o)&&!n&&we(e,o))?r=r.filter(e=>e!==o):i=t,o=q(o)}return t.set(e,r),r}function Ee(n){let{element:r,boundary:i,rootBoundary:a,strategy:o}=n,s=[...i===`clippingAncestors`?B(r)?[]:Te(r,this._c):[].concat(i),a],c=Ce(r,s[0],o),l=c.top,u=c.right,d=c.bottom,f=c.left;for(let n=1;n<s.length;n++){let i=Ce(r,s[n],o);l=t(i.top,l),u=e(i.right,u),d=e(i.bottom,d),f=t(i.left,f)}return{width:u-f,height:d-l,x:f,y:l}}function De(e){let{width:t,height:n}=fe(e);return{width:t,height:n}}function Oe(e,t,n){let r=R(t),a=I(t),o=n===`fixed`,s=Q(e,!0,o,t),c={scrollLeft:0,scrollTop:0},l=i(0);function u(){l.x=$(a)}if(r||!r&&!o)if((P(t)!==`body`||z(a))&&(c=K(t)),r){let e=Q(t,!0,o,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else a&&u();o&&!r&&a&&u();let d=a&&!r&&!o?ge(a,c):i(0);return{x:s.left+c.scrollLeft-l.x-d.x,y:s.top+c.scrollTop-l.y-d.y,width:s.width,height:s.height}}function ke(e){return G(e).position===`static`}function Ae(e,t){if(!R(e)||G(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return I(e)===n&&(n=n.ownerDocument.body),n}function je(e,t){let n=F(e);if(B(e))return n;if(!R(e)){let t=q(e);for(;t&&!W(t);){if(L(t)&&!ke(t))return t;t=q(t)}return n}let r=Ae(e,t);for(;r&&oe(r)&&ke(r);)r=Ae(r,t);return r&&W(r)&&ke(r)&&!H(r)?n:r||ue(e)||n}var Me=async function(e){let t=this.getOffsetParent||je,n=this.getDimensions,r=await n(e.floating);return{reference:Oe(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Ne(e){return G(e).direction===`rtl`}var Pe={convertOffsetParentRelativeRectToViewportRelativeRect:_e,getDocumentElement:I,getClippingRect:Ee,getOffsetParent:je,getElementRects:Me,getClientRects:ve,getDimensions:De,getScale:Z,isElement:L,isRTL:Ne};function Fe(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Ie(n,i){let a=null,o,s=I(n);function c(){var e;clearTimeout(o),(e=a)==null||e.disconnect(),a=null}function l(u,d){u===void 0&&(u=!1),d===void 0&&(d=1),c();let f=n.getBoundingClientRect(),{left:p,top:m,width:h,height:g}=f;if(u||i(),!h||!g)return;let _=r(m),v=r(s.clientWidth-(p+h)),y=r(s.clientHeight-(m+g)),b=r(p),x={rootMargin:-_+`px `+-v+`px `+-y+`px `+-b+`px`,threshold:t(0,e(1,d))||1},S=!0;function C(e){let t=e[0].intersectionRatio;if(t!==d){if(!S)return l();t?l(!1,t):o=setTimeout(()=>{l(!1,1e-7)},1e3)}t===1&&!Fe(f,n.getBoundingClientRect())&&l(),S=!1}try{a=new IntersectionObserver(C,{...x,root:s.ownerDocument})}catch{a=new IntersectionObserver(C,x)}a.observe(n)}return l(!0),c}function Le(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=X(e),u=i||a?[...l?J(l):[],...t?J(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?Ie(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?Q(e):null;c&&g();function g(){let t=Q(e);h&&!Fe(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var Re=te,ze=ne,Be=j,Ve=re,He=(e,t,n)=>{let r=new Map,i={platform:Pe,...n},a={...i.platform,_c:r};return A(e,t,{...i,platform:a})},Ue=(e,t)=>t===`center`?e:`${e}-${t}`,We=(e,t)=>`${e===`left`?`right`:e===`right`?`left`:t===`end`?`right`:t===`start`?`left`:`center`} ${e===`top`?`bottom`:e===`bottom`?`top`:`center`}`,Ge=({reference:e,floating:t,position:n,align:r,gap:i,offset:a,matchReferenceWidth:o=!1})=>{let s=null,c=!1,l=0,u=0,d=e=>`${e.getBoundingClientRect().width}px`,f=()=>{let s=e(),f=t(),p=l,m=++u;o&&(f.style.width=d(s)),He(s,f,{placement:Ue(n(),r()),middleware:[Re({mainAxis:i(),crossAxis:a()}),Be(),ze({padding:5}),Ve({padding:5,apply({availableHeight:e,availableWidth:t,elements:n}){let r=`${Math.max(0,e)}px`,i=`${Math.max(0,t)}px`;n.floating.style.maxHeight=r,n.floating.style.setProperty(`--ui-popover-available-height`,r),n.floating.style.setProperty(`--ui-popover-available-width`,i)}})]}).then(({x:e,y:t,strategy:n,placement:r})=>{if(!c||l!==p||u!==m)return;let[i=`bottom`,a=`center`]=r.split(`-`);Object.assign(f.style,{position:n,inset:`${t}px auto auto ${e}px`,transformOrigin:We(i,a),...o?{width:d(s)}:{}}),f.dataset.side=i,f.dataset.align=a})};return{mounted(){return s!==null},mount(){if(s){f();return}c=!0,l+=1,s=Le(e(),t(),f)},unmount(){c=!1,l+=1,s?.(),s=null},sync(){this.unmount(),this.mount()}}},Ke=e=>{let t=Ge(e),n=!1,r=()=>{if(!n){n=!0;try{e.floating().showPopover()}catch{}t.mount()}},i=()=>{if(n){n=!1;try{e.floating().hidePopover()}catch{}t.unmount()}};return{opened:()=>n,open:r,close:i,sync(){n&&t.sync()},destroy:i}};export{Ke as n,Ge as t};
|
|
2
|
+
//# sourceMappingURL=anchored-popover-CSBqS_MK.js.map
|