diff --git a/.gitignore b/.gitignore index bb86d323..377ddbbb 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,9 @@ # Composer /vendor +# Node +/node_modules + # IDE .vscode/ .idea/ diff --git a/node_modules/.bin/esbuild b/node_modules/.bin/esbuild deleted file mode 120000 index c83ac070..00000000 --- a/node_modules/.bin/esbuild +++ /dev/null @@ -1 +0,0 @@ -../esbuild/bin/esbuild \ No newline at end of file diff --git a/node_modules/.bin/markdown-it b/node_modules/.bin/markdown-it deleted file mode 120000 index 8a641084..00000000 --- a/node_modules/.bin/markdown-it +++ /dev/null @@ -1 +0,0 @@ -../markdown-it/bin/markdown-it.mjs \ No newline at end of file diff --git a/node_modules/.package-lock.json b/node_modules/.package-lock.json deleted file mode 100644 index 612a0245..00000000 --- a/node_modules/.package-lock.json +++ /dev/null @@ -1,635 +0,0 @@ -{ - "name": "filament-help", - "lockfileVersion": 3, - "requires": true, - "packages": { - "node_modules/@esbuild/darwin-arm64": { - "version": "0.25.11", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.25.11.tgz", - "integrity": "sha512-VekY0PBCukppoQrycFxUqkCojnTQhdec0vevUL/EDOCnXd9LKWqD/bHwMPzigIJXPhC59Vd1WFIL57SKs2mg4w==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@floating-ui/core": { - "version": "1.7.3", - "resolved": "https://registry.npmjs.org/@floating-ui/core/-/core-1.7.3.tgz", - "integrity": "sha512-sGnvb5dmrJaKEZ+LDIpguvdX3bDlEllmv4/ClQ9awcmCZrlx5jQyyMWFM5kBI+EyNOCDDiKk8il0zeuX3Zlg/w==", - "license": "MIT", - "optional": true, - "dependencies": { - "@floating-ui/utils": "^0.2.10" - } - }, - "node_modules/@floating-ui/dom": { - "version": "1.7.4", - "resolved": "https://registry.npmjs.org/@floating-ui/dom/-/dom-1.7.4.tgz", - "integrity": "sha512-OOchDgh4F2CchOX94cRVqhvy7b3AFb+/rQXyswmzmGakRfkMgoWVjfnLWkRirfLEfuD4ysVW16eXzwt3jHIzKA==", - "license": "MIT", - "optional": true, - "dependencies": { - "@floating-ui/core": "^1.7.3", - "@floating-ui/utils": "^0.2.10" - } - }, - "node_modules/@floating-ui/utils": { - "version": "0.2.10", - "resolved": "https://registry.npmjs.org/@floating-ui/utils/-/utils-0.2.10.tgz", - "integrity": "sha512-aGTxbpbg8/b5JfU1HXSrbH3wXZuLPJcNEcZQFMxLs3oSzgtVu6nFPkbbGGUvBcUjKV2YyB9Wxxabo+HEH9tcRQ==", - "license": "MIT", - "optional": true - }, - "node_modules/@remirror/core-constants": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@remirror/core-constants/-/core-constants-3.0.0.tgz", - "integrity": "sha512-42aWfPrimMfDKDi4YegyS7x+/0tlzaqwPQCULLanv3DMIlu96KTJR0fM5isWX2UViOqlGnX6YFgqWepcX+XMNg==", - "license": "MIT", - "peer": true - }, - "node_modules/@tiptap/core": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/@tiptap/core/-/core-3.8.0.tgz", - "integrity": "sha512-AfVCpS+nFLrVkcbIzO8d4VSdwX31Og5GuZ5qsJzx6pfvPam+fz7Icf7pyuys8TDvHb5LszWAAHset015Ouex3Q==", - "license": "MIT", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/ueberdosis" - }, - "peerDependencies": { - "@tiptap/pm": "^3.8.0" - } - }, - "node_modules/@tiptap/extension-bubble-menu": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/@tiptap/extension-bubble-menu/-/extension-bubble-menu-3.8.0.tgz", - "integrity": "sha512-PmZZSAlR9o1zFwz2s/eF9DDI5iS1xsR3S4A47shExQmpF/+T8mTmK/ybnfyVL+Hkf9XxIuQ2Cga6VBhJ0mUc9g==", - "license": "MIT", - "optional": true, - "dependencies": { - "@floating-ui/dom": "^1.0.0" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/ueberdosis" - }, - "peerDependencies": { - "@tiptap/core": "^3.8.0", - "@tiptap/pm": "^3.8.0" - } - }, - "node_modules/@tiptap/extension-floating-menu": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/@tiptap/extension-floating-menu/-/extension-floating-menu-3.8.0.tgz", - "integrity": "sha512-/Uad1nlsVAHmQoerPDN4Ir588mDGF06iwxJED8i12mAaIKhaDfi1oZcs87jJwi8kFnnH5VYfaH/+GMbTVVoa9w==", - "license": "MIT", - "optional": true, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/ueberdosis" - }, - "peerDependencies": { - "@floating-ui/dom": "^1.0.0", - "@tiptap/core": "^3.8.0", - "@tiptap/pm": "^3.8.0" - } - }, - "node_modules/@tiptap/pm": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/@tiptap/pm/-/pm-3.8.0.tgz", - "integrity": "sha512-+HjQTpgz9OZMWpg1DRw5j7KXDc+Ea9FQjFKo8cu+HgwfQMmqmJQEMVFO+bwxZrAU7qfaB2Tc4RNHDI8a+8CBAQ==", - "license": "MIT", - "peer": true, - "dependencies": { - "prosemirror-changeset": "^2.3.0", - "prosemirror-collab": "^1.3.1", - "prosemirror-commands": "^1.6.2", - "prosemirror-dropcursor": "^1.8.1", - "prosemirror-gapcursor": "^1.3.2", - "prosemirror-history": "^1.4.1", - "prosemirror-inputrules": "^1.4.0", - "prosemirror-keymap": "^1.2.2", - "prosemirror-markdown": "^1.13.1", - "prosemirror-menu": "^1.2.4", - "prosemirror-model": "^1.24.1", - "prosemirror-schema-basic": "^1.2.3", - "prosemirror-schema-list": "^1.5.0", - "prosemirror-state": "^1.4.3", - "prosemirror-tables": "^1.6.4", - "prosemirror-trailing-node": "^3.0.0", - "prosemirror-transform": "^1.10.2", - "prosemirror-view": "^1.38.1" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/ueberdosis" - } - }, - "node_modules/@tiptap/react": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/@tiptap/react/-/react-3.8.0.tgz", - "integrity": "sha512-ABEdqimvAdFJ9NY6waFu6z+vybs8EIALkOK7z2b+SrT+imPk+IXzLPmDj3n+PAkrdgGJRuSwXxpQbU/H+NR/4w==", - "license": "MIT", - "dependencies": { - "@types/use-sync-external-store": "^0.0.6", - "fast-deep-equal": "^3.1.3", - "use-sync-external-store": "^1.4.0" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/ueberdosis" - }, - "optionalDependencies": { - "@tiptap/extension-bubble-menu": "^3.8.0", - "@tiptap/extension-floating-menu": "^3.8.0" - }, - "peerDependencies": { - "@tiptap/core": "^3.8.0", - "@tiptap/pm": "^3.8.0", - "@types/react": "^17.0.0 || ^18.0.0 || ^19.0.0", - "@types/react-dom": "^17.0.0 || ^18.0.0 || ^19.0.0", - "react": "^17.0.0 || ^18.0.0 || ^19.0.0", - "react-dom": "^17.0.0 || ^18.0.0 || ^19.0.0" - } - }, - "node_modules/@types/linkify-it": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/@types/linkify-it/-/linkify-it-5.0.0.tgz", - "integrity": "sha512-sVDA58zAw4eWAffKOaQH5/5j3XeayukzDk+ewSsnv3p4yJEZHCCzMDiZM8e0OUrRvmpGZ85jf4yDHkHsgBNr9Q==", - "license": "MIT", - "peer": true - }, - "node_modules/@types/markdown-it": { - "version": "14.1.2", - "resolved": "https://registry.npmjs.org/@types/markdown-it/-/markdown-it-14.1.2.tgz", - "integrity": "sha512-promo4eFwuiW+TfGxhi+0x3czqTYJkG8qB17ZUJiVF10Xm7NLVRSLUsfRTU/6h1e24VvRnXCx+hG7li58lkzog==", - "license": "MIT", - "peer": true, - "dependencies": { - "@types/linkify-it": "^5", - "@types/mdurl": "^2" - } - }, - "node_modules/@types/mdurl": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@types/mdurl/-/mdurl-2.0.0.tgz", - "integrity": "sha512-RGdgjQUZba5p6QEFAVx2OGb8rQDL/cPRG7GiedRzMcJ1tYnUANBncjbSB1NRGwbvjcPeikRABz2nshyPk1bhWg==", - "license": "MIT", - "peer": true - }, - "node_modules/@types/react": { - "version": "19.2.2", - "resolved": "https://registry.npmjs.org/@types/react/-/react-19.2.2.tgz", - "integrity": "sha512-6mDvHUFSjyT2B2yeNx2nUgMxh9LtOWvkhIU3uePn2I2oyNymUAX1NIsdgviM4CH+JSrp2D2hsMvJOkxY+0wNRA==", - "license": "MIT", - "peer": true, - "dependencies": { - "csstype": "^3.0.2" - } - }, - "node_modules/@types/react-dom": { - "version": "19.2.2", - "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-19.2.2.tgz", - "integrity": "sha512-9KQPoO6mZCi7jcIStSnlOWn2nEF3mNmyr3rIAsGnAbQKYbRLyqmeSc39EVgtxXVia+LMT8j3knZLAZAh+xLmrw==", - "license": "MIT", - "peer": true, - "peerDependencies": { - "@types/react": "^19.2.0" - } - }, - "node_modules/@types/use-sync-external-store": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/@types/use-sync-external-store/-/use-sync-external-store-0.0.6.tgz", - "integrity": "sha512-zFDAD+tlpf2r4asuHEj0XH6pY6i0g5NeAHPn+15wk3BV6JA69eERFXC1gyGThDkVa1zCyKr5jox1+2LbV/AMLg==", - "license": "MIT" - }, - "node_modules/argparse": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", - "license": "Python-2.0", - "peer": true - }, - "node_modules/crelt": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/crelt/-/crelt-1.0.6.tgz", - "integrity": "sha512-VQ2MBenTq1fWZUH9DJNGti7kKv6EeAuYr3cLwxUWhIu1baTaXh4Ib5W2CqHVqib4/MqbYGJqiL3Zb8GJZr3l4g==", - "license": "MIT", - "peer": true - }, - "node_modules/csstype": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.3.tgz", - "integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==", - "license": "MIT", - "peer": true - }, - "node_modules/entities": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", - "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", - "license": "BSD-2-Clause", - "peer": true, - "engines": { - "node": ">=0.12" - }, - "funding": { - "url": "https://github.com/fb55/entities?sponsor=1" - } - }, - "node_modules/esbuild": { - "version": "0.25.11", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.25.11.tgz", - "integrity": "sha512-KohQwyzrKTQmhXDW1PjCv3Tyspn9n5GcY2RTDqeORIdIJY8yKIF7sTSopFmn/wpMPW4rdPXI0UE5LJLuq3bx0Q==", - "dev": true, - "hasInstallScript": true, - "license": "MIT", - "bin": { - "esbuild": "bin/esbuild" - }, - "engines": { - "node": ">=18" - }, - "optionalDependencies": { - "@esbuild/aix-ppc64": "0.25.11", - "@esbuild/android-arm": "0.25.11", - "@esbuild/android-arm64": "0.25.11", - "@esbuild/android-x64": "0.25.11", - "@esbuild/darwin-arm64": "0.25.11", - "@esbuild/darwin-x64": "0.25.11", - "@esbuild/freebsd-arm64": "0.25.11", - "@esbuild/freebsd-x64": "0.25.11", - "@esbuild/linux-arm": "0.25.11", - "@esbuild/linux-arm64": "0.25.11", - "@esbuild/linux-ia32": "0.25.11", - "@esbuild/linux-loong64": "0.25.11", - "@esbuild/linux-mips64el": "0.25.11", - "@esbuild/linux-ppc64": "0.25.11", - "@esbuild/linux-riscv64": "0.25.11", - "@esbuild/linux-s390x": "0.25.11", - "@esbuild/linux-x64": "0.25.11", - "@esbuild/netbsd-arm64": "0.25.11", - "@esbuild/netbsd-x64": "0.25.11", - "@esbuild/openbsd-arm64": "0.25.11", - "@esbuild/openbsd-x64": "0.25.11", - "@esbuild/openharmony-arm64": "0.25.11", - "@esbuild/sunos-x64": "0.25.11", - "@esbuild/win32-arm64": "0.25.11", - "@esbuild/win32-ia32": "0.25.11", - "@esbuild/win32-x64": "0.25.11" - } - }, - "node_modules/escape-string-regexp": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", - "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", - "license": "MIT", - "peer": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "license": "MIT" - }, - "node_modules/linkify-it": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-5.0.0.tgz", - "integrity": "sha512-5aHCbzQRADcdP+ATqnDuhhJ/MRIqDkZX5pyjFHRRysS8vZ5AbqGEoFIb6pYHPZ+L/OC2Lc+xT8uHVVR5CAK/wQ==", - "license": "MIT", - "peer": true, - "dependencies": { - "uc.micro": "^2.0.0" - } - }, - "node_modules/markdown-it": { - "version": "14.1.0", - "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-14.1.0.tgz", - "integrity": "sha512-a54IwgWPaeBCAAsv13YgmALOF1elABB08FxO9i+r4VFk5Vl4pKokRPeX8u5TCgSsPi6ec1otfLjdOpVcgbpshg==", - "license": "MIT", - "peer": true, - "dependencies": { - "argparse": "^2.0.1", - "entities": "^4.4.0", - "linkify-it": "^5.0.0", - "mdurl": "^2.0.0", - "punycode.js": "^2.3.1", - "uc.micro": "^2.1.0" - }, - "bin": { - "markdown-it": "bin/markdown-it.mjs" - } - }, - "node_modules/mdurl": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-2.0.0.tgz", - "integrity": "sha512-Lf+9+2r+Tdp5wXDXC4PcIBjTDtq4UKjCPMQhKIuzpJNW0b96kVqSwW0bT7FhRSfmAiFYgP+SCRvdrDozfh0U5w==", - "license": "MIT", - "peer": true - }, - "node_modules/orderedmap": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/orderedmap/-/orderedmap-2.1.1.tgz", - "integrity": "sha512-TvAWxi0nDe1j/rtMcWcIj94+Ffe6n7zhow33h40SKxmsmozs6dz/e+EajymfoFcHd7sxNn8yHM8839uixMOV6g==", - "license": "MIT", - "peer": true - }, - "node_modules/prosemirror-changeset": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/prosemirror-changeset/-/prosemirror-changeset-2.3.1.tgz", - "integrity": "sha512-j0kORIBm8ayJNl3zQvD1TTPHJX3g042et6y/KQhZhnPrruO8exkTgG8X+NRpj7kIyMMEx74Xb3DyMIBtO0IKkQ==", - "license": "MIT", - "peer": true, - "dependencies": { - "prosemirror-transform": "^1.0.0" - } - }, - "node_modules/prosemirror-collab": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/prosemirror-collab/-/prosemirror-collab-1.3.1.tgz", - "integrity": "sha512-4SnynYR9TTYaQVXd/ieUvsVV4PDMBzrq2xPUWutHivDuOshZXqQ5rGbZM84HEaXKbLdItse7weMGOUdDVcLKEQ==", - "license": "MIT", - "peer": true, - "dependencies": { - "prosemirror-state": "^1.0.0" - } - }, - "node_modules/prosemirror-commands": { - "version": "1.7.1", - "resolved": "https://registry.npmjs.org/prosemirror-commands/-/prosemirror-commands-1.7.1.tgz", - "integrity": "sha512-rT7qZnQtx5c0/y/KlYaGvtG411S97UaL6gdp6RIZ23DLHanMYLyfGBV5DtSnZdthQql7W+lEVbpSfwtO8T+L2w==", - "license": "MIT", - "peer": true, - "dependencies": { - "prosemirror-model": "^1.0.0", - "prosemirror-state": "^1.0.0", - "prosemirror-transform": "^1.10.2" - } - }, - "node_modules/prosemirror-dropcursor": { - "version": "1.8.2", - "resolved": "https://registry.npmjs.org/prosemirror-dropcursor/-/prosemirror-dropcursor-1.8.2.tgz", - "integrity": "sha512-CCk6Gyx9+Tt2sbYk5NK0nB1ukHi2ryaRgadV/LvyNuO3ena1payM2z6Cg0vO1ebK8cxbzo41ku2DE5Axj1Zuiw==", - "license": "MIT", - "peer": true, - "dependencies": { - "prosemirror-state": "^1.0.0", - "prosemirror-transform": "^1.1.0", - "prosemirror-view": "^1.1.0" - } - }, - "node_modules/prosemirror-gapcursor": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/prosemirror-gapcursor/-/prosemirror-gapcursor-1.4.0.tgz", - "integrity": "sha512-z00qvurSdCEWUIulij/isHaqu4uLS8r/Fi61IbjdIPJEonQgggbJsLnstW7Lgdk4zQ68/yr6B6bf7sJXowIgdQ==", - "license": "MIT", - "peer": true, - "dependencies": { - "prosemirror-keymap": "^1.0.0", - "prosemirror-model": "^1.0.0", - "prosemirror-state": "^1.0.0", - "prosemirror-view": "^1.0.0" - } - }, - "node_modules/prosemirror-history": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/prosemirror-history/-/prosemirror-history-1.4.1.tgz", - "integrity": "sha512-2JZD8z2JviJrboD9cPuX/Sv/1ChFng+xh2tChQ2X4bB2HeK+rra/bmJ3xGntCcjhOqIzSDG6Id7e8RJ9QPXLEQ==", - "license": "MIT", - "peer": true, - "dependencies": { - "prosemirror-state": "^1.2.2", - "prosemirror-transform": "^1.0.0", - "prosemirror-view": "^1.31.0", - "rope-sequence": "^1.3.0" - } - }, - "node_modules/prosemirror-inputrules": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/prosemirror-inputrules/-/prosemirror-inputrules-1.5.1.tgz", - "integrity": "sha512-7wj4uMjKaXWAQ1CDgxNzNtR9AlsuwzHfdFH1ygEHA2KHF2DOEaXl1CJfNPAKCg9qNEh4rum975QLaCiQPyY6Fw==", - "license": "MIT", - "peer": true, - "dependencies": { - "prosemirror-state": "^1.0.0", - "prosemirror-transform": "^1.0.0" - } - }, - "node_modules/prosemirror-keymap": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/prosemirror-keymap/-/prosemirror-keymap-1.2.3.tgz", - "integrity": "sha512-4HucRlpiLd1IPQQXNqeo81BGtkY8Ai5smHhKW9jjPKRc2wQIxksg7Hl1tTI2IfT2B/LgX6bfYvXxEpJl7aKYKw==", - "license": "MIT", - "peer": true, - "dependencies": { - "prosemirror-state": "^1.0.0", - "w3c-keyname": "^2.2.0" - } - }, - "node_modules/prosemirror-markdown": { - "version": "1.13.2", - "resolved": "https://registry.npmjs.org/prosemirror-markdown/-/prosemirror-markdown-1.13.2.tgz", - "integrity": "sha512-FPD9rHPdA9fqzNmIIDhhnYQ6WgNoSWX9StUZ8LEKapaXU9i6XgykaHKhp6XMyXlOWetmaFgGDS/nu/w9/vUc5g==", - "license": "MIT", - "peer": true, - "dependencies": { - "@types/markdown-it": "^14.0.0", - "markdown-it": "^14.0.0", - "prosemirror-model": "^1.25.0" - } - }, - "node_modules/prosemirror-menu": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/prosemirror-menu/-/prosemirror-menu-1.2.5.tgz", - "integrity": "sha512-qwXzynnpBIeg1D7BAtjOusR+81xCp53j7iWu/IargiRZqRjGIlQuu1f3jFi+ehrHhWMLoyOQTSRx/IWZJqOYtQ==", - "license": "MIT", - "peer": true, - "dependencies": { - "crelt": "^1.0.0", - "prosemirror-commands": "^1.0.0", - "prosemirror-history": "^1.0.0", - "prosemirror-state": "^1.0.0" - } - }, - "node_modules/prosemirror-model": { - "version": "1.25.4", - "resolved": "https://registry.npmjs.org/prosemirror-model/-/prosemirror-model-1.25.4.tgz", - "integrity": "sha512-PIM7E43PBxKce8OQeezAs9j4TP+5yDpZVbuurd1h5phUxEKIu+G2a+EUZzIC5nS1mJktDJWzbqS23n1tsAf5QA==", - "license": "MIT", - "peer": true, - "dependencies": { - "orderedmap": "^2.0.0" - } - }, - "node_modules/prosemirror-schema-basic": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/prosemirror-schema-basic/-/prosemirror-schema-basic-1.2.4.tgz", - "integrity": "sha512-ELxP4TlX3yr2v5rM7Sb70SqStq5NvI15c0j9j/gjsrO5vaw+fnnpovCLEGIcpeGfifkuqJwl4fon6b+KdrODYQ==", - "license": "MIT", - "peer": true, - "dependencies": { - "prosemirror-model": "^1.25.0" - } - }, - "node_modules/prosemirror-schema-list": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/prosemirror-schema-list/-/prosemirror-schema-list-1.5.1.tgz", - "integrity": "sha512-927lFx/uwyQaGwJxLWCZRkjXG0p48KpMj6ueoYiu4JX05GGuGcgzAy62dfiV8eFZftgyBUvLx76RsMe20fJl+Q==", - "license": "MIT", - "peer": true, - "dependencies": { - "prosemirror-model": "^1.0.0", - "prosemirror-state": "^1.0.0", - "prosemirror-transform": "^1.7.3" - } - }, - "node_modules/prosemirror-state": { - "version": "1.4.4", - "resolved": "https://registry.npmjs.org/prosemirror-state/-/prosemirror-state-1.4.4.tgz", - "integrity": "sha512-6jiYHH2CIGbCfnxdHbXZ12gySFY/fz/ulZE333G6bPqIZ4F+TXo9ifiR86nAHpWnfoNjOb3o5ESi7J8Uz1jXHw==", - "license": "MIT", - "peer": true, - "dependencies": { - "prosemirror-model": "^1.0.0", - "prosemirror-transform": "^1.0.0", - "prosemirror-view": "^1.27.0" - } - }, - "node_modules/prosemirror-tables": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/prosemirror-tables/-/prosemirror-tables-1.8.1.tgz", - "integrity": "sha512-DAgDoUYHCcc6tOGpLVPSU1k84kCUWTWnfWX3UDy2Delv4ryH0KqTD6RBI6k4yi9j9I8gl3j8MkPpRD/vWPZbug==", - "license": "MIT", - "peer": true, - "dependencies": { - "prosemirror-keymap": "^1.2.2", - "prosemirror-model": "^1.25.0", - "prosemirror-state": "^1.4.3", - "prosemirror-transform": "^1.10.3", - "prosemirror-view": "^1.39.1" - } - }, - "node_modules/prosemirror-trailing-node": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/prosemirror-trailing-node/-/prosemirror-trailing-node-3.0.0.tgz", - "integrity": "sha512-xiun5/3q0w5eRnGYfNlW1uU9W6x5MoFKWwq/0TIRgt09lv7Hcser2QYV8t4muXbEr+Fwo0geYn79Xs4GKywrRQ==", - "license": "MIT", - "peer": true, - "dependencies": { - "@remirror/core-constants": "3.0.0", - "escape-string-regexp": "^4.0.0" - }, - "peerDependencies": { - "prosemirror-model": "^1.22.1", - "prosemirror-state": "^1.4.2", - "prosemirror-view": "^1.33.8" - } - }, - "node_modules/prosemirror-transform": { - "version": "1.10.4", - "resolved": "https://registry.npmjs.org/prosemirror-transform/-/prosemirror-transform-1.10.4.tgz", - "integrity": "sha512-pwDy22nAnGqNR1feOQKHxoFkkUtepoFAd3r2hbEDsnf4wp57kKA36hXsB3njA9FtONBEwSDnDeCiJe+ItD+ykw==", - "license": "MIT", - "peer": true, - "dependencies": { - "prosemirror-model": "^1.21.0" - } - }, - "node_modules/prosemirror-view": { - "version": "1.41.3", - "resolved": "https://registry.npmjs.org/prosemirror-view/-/prosemirror-view-1.41.3.tgz", - "integrity": "sha512-SqMiYMUQNNBP9kfPhLO8WXEk/fon47vc52FQsUiJzTBuyjKgEcoAwMyF04eQ4WZ2ArMn7+ReypYL60aKngbACQ==", - "license": "MIT", - "peer": true, - "dependencies": { - "prosemirror-model": "^1.20.0", - "prosemirror-state": "^1.0.0", - "prosemirror-transform": "^1.1.0" - } - }, - "node_modules/punycode.js": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/punycode.js/-/punycode.js-2.3.1.tgz", - "integrity": "sha512-uxFIHU0YlHYhDQtV4R9J6a52SLx28BCjT+4ieh7IGbgwVJWO+km431c4yRlREUAsAmt/uMjQUyQHNEPf0M39CA==", - "license": "MIT", - "peer": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/react": { - "version": "19.2.0", - "resolved": "https://registry.npmjs.org/react/-/react-19.2.0.tgz", - "integrity": "sha512-tmbWg6W31tQLeB5cdIBOicJDJRR2KzXsV7uSK9iNfLWQ5bIZfxuPEHp7M8wiHyHnn0DD1i7w3Zmin0FtkrwoCQ==", - "license": "MIT", - "peer": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/react-dom": { - "version": "19.2.0", - "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.2.0.tgz", - "integrity": "sha512-UlbRu4cAiGaIewkPyiRGJk0imDN2T3JjieT6spoL2UeSf5od4n5LB/mQ4ejmxhCFT1tYe8IvaFulzynWovsEFQ==", - "license": "MIT", - "peer": true, - "dependencies": { - "scheduler": "^0.27.0" - }, - "peerDependencies": { - "react": "^19.2.0" - } - }, - "node_modules/rope-sequence": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/rope-sequence/-/rope-sequence-1.3.4.tgz", - "integrity": "sha512-UT5EDe2cu2E/6O4igUr5PSFs23nvvukicWHx6GnOPlHAiiYbzNuCRQCuiUdHJQcqKalLKlrYJnjY0ySGsXNQXQ==", - "license": "MIT", - "peer": true - }, - "node_modules/scheduler": { - "version": "0.27.0", - "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.27.0.tgz", - "integrity": "sha512-eNv+WrVbKu1f3vbYJT/xtiF5syA5HPIMtf9IgY/nKg0sWqzAUEvqY/xm7OcZc/qafLx/iO9FgOmeSAp4v5ti/Q==", - "license": "MIT", - "peer": true - }, - "node_modules/uc.micro": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-2.1.0.tgz", - "integrity": "sha512-ARDJmphmdvUk6Glw7y9DQ2bFkKBHwQHLi2lsaH6PPmz/Ka9sFOBsBluozhDltWmnv9u/cF6Rt87znRTPV+yp/A==", - "license": "MIT", - "peer": true - }, - "node_modules/use-sync-external-store": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/use-sync-external-store/-/use-sync-external-store-1.6.0.tgz", - "integrity": "sha512-Pp6GSwGP/NrPIrxVFAIkOQeyw8lFenOHijQWkUTrDvrF4ALqylP2C/KCkeS9dpUM3KvYRQhna5vt7IL95+ZQ9w==", - "license": "MIT", - "peerDependencies": { - "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" - } - }, - "node_modules/w3c-keyname": { - "version": "2.2.8", - "resolved": "https://registry.npmjs.org/w3c-keyname/-/w3c-keyname-2.2.8.tgz", - "integrity": "sha512-dpojBhNsCNN7T82Tm7k26A6G9ML3NkhDsnw9n/eoxSRlVBB4CEtIQ/KTCLI2Fwf3ataSXRhYFkQi3SlnFwPvPQ==", - "license": "MIT", - "peer": true - } - } -} diff --git a/node_modules/@esbuild/darwin-arm64/README.md b/node_modules/@esbuild/darwin-arm64/README.md deleted file mode 100644 index c2c0398d..00000000 --- a/node_modules/@esbuild/darwin-arm64/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# esbuild - -This is the macOS ARM 64-bit binary for esbuild, a JavaScript bundler and minifier. See https://github.com/evanw/esbuild for details. diff --git a/node_modules/@esbuild/darwin-arm64/bin/esbuild b/node_modules/@esbuild/darwin-arm64/bin/esbuild deleted file mode 100755 index 84d052ee..00000000 Binary files a/node_modules/@esbuild/darwin-arm64/bin/esbuild and /dev/null differ diff --git a/node_modules/@esbuild/darwin-arm64/package.json b/node_modules/@esbuild/darwin-arm64/package.json deleted file mode 100644 index cfac7659..00000000 --- a/node_modules/@esbuild/darwin-arm64/package.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "name": "@esbuild/darwin-arm64", - "version": "0.25.11", - "description": "The macOS ARM 64-bit binary for esbuild, a JavaScript bundler.", - "repository": { - "type": "git", - "url": "git+https://github.com/evanw/esbuild.git" - }, - "license": "MIT", - "preferUnplugged": true, - "engines": { - "node": ">=18" - }, - "os": [ - "darwin" - ], - "cpu": [ - "arm64" - ] -} diff --git a/node_modules/@floating-ui/core/LICENSE b/node_modules/@floating-ui/core/LICENSE deleted file mode 100644 index 639cdc6c..00000000 --- a/node_modules/@floating-ui/core/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -MIT License - -Copyright (c) 2021-present Floating UI contributors - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/@floating-ui/core/README.md b/node_modules/@floating-ui/core/README.md deleted file mode 100644 index c4b69b2e..00000000 --- a/node_modules/@floating-ui/core/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# @floating-ui/core - -This is the platform-agnostic core of Floating UI, exposing the main -`computePosition` function but no platform interface logic. diff --git a/node_modules/@floating-ui/core/dist/floating-ui.core.browser.min.mjs b/node_modules/@floating-ui/core/dist/floating-ui.core.browser.min.mjs deleted file mode 100644 index 708b01f5..00000000 --- a/node_modules/@floating-ui/core/dist/floating-ui.core.browser.min.mjs +++ /dev/null @@ -1 +0,0 @@ -const t=["top","right","bottom","left"],e=["start","end"],n=t.reduce(((t,n)=>t.concat(n,n+"-"+e[0],n+"-"+e[1])),[]),i=Math.min,r=Math.max,o={left:"right",right:"left",bottom:"top",top:"bottom"},a={start:"end",end:"start"};function l(t,e,n){return r(t,i(e,n))}function s(t,e){return"function"==typeof t?t(e):t}function c(t){return t.split("-")[0]}function f(t){return t.split("-")[1]}function m(t){return"x"===t?"y":"x"}function u(t){return"y"===t?"height":"width"}const g=new Set(["top","bottom"]);function d(t){return g.has(c(t))?"y":"x"}function p(t){return m(d(t))}function h(t,e,n){void 0===n&&(n=!1);const i=f(t),r=p(t),o=u(r);let a="x"===r?i===(n?"end":"start")?"right":"left":"start"===i?"bottom":"top";return e.reference[o]>e.floating[o]&&(a=R(a)),[a,R(a)]}function y(t){return t.replace(/start|end/g,(t=>a[t]))}const w=["left","right"],x=["right","left"],v=["top","bottom"],b=["bottom","top"];function A(t,e,n,i){const r=f(t);let o=function(t,e,n){switch(t){case"top":case"bottom":return n?e?x:w:e?w:x;case"left":case"right":return e?v:b;default:return[]}}(c(t),"start"===n,i);return r&&(o=o.map((t=>t+"-"+r)),e&&(o=o.concat(o.map(y)))),o}function R(t){return t.replace(/left|right|bottom|top/g,(t=>o[t]))}function D(t){return"number"!=typeof t?function(t){return{top:0,right:0,bottom:0,left:0,...t}}(t):{top:t,right:t,bottom:t,left:t}}function P(t){const{x:e,y:n,width:i,height:r}=t;return{width:i,height:r,top:n,left:e,right:e+i,bottom:n+r,x:e,y:n}}function E(t,e,n){let{reference:i,floating:r}=t;const o=d(e),a=p(e),l=u(a),s=c(e),m="y"===o,g=i.x+i.width/2-r.width/2,h=i.y+i.height/2-r.height/2,y=i[l]/2-r[l]/2;let w;switch(s){case"top":w={x:g,y:i.y-r.height};break;case"bottom":w={x:g,y:i.y+i.height};break;case"right":w={x:i.x+i.width,y:h};break;case"left":w={x:i.x-r.width,y:h};break;default:w={x:i.x,y:i.y}}switch(f(e)){case"start":w[a]-=y*(n&&m?-1:1);break;case"end":w[a]+=y*(n&&m?-1:1)}return w}const O=async(t,e,n)=>{const{placement:i="bottom",strategy:r="absolute",middleware:o=[],platform:a}=n,l=o.filter(Boolean),s=await(null==a.isRTL?void 0:a.isRTL(e));let c=await a.getElementRects({reference:t,floating:e,strategy:r}),{x:f,y:m}=E(c,i,s),u=i,g={},d=0;for(let n=0;n({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:o,rects:a,platform:c,elements:m,middlewareData:g}=e,{element:d,padding:h=0}=s(t,e)||{};if(null==d)return{};const y=D(h),w={x:n,y:r},x=p(o),v=u(x),b=await c.getDimensions(d),A="y"===x,R=A?"top":"left",P=A?"bottom":"right",E=A?"clientHeight":"clientWidth",O=a.reference[v]+a.reference[x]-w[x]-a.floating[v],T=w[x]-a.reference[x],L=await(null==c.getOffsetParent?void 0:c.getOffsetParent(d));let k=L?L[E]:0;k&&await(null==c.isElement?void 0:c.isElement(L))||(k=m.floating[E]||a.floating[v]);const B=O/2-T/2,C=k/2-b[v]/2-1,H=i(y[R],C),S=i(y[P],C),F=H,M=k-b[v]-S,V=k/2-b[v]/2+B,W=l(F,V,M),j=!g.arrow&&null!=f(o)&&V!==W&&a.reference[v]/2-(Vf(e)===t)),...n.filter((e=>f(e)!==t))]:n.filter((t=>c(t)===t))).filter((n=>!t||f(n)===t||!!e&&y(n)!==n))}(p||null,x,w):w,A=await T(e,v),R=(null==(i=l.autoPlacement)?void 0:i.index)||0,D=b[R];if(null==D)return{};const P=h(D,a,await(null==u.isRTL?void 0:u.isRTL(g.floating)));if(m!==D)return{reset:{placement:b[0]}};const E=[A[c(D)],A[P[0]],A[P[1]]],O=[...(null==(r=l.autoPlacement)?void 0:r.overflows)||[],{placement:D,overflows:E}],L=b[R+1];if(L)return{data:{index:R+1,overflows:O},reset:{placement:L}};const k=O.map((t=>{const e=f(t.placement);return[t.placement,e&&d?t.overflows.slice(0,2).reduce(((t,e)=>t+e),0):t.overflows[0],t.overflows]})).sort(((t,e)=>t[1]-e[1])),B=(null==(o=k.filter((t=>t[2].slice(0,f(t[0])?2:3).every((t=>t<=0))))[0])?void 0:o[0])||k[0][0];return B!==m?{data:{index:R+1,overflows:O},reset:{placement:B}}:{}}}},B=function(t){return void 0===t&&(t={}),{name:"flip",options:t,async fn(e){var n,i;const{placement:r,middlewareData:o,rects:a,initialPlacement:l,platform:f,elements:m}=e,{mainAxis:u=!0,crossAxis:g=!0,fallbackPlacements:p,fallbackStrategy:w="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:v=!0,...b}=s(t,e);if(null!=(n=o.arrow)&&n.alignmentOffset)return{};const D=c(r),P=d(l),E=c(l)===l,O=await(null==f.isRTL?void 0:f.isRTL(m.floating)),L=p||(E||!v?[R(l)]:function(t){const e=R(t);return[y(t),e,y(e)]}(l)),k="none"!==x;!p&&k&&L.push(...A(l,v,x,O));const B=[l,...L],C=await T(e,b),H=[];let S=(null==(i=o.flip)?void 0:i.overflows)||[];if(u&&H.push(C[D]),g){const t=h(r,a,O);H.push(C[t[0]],C[t[1]])}if(S=[...S,{placement:r,overflows:H}],!H.every((t=>t<=0))){var F,M;const t=((null==(F=o.flip)?void 0:F.index)||0)+1,e=B[t];if(e){if(!("alignment"===g&&P!==d(e))||S.every((t=>d(t.placement)!==P||t.overflows[0]>0)))return{data:{index:t,overflows:S},reset:{placement:e}}}let n=null==(M=S.filter((t=>t.overflows[0]<=0)).sort(((t,e)=>t.overflows[1]-e.overflows[1]))[0])?void 0:M.placement;if(!n)switch(w){case"bestFit":{var V;const t=null==(V=S.filter((t=>{if(k){const e=d(t.placement);return e===P||"y"===e}return!0})).map((t=>[t.placement,t.overflows.filter((t=>t>0)).reduce(((t,e)=>t+e),0)])).sort(((t,e)=>t[1]-e[1]))[0])?void 0:V[0];t&&(n=t);break}case"initialPlacement":n=l}if(r!==n)return{reset:{placement:n}}}return{}}}};function C(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function H(e){return t.some((t=>e[t]>=0))}const S=function(t){return void 0===t&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:i="referenceHidden",...r}=s(t,e);switch(i){case"referenceHidden":{const t=C(await T(e,{...r,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:t,referenceHidden:H(t)}}}case"escaped":{const t=C(await T(e,{...r,altBoundary:!0}),n.floating);return{data:{escapedOffsets:t,escaped:H(t)}}}default:return{}}}}};function F(t){const e=i(...t.map((t=>t.left))),n=i(...t.map((t=>t.top)));return{x:e,y:n,width:r(...t.map((t=>t.right)))-e,height:r(...t.map((t=>t.bottom)))-n}}const M=function(t){return void 0===t&&(t={}),{name:"inline",options:t,async fn(e){const{placement:n,elements:o,rects:a,platform:l,strategy:f}=e,{padding:m=2,x:u,y:g}=s(t,e),p=Array.from(await(null==l.getClientRects?void 0:l.getClientRects(o.reference))||[]),h=function(t){const e=t.slice().sort(((t,e)=>t.y-e.y)),n=[];let i=null;for(let t=0;ti.height/2?n.push([r]):n[n.length-1].push(r),i=r}return n.map((t=>P(F(t))))}(p),y=P(F(p)),w=D(m);const x=await l.getElementRects({reference:{getBoundingClientRect:function(){if(2===h.length&&h[0].left>h[1].right&&null!=u&&null!=g)return h.find((t=>u>t.left-w.left&&ut.top-w.top&&g=2){if("y"===d(n)){const t=h[0],e=h[h.length-1],i="top"===c(n),r=t.top,o=e.bottom,a=i?t.left:e.left,l=i?t.right:e.right;return{top:r,bottom:o,left:a,right:l,width:l-a,height:o-r,x:a,y:r}}const t="left"===c(n),e=r(...h.map((t=>t.right))),o=i(...h.map((t=>t.left))),a=h.filter((n=>t?n.left===o:n.right===e)),l=a[0].top,s=a[a.length-1].bottom;return{top:l,bottom:s,left:o,right:e,width:e-o,height:s-l,x:o,y:l}}return y}},floating:o.floating,strategy:f});return a.reference.x!==x.reference.x||a.reference.y!==x.reference.y||a.reference.width!==x.reference.width||a.reference.height!==x.reference.height?{reset:{rects:x}}:{}}}},V=new Set(["left","top"]);const W=function(t){return void 0===t&&(t=0),{name:"offset",options:t,async fn(e){var n,i;const{x:r,y:o,placement:a,middlewareData:l}=e,m=await async function(t,e){const{placement:n,platform:i,elements:r}=t,o=await(null==i.isRTL?void 0:i.isRTL(r.floating)),a=c(n),l=f(n),m="y"===d(n),u=V.has(a)?-1:1,g=o&&m?-1:1,p=s(e,t);let{mainAxis:h,crossAxis:y,alignmentAxis:w}="number"==typeof p?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return l&&"number"==typeof w&&(y="end"===l?-1*w:w),m?{x:y*g,y:h*u}:{x:h*u,y:y*g}}(e,t);return a===(null==(n=l.offset)?void 0:n.placement)&&null!=(i=l.arrow)&&i.alignmentOffset?{}:{x:r+m.x,y:o+m.y,data:{...m,placement:a}}}}},j=function(t){return void 0===t&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:i,placement:r}=e,{mainAxis:o=!0,crossAxis:a=!1,limiter:f={fn:t=>{let{x:e,y:n}=t;return{x:e,y:n}}},...u}=s(t,e),g={x:n,y:i},p=await T(e,u),h=d(c(r)),y=m(h);let w=g[y],x=g[h];if(o){const t="y"===y?"bottom":"right";w=l(w+p["y"===y?"top":"left"],w,w-p[t])}if(a){const t="y"===h?"bottom":"right";x=l(x+p["y"===h?"top":"left"],x,x-p[t])}const v=f.fn({...e,[y]:w,[h]:x});return{...v,data:{x:v.x-n,y:v.y-i,enabled:{[y]:o,[h]:a}}}}}},z=function(t){return void 0===t&&(t={}),{options:t,fn(e){const{x:n,y:i,placement:r,rects:o,middlewareData:a}=e,{offset:l=0,mainAxis:f=!0,crossAxis:u=!0}=s(t,e),g={x:n,y:i},p=d(r),h=m(p);let y=g[h],w=g[p];const x=s(l,e),v="number"==typeof x?{mainAxis:x,crossAxis:0}:{mainAxis:0,crossAxis:0,...x};if(f){const t="y"===h?"height":"width",e=o.reference[h]-o.floating[t]+v.mainAxis,n=o.reference[h]+o.reference[t]-v.mainAxis;yn&&(y=n)}if(u){var b,A;const t="y"===h?"width":"height",e=V.has(c(r)),n=o.reference[p]-o.floating[t]+(e&&(null==(b=a.offset)?void 0:b[p])||0)+(e?0:v.crossAxis),i=o.reference[p]+o.reference[t]+(e?0:(null==(A=a.offset)?void 0:A[p])||0)-(e?v.crossAxis:0);wi&&(w=i)}return{[h]:y,[p]:w}}}},q=function(t){return void 0===t&&(t={}),{name:"size",options:t,async fn(e){var n,o;const{placement:a,rects:l,platform:m,elements:u}=e,{apply:g=()=>{},...p}=s(t,e),h=await T(e,p),y=c(a),w=f(a),x="y"===d(a),{width:v,height:b}=l.floating;let A,R;"top"===y||"bottom"===y?(A=y,R=w===(await(null==m.isRTL?void 0:m.isRTL(u.floating))?"start":"end")?"left":"right"):(R=y,A="end"===w?"top":"bottom");const D=b-h.top-h.bottom,P=v-h.left-h.right,E=i(b-h[A],D),O=i(v-h[R],P),L=!e.middlewareData.shift;let k=E,B=O;if(null!=(n=e.middlewareData.shift)&&n.enabled.x&&(B=P),null!=(o=e.middlewareData.shift)&&o.enabled.y&&(k=D),L&&!w){const t=r(h.left,0),e=r(h.right,0),n=r(h.top,0),i=r(h.bottom,0);x?B=v-2*(0!==t||0!==e?t+e:r(h.left,h.right)):k=b-2*(0!==n||0!==i?n+i:r(h.top,h.bottom))}await g({...e,availableWidth:B,availableHeight:k});const C=await m.getDimensions(u.floating);return v!==C.width||b!==C.height?{reset:{rects:!0}}:{}}}};export{L as arrow,k as autoPlacement,O as computePosition,T as detectOverflow,B as flip,S as hide,M as inline,z as limitShift,W as offset,P as rectToClientRect,j as shift,q as size}; diff --git a/node_modules/@floating-ui/core/dist/floating-ui.core.browser.mjs b/node_modules/@floating-ui/core/dist/floating-ui.core.browser.mjs deleted file mode 100644 index 95ef5ddc..00000000 --- a/node_modules/@floating-ui/core/dist/floating-ui.core.browser.mjs +++ /dev/null @@ -1,1178 +0,0 @@ -/** - * Custom positioning reference element. - * @see https://floating-ui.com/docs/virtual-elements - */ - -const sides = ['top', 'right', 'bottom', 'left']; -const alignments = ['start', 'end']; -const placements = /*#__PURE__*/sides.reduce((acc, side) => acc.concat(side, side + "-" + alignments[0], side + "-" + alignments[1]), []); -const min = Math.min; -const max = Math.max; -const oppositeSideMap = { - left: 'right', - right: 'left', - bottom: 'top', - top: 'bottom' -}; -const oppositeAlignmentMap = { - start: 'end', - end: 'start' -}; -function clamp(start, value, end) { - return max(start, min(value, end)); -} -function evaluate(value, param) { - return typeof value === 'function' ? value(param) : value; -} -function getSide(placement) { - return placement.split('-')[0]; -} -function getAlignment(placement) { - return placement.split('-')[1]; -} -function getOppositeAxis(axis) { - return axis === 'x' ? 'y' : 'x'; -} -function getAxisLength(axis) { - return axis === 'y' ? 'height' : 'width'; -} -const yAxisSides = /*#__PURE__*/new Set(['top', 'bottom']); -function getSideAxis(placement) { - return yAxisSides.has(getSide(placement)) ? 'y' : 'x'; -} -function getAlignmentAxis(placement) { - return getOppositeAxis(getSideAxis(placement)); -} -function getAlignmentSides(placement, rects, rtl) { - if (rtl === void 0) { - rtl = false; - } - const alignment = getAlignment(placement); - const alignmentAxis = getAlignmentAxis(placement); - const length = getAxisLength(alignmentAxis); - let mainAlignmentSide = alignmentAxis === 'x' ? alignment === (rtl ? 'end' : 'start') ? 'right' : 'left' : alignment === 'start' ? 'bottom' : 'top'; - if (rects.reference[length] > rects.floating[length]) { - mainAlignmentSide = getOppositePlacement(mainAlignmentSide); - } - return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)]; -} -function getExpandedPlacements(placement) { - const oppositePlacement = getOppositePlacement(placement); - return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)]; -} -function getOppositeAlignmentPlacement(placement) { - return placement.replace(/start|end/g, alignment => oppositeAlignmentMap[alignment]); -} -const lrPlacement = ['left', 'right']; -const rlPlacement = ['right', 'left']; -const tbPlacement = ['top', 'bottom']; -const btPlacement = ['bottom', 'top']; -function getSideList(side, isStart, rtl) { - switch (side) { - case 'top': - case 'bottom': - if (rtl) return isStart ? rlPlacement : lrPlacement; - return isStart ? lrPlacement : rlPlacement; - case 'left': - case 'right': - return isStart ? tbPlacement : btPlacement; - default: - return []; - } -} -function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) { - const alignment = getAlignment(placement); - let list = getSideList(getSide(placement), direction === 'start', rtl); - if (alignment) { - list = list.map(side => side + "-" + alignment); - if (flipAlignment) { - list = list.concat(list.map(getOppositeAlignmentPlacement)); - } - } - return list; -} -function getOppositePlacement(placement) { - return placement.replace(/left|right|bottom|top/g, side => oppositeSideMap[side]); -} -function expandPaddingObject(padding) { - return { - top: 0, - right: 0, - bottom: 0, - left: 0, - ...padding - }; -} -function getPaddingObject(padding) { - return typeof padding !== 'number' ? expandPaddingObject(padding) : { - top: padding, - right: padding, - bottom: padding, - left: padding - }; -} -function rectToClientRect(rect) { - const { - x, - y, - width, - height - } = rect; - return { - width, - height, - top: y, - left: x, - right: x + width, - bottom: y + height, - x, - y - }; -} - -function computeCoordsFromPlacement(_ref, placement, rtl) { - let { - reference, - floating - } = _ref; - const sideAxis = getSideAxis(placement); - const alignmentAxis = getAlignmentAxis(placement); - const alignLength = getAxisLength(alignmentAxis); - const side = getSide(placement); - const isVertical = sideAxis === 'y'; - const commonX = reference.x + reference.width / 2 - floating.width / 2; - const commonY = reference.y + reference.height / 2 - floating.height / 2; - const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2; - let coords; - switch (side) { - case 'top': - coords = { - x: commonX, - y: reference.y - floating.height - }; - break; - case 'bottom': - coords = { - x: commonX, - y: reference.y + reference.height - }; - break; - case 'right': - coords = { - x: reference.x + reference.width, - y: commonY - }; - break; - case 'left': - coords = { - x: reference.x - floating.width, - y: commonY - }; - break; - default: - coords = { - x: reference.x, - y: reference.y - }; - } - switch (getAlignment(placement)) { - case 'start': - coords[alignmentAxis] -= commonAlign * (rtl && isVertical ? -1 : 1); - break; - case 'end': - coords[alignmentAxis] += commonAlign * (rtl && isVertical ? -1 : 1); - break; - } - return coords; -} - -/** - * Computes the `x` and `y` coordinates that will place the floating element - * next to a given reference element. - * - * This export does not have any `platform` interface logic. You will need to - * write one for the platform you are using Floating UI with. - */ -const computePosition = async (reference, floating, config) => { - const { - placement = 'bottom', - strategy = 'absolute', - middleware = [], - platform - } = config; - const validMiddleware = middleware.filter(Boolean); - const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(floating)); - let rects = await platform.getElementRects({ - reference, - floating, - strategy - }); - let { - x, - y - } = computeCoordsFromPlacement(rects, placement, rtl); - let statefulPlacement = placement; - let middlewareData = {}; - let resetCount = 0; - for (let i = 0; i < validMiddleware.length; i++) { - const { - name, - fn - } = validMiddleware[i]; - const { - x: nextX, - y: nextY, - data, - reset - } = await fn({ - x, - y, - initialPlacement: placement, - placement: statefulPlacement, - strategy, - middlewareData, - rects, - platform, - elements: { - reference, - floating - } - }); - x = nextX != null ? nextX : x; - y = nextY != null ? nextY : y; - middlewareData = { - ...middlewareData, - [name]: { - ...middlewareData[name], - ...data - } - }; - if (reset && resetCount <= 50) { - resetCount++; - if (typeof reset === 'object') { - if (reset.placement) { - statefulPlacement = reset.placement; - } - if (reset.rects) { - rects = reset.rects === true ? await platform.getElementRects({ - reference, - floating, - strategy - }) : reset.rects; - } - ({ - x, - y - } = computeCoordsFromPlacement(rects, statefulPlacement, rtl)); - } - i = -1; - } - } - return { - x, - y, - placement: statefulPlacement, - strategy, - middlewareData - }; -}; - -/** - * Resolves with an object of overflow side offsets that determine how much the - * element is overflowing a given clipping boundary on each side. - * - positive = overflowing the boundary by that number of pixels - * - negative = how many pixels left before it will overflow - * - 0 = lies flush with the boundary - * @see https://floating-ui.com/docs/detectOverflow - */ -async function detectOverflow(state, options) { - var _await$platform$isEle; - if (options === void 0) { - options = {}; - } - const { - x, - y, - platform, - rects, - elements, - strategy - } = state; - const { - boundary = 'clippingAncestors', - rootBoundary = 'viewport', - elementContext = 'floating', - altBoundary = false, - padding = 0 - } = evaluate(options, state); - const paddingObject = getPaddingObject(padding); - const altContext = elementContext === 'floating' ? 'reference' : 'floating'; - const element = elements[altBoundary ? altContext : elementContext]; - const clippingClientRect = rectToClientRect(await platform.getClippingRect({ - element: ((_await$platform$isEle = await (platform.isElement == null ? void 0 : platform.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || (await (platform.getDocumentElement == null ? void 0 : platform.getDocumentElement(elements.floating))), - boundary, - rootBoundary, - strategy - })); - const rect = elementContext === 'floating' ? { - x, - y, - width: rects.floating.width, - height: rects.floating.height - } : rects.reference; - const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating)); - const offsetScale = (await (platform.isElement == null ? void 0 : platform.isElement(offsetParent))) ? (await (platform.getScale == null ? void 0 : platform.getScale(offsetParent))) || { - x: 1, - y: 1 - } : { - x: 1, - y: 1 - }; - const elementClientRect = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({ - elements, - rect, - offsetParent, - strategy - }) : rect); - return { - top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y, - bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y, - left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x, - right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x - }; -} - -/** - * Provides data to position an inner element of the floating element so that it - * appears centered to the reference element. - * @see https://floating-ui.com/docs/arrow - */ -const arrow = options => ({ - name: 'arrow', - options, - async fn(state) { - const { - x, - y, - placement, - rects, - platform, - elements, - middlewareData - } = state; - // Since `element` is required, we don't Partial<> the type. - const { - element, - padding = 0 - } = evaluate(options, state) || {}; - if (element == null) { - return {}; - } - const paddingObject = getPaddingObject(padding); - const coords = { - x, - y - }; - const axis = getAlignmentAxis(placement); - const length = getAxisLength(axis); - const arrowDimensions = await platform.getDimensions(element); - const isYAxis = axis === 'y'; - const minProp = isYAxis ? 'top' : 'left'; - const maxProp = isYAxis ? 'bottom' : 'right'; - const clientProp = isYAxis ? 'clientHeight' : 'clientWidth'; - const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length]; - const startDiff = coords[axis] - rects.reference[axis]; - const arrowOffsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(element)); - let clientSize = arrowOffsetParent ? arrowOffsetParent[clientProp] : 0; - - // DOM platform can return `window` as the `offsetParent`. - if (!clientSize || !(await (platform.isElement == null ? void 0 : platform.isElement(arrowOffsetParent)))) { - clientSize = elements.floating[clientProp] || rects.floating[length]; - } - const centerToReference = endDiff / 2 - startDiff / 2; - - // If the padding is large enough that it causes the arrow to no longer be - // centered, modify the padding so that it is centered. - const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1; - const minPadding = min(paddingObject[minProp], largestPossiblePadding); - const maxPadding = min(paddingObject[maxProp], largestPossiblePadding); - - // Make sure the arrow doesn't overflow the floating element if the center - // point is outside the floating element's bounds. - const min$1 = minPadding; - const max = clientSize - arrowDimensions[length] - maxPadding; - const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference; - const offset = clamp(min$1, center, max); - - // If the reference is small enough that the arrow's padding causes it to - // to point to nothing for an aligned placement, adjust the offset of the - // floating element itself. To ensure `shift()` continues to take action, - // a single reset is performed when this is true. - const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset && rects.reference[length] / 2 - (center < min$1 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0; - const alignmentOffset = shouldAddOffset ? center < min$1 ? center - min$1 : center - max : 0; - return { - [axis]: coords[axis] + alignmentOffset, - data: { - [axis]: offset, - centerOffset: center - offset - alignmentOffset, - ...(shouldAddOffset && { - alignmentOffset - }) - }, - reset: shouldAddOffset - }; - } -}); - -function getPlacementList(alignment, autoAlignment, allowedPlacements) { - const allowedPlacementsSortedByAlignment = alignment ? [...allowedPlacements.filter(placement => getAlignment(placement) === alignment), ...allowedPlacements.filter(placement => getAlignment(placement) !== alignment)] : allowedPlacements.filter(placement => getSide(placement) === placement); - return allowedPlacementsSortedByAlignment.filter(placement => { - if (alignment) { - return getAlignment(placement) === alignment || (autoAlignment ? getOppositeAlignmentPlacement(placement) !== placement : false); - } - return true; - }); -} -/** - * Optimizes the visibility of the floating element by choosing the placement - * that has the most space available automatically, without needing to specify a - * preferred placement. Alternative to `flip`. - * @see https://floating-ui.com/docs/autoPlacement - */ -const autoPlacement = function (options) { - if (options === void 0) { - options = {}; - } - return { - name: 'autoPlacement', - options, - async fn(state) { - var _middlewareData$autoP, _middlewareData$autoP2, _placementsThatFitOnE; - const { - rects, - middlewareData, - placement, - platform, - elements - } = state; - const { - crossAxis = false, - alignment, - allowedPlacements = placements, - autoAlignment = true, - ...detectOverflowOptions - } = evaluate(options, state); - const placements$1 = alignment !== undefined || allowedPlacements === placements ? getPlacementList(alignment || null, autoAlignment, allowedPlacements) : allowedPlacements; - const overflow = await detectOverflow(state, detectOverflowOptions); - const currentIndex = ((_middlewareData$autoP = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP.index) || 0; - const currentPlacement = placements$1[currentIndex]; - if (currentPlacement == null) { - return {}; - } - const alignmentSides = getAlignmentSides(currentPlacement, rects, await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating))); - - // Make `computeCoords` start from the right place. - if (placement !== currentPlacement) { - return { - reset: { - placement: placements$1[0] - } - }; - } - const currentOverflows = [overflow[getSide(currentPlacement)], overflow[alignmentSides[0]], overflow[alignmentSides[1]]]; - const allOverflows = [...(((_middlewareData$autoP2 = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP2.overflows) || []), { - placement: currentPlacement, - overflows: currentOverflows - }]; - const nextPlacement = placements$1[currentIndex + 1]; - - // There are more placements to check. - if (nextPlacement) { - return { - data: { - index: currentIndex + 1, - overflows: allOverflows - }, - reset: { - placement: nextPlacement - } - }; - } - const placementsSortedByMostSpace = allOverflows.map(d => { - const alignment = getAlignment(d.placement); - return [d.placement, alignment && crossAxis ? - // Check along the mainAxis and main crossAxis side. - d.overflows.slice(0, 2).reduce((acc, v) => acc + v, 0) : - // Check only the mainAxis. - d.overflows[0], d.overflows]; - }).sort((a, b) => a[1] - b[1]); - const placementsThatFitOnEachSide = placementsSortedByMostSpace.filter(d => d[2].slice(0, - // Aligned placements should not check their opposite crossAxis - // side. - getAlignment(d[0]) ? 2 : 3).every(v => v <= 0)); - const resetPlacement = ((_placementsThatFitOnE = placementsThatFitOnEachSide[0]) == null ? void 0 : _placementsThatFitOnE[0]) || placementsSortedByMostSpace[0][0]; - if (resetPlacement !== placement) { - return { - data: { - index: currentIndex + 1, - overflows: allOverflows - }, - reset: { - placement: resetPlacement - } - }; - } - return {}; - } - }; -}; - -/** - * Optimizes the visibility of the floating element by flipping the `placement` - * in order to keep it in view when the preferred placement(s) will overflow the - * clipping boundary. Alternative to `autoPlacement`. - * @see https://floating-ui.com/docs/flip - */ -const flip = function (options) { - if (options === void 0) { - options = {}; - } - return { - name: 'flip', - options, - async fn(state) { - var _middlewareData$arrow, _middlewareData$flip; - const { - placement, - middlewareData, - rects, - initialPlacement, - platform, - elements - } = state; - const { - mainAxis: checkMainAxis = true, - crossAxis: checkCrossAxis = true, - fallbackPlacements: specifiedFallbackPlacements, - fallbackStrategy = 'bestFit', - fallbackAxisSideDirection = 'none', - flipAlignment = true, - ...detectOverflowOptions - } = evaluate(options, state); - - // If a reset by the arrow was caused due to an alignment offset being - // added, we should skip any logic now since `flip()` has already done its - // work. - // https://github.com/floating-ui/floating-ui/issues/2549#issuecomment-1719601643 - if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) { - return {}; - } - const side = getSide(placement); - const initialSideAxis = getSideAxis(initialPlacement); - const isBasePlacement = getSide(initialPlacement) === initialPlacement; - const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)); - const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement)); - const hasFallbackAxisSideDirection = fallbackAxisSideDirection !== 'none'; - if (!specifiedFallbackPlacements && hasFallbackAxisSideDirection) { - fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl)); - } - const placements = [initialPlacement, ...fallbackPlacements]; - const overflow = await detectOverflow(state, detectOverflowOptions); - const overflows = []; - let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || []; - if (checkMainAxis) { - overflows.push(overflow[side]); - } - if (checkCrossAxis) { - const sides = getAlignmentSides(placement, rects, rtl); - overflows.push(overflow[sides[0]], overflow[sides[1]]); - } - overflowsData = [...overflowsData, { - placement, - overflows - }]; - - // One or more sides is overflowing. - if (!overflows.every(side => side <= 0)) { - var _middlewareData$flip2, _overflowsData$filter; - const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1; - const nextPlacement = placements[nextIndex]; - if (nextPlacement) { - const ignoreCrossAxisOverflow = checkCrossAxis === 'alignment' ? initialSideAxis !== getSideAxis(nextPlacement) : false; - if (!ignoreCrossAxisOverflow || - // We leave the current main axis only if every placement on that axis - // overflows the main axis. - overflowsData.every(d => getSideAxis(d.placement) === initialSideAxis ? d.overflows[0] > 0 : true)) { - // Try next placement and re-run the lifecycle. - return { - data: { - index: nextIndex, - overflows: overflowsData - }, - reset: { - placement: nextPlacement - } - }; - } - } - - // First, find the candidates that fit on the mainAxis side of overflow, - // then find the placement that fits the best on the main crossAxis side. - let resetPlacement = (_overflowsData$filter = overflowsData.filter(d => d.overflows[0] <= 0).sort((a, b) => a.overflows[1] - b.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement; - - // Otherwise fallback. - if (!resetPlacement) { - switch (fallbackStrategy) { - case 'bestFit': - { - var _overflowsData$filter2; - const placement = (_overflowsData$filter2 = overflowsData.filter(d => { - if (hasFallbackAxisSideDirection) { - const currentSideAxis = getSideAxis(d.placement); - return currentSideAxis === initialSideAxis || - // Create a bias to the `y` side axis due to horizontal - // reading directions favoring greater width. - currentSideAxis === 'y'; - } - return true; - }).map(d => [d.placement, d.overflows.filter(overflow => overflow > 0).reduce((acc, overflow) => acc + overflow, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$filter2[0]; - if (placement) { - resetPlacement = placement; - } - break; - } - case 'initialPlacement': - resetPlacement = initialPlacement; - break; - } - } - if (placement !== resetPlacement) { - return { - reset: { - placement: resetPlacement - } - }; - } - } - return {}; - } - }; -}; - -function getSideOffsets(overflow, rect) { - return { - top: overflow.top - rect.height, - right: overflow.right - rect.width, - bottom: overflow.bottom - rect.height, - left: overflow.left - rect.width - }; -} -function isAnySideFullyClipped(overflow) { - return sides.some(side => overflow[side] >= 0); -} -/** - * Provides data to hide the floating element in applicable situations, such as - * when it is not in the same clipping context as the reference element. - * @see https://floating-ui.com/docs/hide - */ -const hide = function (options) { - if (options === void 0) { - options = {}; - } - return { - name: 'hide', - options, - async fn(state) { - const { - rects - } = state; - const { - strategy = 'referenceHidden', - ...detectOverflowOptions - } = evaluate(options, state); - switch (strategy) { - case 'referenceHidden': - { - const overflow = await detectOverflow(state, { - ...detectOverflowOptions, - elementContext: 'reference' - }); - const offsets = getSideOffsets(overflow, rects.reference); - return { - data: { - referenceHiddenOffsets: offsets, - referenceHidden: isAnySideFullyClipped(offsets) - } - }; - } - case 'escaped': - { - const overflow = await detectOverflow(state, { - ...detectOverflowOptions, - altBoundary: true - }); - const offsets = getSideOffsets(overflow, rects.floating); - return { - data: { - escapedOffsets: offsets, - escaped: isAnySideFullyClipped(offsets) - } - }; - } - default: - { - return {}; - } - } - } - }; -}; - -function getBoundingRect(rects) { - const minX = min(...rects.map(rect => rect.left)); - const minY = min(...rects.map(rect => rect.top)); - const maxX = max(...rects.map(rect => rect.right)); - const maxY = max(...rects.map(rect => rect.bottom)); - return { - x: minX, - y: minY, - width: maxX - minX, - height: maxY - minY - }; -} -function getRectsByLine(rects) { - const sortedRects = rects.slice().sort((a, b) => a.y - b.y); - const groups = []; - let prevRect = null; - for (let i = 0; i < sortedRects.length; i++) { - const rect = sortedRects[i]; - if (!prevRect || rect.y - prevRect.y > prevRect.height / 2) { - groups.push([rect]); - } else { - groups[groups.length - 1].push(rect); - } - prevRect = rect; - } - return groups.map(rect => rectToClientRect(getBoundingRect(rect))); -} -/** - * Provides improved positioning for inline reference elements that can span - * over multiple lines, such as hyperlinks or range selections. - * @see https://floating-ui.com/docs/inline - */ -const inline = function (options) { - if (options === void 0) { - options = {}; - } - return { - name: 'inline', - options, - async fn(state) { - const { - placement, - elements, - rects, - platform, - strategy - } = state; - // A MouseEvent's client{X,Y} coords can be up to 2 pixels off a - // ClientRect's bounds, despite the event listener being triggered. A - // padding of 2 seems to handle this issue. - const { - padding = 2, - x, - y - } = evaluate(options, state); - const nativeClientRects = Array.from((await (platform.getClientRects == null ? void 0 : platform.getClientRects(elements.reference))) || []); - const clientRects = getRectsByLine(nativeClientRects); - const fallback = rectToClientRect(getBoundingRect(nativeClientRects)); - const paddingObject = getPaddingObject(padding); - function getBoundingClientRect() { - // There are two rects and they are disjoined. - if (clientRects.length === 2 && clientRects[0].left > clientRects[1].right && x != null && y != null) { - // Find the first rect in which the point is fully inside. - return clientRects.find(rect => x > rect.left - paddingObject.left && x < rect.right + paddingObject.right && y > rect.top - paddingObject.top && y < rect.bottom + paddingObject.bottom) || fallback; - } - - // There are 2 or more connected rects. - if (clientRects.length >= 2) { - if (getSideAxis(placement) === 'y') { - const firstRect = clientRects[0]; - const lastRect = clientRects[clientRects.length - 1]; - const isTop = getSide(placement) === 'top'; - const top = firstRect.top; - const bottom = lastRect.bottom; - const left = isTop ? firstRect.left : lastRect.left; - const right = isTop ? firstRect.right : lastRect.right; - const width = right - left; - const height = bottom - top; - return { - top, - bottom, - left, - right, - width, - height, - x: left, - y: top - }; - } - const isLeftSide = getSide(placement) === 'left'; - const maxRight = max(...clientRects.map(rect => rect.right)); - const minLeft = min(...clientRects.map(rect => rect.left)); - const measureRects = clientRects.filter(rect => isLeftSide ? rect.left === minLeft : rect.right === maxRight); - const top = measureRects[0].top; - const bottom = measureRects[measureRects.length - 1].bottom; - const left = minLeft; - const right = maxRight; - const width = right - left; - const height = bottom - top; - return { - top, - bottom, - left, - right, - width, - height, - x: left, - y: top - }; - } - return fallback; - } - const resetRects = await platform.getElementRects({ - reference: { - getBoundingClientRect - }, - floating: elements.floating, - strategy - }); - if (rects.reference.x !== resetRects.reference.x || rects.reference.y !== resetRects.reference.y || rects.reference.width !== resetRects.reference.width || rects.reference.height !== resetRects.reference.height) { - return { - reset: { - rects: resetRects - } - }; - } - return {}; - } - }; -}; - -const originSides = /*#__PURE__*/new Set(['left', 'top']); - -// For type backwards-compatibility, the `OffsetOptions` type was also -// Derivable. - -async function convertValueToCoords(state, options) { - const { - placement, - platform, - elements - } = state; - const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)); - const side = getSide(placement); - const alignment = getAlignment(placement); - const isVertical = getSideAxis(placement) === 'y'; - const mainAxisMulti = originSides.has(side) ? -1 : 1; - const crossAxisMulti = rtl && isVertical ? -1 : 1; - const rawValue = evaluate(options, state); - - // eslint-disable-next-line prefer-const - let { - mainAxis, - crossAxis, - alignmentAxis - } = typeof rawValue === 'number' ? { - mainAxis: rawValue, - crossAxis: 0, - alignmentAxis: null - } : { - mainAxis: rawValue.mainAxis || 0, - crossAxis: rawValue.crossAxis || 0, - alignmentAxis: rawValue.alignmentAxis - }; - if (alignment && typeof alignmentAxis === 'number') { - crossAxis = alignment === 'end' ? alignmentAxis * -1 : alignmentAxis; - } - return isVertical ? { - x: crossAxis * crossAxisMulti, - y: mainAxis * mainAxisMulti - } : { - x: mainAxis * mainAxisMulti, - y: crossAxis * crossAxisMulti - }; -} - -/** - * Modifies the placement by translating the floating element along the - * specified axes. - * A number (shorthand for `mainAxis` or distance), or an axes configuration - * object may be passed. - * @see https://floating-ui.com/docs/offset - */ -const offset = function (options) { - if (options === void 0) { - options = 0; - } - return { - name: 'offset', - options, - async fn(state) { - var _middlewareData$offse, _middlewareData$arrow; - const { - x, - y, - placement, - middlewareData - } = state; - const diffCoords = await convertValueToCoords(state, options); - - // If the placement is the same and the arrow caused an alignment offset - // then we don't need to change the positioning coordinates. - if (placement === ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) { - return {}; - } - return { - x: x + diffCoords.x, - y: y + diffCoords.y, - data: { - ...diffCoords, - placement - } - }; - } - }; -}; - -/** - * Optimizes the visibility of the floating element by shifting it in order to - * keep it in view when it will overflow the clipping boundary. - * @see https://floating-ui.com/docs/shift - */ -const shift = function (options) { - if (options === void 0) { - options = {}; - } - return { - name: 'shift', - options, - async fn(state) { - const { - x, - y, - placement - } = state; - const { - mainAxis: checkMainAxis = true, - crossAxis: checkCrossAxis = false, - limiter = { - fn: _ref => { - let { - x, - y - } = _ref; - return { - x, - y - }; - } - }, - ...detectOverflowOptions - } = evaluate(options, state); - const coords = { - x, - y - }; - const overflow = await detectOverflow(state, detectOverflowOptions); - const crossAxis = getSideAxis(getSide(placement)); - const mainAxis = getOppositeAxis(crossAxis); - let mainAxisCoord = coords[mainAxis]; - let crossAxisCoord = coords[crossAxis]; - if (checkMainAxis) { - const minSide = mainAxis === 'y' ? 'top' : 'left'; - const maxSide = mainAxis === 'y' ? 'bottom' : 'right'; - const min = mainAxisCoord + overflow[minSide]; - const max = mainAxisCoord - overflow[maxSide]; - mainAxisCoord = clamp(min, mainAxisCoord, max); - } - if (checkCrossAxis) { - const minSide = crossAxis === 'y' ? 'top' : 'left'; - const maxSide = crossAxis === 'y' ? 'bottom' : 'right'; - const min = crossAxisCoord + overflow[minSide]; - const max = crossAxisCoord - overflow[maxSide]; - crossAxisCoord = clamp(min, crossAxisCoord, max); - } - const limitedCoords = limiter.fn({ - ...state, - [mainAxis]: mainAxisCoord, - [crossAxis]: crossAxisCoord - }); - return { - ...limitedCoords, - data: { - x: limitedCoords.x - x, - y: limitedCoords.y - y, - enabled: { - [mainAxis]: checkMainAxis, - [crossAxis]: checkCrossAxis - } - } - }; - } - }; -}; -/** - * Built-in `limiter` that will stop `shift()` at a certain point. - */ -const limitShift = function (options) { - if (options === void 0) { - options = {}; - } - return { - options, - fn(state) { - const { - x, - y, - placement, - rects, - middlewareData - } = state; - const { - offset = 0, - mainAxis: checkMainAxis = true, - crossAxis: checkCrossAxis = true - } = evaluate(options, state); - const coords = { - x, - y - }; - const crossAxis = getSideAxis(placement); - const mainAxis = getOppositeAxis(crossAxis); - let mainAxisCoord = coords[mainAxis]; - let crossAxisCoord = coords[crossAxis]; - const rawOffset = evaluate(offset, state); - const computedOffset = typeof rawOffset === 'number' ? { - mainAxis: rawOffset, - crossAxis: 0 - } : { - mainAxis: 0, - crossAxis: 0, - ...rawOffset - }; - if (checkMainAxis) { - const len = mainAxis === 'y' ? 'height' : 'width'; - const limitMin = rects.reference[mainAxis] - rects.floating[len] + computedOffset.mainAxis; - const limitMax = rects.reference[mainAxis] + rects.reference[len] - computedOffset.mainAxis; - if (mainAxisCoord < limitMin) { - mainAxisCoord = limitMin; - } else if (mainAxisCoord > limitMax) { - mainAxisCoord = limitMax; - } - } - if (checkCrossAxis) { - var _middlewareData$offse, _middlewareData$offse2; - const len = mainAxis === 'y' ? 'width' : 'height'; - const isOriginSide = originSides.has(getSide(placement)); - const limitMin = rects.reference[crossAxis] - rects.floating[len] + (isOriginSide ? ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse[crossAxis]) || 0 : 0) + (isOriginSide ? 0 : computedOffset.crossAxis); - const limitMax = rects.reference[crossAxis] + rects.reference[len] + (isOriginSide ? 0 : ((_middlewareData$offse2 = middlewareData.offset) == null ? void 0 : _middlewareData$offse2[crossAxis]) || 0) - (isOriginSide ? computedOffset.crossAxis : 0); - if (crossAxisCoord < limitMin) { - crossAxisCoord = limitMin; - } else if (crossAxisCoord > limitMax) { - crossAxisCoord = limitMax; - } - } - return { - [mainAxis]: mainAxisCoord, - [crossAxis]: crossAxisCoord - }; - } - }; -}; - -/** - * Provides data that allows you to change the size of the floating element — - * for instance, prevent it from overflowing the clipping boundary or match the - * width of the reference element. - * @see https://floating-ui.com/docs/size - */ -const size = function (options) { - if (options === void 0) { - options = {}; - } - return { - name: 'size', - options, - async fn(state) { - var _state$middlewareData, _state$middlewareData2; - const { - placement, - rects, - platform, - elements - } = state; - const { - apply = () => {}, - ...detectOverflowOptions - } = evaluate(options, state); - const overflow = await detectOverflow(state, detectOverflowOptions); - const side = getSide(placement); - const alignment = getAlignment(placement); - const isYAxis = getSideAxis(placement) === 'y'; - const { - width, - height - } = rects.floating; - let heightSide; - let widthSide; - if (side === 'top' || side === 'bottom') { - heightSide = side; - widthSide = alignment === ((await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating))) ? 'start' : 'end') ? 'left' : 'right'; - } else { - widthSide = side; - heightSide = alignment === 'end' ? 'top' : 'bottom'; - } - const maximumClippingHeight = height - overflow.top - overflow.bottom; - const maximumClippingWidth = width - overflow.left - overflow.right; - const overflowAvailableHeight = min(height - overflow[heightSide], maximumClippingHeight); - const overflowAvailableWidth = min(width - overflow[widthSide], maximumClippingWidth); - const noShift = !state.middlewareData.shift; - let availableHeight = overflowAvailableHeight; - let availableWidth = overflowAvailableWidth; - if ((_state$middlewareData = state.middlewareData.shift) != null && _state$middlewareData.enabled.x) { - availableWidth = maximumClippingWidth; - } - if ((_state$middlewareData2 = state.middlewareData.shift) != null && _state$middlewareData2.enabled.y) { - availableHeight = maximumClippingHeight; - } - if (noShift && !alignment) { - const xMin = max(overflow.left, 0); - const xMax = max(overflow.right, 0); - const yMin = max(overflow.top, 0); - const yMax = max(overflow.bottom, 0); - if (isYAxis) { - availableWidth = width - 2 * (xMin !== 0 || xMax !== 0 ? xMin + xMax : max(overflow.left, overflow.right)); - } else { - availableHeight = height - 2 * (yMin !== 0 || yMax !== 0 ? yMin + yMax : max(overflow.top, overflow.bottom)); - } - } - await apply({ - ...state, - availableWidth, - availableHeight - }); - const nextDimensions = await platform.getDimensions(elements.floating); - if (width !== nextDimensions.width || height !== nextDimensions.height) { - return { - reset: { - rects: true - } - }; - } - return {}; - } - }; -}; - -export { arrow, autoPlacement, computePosition, detectOverflow, flip, hide, inline, limitShift, offset, rectToClientRect, shift, size }; diff --git a/node_modules/@floating-ui/core/dist/floating-ui.core.d.mts b/node_modules/@floating-ui/core/dist/floating-ui.core.d.mts deleted file mode 100644 index 5c0240bc..00000000 --- a/node_modules/@floating-ui/core/dist/floating-ui.core.d.mts +++ /dev/null @@ -1,528 +0,0 @@ -import { AlignedPlacement } from '@floating-ui/utils'; -import { Alignment } from '@floating-ui/utils'; -import { Axis } from '@floating-ui/utils'; -import { ClientRectObject } from '@floating-ui/utils'; -import { Coords } from '@floating-ui/utils'; -import { Dimensions } from '@floating-ui/utils'; -import { ElementRects } from '@floating-ui/utils'; -import { Length } from '@floating-ui/utils'; -import { Padding } from '@floating-ui/utils'; -import { Placement } from '@floating-ui/utils'; -import { Rect } from '@floating-ui/utils'; -import { rectToClientRect } from '@floating-ui/utils'; -import { Side } from '@floating-ui/utils'; -import { SideObject } from '@floating-ui/utils'; -import { Strategy } from '@floating-ui/utils'; -import { VirtualElement } from '@floating-ui/utils'; - -export { AlignedPlacement } - -export { Alignment } - -/** - * Provides data to position an inner element of the floating element so that it - * appears centered to the reference element. - * @see https://floating-ui.com/docs/arrow - */ -export declare const arrow: (options: ArrowOptions | Derivable) => Middleware; - -export declare interface ArrowOptions { - /** - * The arrow element to be positioned. - * @default undefined - */ - element: any; - /** - * The padding between the arrow element and the floating element edges. - * Useful when the floating element has rounded corners. - * @default 0 - */ - padding?: Padding; -} - -/** - * Optimizes the visibility of the floating element by choosing the placement - * that has the most space available automatically, without needing to specify a - * preferred placement. Alternative to `flip`. - * @see https://floating-ui.com/docs/autoPlacement - */ -export declare const autoPlacement: (options?: AutoPlacementOptions | Derivable) => Middleware; - -export declare interface AutoPlacementOptions extends DetectOverflowOptions { - /** - * The axis that runs along the alignment of the floating element. Determines - * whether to check for most space along this axis. - * @default false - */ - crossAxis?: boolean; - /** - * Choose placements with a particular alignment. - * @default undefined - */ - alignment?: Alignment | null; - /** - * Whether to choose placements with the opposite alignment if the preferred - * alignment does not fit. - * @default true - */ - autoAlignment?: boolean; - /** - * Which placements are allowed to be chosen. Placements must be within the - * `alignment` option if explicitly set. - * @default allPlacements (variable) - */ - allowedPlacements?: Array; -} - -export { Axis } - -export declare type Boundary = any; - -export { ClientRectObject } - -export declare type ComputePosition = (reference: unknown, floating: unknown, config: ComputePositionConfig) => Promise; - -/** - * Computes the `x` and `y` coordinates that will place the floating element - * next to a given reference element. - * - * This export does not have any `platform` interface logic. You will need to - * write one for the platform you are using Floating UI with. - */ -export declare const computePosition: ComputePosition; - -export declare interface ComputePositionConfig { - /** - * Object to interface with the current platform. - */ - platform: Platform; - /** - * Where to place the floating element relative to the reference element. - */ - placement?: Placement; - /** - * The strategy to use when positioning the floating element. - */ - strategy?: Strategy; - /** - * Array of middleware objects to modify the positioning or provide data for - * rendering. - */ - middleware?: Array; -} - -export declare interface ComputePositionReturn extends Coords { - /** - * The final chosen placement of the floating element. - */ - placement: Placement; - /** - * The strategy used to position the floating element. - */ - strategy: Strategy; - /** - * Object containing data returned from all middleware, keyed by their name. - */ - middlewareData: MiddlewareData; -} - -export { Coords } - -/** - * Function option to derive middleware options from state. - */ -export declare type Derivable = (state: MiddlewareState) => T; - -/** - * Resolves with an object of overflow side offsets that determine how much the - * element is overflowing a given clipping boundary on each side. - * - positive = overflowing the boundary by that number of pixels - * - negative = how many pixels left before it will overflow - * - 0 = lies flush with the boundary - * @see https://floating-ui.com/docs/detectOverflow - */ -export declare function detectOverflow(state: MiddlewareState, options?: DetectOverflowOptions | Derivable): Promise; - -export declare interface DetectOverflowOptions { - /** - * The clipping element(s) or area in which overflow will be checked. - * @default 'clippingAncestors' - */ - boundary?: Boundary; - /** - * The root clipping area in which overflow will be checked. - * @default 'viewport' - */ - rootBoundary?: RootBoundary; - /** - * The element in which overflow is being checked relative to a boundary. - * @default 'floating' - */ - elementContext?: ElementContext; - /** - * Whether to check for overflow using the alternate element's boundary - * (`clippingAncestors` boundary only). - * @default false - */ - altBoundary?: boolean; - /** - * Virtual padding for the resolved overflow detection offsets. - * @default 0 - */ - padding?: Padding; -} - -export { Dimensions } - -export declare type ElementContext = 'reference' | 'floating'; - -export { ElementRects } - -export declare interface Elements { - reference: ReferenceElement; - floating: FloatingElement; -} - -/** - * Optimizes the visibility of the floating element by flipping the `placement` - * in order to keep it in view when the preferred placement(s) will overflow the - * clipping boundary. Alternative to `autoPlacement`. - * @see https://floating-ui.com/docs/flip - */ -export declare const flip: (options?: FlipOptions | Derivable) => Middleware; - -export declare interface FlipOptions extends DetectOverflowOptions { - /** - * The axis that runs along the side of the floating element. Determines - * whether overflow along this axis is checked to perform a flip. - * @default true - */ - mainAxis?: boolean; - /** - * The axis that runs along the alignment of the floating element. Determines - * whether overflow along this axis is checked to perform a flip. - * - `true`: Whether to check cross axis overflow for both side and alignment flipping. - * - `false`: Whether to disable all cross axis overflow checking. - * - `'alignment'`: Whether to check cross axis overflow for alignment flipping only. - * @default true - */ - crossAxis?: boolean | 'alignment'; - /** - * Placements to try sequentially if the preferred `placement` does not fit. - * @default [oppositePlacement] (computed) - */ - fallbackPlacements?: Array; - /** - * What strategy to use when no placements fit. - * @default 'bestFit' - */ - fallbackStrategy?: 'bestFit' | 'initialPlacement'; - /** - * Whether to allow fallback to the perpendicular axis of the preferred - * placement, and if so, which side direction along the axis to prefer. - * @default 'none' (disallow fallback) - */ - fallbackAxisSideDirection?: 'none' | 'start' | 'end'; - /** - * Whether to flip to placements with the opposite alignment if they fit - * better. - * @default true - */ - flipAlignment?: boolean; -} - -export declare type FloatingElement = any; - -/** - * Provides data to hide the floating element in applicable situations, such as - * when it is not in the same clipping context as the reference element. - * @see https://floating-ui.com/docs/hide - */ -export declare const hide: (options?: HideOptions | Derivable) => Middleware; - -export declare interface HideOptions extends DetectOverflowOptions { - /** - * The strategy used to determine when to hide the floating element. - */ - strategy?: 'referenceHidden' | 'escaped'; -} - -/** - * Provides improved positioning for inline reference elements that can span - * over multiple lines, such as hyperlinks or range selections. - * @see https://floating-ui.com/docs/inline - */ -export declare const inline: (options?: InlineOptions | Derivable) => Middleware; - -export declare interface InlineOptions { - /** - * Viewport-relative `x` coordinate to choose a `ClientRect`. - * @default undefined - */ - x?: number; - /** - * Viewport-relative `y` coordinate to choose a `ClientRect`. - * @default undefined - */ - y?: number; - /** - * Represents the padding around a disjoined rect when choosing it. - * @default 2 - */ - padding?: Padding; -} - -export { Length } - -/** - * Built-in `limiter` that will stop `shift()` at a certain point. - */ -export declare const limitShift: (options?: LimitShiftOptions | Derivable) => { - options: any; - fn: (state: MiddlewareState) => Coords; -}; - -declare type LimitShiftOffset = number | { - /** - * Offset the limiting of the axis that runs along the alignment of the - * floating element. - */ - mainAxis?: number; - /** - * Offset the limiting of the axis that runs along the side of the - * floating element. - */ - crossAxis?: number; -}; - -export declare interface LimitShiftOptions { - /** - * Offset when limiting starts. `0` will limit when the opposite edges of the - * reference and floating elements are aligned. - * - positive = start limiting earlier - * - negative = start limiting later - */ - offset?: LimitShiftOffset | Derivable; - /** - * Whether to limit the axis that runs along the alignment of the floating - * element. - */ - mainAxis?: boolean; - /** - * Whether to limit the axis that runs along the side of the floating element. - */ - crossAxis?: boolean; -} - -export declare type Middleware = { - name: string; - options?: any; - fn: (state: MiddlewareState) => Promisable; -}; - -/** - * @deprecated use `MiddlewareState` instead. - */ -export declare type MiddlewareArguments = MiddlewareState; - -export declare interface MiddlewareData { - [key: string]: any; - arrow?: Partial & { - centerOffset: number; - alignmentOffset?: number; - }; - autoPlacement?: { - index?: number; - overflows: Array<{ - placement: Placement; - overflows: Array; - }>; - }; - flip?: { - index?: number; - overflows: Array<{ - placement: Placement; - overflows: Array; - }>; - }; - hide?: { - referenceHidden?: boolean; - escaped?: boolean; - referenceHiddenOffsets?: SideObject; - escapedOffsets?: SideObject; - }; - offset?: Coords & { - placement: Placement; - }; - shift?: Coords & { - enabled: { - [key in Axis]: boolean; - }; - }; -} - -export declare interface MiddlewareReturn extends Partial { - data?: { - [key: string]: any; - }; - reset?: boolean | { - placement?: Placement; - rects?: boolean | ElementRects; - }; -} - -export declare interface MiddlewareState extends Coords { - initialPlacement: Placement; - placement: Placement; - strategy: Strategy; - middlewareData: MiddlewareData; - elements: Elements; - rects: ElementRects; - platform: Platform; -} - -/** - * Modifies the placement by translating the floating element along the - * specified axes. - * A number (shorthand for `mainAxis` or distance), or an axes configuration - * object may be passed. - * @see https://floating-ui.com/docs/offset - */ -export declare const offset: (options?: OffsetOptions) => Middleware; - -export declare type OffsetOptions = OffsetValue | Derivable; - -declare type OffsetValue = number | { - /** - * The axis that runs along the side of the floating element. Represents - * the distance (gutter or margin) between the reference and floating - * element. - * @default 0 - */ - mainAxis?: number; - /** - * The axis that runs along the alignment of the floating element. - * Represents the skidding between the reference and floating element. - * @default 0 - */ - crossAxis?: number; - /** - * The same axis as `crossAxis` but applies only to aligned placements - * and inverts the `end` alignment. When set to a number, it overrides the - * `crossAxis` value. - * - * A positive number will move the floating element in the direction of - * the opposite edge to the one that is aligned, while a negative number - * the reverse. - * @default null - */ - alignmentAxis?: number | null; -}; - -export { Padding } - -export { Placement } - -/** - * Platform interface methods to work with the current platform. - * @see https://floating-ui.com/docs/platform - */ -export declare interface Platform { - getElementRects: (args: { - reference: ReferenceElement; - floating: FloatingElement; - strategy: Strategy; - }) => Promisable; - getClippingRect: (args: { - element: any; - boundary: Boundary; - rootBoundary: RootBoundary; - strategy: Strategy; - }) => Promisable; - getDimensions: (element: any) => Promisable; - convertOffsetParentRelativeRectToViewportRelativeRect?: (args: { - elements?: Elements; - rect: Rect; - offsetParent: any; - strategy: Strategy; - }) => Promisable; - getOffsetParent?: (element: any) => Promisable; - isElement?: (value: any) => Promisable; - getDocumentElement?: (element: any) => Promisable; - getClientRects?: (element: any) => Promisable>; - isRTL?: (element: any) => Promisable; - getScale?: (element: any) => Promisable<{ - x: number; - y: number; - }>; -} - -declare type Promisable = T | Promise; - -export { Rect } - -export { rectToClientRect } - -export declare type ReferenceElement = any; - -export declare type RootBoundary = 'viewport' | 'document' | Rect; - -/** - * Optimizes the visibility of the floating element by shifting it in order to - * keep it in view when it will overflow the clipping boundary. - * @see https://floating-ui.com/docs/shift - */ -export declare const shift: (options?: ShiftOptions | Derivable) => Middleware; - -export declare interface ShiftOptions extends DetectOverflowOptions { - /** - * The axis that runs along the alignment of the floating element. Determines - * whether overflow along this axis is checked to perform shifting. - * @default true - */ - mainAxis?: boolean; - /** - * The axis that runs along the side of the floating element. Determines - * whether overflow along this axis is checked to perform shifting. - * @default false - */ - crossAxis?: boolean; - /** - * Accepts a function that limits the shifting done in order to prevent - * detachment. - */ - limiter?: { - fn: (state: MiddlewareState) => Coords; - options?: any; - }; -} - -export { Side } - -export { SideObject } - -/** - * Provides data that allows you to change the size of the floating element — - * for instance, prevent it from overflowing the clipping boundary or match the - * width of the reference element. - * @see https://floating-ui.com/docs/size - */ -export declare const size: (options?: SizeOptions | Derivable) => Middleware; - -export declare interface SizeOptions extends DetectOverflowOptions { - /** - * Function that is called to perform style mutations to the floating element - * to change its size. - * @default undefined - */ - apply?(args: MiddlewareState & { - availableWidth: number; - availableHeight: number; - }): void | Promise; -} - -export { Strategy } - -export { VirtualElement } - -export { } diff --git a/node_modules/@floating-ui/core/dist/floating-ui.core.d.ts b/node_modules/@floating-ui/core/dist/floating-ui.core.d.ts deleted file mode 100644 index 5c0240bc..00000000 --- a/node_modules/@floating-ui/core/dist/floating-ui.core.d.ts +++ /dev/null @@ -1,528 +0,0 @@ -import { AlignedPlacement } from '@floating-ui/utils'; -import { Alignment } from '@floating-ui/utils'; -import { Axis } from '@floating-ui/utils'; -import { ClientRectObject } from '@floating-ui/utils'; -import { Coords } from '@floating-ui/utils'; -import { Dimensions } from '@floating-ui/utils'; -import { ElementRects } from '@floating-ui/utils'; -import { Length } from '@floating-ui/utils'; -import { Padding } from '@floating-ui/utils'; -import { Placement } from '@floating-ui/utils'; -import { Rect } from '@floating-ui/utils'; -import { rectToClientRect } from '@floating-ui/utils'; -import { Side } from '@floating-ui/utils'; -import { SideObject } from '@floating-ui/utils'; -import { Strategy } from '@floating-ui/utils'; -import { VirtualElement } from '@floating-ui/utils'; - -export { AlignedPlacement } - -export { Alignment } - -/** - * Provides data to position an inner element of the floating element so that it - * appears centered to the reference element. - * @see https://floating-ui.com/docs/arrow - */ -export declare const arrow: (options: ArrowOptions | Derivable) => Middleware; - -export declare interface ArrowOptions { - /** - * The arrow element to be positioned. - * @default undefined - */ - element: any; - /** - * The padding between the arrow element and the floating element edges. - * Useful when the floating element has rounded corners. - * @default 0 - */ - padding?: Padding; -} - -/** - * Optimizes the visibility of the floating element by choosing the placement - * that has the most space available automatically, without needing to specify a - * preferred placement. Alternative to `flip`. - * @see https://floating-ui.com/docs/autoPlacement - */ -export declare const autoPlacement: (options?: AutoPlacementOptions | Derivable) => Middleware; - -export declare interface AutoPlacementOptions extends DetectOverflowOptions { - /** - * The axis that runs along the alignment of the floating element. Determines - * whether to check for most space along this axis. - * @default false - */ - crossAxis?: boolean; - /** - * Choose placements with a particular alignment. - * @default undefined - */ - alignment?: Alignment | null; - /** - * Whether to choose placements with the opposite alignment if the preferred - * alignment does not fit. - * @default true - */ - autoAlignment?: boolean; - /** - * Which placements are allowed to be chosen. Placements must be within the - * `alignment` option if explicitly set. - * @default allPlacements (variable) - */ - allowedPlacements?: Array; -} - -export { Axis } - -export declare type Boundary = any; - -export { ClientRectObject } - -export declare type ComputePosition = (reference: unknown, floating: unknown, config: ComputePositionConfig) => Promise; - -/** - * Computes the `x` and `y` coordinates that will place the floating element - * next to a given reference element. - * - * This export does not have any `platform` interface logic. You will need to - * write one for the platform you are using Floating UI with. - */ -export declare const computePosition: ComputePosition; - -export declare interface ComputePositionConfig { - /** - * Object to interface with the current platform. - */ - platform: Platform; - /** - * Where to place the floating element relative to the reference element. - */ - placement?: Placement; - /** - * The strategy to use when positioning the floating element. - */ - strategy?: Strategy; - /** - * Array of middleware objects to modify the positioning or provide data for - * rendering. - */ - middleware?: Array; -} - -export declare interface ComputePositionReturn extends Coords { - /** - * The final chosen placement of the floating element. - */ - placement: Placement; - /** - * The strategy used to position the floating element. - */ - strategy: Strategy; - /** - * Object containing data returned from all middleware, keyed by their name. - */ - middlewareData: MiddlewareData; -} - -export { Coords } - -/** - * Function option to derive middleware options from state. - */ -export declare type Derivable = (state: MiddlewareState) => T; - -/** - * Resolves with an object of overflow side offsets that determine how much the - * element is overflowing a given clipping boundary on each side. - * - positive = overflowing the boundary by that number of pixels - * - negative = how many pixels left before it will overflow - * - 0 = lies flush with the boundary - * @see https://floating-ui.com/docs/detectOverflow - */ -export declare function detectOverflow(state: MiddlewareState, options?: DetectOverflowOptions | Derivable): Promise; - -export declare interface DetectOverflowOptions { - /** - * The clipping element(s) or area in which overflow will be checked. - * @default 'clippingAncestors' - */ - boundary?: Boundary; - /** - * The root clipping area in which overflow will be checked. - * @default 'viewport' - */ - rootBoundary?: RootBoundary; - /** - * The element in which overflow is being checked relative to a boundary. - * @default 'floating' - */ - elementContext?: ElementContext; - /** - * Whether to check for overflow using the alternate element's boundary - * (`clippingAncestors` boundary only). - * @default false - */ - altBoundary?: boolean; - /** - * Virtual padding for the resolved overflow detection offsets. - * @default 0 - */ - padding?: Padding; -} - -export { Dimensions } - -export declare type ElementContext = 'reference' | 'floating'; - -export { ElementRects } - -export declare interface Elements { - reference: ReferenceElement; - floating: FloatingElement; -} - -/** - * Optimizes the visibility of the floating element by flipping the `placement` - * in order to keep it in view when the preferred placement(s) will overflow the - * clipping boundary. Alternative to `autoPlacement`. - * @see https://floating-ui.com/docs/flip - */ -export declare const flip: (options?: FlipOptions | Derivable) => Middleware; - -export declare interface FlipOptions extends DetectOverflowOptions { - /** - * The axis that runs along the side of the floating element. Determines - * whether overflow along this axis is checked to perform a flip. - * @default true - */ - mainAxis?: boolean; - /** - * The axis that runs along the alignment of the floating element. Determines - * whether overflow along this axis is checked to perform a flip. - * - `true`: Whether to check cross axis overflow for both side and alignment flipping. - * - `false`: Whether to disable all cross axis overflow checking. - * - `'alignment'`: Whether to check cross axis overflow for alignment flipping only. - * @default true - */ - crossAxis?: boolean | 'alignment'; - /** - * Placements to try sequentially if the preferred `placement` does not fit. - * @default [oppositePlacement] (computed) - */ - fallbackPlacements?: Array; - /** - * What strategy to use when no placements fit. - * @default 'bestFit' - */ - fallbackStrategy?: 'bestFit' | 'initialPlacement'; - /** - * Whether to allow fallback to the perpendicular axis of the preferred - * placement, and if so, which side direction along the axis to prefer. - * @default 'none' (disallow fallback) - */ - fallbackAxisSideDirection?: 'none' | 'start' | 'end'; - /** - * Whether to flip to placements with the opposite alignment if they fit - * better. - * @default true - */ - flipAlignment?: boolean; -} - -export declare type FloatingElement = any; - -/** - * Provides data to hide the floating element in applicable situations, such as - * when it is not in the same clipping context as the reference element. - * @see https://floating-ui.com/docs/hide - */ -export declare const hide: (options?: HideOptions | Derivable) => Middleware; - -export declare interface HideOptions extends DetectOverflowOptions { - /** - * The strategy used to determine when to hide the floating element. - */ - strategy?: 'referenceHidden' | 'escaped'; -} - -/** - * Provides improved positioning for inline reference elements that can span - * over multiple lines, such as hyperlinks or range selections. - * @see https://floating-ui.com/docs/inline - */ -export declare const inline: (options?: InlineOptions | Derivable) => Middleware; - -export declare interface InlineOptions { - /** - * Viewport-relative `x` coordinate to choose a `ClientRect`. - * @default undefined - */ - x?: number; - /** - * Viewport-relative `y` coordinate to choose a `ClientRect`. - * @default undefined - */ - y?: number; - /** - * Represents the padding around a disjoined rect when choosing it. - * @default 2 - */ - padding?: Padding; -} - -export { Length } - -/** - * Built-in `limiter` that will stop `shift()` at a certain point. - */ -export declare const limitShift: (options?: LimitShiftOptions | Derivable) => { - options: any; - fn: (state: MiddlewareState) => Coords; -}; - -declare type LimitShiftOffset = number | { - /** - * Offset the limiting of the axis that runs along the alignment of the - * floating element. - */ - mainAxis?: number; - /** - * Offset the limiting of the axis that runs along the side of the - * floating element. - */ - crossAxis?: number; -}; - -export declare interface LimitShiftOptions { - /** - * Offset when limiting starts. `0` will limit when the opposite edges of the - * reference and floating elements are aligned. - * - positive = start limiting earlier - * - negative = start limiting later - */ - offset?: LimitShiftOffset | Derivable; - /** - * Whether to limit the axis that runs along the alignment of the floating - * element. - */ - mainAxis?: boolean; - /** - * Whether to limit the axis that runs along the side of the floating element. - */ - crossAxis?: boolean; -} - -export declare type Middleware = { - name: string; - options?: any; - fn: (state: MiddlewareState) => Promisable; -}; - -/** - * @deprecated use `MiddlewareState` instead. - */ -export declare type MiddlewareArguments = MiddlewareState; - -export declare interface MiddlewareData { - [key: string]: any; - arrow?: Partial & { - centerOffset: number; - alignmentOffset?: number; - }; - autoPlacement?: { - index?: number; - overflows: Array<{ - placement: Placement; - overflows: Array; - }>; - }; - flip?: { - index?: number; - overflows: Array<{ - placement: Placement; - overflows: Array; - }>; - }; - hide?: { - referenceHidden?: boolean; - escaped?: boolean; - referenceHiddenOffsets?: SideObject; - escapedOffsets?: SideObject; - }; - offset?: Coords & { - placement: Placement; - }; - shift?: Coords & { - enabled: { - [key in Axis]: boolean; - }; - }; -} - -export declare interface MiddlewareReturn extends Partial { - data?: { - [key: string]: any; - }; - reset?: boolean | { - placement?: Placement; - rects?: boolean | ElementRects; - }; -} - -export declare interface MiddlewareState extends Coords { - initialPlacement: Placement; - placement: Placement; - strategy: Strategy; - middlewareData: MiddlewareData; - elements: Elements; - rects: ElementRects; - platform: Platform; -} - -/** - * Modifies the placement by translating the floating element along the - * specified axes. - * A number (shorthand for `mainAxis` or distance), or an axes configuration - * object may be passed. - * @see https://floating-ui.com/docs/offset - */ -export declare const offset: (options?: OffsetOptions) => Middleware; - -export declare type OffsetOptions = OffsetValue | Derivable; - -declare type OffsetValue = number | { - /** - * The axis that runs along the side of the floating element. Represents - * the distance (gutter or margin) between the reference and floating - * element. - * @default 0 - */ - mainAxis?: number; - /** - * The axis that runs along the alignment of the floating element. - * Represents the skidding between the reference and floating element. - * @default 0 - */ - crossAxis?: number; - /** - * The same axis as `crossAxis` but applies only to aligned placements - * and inverts the `end` alignment. When set to a number, it overrides the - * `crossAxis` value. - * - * A positive number will move the floating element in the direction of - * the opposite edge to the one that is aligned, while a negative number - * the reverse. - * @default null - */ - alignmentAxis?: number | null; -}; - -export { Padding } - -export { Placement } - -/** - * Platform interface methods to work with the current platform. - * @see https://floating-ui.com/docs/platform - */ -export declare interface Platform { - getElementRects: (args: { - reference: ReferenceElement; - floating: FloatingElement; - strategy: Strategy; - }) => Promisable; - getClippingRect: (args: { - element: any; - boundary: Boundary; - rootBoundary: RootBoundary; - strategy: Strategy; - }) => Promisable; - getDimensions: (element: any) => Promisable; - convertOffsetParentRelativeRectToViewportRelativeRect?: (args: { - elements?: Elements; - rect: Rect; - offsetParent: any; - strategy: Strategy; - }) => Promisable; - getOffsetParent?: (element: any) => Promisable; - isElement?: (value: any) => Promisable; - getDocumentElement?: (element: any) => Promisable; - getClientRects?: (element: any) => Promisable>; - isRTL?: (element: any) => Promisable; - getScale?: (element: any) => Promisable<{ - x: number; - y: number; - }>; -} - -declare type Promisable = T | Promise; - -export { Rect } - -export { rectToClientRect } - -export declare type ReferenceElement = any; - -export declare type RootBoundary = 'viewport' | 'document' | Rect; - -/** - * Optimizes the visibility of the floating element by shifting it in order to - * keep it in view when it will overflow the clipping boundary. - * @see https://floating-ui.com/docs/shift - */ -export declare const shift: (options?: ShiftOptions | Derivable) => Middleware; - -export declare interface ShiftOptions extends DetectOverflowOptions { - /** - * The axis that runs along the alignment of the floating element. Determines - * whether overflow along this axis is checked to perform shifting. - * @default true - */ - mainAxis?: boolean; - /** - * The axis that runs along the side of the floating element. Determines - * whether overflow along this axis is checked to perform shifting. - * @default false - */ - crossAxis?: boolean; - /** - * Accepts a function that limits the shifting done in order to prevent - * detachment. - */ - limiter?: { - fn: (state: MiddlewareState) => Coords; - options?: any; - }; -} - -export { Side } - -export { SideObject } - -/** - * Provides data that allows you to change the size of the floating element — - * for instance, prevent it from overflowing the clipping boundary or match the - * width of the reference element. - * @see https://floating-ui.com/docs/size - */ -export declare const size: (options?: SizeOptions | Derivable) => Middleware; - -export declare interface SizeOptions extends DetectOverflowOptions { - /** - * Function that is called to perform style mutations to the floating element - * to change its size. - * @default undefined - */ - apply?(args: MiddlewareState & { - availableWidth: number; - availableHeight: number; - }): void | Promise; -} - -export { Strategy } - -export { VirtualElement } - -export { } diff --git a/node_modules/@floating-ui/core/dist/floating-ui.core.esm.js b/node_modules/@floating-ui/core/dist/floating-ui.core.esm.js deleted file mode 100644 index 14649462..00000000 --- a/node_modules/@floating-ui/core/dist/floating-ui.core.esm.js +++ /dev/null @@ -1,1049 +0,0 @@ -import { getSideAxis, getAlignmentAxis, getAxisLength, getSide, getAlignment, evaluate, getPaddingObject, rectToClientRect, min, clamp, placements, getAlignmentSides, getOppositeAlignmentPlacement, getOppositePlacement, getExpandedPlacements, getOppositeAxisPlacements, sides, max, getOppositeAxis } from '@floating-ui/utils'; -export { rectToClientRect } from '@floating-ui/utils'; - -function computeCoordsFromPlacement(_ref, placement, rtl) { - let { - reference, - floating - } = _ref; - const sideAxis = getSideAxis(placement); - const alignmentAxis = getAlignmentAxis(placement); - const alignLength = getAxisLength(alignmentAxis); - const side = getSide(placement); - const isVertical = sideAxis === 'y'; - const commonX = reference.x + reference.width / 2 - floating.width / 2; - const commonY = reference.y + reference.height / 2 - floating.height / 2; - const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2; - let coords; - switch (side) { - case 'top': - coords = { - x: commonX, - y: reference.y - floating.height - }; - break; - case 'bottom': - coords = { - x: commonX, - y: reference.y + reference.height - }; - break; - case 'right': - coords = { - x: reference.x + reference.width, - y: commonY - }; - break; - case 'left': - coords = { - x: reference.x - floating.width, - y: commonY - }; - break; - default: - coords = { - x: reference.x, - y: reference.y - }; - } - switch (getAlignment(placement)) { - case 'start': - coords[alignmentAxis] -= commonAlign * (rtl && isVertical ? -1 : 1); - break; - case 'end': - coords[alignmentAxis] += commonAlign * (rtl && isVertical ? -1 : 1); - break; - } - return coords; -} - -/** - * Computes the `x` and `y` coordinates that will place the floating element - * next to a given reference element. - * - * This export does not have any `platform` interface logic. You will need to - * write one for the platform you are using Floating UI with. - */ -const computePosition = async (reference, floating, config) => { - const { - placement = 'bottom', - strategy = 'absolute', - middleware = [], - platform - } = config; - const validMiddleware = middleware.filter(Boolean); - const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(floating)); - let rects = await platform.getElementRects({ - reference, - floating, - strategy - }); - let { - x, - y - } = computeCoordsFromPlacement(rects, placement, rtl); - let statefulPlacement = placement; - let middlewareData = {}; - let resetCount = 0; - for (let i = 0; i < validMiddleware.length; i++) { - const { - name, - fn - } = validMiddleware[i]; - const { - x: nextX, - y: nextY, - data, - reset - } = await fn({ - x, - y, - initialPlacement: placement, - placement: statefulPlacement, - strategy, - middlewareData, - rects, - platform, - elements: { - reference, - floating - } - }); - x = nextX != null ? nextX : x; - y = nextY != null ? nextY : y; - middlewareData = { - ...middlewareData, - [name]: { - ...middlewareData[name], - ...data - } - }; - if (reset && resetCount <= 50) { - resetCount++; - if (typeof reset === 'object') { - if (reset.placement) { - statefulPlacement = reset.placement; - } - if (reset.rects) { - rects = reset.rects === true ? await platform.getElementRects({ - reference, - floating, - strategy - }) : reset.rects; - } - ({ - x, - y - } = computeCoordsFromPlacement(rects, statefulPlacement, rtl)); - } - i = -1; - } - } - return { - x, - y, - placement: statefulPlacement, - strategy, - middlewareData - }; -}; - -/** - * Resolves with an object of overflow side offsets that determine how much the - * element is overflowing a given clipping boundary on each side. - * - positive = overflowing the boundary by that number of pixels - * - negative = how many pixels left before it will overflow - * - 0 = lies flush with the boundary - * @see https://floating-ui.com/docs/detectOverflow - */ -async function detectOverflow(state, options) { - var _await$platform$isEle; - if (options === void 0) { - options = {}; - } - const { - x, - y, - platform, - rects, - elements, - strategy - } = state; - const { - boundary = 'clippingAncestors', - rootBoundary = 'viewport', - elementContext = 'floating', - altBoundary = false, - padding = 0 - } = evaluate(options, state); - const paddingObject = getPaddingObject(padding); - const altContext = elementContext === 'floating' ? 'reference' : 'floating'; - const element = elements[altBoundary ? altContext : elementContext]; - const clippingClientRect = rectToClientRect(await platform.getClippingRect({ - element: ((_await$platform$isEle = await (platform.isElement == null ? void 0 : platform.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || (await (platform.getDocumentElement == null ? void 0 : platform.getDocumentElement(elements.floating))), - boundary, - rootBoundary, - strategy - })); - const rect = elementContext === 'floating' ? { - x, - y, - width: rects.floating.width, - height: rects.floating.height - } : rects.reference; - const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating)); - const offsetScale = (await (platform.isElement == null ? void 0 : platform.isElement(offsetParent))) ? (await (platform.getScale == null ? void 0 : platform.getScale(offsetParent))) || { - x: 1, - y: 1 - } : { - x: 1, - y: 1 - }; - const elementClientRect = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({ - elements, - rect, - offsetParent, - strategy - }) : rect); - return { - top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y, - bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y, - left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x, - right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x - }; -} - -/** - * Provides data to position an inner element of the floating element so that it - * appears centered to the reference element. - * @see https://floating-ui.com/docs/arrow - */ -const arrow = options => ({ - name: 'arrow', - options, - async fn(state) { - const { - x, - y, - placement, - rects, - platform, - elements, - middlewareData - } = state; - // Since `element` is required, we don't Partial<> the type. - const { - element, - padding = 0 - } = evaluate(options, state) || {}; - if (element == null) { - return {}; - } - const paddingObject = getPaddingObject(padding); - const coords = { - x, - y - }; - const axis = getAlignmentAxis(placement); - const length = getAxisLength(axis); - const arrowDimensions = await platform.getDimensions(element); - const isYAxis = axis === 'y'; - const minProp = isYAxis ? 'top' : 'left'; - const maxProp = isYAxis ? 'bottom' : 'right'; - const clientProp = isYAxis ? 'clientHeight' : 'clientWidth'; - const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length]; - const startDiff = coords[axis] - rects.reference[axis]; - const arrowOffsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(element)); - let clientSize = arrowOffsetParent ? arrowOffsetParent[clientProp] : 0; - - // DOM platform can return `window` as the `offsetParent`. - if (!clientSize || !(await (platform.isElement == null ? void 0 : platform.isElement(arrowOffsetParent)))) { - clientSize = elements.floating[clientProp] || rects.floating[length]; - } - const centerToReference = endDiff / 2 - startDiff / 2; - - // If the padding is large enough that it causes the arrow to no longer be - // centered, modify the padding so that it is centered. - const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1; - const minPadding = min(paddingObject[minProp], largestPossiblePadding); - const maxPadding = min(paddingObject[maxProp], largestPossiblePadding); - - // Make sure the arrow doesn't overflow the floating element if the center - // point is outside the floating element's bounds. - const min$1 = minPadding; - const max = clientSize - arrowDimensions[length] - maxPadding; - const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference; - const offset = clamp(min$1, center, max); - - // If the reference is small enough that the arrow's padding causes it to - // to point to nothing for an aligned placement, adjust the offset of the - // floating element itself. To ensure `shift()` continues to take action, - // a single reset is performed when this is true. - const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset && rects.reference[length] / 2 - (center < min$1 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0; - const alignmentOffset = shouldAddOffset ? center < min$1 ? center - min$1 : center - max : 0; - return { - [axis]: coords[axis] + alignmentOffset, - data: { - [axis]: offset, - centerOffset: center - offset - alignmentOffset, - ...(shouldAddOffset && { - alignmentOffset - }) - }, - reset: shouldAddOffset - }; - } -}); - -function getPlacementList(alignment, autoAlignment, allowedPlacements) { - const allowedPlacementsSortedByAlignment = alignment ? [...allowedPlacements.filter(placement => getAlignment(placement) === alignment), ...allowedPlacements.filter(placement => getAlignment(placement) !== alignment)] : allowedPlacements.filter(placement => getSide(placement) === placement); - return allowedPlacementsSortedByAlignment.filter(placement => { - if (alignment) { - return getAlignment(placement) === alignment || (autoAlignment ? getOppositeAlignmentPlacement(placement) !== placement : false); - } - return true; - }); -} -/** - * Optimizes the visibility of the floating element by choosing the placement - * that has the most space available automatically, without needing to specify a - * preferred placement. Alternative to `flip`. - * @see https://floating-ui.com/docs/autoPlacement - */ -const autoPlacement = function (options) { - if (options === void 0) { - options = {}; - } - return { - name: 'autoPlacement', - options, - async fn(state) { - var _middlewareData$autoP, _middlewareData$autoP2, _placementsThatFitOnE; - const { - rects, - middlewareData, - placement, - platform, - elements - } = state; - const { - crossAxis = false, - alignment, - allowedPlacements = placements, - autoAlignment = true, - ...detectOverflowOptions - } = evaluate(options, state); - const placements$1 = alignment !== undefined || allowedPlacements === placements ? getPlacementList(alignment || null, autoAlignment, allowedPlacements) : allowedPlacements; - const overflow = await detectOverflow(state, detectOverflowOptions); - const currentIndex = ((_middlewareData$autoP = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP.index) || 0; - const currentPlacement = placements$1[currentIndex]; - if (currentPlacement == null) { - return {}; - } - const alignmentSides = getAlignmentSides(currentPlacement, rects, await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating))); - - // Make `computeCoords` start from the right place. - if (placement !== currentPlacement) { - return { - reset: { - placement: placements$1[0] - } - }; - } - const currentOverflows = [overflow[getSide(currentPlacement)], overflow[alignmentSides[0]], overflow[alignmentSides[1]]]; - const allOverflows = [...(((_middlewareData$autoP2 = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP2.overflows) || []), { - placement: currentPlacement, - overflows: currentOverflows - }]; - const nextPlacement = placements$1[currentIndex + 1]; - - // There are more placements to check. - if (nextPlacement) { - return { - data: { - index: currentIndex + 1, - overflows: allOverflows - }, - reset: { - placement: nextPlacement - } - }; - } - const placementsSortedByMostSpace = allOverflows.map(d => { - const alignment = getAlignment(d.placement); - return [d.placement, alignment && crossAxis ? - // Check along the mainAxis and main crossAxis side. - d.overflows.slice(0, 2).reduce((acc, v) => acc + v, 0) : - // Check only the mainAxis. - d.overflows[0], d.overflows]; - }).sort((a, b) => a[1] - b[1]); - const placementsThatFitOnEachSide = placementsSortedByMostSpace.filter(d => d[2].slice(0, - // Aligned placements should not check their opposite crossAxis - // side. - getAlignment(d[0]) ? 2 : 3).every(v => v <= 0)); - const resetPlacement = ((_placementsThatFitOnE = placementsThatFitOnEachSide[0]) == null ? void 0 : _placementsThatFitOnE[0]) || placementsSortedByMostSpace[0][0]; - if (resetPlacement !== placement) { - return { - data: { - index: currentIndex + 1, - overflows: allOverflows - }, - reset: { - placement: resetPlacement - } - }; - } - return {}; - } - }; -}; - -/** - * Optimizes the visibility of the floating element by flipping the `placement` - * in order to keep it in view when the preferred placement(s) will overflow the - * clipping boundary. Alternative to `autoPlacement`. - * @see https://floating-ui.com/docs/flip - */ -const flip = function (options) { - if (options === void 0) { - options = {}; - } - return { - name: 'flip', - options, - async fn(state) { - var _middlewareData$arrow, _middlewareData$flip; - const { - placement, - middlewareData, - rects, - initialPlacement, - platform, - elements - } = state; - const { - mainAxis: checkMainAxis = true, - crossAxis: checkCrossAxis = true, - fallbackPlacements: specifiedFallbackPlacements, - fallbackStrategy = 'bestFit', - fallbackAxisSideDirection = 'none', - flipAlignment = true, - ...detectOverflowOptions - } = evaluate(options, state); - - // If a reset by the arrow was caused due to an alignment offset being - // added, we should skip any logic now since `flip()` has already done its - // work. - // https://github.com/floating-ui/floating-ui/issues/2549#issuecomment-1719601643 - if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) { - return {}; - } - const side = getSide(placement); - const initialSideAxis = getSideAxis(initialPlacement); - const isBasePlacement = getSide(initialPlacement) === initialPlacement; - const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)); - const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement)); - const hasFallbackAxisSideDirection = fallbackAxisSideDirection !== 'none'; - if (!specifiedFallbackPlacements && hasFallbackAxisSideDirection) { - fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl)); - } - const placements = [initialPlacement, ...fallbackPlacements]; - const overflow = await detectOverflow(state, detectOverflowOptions); - const overflows = []; - let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || []; - if (checkMainAxis) { - overflows.push(overflow[side]); - } - if (checkCrossAxis) { - const sides = getAlignmentSides(placement, rects, rtl); - overflows.push(overflow[sides[0]], overflow[sides[1]]); - } - overflowsData = [...overflowsData, { - placement, - overflows - }]; - - // One or more sides is overflowing. - if (!overflows.every(side => side <= 0)) { - var _middlewareData$flip2, _overflowsData$filter; - const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1; - const nextPlacement = placements[nextIndex]; - if (nextPlacement) { - const ignoreCrossAxisOverflow = checkCrossAxis === 'alignment' ? initialSideAxis !== getSideAxis(nextPlacement) : false; - if (!ignoreCrossAxisOverflow || - // We leave the current main axis only if every placement on that axis - // overflows the main axis. - overflowsData.every(d => getSideAxis(d.placement) === initialSideAxis ? d.overflows[0] > 0 : true)) { - // Try next placement and re-run the lifecycle. - return { - data: { - index: nextIndex, - overflows: overflowsData - }, - reset: { - placement: nextPlacement - } - }; - } - } - - // First, find the candidates that fit on the mainAxis side of overflow, - // then find the placement that fits the best on the main crossAxis side. - let resetPlacement = (_overflowsData$filter = overflowsData.filter(d => d.overflows[0] <= 0).sort((a, b) => a.overflows[1] - b.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement; - - // Otherwise fallback. - if (!resetPlacement) { - switch (fallbackStrategy) { - case 'bestFit': - { - var _overflowsData$filter2; - const placement = (_overflowsData$filter2 = overflowsData.filter(d => { - if (hasFallbackAxisSideDirection) { - const currentSideAxis = getSideAxis(d.placement); - return currentSideAxis === initialSideAxis || - // Create a bias to the `y` side axis due to horizontal - // reading directions favoring greater width. - currentSideAxis === 'y'; - } - return true; - }).map(d => [d.placement, d.overflows.filter(overflow => overflow > 0).reduce((acc, overflow) => acc + overflow, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$filter2[0]; - if (placement) { - resetPlacement = placement; - } - break; - } - case 'initialPlacement': - resetPlacement = initialPlacement; - break; - } - } - if (placement !== resetPlacement) { - return { - reset: { - placement: resetPlacement - } - }; - } - } - return {}; - } - }; -}; - -function getSideOffsets(overflow, rect) { - return { - top: overflow.top - rect.height, - right: overflow.right - rect.width, - bottom: overflow.bottom - rect.height, - left: overflow.left - rect.width - }; -} -function isAnySideFullyClipped(overflow) { - return sides.some(side => overflow[side] >= 0); -} -/** - * Provides data to hide the floating element in applicable situations, such as - * when it is not in the same clipping context as the reference element. - * @see https://floating-ui.com/docs/hide - */ -const hide = function (options) { - if (options === void 0) { - options = {}; - } - return { - name: 'hide', - options, - async fn(state) { - const { - rects - } = state; - const { - strategy = 'referenceHidden', - ...detectOverflowOptions - } = evaluate(options, state); - switch (strategy) { - case 'referenceHidden': - { - const overflow = await detectOverflow(state, { - ...detectOverflowOptions, - elementContext: 'reference' - }); - const offsets = getSideOffsets(overflow, rects.reference); - return { - data: { - referenceHiddenOffsets: offsets, - referenceHidden: isAnySideFullyClipped(offsets) - } - }; - } - case 'escaped': - { - const overflow = await detectOverflow(state, { - ...detectOverflowOptions, - altBoundary: true - }); - const offsets = getSideOffsets(overflow, rects.floating); - return { - data: { - escapedOffsets: offsets, - escaped: isAnySideFullyClipped(offsets) - } - }; - } - default: - { - return {}; - } - } - } - }; -}; - -function getBoundingRect(rects) { - const minX = min(...rects.map(rect => rect.left)); - const minY = min(...rects.map(rect => rect.top)); - const maxX = max(...rects.map(rect => rect.right)); - const maxY = max(...rects.map(rect => rect.bottom)); - return { - x: minX, - y: minY, - width: maxX - minX, - height: maxY - minY - }; -} -function getRectsByLine(rects) { - const sortedRects = rects.slice().sort((a, b) => a.y - b.y); - const groups = []; - let prevRect = null; - for (let i = 0; i < sortedRects.length; i++) { - const rect = sortedRects[i]; - if (!prevRect || rect.y - prevRect.y > prevRect.height / 2) { - groups.push([rect]); - } else { - groups[groups.length - 1].push(rect); - } - prevRect = rect; - } - return groups.map(rect => rectToClientRect(getBoundingRect(rect))); -} -/** - * Provides improved positioning for inline reference elements that can span - * over multiple lines, such as hyperlinks or range selections. - * @see https://floating-ui.com/docs/inline - */ -const inline = function (options) { - if (options === void 0) { - options = {}; - } - return { - name: 'inline', - options, - async fn(state) { - const { - placement, - elements, - rects, - platform, - strategy - } = state; - // A MouseEvent's client{X,Y} coords can be up to 2 pixels off a - // ClientRect's bounds, despite the event listener being triggered. A - // padding of 2 seems to handle this issue. - const { - padding = 2, - x, - y - } = evaluate(options, state); - const nativeClientRects = Array.from((await (platform.getClientRects == null ? void 0 : platform.getClientRects(elements.reference))) || []); - const clientRects = getRectsByLine(nativeClientRects); - const fallback = rectToClientRect(getBoundingRect(nativeClientRects)); - const paddingObject = getPaddingObject(padding); - function getBoundingClientRect() { - // There are two rects and they are disjoined. - if (clientRects.length === 2 && clientRects[0].left > clientRects[1].right && x != null && y != null) { - // Find the first rect in which the point is fully inside. - return clientRects.find(rect => x > rect.left - paddingObject.left && x < rect.right + paddingObject.right && y > rect.top - paddingObject.top && y < rect.bottom + paddingObject.bottom) || fallback; - } - - // There are 2 or more connected rects. - if (clientRects.length >= 2) { - if (getSideAxis(placement) === 'y') { - const firstRect = clientRects[0]; - const lastRect = clientRects[clientRects.length - 1]; - const isTop = getSide(placement) === 'top'; - const top = firstRect.top; - const bottom = lastRect.bottom; - const left = isTop ? firstRect.left : lastRect.left; - const right = isTop ? firstRect.right : lastRect.right; - const width = right - left; - const height = bottom - top; - return { - top, - bottom, - left, - right, - width, - height, - x: left, - y: top - }; - } - const isLeftSide = getSide(placement) === 'left'; - const maxRight = max(...clientRects.map(rect => rect.right)); - const minLeft = min(...clientRects.map(rect => rect.left)); - const measureRects = clientRects.filter(rect => isLeftSide ? rect.left === minLeft : rect.right === maxRight); - const top = measureRects[0].top; - const bottom = measureRects[measureRects.length - 1].bottom; - const left = minLeft; - const right = maxRight; - const width = right - left; - const height = bottom - top; - return { - top, - bottom, - left, - right, - width, - height, - x: left, - y: top - }; - } - return fallback; - } - const resetRects = await platform.getElementRects({ - reference: { - getBoundingClientRect - }, - floating: elements.floating, - strategy - }); - if (rects.reference.x !== resetRects.reference.x || rects.reference.y !== resetRects.reference.y || rects.reference.width !== resetRects.reference.width || rects.reference.height !== resetRects.reference.height) { - return { - reset: { - rects: resetRects - } - }; - } - return {}; - } - }; -}; - -const originSides = /*#__PURE__*/new Set(['left', 'top']); - -// For type backwards-compatibility, the `OffsetOptions` type was also -// Derivable. - -async function convertValueToCoords(state, options) { - const { - placement, - platform, - elements - } = state; - const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)); - const side = getSide(placement); - const alignment = getAlignment(placement); - const isVertical = getSideAxis(placement) === 'y'; - const mainAxisMulti = originSides.has(side) ? -1 : 1; - const crossAxisMulti = rtl && isVertical ? -1 : 1; - const rawValue = evaluate(options, state); - - // eslint-disable-next-line prefer-const - let { - mainAxis, - crossAxis, - alignmentAxis - } = typeof rawValue === 'number' ? { - mainAxis: rawValue, - crossAxis: 0, - alignmentAxis: null - } : { - mainAxis: rawValue.mainAxis || 0, - crossAxis: rawValue.crossAxis || 0, - alignmentAxis: rawValue.alignmentAxis - }; - if (alignment && typeof alignmentAxis === 'number') { - crossAxis = alignment === 'end' ? alignmentAxis * -1 : alignmentAxis; - } - return isVertical ? { - x: crossAxis * crossAxisMulti, - y: mainAxis * mainAxisMulti - } : { - x: mainAxis * mainAxisMulti, - y: crossAxis * crossAxisMulti - }; -} - -/** - * Modifies the placement by translating the floating element along the - * specified axes. - * A number (shorthand for `mainAxis` or distance), or an axes configuration - * object may be passed. - * @see https://floating-ui.com/docs/offset - */ -const offset = function (options) { - if (options === void 0) { - options = 0; - } - return { - name: 'offset', - options, - async fn(state) { - var _middlewareData$offse, _middlewareData$arrow; - const { - x, - y, - placement, - middlewareData - } = state; - const diffCoords = await convertValueToCoords(state, options); - - // If the placement is the same and the arrow caused an alignment offset - // then we don't need to change the positioning coordinates. - if (placement === ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) { - return {}; - } - return { - x: x + diffCoords.x, - y: y + diffCoords.y, - data: { - ...diffCoords, - placement - } - }; - } - }; -}; - -/** - * Optimizes the visibility of the floating element by shifting it in order to - * keep it in view when it will overflow the clipping boundary. - * @see https://floating-ui.com/docs/shift - */ -const shift = function (options) { - if (options === void 0) { - options = {}; - } - return { - name: 'shift', - options, - async fn(state) { - const { - x, - y, - placement - } = state; - const { - mainAxis: checkMainAxis = true, - crossAxis: checkCrossAxis = false, - limiter = { - fn: _ref => { - let { - x, - y - } = _ref; - return { - x, - y - }; - } - }, - ...detectOverflowOptions - } = evaluate(options, state); - const coords = { - x, - y - }; - const overflow = await detectOverflow(state, detectOverflowOptions); - const crossAxis = getSideAxis(getSide(placement)); - const mainAxis = getOppositeAxis(crossAxis); - let mainAxisCoord = coords[mainAxis]; - let crossAxisCoord = coords[crossAxis]; - if (checkMainAxis) { - const minSide = mainAxis === 'y' ? 'top' : 'left'; - const maxSide = mainAxis === 'y' ? 'bottom' : 'right'; - const min = mainAxisCoord + overflow[minSide]; - const max = mainAxisCoord - overflow[maxSide]; - mainAxisCoord = clamp(min, mainAxisCoord, max); - } - if (checkCrossAxis) { - const minSide = crossAxis === 'y' ? 'top' : 'left'; - const maxSide = crossAxis === 'y' ? 'bottom' : 'right'; - const min = crossAxisCoord + overflow[minSide]; - const max = crossAxisCoord - overflow[maxSide]; - crossAxisCoord = clamp(min, crossAxisCoord, max); - } - const limitedCoords = limiter.fn({ - ...state, - [mainAxis]: mainAxisCoord, - [crossAxis]: crossAxisCoord - }); - return { - ...limitedCoords, - data: { - x: limitedCoords.x - x, - y: limitedCoords.y - y, - enabled: { - [mainAxis]: checkMainAxis, - [crossAxis]: checkCrossAxis - } - } - }; - } - }; -}; -/** - * Built-in `limiter` that will stop `shift()` at a certain point. - */ -const limitShift = function (options) { - if (options === void 0) { - options = {}; - } - return { - options, - fn(state) { - const { - x, - y, - placement, - rects, - middlewareData - } = state; - const { - offset = 0, - mainAxis: checkMainAxis = true, - crossAxis: checkCrossAxis = true - } = evaluate(options, state); - const coords = { - x, - y - }; - const crossAxis = getSideAxis(placement); - const mainAxis = getOppositeAxis(crossAxis); - let mainAxisCoord = coords[mainAxis]; - let crossAxisCoord = coords[crossAxis]; - const rawOffset = evaluate(offset, state); - const computedOffset = typeof rawOffset === 'number' ? { - mainAxis: rawOffset, - crossAxis: 0 - } : { - mainAxis: 0, - crossAxis: 0, - ...rawOffset - }; - if (checkMainAxis) { - const len = mainAxis === 'y' ? 'height' : 'width'; - const limitMin = rects.reference[mainAxis] - rects.floating[len] + computedOffset.mainAxis; - const limitMax = rects.reference[mainAxis] + rects.reference[len] - computedOffset.mainAxis; - if (mainAxisCoord < limitMin) { - mainAxisCoord = limitMin; - } else if (mainAxisCoord > limitMax) { - mainAxisCoord = limitMax; - } - } - if (checkCrossAxis) { - var _middlewareData$offse, _middlewareData$offse2; - const len = mainAxis === 'y' ? 'width' : 'height'; - const isOriginSide = originSides.has(getSide(placement)); - const limitMin = rects.reference[crossAxis] - rects.floating[len] + (isOriginSide ? ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse[crossAxis]) || 0 : 0) + (isOriginSide ? 0 : computedOffset.crossAxis); - const limitMax = rects.reference[crossAxis] + rects.reference[len] + (isOriginSide ? 0 : ((_middlewareData$offse2 = middlewareData.offset) == null ? void 0 : _middlewareData$offse2[crossAxis]) || 0) - (isOriginSide ? computedOffset.crossAxis : 0); - if (crossAxisCoord < limitMin) { - crossAxisCoord = limitMin; - } else if (crossAxisCoord > limitMax) { - crossAxisCoord = limitMax; - } - } - return { - [mainAxis]: mainAxisCoord, - [crossAxis]: crossAxisCoord - }; - } - }; -}; - -/** - * Provides data that allows you to change the size of the floating element — - * for instance, prevent it from overflowing the clipping boundary or match the - * width of the reference element. - * @see https://floating-ui.com/docs/size - */ -const size = function (options) { - if (options === void 0) { - options = {}; - } - return { - name: 'size', - options, - async fn(state) { - var _state$middlewareData, _state$middlewareData2; - const { - placement, - rects, - platform, - elements - } = state; - const { - apply = () => {}, - ...detectOverflowOptions - } = evaluate(options, state); - const overflow = await detectOverflow(state, detectOverflowOptions); - const side = getSide(placement); - const alignment = getAlignment(placement); - const isYAxis = getSideAxis(placement) === 'y'; - const { - width, - height - } = rects.floating; - let heightSide; - let widthSide; - if (side === 'top' || side === 'bottom') { - heightSide = side; - widthSide = alignment === ((await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating))) ? 'start' : 'end') ? 'left' : 'right'; - } else { - widthSide = side; - heightSide = alignment === 'end' ? 'top' : 'bottom'; - } - const maximumClippingHeight = height - overflow.top - overflow.bottom; - const maximumClippingWidth = width - overflow.left - overflow.right; - const overflowAvailableHeight = min(height - overflow[heightSide], maximumClippingHeight); - const overflowAvailableWidth = min(width - overflow[widthSide], maximumClippingWidth); - const noShift = !state.middlewareData.shift; - let availableHeight = overflowAvailableHeight; - let availableWidth = overflowAvailableWidth; - if ((_state$middlewareData = state.middlewareData.shift) != null && _state$middlewareData.enabled.x) { - availableWidth = maximumClippingWidth; - } - if ((_state$middlewareData2 = state.middlewareData.shift) != null && _state$middlewareData2.enabled.y) { - availableHeight = maximumClippingHeight; - } - if (noShift && !alignment) { - const xMin = max(overflow.left, 0); - const xMax = max(overflow.right, 0); - const yMin = max(overflow.top, 0); - const yMax = max(overflow.bottom, 0); - if (isYAxis) { - availableWidth = width - 2 * (xMin !== 0 || xMax !== 0 ? xMin + xMax : max(overflow.left, overflow.right)); - } else { - availableHeight = height - 2 * (yMin !== 0 || yMax !== 0 ? yMin + yMax : max(overflow.top, overflow.bottom)); - } - } - await apply({ - ...state, - availableWidth, - availableHeight - }); - const nextDimensions = await platform.getDimensions(elements.floating); - if (width !== nextDimensions.width || height !== nextDimensions.height) { - return { - reset: { - rects: true - } - }; - } - return {}; - } - }; -}; - -export { arrow, autoPlacement, computePosition, detectOverflow, flip, hide, inline, limitShift, offset, shift, size }; diff --git a/node_modules/@floating-ui/core/dist/floating-ui.core.mjs b/node_modules/@floating-ui/core/dist/floating-ui.core.mjs deleted file mode 100644 index 14649462..00000000 --- a/node_modules/@floating-ui/core/dist/floating-ui.core.mjs +++ /dev/null @@ -1,1049 +0,0 @@ -import { getSideAxis, getAlignmentAxis, getAxisLength, getSide, getAlignment, evaluate, getPaddingObject, rectToClientRect, min, clamp, placements, getAlignmentSides, getOppositeAlignmentPlacement, getOppositePlacement, getExpandedPlacements, getOppositeAxisPlacements, sides, max, getOppositeAxis } from '@floating-ui/utils'; -export { rectToClientRect } from '@floating-ui/utils'; - -function computeCoordsFromPlacement(_ref, placement, rtl) { - let { - reference, - floating - } = _ref; - const sideAxis = getSideAxis(placement); - const alignmentAxis = getAlignmentAxis(placement); - const alignLength = getAxisLength(alignmentAxis); - const side = getSide(placement); - const isVertical = sideAxis === 'y'; - const commonX = reference.x + reference.width / 2 - floating.width / 2; - const commonY = reference.y + reference.height / 2 - floating.height / 2; - const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2; - let coords; - switch (side) { - case 'top': - coords = { - x: commonX, - y: reference.y - floating.height - }; - break; - case 'bottom': - coords = { - x: commonX, - y: reference.y + reference.height - }; - break; - case 'right': - coords = { - x: reference.x + reference.width, - y: commonY - }; - break; - case 'left': - coords = { - x: reference.x - floating.width, - y: commonY - }; - break; - default: - coords = { - x: reference.x, - y: reference.y - }; - } - switch (getAlignment(placement)) { - case 'start': - coords[alignmentAxis] -= commonAlign * (rtl && isVertical ? -1 : 1); - break; - case 'end': - coords[alignmentAxis] += commonAlign * (rtl && isVertical ? -1 : 1); - break; - } - return coords; -} - -/** - * Computes the `x` and `y` coordinates that will place the floating element - * next to a given reference element. - * - * This export does not have any `platform` interface logic. You will need to - * write one for the platform you are using Floating UI with. - */ -const computePosition = async (reference, floating, config) => { - const { - placement = 'bottom', - strategy = 'absolute', - middleware = [], - platform - } = config; - const validMiddleware = middleware.filter(Boolean); - const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(floating)); - let rects = await platform.getElementRects({ - reference, - floating, - strategy - }); - let { - x, - y - } = computeCoordsFromPlacement(rects, placement, rtl); - let statefulPlacement = placement; - let middlewareData = {}; - let resetCount = 0; - for (let i = 0; i < validMiddleware.length; i++) { - const { - name, - fn - } = validMiddleware[i]; - const { - x: nextX, - y: nextY, - data, - reset - } = await fn({ - x, - y, - initialPlacement: placement, - placement: statefulPlacement, - strategy, - middlewareData, - rects, - platform, - elements: { - reference, - floating - } - }); - x = nextX != null ? nextX : x; - y = nextY != null ? nextY : y; - middlewareData = { - ...middlewareData, - [name]: { - ...middlewareData[name], - ...data - } - }; - if (reset && resetCount <= 50) { - resetCount++; - if (typeof reset === 'object') { - if (reset.placement) { - statefulPlacement = reset.placement; - } - if (reset.rects) { - rects = reset.rects === true ? await platform.getElementRects({ - reference, - floating, - strategy - }) : reset.rects; - } - ({ - x, - y - } = computeCoordsFromPlacement(rects, statefulPlacement, rtl)); - } - i = -1; - } - } - return { - x, - y, - placement: statefulPlacement, - strategy, - middlewareData - }; -}; - -/** - * Resolves with an object of overflow side offsets that determine how much the - * element is overflowing a given clipping boundary on each side. - * - positive = overflowing the boundary by that number of pixels - * - negative = how many pixels left before it will overflow - * - 0 = lies flush with the boundary - * @see https://floating-ui.com/docs/detectOverflow - */ -async function detectOverflow(state, options) { - var _await$platform$isEle; - if (options === void 0) { - options = {}; - } - const { - x, - y, - platform, - rects, - elements, - strategy - } = state; - const { - boundary = 'clippingAncestors', - rootBoundary = 'viewport', - elementContext = 'floating', - altBoundary = false, - padding = 0 - } = evaluate(options, state); - const paddingObject = getPaddingObject(padding); - const altContext = elementContext === 'floating' ? 'reference' : 'floating'; - const element = elements[altBoundary ? altContext : elementContext]; - const clippingClientRect = rectToClientRect(await platform.getClippingRect({ - element: ((_await$platform$isEle = await (platform.isElement == null ? void 0 : platform.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || (await (platform.getDocumentElement == null ? void 0 : platform.getDocumentElement(elements.floating))), - boundary, - rootBoundary, - strategy - })); - const rect = elementContext === 'floating' ? { - x, - y, - width: rects.floating.width, - height: rects.floating.height - } : rects.reference; - const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating)); - const offsetScale = (await (platform.isElement == null ? void 0 : platform.isElement(offsetParent))) ? (await (platform.getScale == null ? void 0 : platform.getScale(offsetParent))) || { - x: 1, - y: 1 - } : { - x: 1, - y: 1 - }; - const elementClientRect = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({ - elements, - rect, - offsetParent, - strategy - }) : rect); - return { - top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y, - bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y, - left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x, - right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x - }; -} - -/** - * Provides data to position an inner element of the floating element so that it - * appears centered to the reference element. - * @see https://floating-ui.com/docs/arrow - */ -const arrow = options => ({ - name: 'arrow', - options, - async fn(state) { - const { - x, - y, - placement, - rects, - platform, - elements, - middlewareData - } = state; - // Since `element` is required, we don't Partial<> the type. - const { - element, - padding = 0 - } = evaluate(options, state) || {}; - if (element == null) { - return {}; - } - const paddingObject = getPaddingObject(padding); - const coords = { - x, - y - }; - const axis = getAlignmentAxis(placement); - const length = getAxisLength(axis); - const arrowDimensions = await platform.getDimensions(element); - const isYAxis = axis === 'y'; - const minProp = isYAxis ? 'top' : 'left'; - const maxProp = isYAxis ? 'bottom' : 'right'; - const clientProp = isYAxis ? 'clientHeight' : 'clientWidth'; - const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length]; - const startDiff = coords[axis] - rects.reference[axis]; - const arrowOffsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(element)); - let clientSize = arrowOffsetParent ? arrowOffsetParent[clientProp] : 0; - - // DOM platform can return `window` as the `offsetParent`. - if (!clientSize || !(await (platform.isElement == null ? void 0 : platform.isElement(arrowOffsetParent)))) { - clientSize = elements.floating[clientProp] || rects.floating[length]; - } - const centerToReference = endDiff / 2 - startDiff / 2; - - // If the padding is large enough that it causes the arrow to no longer be - // centered, modify the padding so that it is centered. - const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1; - const minPadding = min(paddingObject[minProp], largestPossiblePadding); - const maxPadding = min(paddingObject[maxProp], largestPossiblePadding); - - // Make sure the arrow doesn't overflow the floating element if the center - // point is outside the floating element's bounds. - const min$1 = minPadding; - const max = clientSize - arrowDimensions[length] - maxPadding; - const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference; - const offset = clamp(min$1, center, max); - - // If the reference is small enough that the arrow's padding causes it to - // to point to nothing for an aligned placement, adjust the offset of the - // floating element itself. To ensure `shift()` continues to take action, - // a single reset is performed when this is true. - const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset && rects.reference[length] / 2 - (center < min$1 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0; - const alignmentOffset = shouldAddOffset ? center < min$1 ? center - min$1 : center - max : 0; - return { - [axis]: coords[axis] + alignmentOffset, - data: { - [axis]: offset, - centerOffset: center - offset - alignmentOffset, - ...(shouldAddOffset && { - alignmentOffset - }) - }, - reset: shouldAddOffset - }; - } -}); - -function getPlacementList(alignment, autoAlignment, allowedPlacements) { - const allowedPlacementsSortedByAlignment = alignment ? [...allowedPlacements.filter(placement => getAlignment(placement) === alignment), ...allowedPlacements.filter(placement => getAlignment(placement) !== alignment)] : allowedPlacements.filter(placement => getSide(placement) === placement); - return allowedPlacementsSortedByAlignment.filter(placement => { - if (alignment) { - return getAlignment(placement) === alignment || (autoAlignment ? getOppositeAlignmentPlacement(placement) !== placement : false); - } - return true; - }); -} -/** - * Optimizes the visibility of the floating element by choosing the placement - * that has the most space available automatically, without needing to specify a - * preferred placement. Alternative to `flip`. - * @see https://floating-ui.com/docs/autoPlacement - */ -const autoPlacement = function (options) { - if (options === void 0) { - options = {}; - } - return { - name: 'autoPlacement', - options, - async fn(state) { - var _middlewareData$autoP, _middlewareData$autoP2, _placementsThatFitOnE; - const { - rects, - middlewareData, - placement, - platform, - elements - } = state; - const { - crossAxis = false, - alignment, - allowedPlacements = placements, - autoAlignment = true, - ...detectOverflowOptions - } = evaluate(options, state); - const placements$1 = alignment !== undefined || allowedPlacements === placements ? getPlacementList(alignment || null, autoAlignment, allowedPlacements) : allowedPlacements; - const overflow = await detectOverflow(state, detectOverflowOptions); - const currentIndex = ((_middlewareData$autoP = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP.index) || 0; - const currentPlacement = placements$1[currentIndex]; - if (currentPlacement == null) { - return {}; - } - const alignmentSides = getAlignmentSides(currentPlacement, rects, await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating))); - - // Make `computeCoords` start from the right place. - if (placement !== currentPlacement) { - return { - reset: { - placement: placements$1[0] - } - }; - } - const currentOverflows = [overflow[getSide(currentPlacement)], overflow[alignmentSides[0]], overflow[alignmentSides[1]]]; - const allOverflows = [...(((_middlewareData$autoP2 = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP2.overflows) || []), { - placement: currentPlacement, - overflows: currentOverflows - }]; - const nextPlacement = placements$1[currentIndex + 1]; - - // There are more placements to check. - if (nextPlacement) { - return { - data: { - index: currentIndex + 1, - overflows: allOverflows - }, - reset: { - placement: nextPlacement - } - }; - } - const placementsSortedByMostSpace = allOverflows.map(d => { - const alignment = getAlignment(d.placement); - return [d.placement, alignment && crossAxis ? - // Check along the mainAxis and main crossAxis side. - d.overflows.slice(0, 2).reduce((acc, v) => acc + v, 0) : - // Check only the mainAxis. - d.overflows[0], d.overflows]; - }).sort((a, b) => a[1] - b[1]); - const placementsThatFitOnEachSide = placementsSortedByMostSpace.filter(d => d[2].slice(0, - // Aligned placements should not check their opposite crossAxis - // side. - getAlignment(d[0]) ? 2 : 3).every(v => v <= 0)); - const resetPlacement = ((_placementsThatFitOnE = placementsThatFitOnEachSide[0]) == null ? void 0 : _placementsThatFitOnE[0]) || placementsSortedByMostSpace[0][0]; - if (resetPlacement !== placement) { - return { - data: { - index: currentIndex + 1, - overflows: allOverflows - }, - reset: { - placement: resetPlacement - } - }; - } - return {}; - } - }; -}; - -/** - * Optimizes the visibility of the floating element by flipping the `placement` - * in order to keep it in view when the preferred placement(s) will overflow the - * clipping boundary. Alternative to `autoPlacement`. - * @see https://floating-ui.com/docs/flip - */ -const flip = function (options) { - if (options === void 0) { - options = {}; - } - return { - name: 'flip', - options, - async fn(state) { - var _middlewareData$arrow, _middlewareData$flip; - const { - placement, - middlewareData, - rects, - initialPlacement, - platform, - elements - } = state; - const { - mainAxis: checkMainAxis = true, - crossAxis: checkCrossAxis = true, - fallbackPlacements: specifiedFallbackPlacements, - fallbackStrategy = 'bestFit', - fallbackAxisSideDirection = 'none', - flipAlignment = true, - ...detectOverflowOptions - } = evaluate(options, state); - - // If a reset by the arrow was caused due to an alignment offset being - // added, we should skip any logic now since `flip()` has already done its - // work. - // https://github.com/floating-ui/floating-ui/issues/2549#issuecomment-1719601643 - if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) { - return {}; - } - const side = getSide(placement); - const initialSideAxis = getSideAxis(initialPlacement); - const isBasePlacement = getSide(initialPlacement) === initialPlacement; - const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)); - const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement)); - const hasFallbackAxisSideDirection = fallbackAxisSideDirection !== 'none'; - if (!specifiedFallbackPlacements && hasFallbackAxisSideDirection) { - fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl)); - } - const placements = [initialPlacement, ...fallbackPlacements]; - const overflow = await detectOverflow(state, detectOverflowOptions); - const overflows = []; - let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || []; - if (checkMainAxis) { - overflows.push(overflow[side]); - } - if (checkCrossAxis) { - const sides = getAlignmentSides(placement, rects, rtl); - overflows.push(overflow[sides[0]], overflow[sides[1]]); - } - overflowsData = [...overflowsData, { - placement, - overflows - }]; - - // One or more sides is overflowing. - if (!overflows.every(side => side <= 0)) { - var _middlewareData$flip2, _overflowsData$filter; - const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1; - const nextPlacement = placements[nextIndex]; - if (nextPlacement) { - const ignoreCrossAxisOverflow = checkCrossAxis === 'alignment' ? initialSideAxis !== getSideAxis(nextPlacement) : false; - if (!ignoreCrossAxisOverflow || - // We leave the current main axis only if every placement on that axis - // overflows the main axis. - overflowsData.every(d => getSideAxis(d.placement) === initialSideAxis ? d.overflows[0] > 0 : true)) { - // Try next placement and re-run the lifecycle. - return { - data: { - index: nextIndex, - overflows: overflowsData - }, - reset: { - placement: nextPlacement - } - }; - } - } - - // First, find the candidates that fit on the mainAxis side of overflow, - // then find the placement that fits the best on the main crossAxis side. - let resetPlacement = (_overflowsData$filter = overflowsData.filter(d => d.overflows[0] <= 0).sort((a, b) => a.overflows[1] - b.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement; - - // Otherwise fallback. - if (!resetPlacement) { - switch (fallbackStrategy) { - case 'bestFit': - { - var _overflowsData$filter2; - const placement = (_overflowsData$filter2 = overflowsData.filter(d => { - if (hasFallbackAxisSideDirection) { - const currentSideAxis = getSideAxis(d.placement); - return currentSideAxis === initialSideAxis || - // Create a bias to the `y` side axis due to horizontal - // reading directions favoring greater width. - currentSideAxis === 'y'; - } - return true; - }).map(d => [d.placement, d.overflows.filter(overflow => overflow > 0).reduce((acc, overflow) => acc + overflow, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$filter2[0]; - if (placement) { - resetPlacement = placement; - } - break; - } - case 'initialPlacement': - resetPlacement = initialPlacement; - break; - } - } - if (placement !== resetPlacement) { - return { - reset: { - placement: resetPlacement - } - }; - } - } - return {}; - } - }; -}; - -function getSideOffsets(overflow, rect) { - return { - top: overflow.top - rect.height, - right: overflow.right - rect.width, - bottom: overflow.bottom - rect.height, - left: overflow.left - rect.width - }; -} -function isAnySideFullyClipped(overflow) { - return sides.some(side => overflow[side] >= 0); -} -/** - * Provides data to hide the floating element in applicable situations, such as - * when it is not in the same clipping context as the reference element. - * @see https://floating-ui.com/docs/hide - */ -const hide = function (options) { - if (options === void 0) { - options = {}; - } - return { - name: 'hide', - options, - async fn(state) { - const { - rects - } = state; - const { - strategy = 'referenceHidden', - ...detectOverflowOptions - } = evaluate(options, state); - switch (strategy) { - case 'referenceHidden': - { - const overflow = await detectOverflow(state, { - ...detectOverflowOptions, - elementContext: 'reference' - }); - const offsets = getSideOffsets(overflow, rects.reference); - return { - data: { - referenceHiddenOffsets: offsets, - referenceHidden: isAnySideFullyClipped(offsets) - } - }; - } - case 'escaped': - { - const overflow = await detectOverflow(state, { - ...detectOverflowOptions, - altBoundary: true - }); - const offsets = getSideOffsets(overflow, rects.floating); - return { - data: { - escapedOffsets: offsets, - escaped: isAnySideFullyClipped(offsets) - } - }; - } - default: - { - return {}; - } - } - } - }; -}; - -function getBoundingRect(rects) { - const minX = min(...rects.map(rect => rect.left)); - const minY = min(...rects.map(rect => rect.top)); - const maxX = max(...rects.map(rect => rect.right)); - const maxY = max(...rects.map(rect => rect.bottom)); - return { - x: minX, - y: minY, - width: maxX - minX, - height: maxY - minY - }; -} -function getRectsByLine(rects) { - const sortedRects = rects.slice().sort((a, b) => a.y - b.y); - const groups = []; - let prevRect = null; - for (let i = 0; i < sortedRects.length; i++) { - const rect = sortedRects[i]; - if (!prevRect || rect.y - prevRect.y > prevRect.height / 2) { - groups.push([rect]); - } else { - groups[groups.length - 1].push(rect); - } - prevRect = rect; - } - return groups.map(rect => rectToClientRect(getBoundingRect(rect))); -} -/** - * Provides improved positioning for inline reference elements that can span - * over multiple lines, such as hyperlinks or range selections. - * @see https://floating-ui.com/docs/inline - */ -const inline = function (options) { - if (options === void 0) { - options = {}; - } - return { - name: 'inline', - options, - async fn(state) { - const { - placement, - elements, - rects, - platform, - strategy - } = state; - // A MouseEvent's client{X,Y} coords can be up to 2 pixels off a - // ClientRect's bounds, despite the event listener being triggered. A - // padding of 2 seems to handle this issue. - const { - padding = 2, - x, - y - } = evaluate(options, state); - const nativeClientRects = Array.from((await (platform.getClientRects == null ? void 0 : platform.getClientRects(elements.reference))) || []); - const clientRects = getRectsByLine(nativeClientRects); - const fallback = rectToClientRect(getBoundingRect(nativeClientRects)); - const paddingObject = getPaddingObject(padding); - function getBoundingClientRect() { - // There are two rects and they are disjoined. - if (clientRects.length === 2 && clientRects[0].left > clientRects[1].right && x != null && y != null) { - // Find the first rect in which the point is fully inside. - return clientRects.find(rect => x > rect.left - paddingObject.left && x < rect.right + paddingObject.right && y > rect.top - paddingObject.top && y < rect.bottom + paddingObject.bottom) || fallback; - } - - // There are 2 or more connected rects. - if (clientRects.length >= 2) { - if (getSideAxis(placement) === 'y') { - const firstRect = clientRects[0]; - const lastRect = clientRects[clientRects.length - 1]; - const isTop = getSide(placement) === 'top'; - const top = firstRect.top; - const bottom = lastRect.bottom; - const left = isTop ? firstRect.left : lastRect.left; - const right = isTop ? firstRect.right : lastRect.right; - const width = right - left; - const height = bottom - top; - return { - top, - bottom, - left, - right, - width, - height, - x: left, - y: top - }; - } - const isLeftSide = getSide(placement) === 'left'; - const maxRight = max(...clientRects.map(rect => rect.right)); - const minLeft = min(...clientRects.map(rect => rect.left)); - const measureRects = clientRects.filter(rect => isLeftSide ? rect.left === minLeft : rect.right === maxRight); - const top = measureRects[0].top; - const bottom = measureRects[measureRects.length - 1].bottom; - const left = minLeft; - const right = maxRight; - const width = right - left; - const height = bottom - top; - return { - top, - bottom, - left, - right, - width, - height, - x: left, - y: top - }; - } - return fallback; - } - const resetRects = await platform.getElementRects({ - reference: { - getBoundingClientRect - }, - floating: elements.floating, - strategy - }); - if (rects.reference.x !== resetRects.reference.x || rects.reference.y !== resetRects.reference.y || rects.reference.width !== resetRects.reference.width || rects.reference.height !== resetRects.reference.height) { - return { - reset: { - rects: resetRects - } - }; - } - return {}; - } - }; -}; - -const originSides = /*#__PURE__*/new Set(['left', 'top']); - -// For type backwards-compatibility, the `OffsetOptions` type was also -// Derivable. - -async function convertValueToCoords(state, options) { - const { - placement, - platform, - elements - } = state; - const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)); - const side = getSide(placement); - const alignment = getAlignment(placement); - const isVertical = getSideAxis(placement) === 'y'; - const mainAxisMulti = originSides.has(side) ? -1 : 1; - const crossAxisMulti = rtl && isVertical ? -1 : 1; - const rawValue = evaluate(options, state); - - // eslint-disable-next-line prefer-const - let { - mainAxis, - crossAxis, - alignmentAxis - } = typeof rawValue === 'number' ? { - mainAxis: rawValue, - crossAxis: 0, - alignmentAxis: null - } : { - mainAxis: rawValue.mainAxis || 0, - crossAxis: rawValue.crossAxis || 0, - alignmentAxis: rawValue.alignmentAxis - }; - if (alignment && typeof alignmentAxis === 'number') { - crossAxis = alignment === 'end' ? alignmentAxis * -1 : alignmentAxis; - } - return isVertical ? { - x: crossAxis * crossAxisMulti, - y: mainAxis * mainAxisMulti - } : { - x: mainAxis * mainAxisMulti, - y: crossAxis * crossAxisMulti - }; -} - -/** - * Modifies the placement by translating the floating element along the - * specified axes. - * A number (shorthand for `mainAxis` or distance), or an axes configuration - * object may be passed. - * @see https://floating-ui.com/docs/offset - */ -const offset = function (options) { - if (options === void 0) { - options = 0; - } - return { - name: 'offset', - options, - async fn(state) { - var _middlewareData$offse, _middlewareData$arrow; - const { - x, - y, - placement, - middlewareData - } = state; - const diffCoords = await convertValueToCoords(state, options); - - // If the placement is the same and the arrow caused an alignment offset - // then we don't need to change the positioning coordinates. - if (placement === ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) { - return {}; - } - return { - x: x + diffCoords.x, - y: y + diffCoords.y, - data: { - ...diffCoords, - placement - } - }; - } - }; -}; - -/** - * Optimizes the visibility of the floating element by shifting it in order to - * keep it in view when it will overflow the clipping boundary. - * @see https://floating-ui.com/docs/shift - */ -const shift = function (options) { - if (options === void 0) { - options = {}; - } - return { - name: 'shift', - options, - async fn(state) { - const { - x, - y, - placement - } = state; - const { - mainAxis: checkMainAxis = true, - crossAxis: checkCrossAxis = false, - limiter = { - fn: _ref => { - let { - x, - y - } = _ref; - return { - x, - y - }; - } - }, - ...detectOverflowOptions - } = evaluate(options, state); - const coords = { - x, - y - }; - const overflow = await detectOverflow(state, detectOverflowOptions); - const crossAxis = getSideAxis(getSide(placement)); - const mainAxis = getOppositeAxis(crossAxis); - let mainAxisCoord = coords[mainAxis]; - let crossAxisCoord = coords[crossAxis]; - if (checkMainAxis) { - const minSide = mainAxis === 'y' ? 'top' : 'left'; - const maxSide = mainAxis === 'y' ? 'bottom' : 'right'; - const min = mainAxisCoord + overflow[minSide]; - const max = mainAxisCoord - overflow[maxSide]; - mainAxisCoord = clamp(min, mainAxisCoord, max); - } - if (checkCrossAxis) { - const minSide = crossAxis === 'y' ? 'top' : 'left'; - const maxSide = crossAxis === 'y' ? 'bottom' : 'right'; - const min = crossAxisCoord + overflow[minSide]; - const max = crossAxisCoord - overflow[maxSide]; - crossAxisCoord = clamp(min, crossAxisCoord, max); - } - const limitedCoords = limiter.fn({ - ...state, - [mainAxis]: mainAxisCoord, - [crossAxis]: crossAxisCoord - }); - return { - ...limitedCoords, - data: { - x: limitedCoords.x - x, - y: limitedCoords.y - y, - enabled: { - [mainAxis]: checkMainAxis, - [crossAxis]: checkCrossAxis - } - } - }; - } - }; -}; -/** - * Built-in `limiter` that will stop `shift()` at a certain point. - */ -const limitShift = function (options) { - if (options === void 0) { - options = {}; - } - return { - options, - fn(state) { - const { - x, - y, - placement, - rects, - middlewareData - } = state; - const { - offset = 0, - mainAxis: checkMainAxis = true, - crossAxis: checkCrossAxis = true - } = evaluate(options, state); - const coords = { - x, - y - }; - const crossAxis = getSideAxis(placement); - const mainAxis = getOppositeAxis(crossAxis); - let mainAxisCoord = coords[mainAxis]; - let crossAxisCoord = coords[crossAxis]; - const rawOffset = evaluate(offset, state); - const computedOffset = typeof rawOffset === 'number' ? { - mainAxis: rawOffset, - crossAxis: 0 - } : { - mainAxis: 0, - crossAxis: 0, - ...rawOffset - }; - if (checkMainAxis) { - const len = mainAxis === 'y' ? 'height' : 'width'; - const limitMin = rects.reference[mainAxis] - rects.floating[len] + computedOffset.mainAxis; - const limitMax = rects.reference[mainAxis] + rects.reference[len] - computedOffset.mainAxis; - if (mainAxisCoord < limitMin) { - mainAxisCoord = limitMin; - } else if (mainAxisCoord > limitMax) { - mainAxisCoord = limitMax; - } - } - if (checkCrossAxis) { - var _middlewareData$offse, _middlewareData$offse2; - const len = mainAxis === 'y' ? 'width' : 'height'; - const isOriginSide = originSides.has(getSide(placement)); - const limitMin = rects.reference[crossAxis] - rects.floating[len] + (isOriginSide ? ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse[crossAxis]) || 0 : 0) + (isOriginSide ? 0 : computedOffset.crossAxis); - const limitMax = rects.reference[crossAxis] + rects.reference[len] + (isOriginSide ? 0 : ((_middlewareData$offse2 = middlewareData.offset) == null ? void 0 : _middlewareData$offse2[crossAxis]) || 0) - (isOriginSide ? computedOffset.crossAxis : 0); - if (crossAxisCoord < limitMin) { - crossAxisCoord = limitMin; - } else if (crossAxisCoord > limitMax) { - crossAxisCoord = limitMax; - } - } - return { - [mainAxis]: mainAxisCoord, - [crossAxis]: crossAxisCoord - }; - } - }; -}; - -/** - * Provides data that allows you to change the size of the floating element — - * for instance, prevent it from overflowing the clipping boundary or match the - * width of the reference element. - * @see https://floating-ui.com/docs/size - */ -const size = function (options) { - if (options === void 0) { - options = {}; - } - return { - name: 'size', - options, - async fn(state) { - var _state$middlewareData, _state$middlewareData2; - const { - placement, - rects, - platform, - elements - } = state; - const { - apply = () => {}, - ...detectOverflowOptions - } = evaluate(options, state); - const overflow = await detectOverflow(state, detectOverflowOptions); - const side = getSide(placement); - const alignment = getAlignment(placement); - const isYAxis = getSideAxis(placement) === 'y'; - const { - width, - height - } = rects.floating; - let heightSide; - let widthSide; - if (side === 'top' || side === 'bottom') { - heightSide = side; - widthSide = alignment === ((await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating))) ? 'start' : 'end') ? 'left' : 'right'; - } else { - widthSide = side; - heightSide = alignment === 'end' ? 'top' : 'bottom'; - } - const maximumClippingHeight = height - overflow.top - overflow.bottom; - const maximumClippingWidth = width - overflow.left - overflow.right; - const overflowAvailableHeight = min(height - overflow[heightSide], maximumClippingHeight); - const overflowAvailableWidth = min(width - overflow[widthSide], maximumClippingWidth); - const noShift = !state.middlewareData.shift; - let availableHeight = overflowAvailableHeight; - let availableWidth = overflowAvailableWidth; - if ((_state$middlewareData = state.middlewareData.shift) != null && _state$middlewareData.enabled.x) { - availableWidth = maximumClippingWidth; - } - if ((_state$middlewareData2 = state.middlewareData.shift) != null && _state$middlewareData2.enabled.y) { - availableHeight = maximumClippingHeight; - } - if (noShift && !alignment) { - const xMin = max(overflow.left, 0); - const xMax = max(overflow.right, 0); - const yMin = max(overflow.top, 0); - const yMax = max(overflow.bottom, 0); - if (isYAxis) { - availableWidth = width - 2 * (xMin !== 0 || xMax !== 0 ? xMin + xMax : max(overflow.left, overflow.right)); - } else { - availableHeight = height - 2 * (yMin !== 0 || yMax !== 0 ? yMin + yMax : max(overflow.top, overflow.bottom)); - } - } - await apply({ - ...state, - availableWidth, - availableHeight - }); - const nextDimensions = await platform.getDimensions(elements.floating); - if (width !== nextDimensions.width || height !== nextDimensions.height) { - return { - reset: { - rects: true - } - }; - } - return {}; - } - }; -}; - -export { arrow, autoPlacement, computePosition, detectOverflow, flip, hide, inline, limitShift, offset, shift, size }; diff --git a/node_modules/@floating-ui/core/dist/floating-ui.core.umd.js b/node_modules/@floating-ui/core/dist/floating-ui.core.umd.js deleted file mode 100644 index 49f24822..00000000 --- a/node_modules/@floating-ui/core/dist/floating-ui.core.umd.js +++ /dev/null @@ -1,1197 +0,0 @@ -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : - typeof define === 'function' && define.amd ? define(['exports'], factory) : - (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.FloatingUICore = {})); -})(this, (function (exports) { 'use strict'; - - /** - * Custom positioning reference element. - * @see https://floating-ui.com/docs/virtual-elements - */ - - const sides = ['top', 'right', 'bottom', 'left']; - const alignments = ['start', 'end']; - const placements = /*#__PURE__*/sides.reduce((acc, side) => acc.concat(side, side + "-" + alignments[0], side + "-" + alignments[1]), []); - const min = Math.min; - const max = Math.max; - const oppositeSideMap = { - left: 'right', - right: 'left', - bottom: 'top', - top: 'bottom' - }; - const oppositeAlignmentMap = { - start: 'end', - end: 'start' - }; - function clamp(start, value, end) { - return max(start, min(value, end)); - } - function evaluate(value, param) { - return typeof value === 'function' ? value(param) : value; - } - function getSide(placement) { - return placement.split('-')[0]; - } - function getAlignment(placement) { - return placement.split('-')[1]; - } - function getOppositeAxis(axis) { - return axis === 'x' ? 'y' : 'x'; - } - function getAxisLength(axis) { - return axis === 'y' ? 'height' : 'width'; - } - const yAxisSides = /*#__PURE__*/new Set(['top', 'bottom']); - function getSideAxis(placement) { - return yAxisSides.has(getSide(placement)) ? 'y' : 'x'; - } - function getAlignmentAxis(placement) { - return getOppositeAxis(getSideAxis(placement)); - } - function getAlignmentSides(placement, rects, rtl) { - if (rtl === void 0) { - rtl = false; - } - const alignment = getAlignment(placement); - const alignmentAxis = getAlignmentAxis(placement); - const length = getAxisLength(alignmentAxis); - let mainAlignmentSide = alignmentAxis === 'x' ? alignment === (rtl ? 'end' : 'start') ? 'right' : 'left' : alignment === 'start' ? 'bottom' : 'top'; - if (rects.reference[length] > rects.floating[length]) { - mainAlignmentSide = getOppositePlacement(mainAlignmentSide); - } - return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)]; - } - function getExpandedPlacements(placement) { - const oppositePlacement = getOppositePlacement(placement); - return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)]; - } - function getOppositeAlignmentPlacement(placement) { - return placement.replace(/start|end/g, alignment => oppositeAlignmentMap[alignment]); - } - const lrPlacement = ['left', 'right']; - const rlPlacement = ['right', 'left']; - const tbPlacement = ['top', 'bottom']; - const btPlacement = ['bottom', 'top']; - function getSideList(side, isStart, rtl) { - switch (side) { - case 'top': - case 'bottom': - if (rtl) return isStart ? rlPlacement : lrPlacement; - return isStart ? lrPlacement : rlPlacement; - case 'left': - case 'right': - return isStart ? tbPlacement : btPlacement; - default: - return []; - } - } - function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) { - const alignment = getAlignment(placement); - let list = getSideList(getSide(placement), direction === 'start', rtl); - if (alignment) { - list = list.map(side => side + "-" + alignment); - if (flipAlignment) { - list = list.concat(list.map(getOppositeAlignmentPlacement)); - } - } - return list; - } - function getOppositePlacement(placement) { - return placement.replace(/left|right|bottom|top/g, side => oppositeSideMap[side]); - } - function expandPaddingObject(padding) { - return { - top: 0, - right: 0, - bottom: 0, - left: 0, - ...padding - }; - } - function getPaddingObject(padding) { - return typeof padding !== 'number' ? expandPaddingObject(padding) : { - top: padding, - right: padding, - bottom: padding, - left: padding - }; - } - function rectToClientRect(rect) { - const { - x, - y, - width, - height - } = rect; - return { - width, - height, - top: y, - left: x, - right: x + width, - bottom: y + height, - x, - y - }; - } - - function computeCoordsFromPlacement(_ref, placement, rtl) { - let { - reference, - floating - } = _ref; - const sideAxis = getSideAxis(placement); - const alignmentAxis = getAlignmentAxis(placement); - const alignLength = getAxisLength(alignmentAxis); - const side = getSide(placement); - const isVertical = sideAxis === 'y'; - const commonX = reference.x + reference.width / 2 - floating.width / 2; - const commonY = reference.y + reference.height / 2 - floating.height / 2; - const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2; - let coords; - switch (side) { - case 'top': - coords = { - x: commonX, - y: reference.y - floating.height - }; - break; - case 'bottom': - coords = { - x: commonX, - y: reference.y + reference.height - }; - break; - case 'right': - coords = { - x: reference.x + reference.width, - y: commonY - }; - break; - case 'left': - coords = { - x: reference.x - floating.width, - y: commonY - }; - break; - default: - coords = { - x: reference.x, - y: reference.y - }; - } - switch (getAlignment(placement)) { - case 'start': - coords[alignmentAxis] -= commonAlign * (rtl && isVertical ? -1 : 1); - break; - case 'end': - coords[alignmentAxis] += commonAlign * (rtl && isVertical ? -1 : 1); - break; - } - return coords; - } - - /** - * Computes the `x` and `y` coordinates that will place the floating element - * next to a given reference element. - * - * This export does not have any `platform` interface logic. You will need to - * write one for the platform you are using Floating UI with. - */ - const computePosition = async (reference, floating, config) => { - const { - placement = 'bottom', - strategy = 'absolute', - middleware = [], - platform - } = config; - const validMiddleware = middleware.filter(Boolean); - const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(floating)); - let rects = await platform.getElementRects({ - reference, - floating, - strategy - }); - let { - x, - y - } = computeCoordsFromPlacement(rects, placement, rtl); - let statefulPlacement = placement; - let middlewareData = {}; - let resetCount = 0; - for (let i = 0; i < validMiddleware.length; i++) { - const { - name, - fn - } = validMiddleware[i]; - const { - x: nextX, - y: nextY, - data, - reset - } = await fn({ - x, - y, - initialPlacement: placement, - placement: statefulPlacement, - strategy, - middlewareData, - rects, - platform, - elements: { - reference, - floating - } - }); - x = nextX != null ? nextX : x; - y = nextY != null ? nextY : y; - middlewareData = { - ...middlewareData, - [name]: { - ...middlewareData[name], - ...data - } - }; - if (reset && resetCount <= 50) { - resetCount++; - if (typeof reset === 'object') { - if (reset.placement) { - statefulPlacement = reset.placement; - } - if (reset.rects) { - rects = reset.rects === true ? await platform.getElementRects({ - reference, - floating, - strategy - }) : reset.rects; - } - ({ - x, - y - } = computeCoordsFromPlacement(rects, statefulPlacement, rtl)); - } - i = -1; - } - } - return { - x, - y, - placement: statefulPlacement, - strategy, - middlewareData - }; - }; - - /** - * Resolves with an object of overflow side offsets that determine how much the - * element is overflowing a given clipping boundary on each side. - * - positive = overflowing the boundary by that number of pixels - * - negative = how many pixels left before it will overflow - * - 0 = lies flush with the boundary - * @see https://floating-ui.com/docs/detectOverflow - */ - async function detectOverflow(state, options) { - var _await$platform$isEle; - if (options === void 0) { - options = {}; - } - const { - x, - y, - platform, - rects, - elements, - strategy - } = state; - const { - boundary = 'clippingAncestors', - rootBoundary = 'viewport', - elementContext = 'floating', - altBoundary = false, - padding = 0 - } = evaluate(options, state); - const paddingObject = getPaddingObject(padding); - const altContext = elementContext === 'floating' ? 'reference' : 'floating'; - const element = elements[altBoundary ? altContext : elementContext]; - const clippingClientRect = rectToClientRect(await platform.getClippingRect({ - element: ((_await$platform$isEle = await (platform.isElement == null ? void 0 : platform.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || (await (platform.getDocumentElement == null ? void 0 : platform.getDocumentElement(elements.floating))), - boundary, - rootBoundary, - strategy - })); - const rect = elementContext === 'floating' ? { - x, - y, - width: rects.floating.width, - height: rects.floating.height - } : rects.reference; - const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating)); - const offsetScale = (await (platform.isElement == null ? void 0 : platform.isElement(offsetParent))) ? (await (platform.getScale == null ? void 0 : platform.getScale(offsetParent))) || { - x: 1, - y: 1 - } : { - x: 1, - y: 1 - }; - const elementClientRect = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({ - elements, - rect, - offsetParent, - strategy - }) : rect); - return { - top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y, - bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y, - left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x, - right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x - }; - } - - /** - * Provides data to position an inner element of the floating element so that it - * appears centered to the reference element. - * @see https://floating-ui.com/docs/arrow - */ - const arrow = options => ({ - name: 'arrow', - options, - async fn(state) { - const { - x, - y, - placement, - rects, - platform, - elements, - middlewareData - } = state; - // Since `element` is required, we don't Partial<> the type. - const { - element, - padding = 0 - } = evaluate(options, state) || {}; - if (element == null) { - return {}; - } - const paddingObject = getPaddingObject(padding); - const coords = { - x, - y - }; - const axis = getAlignmentAxis(placement); - const length = getAxisLength(axis); - const arrowDimensions = await platform.getDimensions(element); - const isYAxis = axis === 'y'; - const minProp = isYAxis ? 'top' : 'left'; - const maxProp = isYAxis ? 'bottom' : 'right'; - const clientProp = isYAxis ? 'clientHeight' : 'clientWidth'; - const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length]; - const startDiff = coords[axis] - rects.reference[axis]; - const arrowOffsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(element)); - let clientSize = arrowOffsetParent ? arrowOffsetParent[clientProp] : 0; - - // DOM platform can return `window` as the `offsetParent`. - if (!clientSize || !(await (platform.isElement == null ? void 0 : platform.isElement(arrowOffsetParent)))) { - clientSize = elements.floating[clientProp] || rects.floating[length]; - } - const centerToReference = endDiff / 2 - startDiff / 2; - - // If the padding is large enough that it causes the arrow to no longer be - // centered, modify the padding so that it is centered. - const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1; - const minPadding = min(paddingObject[minProp], largestPossiblePadding); - const maxPadding = min(paddingObject[maxProp], largestPossiblePadding); - - // Make sure the arrow doesn't overflow the floating element if the center - // point is outside the floating element's bounds. - const min$1 = minPadding; - const max = clientSize - arrowDimensions[length] - maxPadding; - const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference; - const offset = clamp(min$1, center, max); - - // If the reference is small enough that the arrow's padding causes it to - // to point to nothing for an aligned placement, adjust the offset of the - // floating element itself. To ensure `shift()` continues to take action, - // a single reset is performed when this is true. - const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset && rects.reference[length] / 2 - (center < min$1 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0; - const alignmentOffset = shouldAddOffset ? center < min$1 ? center - min$1 : center - max : 0; - return { - [axis]: coords[axis] + alignmentOffset, - data: { - [axis]: offset, - centerOffset: center - offset - alignmentOffset, - ...(shouldAddOffset && { - alignmentOffset - }) - }, - reset: shouldAddOffset - }; - } - }); - - function getPlacementList(alignment, autoAlignment, allowedPlacements) { - const allowedPlacementsSortedByAlignment = alignment ? [...allowedPlacements.filter(placement => getAlignment(placement) === alignment), ...allowedPlacements.filter(placement => getAlignment(placement) !== alignment)] : allowedPlacements.filter(placement => getSide(placement) === placement); - return allowedPlacementsSortedByAlignment.filter(placement => { - if (alignment) { - return getAlignment(placement) === alignment || (autoAlignment ? getOppositeAlignmentPlacement(placement) !== placement : false); - } - return true; - }); - } - /** - * Optimizes the visibility of the floating element by choosing the placement - * that has the most space available automatically, without needing to specify a - * preferred placement. Alternative to `flip`. - * @see https://floating-ui.com/docs/autoPlacement - */ - const autoPlacement = function (options) { - if (options === void 0) { - options = {}; - } - return { - name: 'autoPlacement', - options, - async fn(state) { - var _middlewareData$autoP, _middlewareData$autoP2, _placementsThatFitOnE; - const { - rects, - middlewareData, - placement, - platform, - elements - } = state; - const { - crossAxis = false, - alignment, - allowedPlacements = placements, - autoAlignment = true, - ...detectOverflowOptions - } = evaluate(options, state); - const placements$1 = alignment !== undefined || allowedPlacements === placements ? getPlacementList(alignment || null, autoAlignment, allowedPlacements) : allowedPlacements; - const overflow = await detectOverflow(state, detectOverflowOptions); - const currentIndex = ((_middlewareData$autoP = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP.index) || 0; - const currentPlacement = placements$1[currentIndex]; - if (currentPlacement == null) { - return {}; - } - const alignmentSides = getAlignmentSides(currentPlacement, rects, await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating))); - - // Make `computeCoords` start from the right place. - if (placement !== currentPlacement) { - return { - reset: { - placement: placements$1[0] - } - }; - } - const currentOverflows = [overflow[getSide(currentPlacement)], overflow[alignmentSides[0]], overflow[alignmentSides[1]]]; - const allOverflows = [...(((_middlewareData$autoP2 = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP2.overflows) || []), { - placement: currentPlacement, - overflows: currentOverflows - }]; - const nextPlacement = placements$1[currentIndex + 1]; - - // There are more placements to check. - if (nextPlacement) { - return { - data: { - index: currentIndex + 1, - overflows: allOverflows - }, - reset: { - placement: nextPlacement - } - }; - } - const placementsSortedByMostSpace = allOverflows.map(d => { - const alignment = getAlignment(d.placement); - return [d.placement, alignment && crossAxis ? - // Check along the mainAxis and main crossAxis side. - d.overflows.slice(0, 2).reduce((acc, v) => acc + v, 0) : - // Check only the mainAxis. - d.overflows[0], d.overflows]; - }).sort((a, b) => a[1] - b[1]); - const placementsThatFitOnEachSide = placementsSortedByMostSpace.filter(d => d[2].slice(0, - // Aligned placements should not check their opposite crossAxis - // side. - getAlignment(d[0]) ? 2 : 3).every(v => v <= 0)); - const resetPlacement = ((_placementsThatFitOnE = placementsThatFitOnEachSide[0]) == null ? void 0 : _placementsThatFitOnE[0]) || placementsSortedByMostSpace[0][0]; - if (resetPlacement !== placement) { - return { - data: { - index: currentIndex + 1, - overflows: allOverflows - }, - reset: { - placement: resetPlacement - } - }; - } - return {}; - } - }; - }; - - /** - * Optimizes the visibility of the floating element by flipping the `placement` - * in order to keep it in view when the preferred placement(s) will overflow the - * clipping boundary. Alternative to `autoPlacement`. - * @see https://floating-ui.com/docs/flip - */ - const flip = function (options) { - if (options === void 0) { - options = {}; - } - return { - name: 'flip', - options, - async fn(state) { - var _middlewareData$arrow, _middlewareData$flip; - const { - placement, - middlewareData, - rects, - initialPlacement, - platform, - elements - } = state; - const { - mainAxis: checkMainAxis = true, - crossAxis: checkCrossAxis = true, - fallbackPlacements: specifiedFallbackPlacements, - fallbackStrategy = 'bestFit', - fallbackAxisSideDirection = 'none', - flipAlignment = true, - ...detectOverflowOptions - } = evaluate(options, state); - - // If a reset by the arrow was caused due to an alignment offset being - // added, we should skip any logic now since `flip()` has already done its - // work. - // https://github.com/floating-ui/floating-ui/issues/2549#issuecomment-1719601643 - if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) { - return {}; - } - const side = getSide(placement); - const initialSideAxis = getSideAxis(initialPlacement); - const isBasePlacement = getSide(initialPlacement) === initialPlacement; - const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)); - const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement)); - const hasFallbackAxisSideDirection = fallbackAxisSideDirection !== 'none'; - if (!specifiedFallbackPlacements && hasFallbackAxisSideDirection) { - fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl)); - } - const placements = [initialPlacement, ...fallbackPlacements]; - const overflow = await detectOverflow(state, detectOverflowOptions); - const overflows = []; - let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || []; - if (checkMainAxis) { - overflows.push(overflow[side]); - } - if (checkCrossAxis) { - const sides = getAlignmentSides(placement, rects, rtl); - overflows.push(overflow[sides[0]], overflow[sides[1]]); - } - overflowsData = [...overflowsData, { - placement, - overflows - }]; - - // One or more sides is overflowing. - if (!overflows.every(side => side <= 0)) { - var _middlewareData$flip2, _overflowsData$filter; - const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1; - const nextPlacement = placements[nextIndex]; - if (nextPlacement) { - const ignoreCrossAxisOverflow = checkCrossAxis === 'alignment' ? initialSideAxis !== getSideAxis(nextPlacement) : false; - if (!ignoreCrossAxisOverflow || - // We leave the current main axis only if every placement on that axis - // overflows the main axis. - overflowsData.every(d => getSideAxis(d.placement) === initialSideAxis ? d.overflows[0] > 0 : true)) { - // Try next placement and re-run the lifecycle. - return { - data: { - index: nextIndex, - overflows: overflowsData - }, - reset: { - placement: nextPlacement - } - }; - } - } - - // First, find the candidates that fit on the mainAxis side of overflow, - // then find the placement that fits the best on the main crossAxis side. - let resetPlacement = (_overflowsData$filter = overflowsData.filter(d => d.overflows[0] <= 0).sort((a, b) => a.overflows[1] - b.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement; - - // Otherwise fallback. - if (!resetPlacement) { - switch (fallbackStrategy) { - case 'bestFit': - { - var _overflowsData$filter2; - const placement = (_overflowsData$filter2 = overflowsData.filter(d => { - if (hasFallbackAxisSideDirection) { - const currentSideAxis = getSideAxis(d.placement); - return currentSideAxis === initialSideAxis || - // Create a bias to the `y` side axis due to horizontal - // reading directions favoring greater width. - currentSideAxis === 'y'; - } - return true; - }).map(d => [d.placement, d.overflows.filter(overflow => overflow > 0).reduce((acc, overflow) => acc + overflow, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$filter2[0]; - if (placement) { - resetPlacement = placement; - } - break; - } - case 'initialPlacement': - resetPlacement = initialPlacement; - break; - } - } - if (placement !== resetPlacement) { - return { - reset: { - placement: resetPlacement - } - }; - } - } - return {}; - } - }; - }; - - function getSideOffsets(overflow, rect) { - return { - top: overflow.top - rect.height, - right: overflow.right - rect.width, - bottom: overflow.bottom - rect.height, - left: overflow.left - rect.width - }; - } - function isAnySideFullyClipped(overflow) { - return sides.some(side => overflow[side] >= 0); - } - /** - * Provides data to hide the floating element in applicable situations, such as - * when it is not in the same clipping context as the reference element. - * @see https://floating-ui.com/docs/hide - */ - const hide = function (options) { - if (options === void 0) { - options = {}; - } - return { - name: 'hide', - options, - async fn(state) { - const { - rects - } = state; - const { - strategy = 'referenceHidden', - ...detectOverflowOptions - } = evaluate(options, state); - switch (strategy) { - case 'referenceHidden': - { - const overflow = await detectOverflow(state, { - ...detectOverflowOptions, - elementContext: 'reference' - }); - const offsets = getSideOffsets(overflow, rects.reference); - return { - data: { - referenceHiddenOffsets: offsets, - referenceHidden: isAnySideFullyClipped(offsets) - } - }; - } - case 'escaped': - { - const overflow = await detectOverflow(state, { - ...detectOverflowOptions, - altBoundary: true - }); - const offsets = getSideOffsets(overflow, rects.floating); - return { - data: { - escapedOffsets: offsets, - escaped: isAnySideFullyClipped(offsets) - } - }; - } - default: - { - return {}; - } - } - } - }; - }; - - function getBoundingRect(rects) { - const minX = min(...rects.map(rect => rect.left)); - const minY = min(...rects.map(rect => rect.top)); - const maxX = max(...rects.map(rect => rect.right)); - const maxY = max(...rects.map(rect => rect.bottom)); - return { - x: minX, - y: minY, - width: maxX - minX, - height: maxY - minY - }; - } - function getRectsByLine(rects) { - const sortedRects = rects.slice().sort((a, b) => a.y - b.y); - const groups = []; - let prevRect = null; - for (let i = 0; i < sortedRects.length; i++) { - const rect = sortedRects[i]; - if (!prevRect || rect.y - prevRect.y > prevRect.height / 2) { - groups.push([rect]); - } else { - groups[groups.length - 1].push(rect); - } - prevRect = rect; - } - return groups.map(rect => rectToClientRect(getBoundingRect(rect))); - } - /** - * Provides improved positioning for inline reference elements that can span - * over multiple lines, such as hyperlinks or range selections. - * @see https://floating-ui.com/docs/inline - */ - const inline = function (options) { - if (options === void 0) { - options = {}; - } - return { - name: 'inline', - options, - async fn(state) { - const { - placement, - elements, - rects, - platform, - strategy - } = state; - // A MouseEvent's client{X,Y} coords can be up to 2 pixels off a - // ClientRect's bounds, despite the event listener being triggered. A - // padding of 2 seems to handle this issue. - const { - padding = 2, - x, - y - } = evaluate(options, state); - const nativeClientRects = Array.from((await (platform.getClientRects == null ? void 0 : platform.getClientRects(elements.reference))) || []); - const clientRects = getRectsByLine(nativeClientRects); - const fallback = rectToClientRect(getBoundingRect(nativeClientRects)); - const paddingObject = getPaddingObject(padding); - function getBoundingClientRect() { - // There are two rects and they are disjoined. - if (clientRects.length === 2 && clientRects[0].left > clientRects[1].right && x != null && y != null) { - // Find the first rect in which the point is fully inside. - return clientRects.find(rect => x > rect.left - paddingObject.left && x < rect.right + paddingObject.right && y > rect.top - paddingObject.top && y < rect.bottom + paddingObject.bottom) || fallback; - } - - // There are 2 or more connected rects. - if (clientRects.length >= 2) { - if (getSideAxis(placement) === 'y') { - const firstRect = clientRects[0]; - const lastRect = clientRects[clientRects.length - 1]; - const isTop = getSide(placement) === 'top'; - const top = firstRect.top; - const bottom = lastRect.bottom; - const left = isTop ? firstRect.left : lastRect.left; - const right = isTop ? firstRect.right : lastRect.right; - const width = right - left; - const height = bottom - top; - return { - top, - bottom, - left, - right, - width, - height, - x: left, - y: top - }; - } - const isLeftSide = getSide(placement) === 'left'; - const maxRight = max(...clientRects.map(rect => rect.right)); - const minLeft = min(...clientRects.map(rect => rect.left)); - const measureRects = clientRects.filter(rect => isLeftSide ? rect.left === minLeft : rect.right === maxRight); - const top = measureRects[0].top; - const bottom = measureRects[measureRects.length - 1].bottom; - const left = minLeft; - const right = maxRight; - const width = right - left; - const height = bottom - top; - return { - top, - bottom, - left, - right, - width, - height, - x: left, - y: top - }; - } - return fallback; - } - const resetRects = await platform.getElementRects({ - reference: { - getBoundingClientRect - }, - floating: elements.floating, - strategy - }); - if (rects.reference.x !== resetRects.reference.x || rects.reference.y !== resetRects.reference.y || rects.reference.width !== resetRects.reference.width || rects.reference.height !== resetRects.reference.height) { - return { - reset: { - rects: resetRects - } - }; - } - return {}; - } - }; - }; - - const originSides = /*#__PURE__*/new Set(['left', 'top']); - - // For type backwards-compatibility, the `OffsetOptions` type was also - // Derivable. - - async function convertValueToCoords(state, options) { - const { - placement, - platform, - elements - } = state; - const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)); - const side = getSide(placement); - const alignment = getAlignment(placement); - const isVertical = getSideAxis(placement) === 'y'; - const mainAxisMulti = originSides.has(side) ? -1 : 1; - const crossAxisMulti = rtl && isVertical ? -1 : 1; - const rawValue = evaluate(options, state); - - // eslint-disable-next-line prefer-const - let { - mainAxis, - crossAxis, - alignmentAxis - } = typeof rawValue === 'number' ? { - mainAxis: rawValue, - crossAxis: 0, - alignmentAxis: null - } : { - mainAxis: rawValue.mainAxis || 0, - crossAxis: rawValue.crossAxis || 0, - alignmentAxis: rawValue.alignmentAxis - }; - if (alignment && typeof alignmentAxis === 'number') { - crossAxis = alignment === 'end' ? alignmentAxis * -1 : alignmentAxis; - } - return isVertical ? { - x: crossAxis * crossAxisMulti, - y: mainAxis * mainAxisMulti - } : { - x: mainAxis * mainAxisMulti, - y: crossAxis * crossAxisMulti - }; - } - - /** - * Modifies the placement by translating the floating element along the - * specified axes. - * A number (shorthand for `mainAxis` or distance), or an axes configuration - * object may be passed. - * @see https://floating-ui.com/docs/offset - */ - const offset = function (options) { - if (options === void 0) { - options = 0; - } - return { - name: 'offset', - options, - async fn(state) { - var _middlewareData$offse, _middlewareData$arrow; - const { - x, - y, - placement, - middlewareData - } = state; - const diffCoords = await convertValueToCoords(state, options); - - // If the placement is the same and the arrow caused an alignment offset - // then we don't need to change the positioning coordinates. - if (placement === ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) { - return {}; - } - return { - x: x + diffCoords.x, - y: y + diffCoords.y, - data: { - ...diffCoords, - placement - } - }; - } - }; - }; - - /** - * Optimizes the visibility of the floating element by shifting it in order to - * keep it in view when it will overflow the clipping boundary. - * @see https://floating-ui.com/docs/shift - */ - const shift = function (options) { - if (options === void 0) { - options = {}; - } - return { - name: 'shift', - options, - async fn(state) { - const { - x, - y, - placement - } = state; - const { - mainAxis: checkMainAxis = true, - crossAxis: checkCrossAxis = false, - limiter = { - fn: _ref => { - let { - x, - y - } = _ref; - return { - x, - y - }; - } - }, - ...detectOverflowOptions - } = evaluate(options, state); - const coords = { - x, - y - }; - const overflow = await detectOverflow(state, detectOverflowOptions); - const crossAxis = getSideAxis(getSide(placement)); - const mainAxis = getOppositeAxis(crossAxis); - let mainAxisCoord = coords[mainAxis]; - let crossAxisCoord = coords[crossAxis]; - if (checkMainAxis) { - const minSide = mainAxis === 'y' ? 'top' : 'left'; - const maxSide = mainAxis === 'y' ? 'bottom' : 'right'; - const min = mainAxisCoord + overflow[minSide]; - const max = mainAxisCoord - overflow[maxSide]; - mainAxisCoord = clamp(min, mainAxisCoord, max); - } - if (checkCrossAxis) { - const minSide = crossAxis === 'y' ? 'top' : 'left'; - const maxSide = crossAxis === 'y' ? 'bottom' : 'right'; - const min = crossAxisCoord + overflow[minSide]; - const max = crossAxisCoord - overflow[maxSide]; - crossAxisCoord = clamp(min, crossAxisCoord, max); - } - const limitedCoords = limiter.fn({ - ...state, - [mainAxis]: mainAxisCoord, - [crossAxis]: crossAxisCoord - }); - return { - ...limitedCoords, - data: { - x: limitedCoords.x - x, - y: limitedCoords.y - y, - enabled: { - [mainAxis]: checkMainAxis, - [crossAxis]: checkCrossAxis - } - } - }; - } - }; - }; - /** - * Built-in `limiter` that will stop `shift()` at a certain point. - */ - const limitShift = function (options) { - if (options === void 0) { - options = {}; - } - return { - options, - fn(state) { - const { - x, - y, - placement, - rects, - middlewareData - } = state; - const { - offset = 0, - mainAxis: checkMainAxis = true, - crossAxis: checkCrossAxis = true - } = evaluate(options, state); - const coords = { - x, - y - }; - const crossAxis = getSideAxis(placement); - const mainAxis = getOppositeAxis(crossAxis); - let mainAxisCoord = coords[mainAxis]; - let crossAxisCoord = coords[crossAxis]; - const rawOffset = evaluate(offset, state); - const computedOffset = typeof rawOffset === 'number' ? { - mainAxis: rawOffset, - crossAxis: 0 - } : { - mainAxis: 0, - crossAxis: 0, - ...rawOffset - }; - if (checkMainAxis) { - const len = mainAxis === 'y' ? 'height' : 'width'; - const limitMin = rects.reference[mainAxis] - rects.floating[len] + computedOffset.mainAxis; - const limitMax = rects.reference[mainAxis] + rects.reference[len] - computedOffset.mainAxis; - if (mainAxisCoord < limitMin) { - mainAxisCoord = limitMin; - } else if (mainAxisCoord > limitMax) { - mainAxisCoord = limitMax; - } - } - if (checkCrossAxis) { - var _middlewareData$offse, _middlewareData$offse2; - const len = mainAxis === 'y' ? 'width' : 'height'; - const isOriginSide = originSides.has(getSide(placement)); - const limitMin = rects.reference[crossAxis] - rects.floating[len] + (isOriginSide ? ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse[crossAxis]) || 0 : 0) + (isOriginSide ? 0 : computedOffset.crossAxis); - const limitMax = rects.reference[crossAxis] + rects.reference[len] + (isOriginSide ? 0 : ((_middlewareData$offse2 = middlewareData.offset) == null ? void 0 : _middlewareData$offse2[crossAxis]) || 0) - (isOriginSide ? computedOffset.crossAxis : 0); - if (crossAxisCoord < limitMin) { - crossAxisCoord = limitMin; - } else if (crossAxisCoord > limitMax) { - crossAxisCoord = limitMax; - } - } - return { - [mainAxis]: mainAxisCoord, - [crossAxis]: crossAxisCoord - }; - } - }; - }; - - /** - * Provides data that allows you to change the size of the floating element — - * for instance, prevent it from overflowing the clipping boundary or match the - * width of the reference element. - * @see https://floating-ui.com/docs/size - */ - const size = function (options) { - if (options === void 0) { - options = {}; - } - return { - name: 'size', - options, - async fn(state) { - var _state$middlewareData, _state$middlewareData2; - const { - placement, - rects, - platform, - elements - } = state; - const { - apply = () => {}, - ...detectOverflowOptions - } = evaluate(options, state); - const overflow = await detectOverflow(state, detectOverflowOptions); - const side = getSide(placement); - const alignment = getAlignment(placement); - const isYAxis = getSideAxis(placement) === 'y'; - const { - width, - height - } = rects.floating; - let heightSide; - let widthSide; - if (side === 'top' || side === 'bottom') { - heightSide = side; - widthSide = alignment === ((await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating))) ? 'start' : 'end') ? 'left' : 'right'; - } else { - widthSide = side; - heightSide = alignment === 'end' ? 'top' : 'bottom'; - } - const maximumClippingHeight = height - overflow.top - overflow.bottom; - const maximumClippingWidth = width - overflow.left - overflow.right; - const overflowAvailableHeight = min(height - overflow[heightSide], maximumClippingHeight); - const overflowAvailableWidth = min(width - overflow[widthSide], maximumClippingWidth); - const noShift = !state.middlewareData.shift; - let availableHeight = overflowAvailableHeight; - let availableWidth = overflowAvailableWidth; - if ((_state$middlewareData = state.middlewareData.shift) != null && _state$middlewareData.enabled.x) { - availableWidth = maximumClippingWidth; - } - if ((_state$middlewareData2 = state.middlewareData.shift) != null && _state$middlewareData2.enabled.y) { - availableHeight = maximumClippingHeight; - } - if (noShift && !alignment) { - const xMin = max(overflow.left, 0); - const xMax = max(overflow.right, 0); - const yMin = max(overflow.top, 0); - const yMax = max(overflow.bottom, 0); - if (isYAxis) { - availableWidth = width - 2 * (xMin !== 0 || xMax !== 0 ? xMin + xMax : max(overflow.left, overflow.right)); - } else { - availableHeight = height - 2 * (yMin !== 0 || yMax !== 0 ? yMin + yMax : max(overflow.top, overflow.bottom)); - } - } - await apply({ - ...state, - availableWidth, - availableHeight - }); - const nextDimensions = await platform.getDimensions(elements.floating); - if (width !== nextDimensions.width || height !== nextDimensions.height) { - return { - reset: { - rects: true - } - }; - } - return {}; - } - }; - }; - - exports.arrow = arrow; - exports.autoPlacement = autoPlacement; - exports.computePosition = computePosition; - exports.detectOverflow = detectOverflow; - exports.flip = flip; - exports.hide = hide; - exports.inline = inline; - exports.limitShift = limitShift; - exports.offset = offset; - exports.rectToClientRect = rectToClientRect; - exports.shift = shift; - exports.size = size; - -})); diff --git a/node_modules/@floating-ui/core/dist/floating-ui.core.umd.min.js b/node_modules/@floating-ui/core/dist/floating-ui.core.umd.min.js deleted file mode 100644 index 4d5eb469..00000000 --- a/node_modules/@floating-ui/core/dist/floating-ui.core.umd.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).FloatingUICore={})}(this,(function(t){"use strict";const e=["top","right","bottom","left"],n=["start","end"],i=e.reduce(((t,e)=>t.concat(e,e+"-"+n[0],e+"-"+n[1])),[]),o=Math.min,r=Math.max,a={left:"right",right:"left",bottom:"top",top:"bottom"},l={start:"end",end:"start"};function s(t,e,n){return r(t,o(e,n))}function f(t,e){return"function"==typeof t?t(e):t}function c(t){return t.split("-")[0]}function m(t){return t.split("-")[1]}function u(t){return"x"===t?"y":"x"}function d(t){return"y"===t?"height":"width"}const g=new Set(["top","bottom"]);function p(t){return g.has(c(t))?"y":"x"}function h(t){return u(p(t))}function y(t,e,n){void 0===n&&(n=!1);const i=m(t),o=h(t),r=d(o);let a="x"===o?i===(n?"end":"start")?"right":"left":"start"===i?"bottom":"top";return e.reference[r]>e.floating[r]&&(a=P(a)),[a,P(a)]}function w(t){return t.replace(/start|end/g,(t=>l[t]))}const x=["left","right"],v=["right","left"],b=["top","bottom"],A=["bottom","top"];function R(t,e,n,i){const o=m(t);let r=function(t,e,n){switch(t){case"top":case"bottom":return n?e?v:x:e?x:v;case"left":case"right":return e?b:A;default:return[]}}(c(t),"start"===n,i);return o&&(r=r.map((t=>t+"-"+o)),e&&(r=r.concat(r.map(w)))),r}function P(t){return t.replace(/left|right|bottom|top/g,(t=>a[t]))}function D(t){return"number"!=typeof t?function(t){return{top:0,right:0,bottom:0,left:0,...t}}(t):{top:t,right:t,bottom:t,left:t}}function T(t){const{x:e,y:n,width:i,height:o}=t;return{width:i,height:o,top:n,left:e,right:e+i,bottom:n+o,x:e,y:n}}function O(t,e,n){let{reference:i,floating:o}=t;const r=p(e),a=h(e),l=d(a),s=c(e),f="y"===r,u=i.x+i.width/2-o.width/2,g=i.y+i.height/2-o.height/2,y=i[l]/2-o[l]/2;let w;switch(s){case"top":w={x:u,y:i.y-o.height};break;case"bottom":w={x:u,y:i.y+i.height};break;case"right":w={x:i.x+i.width,y:g};break;case"left":w={x:i.x-o.width,y:g};break;default:w={x:i.x,y:i.y}}switch(m(e)){case"start":w[a]-=y*(n&&f?-1:1);break;case"end":w[a]+=y*(n&&f?-1:1)}return w}async function E(t,e){var n;void 0===e&&(e={});const{x:i,y:o,platform:r,rects:a,elements:l,strategy:s}=t,{boundary:c="clippingAncestors",rootBoundary:m="viewport",elementContext:u="floating",altBoundary:d=!1,padding:g=0}=f(e,t),p=D(g),h=l[d?"floating"===u?"reference":"floating":u],y=T(await r.getClippingRect({element:null==(n=await(null==r.isElement?void 0:r.isElement(h)))||n?h:h.contextElement||await(null==r.getDocumentElement?void 0:r.getDocumentElement(l.floating)),boundary:c,rootBoundary:m,strategy:s})),w="floating"===u?{x:i,y:o,width:a.floating.width,height:a.floating.height}:a.reference,x=await(null==r.getOffsetParent?void 0:r.getOffsetParent(l.floating)),v=await(null==r.isElement?void 0:r.isElement(x))&&await(null==r.getScale?void 0:r.getScale(x))||{x:1,y:1},b=T(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:w,offsetParent:x,strategy:s}):w);return{top:(y.top-b.top+p.top)/v.y,bottom:(b.bottom-y.bottom+p.bottom)/v.y,left:(y.left-b.left+p.left)/v.x,right:(b.right-y.right+p.right)/v.x}}function L(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function k(t){return e.some((e=>t[e]>=0))}function C(t){const e=o(...t.map((t=>t.left))),n=o(...t.map((t=>t.top)));return{x:e,y:n,width:r(...t.map((t=>t.right)))-e,height:r(...t.map((t=>t.bottom)))-n}}const S=new Set(["left","top"]);t.arrow=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:i,placement:r,rects:a,platform:l,elements:c,middlewareData:u}=e,{element:g,padding:p=0}=f(t,e)||{};if(null==g)return{};const y=D(p),w={x:n,y:i},x=h(r),v=d(x),b=await l.getDimensions(g),A="y"===x,R=A?"top":"left",P=A?"bottom":"right",T=A?"clientHeight":"clientWidth",O=a.reference[v]+a.reference[x]-w[x]-a.floating[v],E=w[x]-a.reference[x],L=await(null==l.getOffsetParent?void 0:l.getOffsetParent(g));let k=L?L[T]:0;k&&await(null==l.isElement?void 0:l.isElement(L))||(k=c.floating[T]||a.floating[v]);const C=O/2-E/2,S=k/2-b[v]/2-1,B=o(y[R],S),H=o(y[P],S),F=B,j=k-b[v]-H,z=k/2-b[v]/2+C,M=s(F,z,j),V=!u.arrow&&null!=m(r)&&z!==M&&a.reference[v]/2-(zm(e)===t)),...n.filter((e=>m(e)!==t))]:n.filter((t=>c(t)===t))).filter((n=>!t||m(n)===t||!!e&&w(n)!==n))}(p||null,x,h):h,A=await E(e,v),R=(null==(n=l.autoPlacement)?void 0:n.index)||0,P=b[R];if(null==P)return{};const D=y(P,a,await(null==u.isRTL?void 0:u.isRTL(d.floating)));if(s!==P)return{reset:{placement:b[0]}};const T=[A[c(P)],A[D[0]],A[D[1]]],O=[...(null==(o=l.autoPlacement)?void 0:o.overflows)||[],{placement:P,overflows:T}],L=b[R+1];if(L)return{data:{index:R+1,overflows:O},reset:{placement:L}};const k=O.map((t=>{const e=m(t.placement);return[t.placement,e&&g?t.overflows.slice(0,2).reduce(((t,e)=>t+e),0):t.overflows[0],t.overflows]})).sort(((t,e)=>t[1]-e[1])),C=(null==(r=k.filter((t=>t[2].slice(0,m(t[0])?2:3).every((t=>t<=0))))[0])?void 0:r[0])||k[0][0];return C!==s?{data:{index:R+1,overflows:O},reset:{placement:C}}:{}}}},t.computePosition=async(t,e,n)=>{const{placement:i="bottom",strategy:o="absolute",middleware:r=[],platform:a}=n,l=r.filter(Boolean),s=await(null==a.isRTL?void 0:a.isRTL(e));let f=await a.getElementRects({reference:t,floating:e,strategy:o}),{x:c,y:m}=O(f,i,s),u=i,d={},g=0;for(let n=0;nt<=0))){var F,j;const t=((null==(F=r.flip)?void 0:F.index)||0)+1,e=C[t];if(e){if(!("alignment"===d&&D!==p(e))||H.every((t=>p(t.placement)!==D||t.overflows[0]>0)))return{data:{index:t,overflows:H},reset:{placement:e}}}let n=null==(j=H.filter((t=>t.overflows[0]<=0)).sort(((t,e)=>t.overflows[1]-e.overflows[1]))[0])?void 0:j.placement;if(!n)switch(h){case"bestFit":{var z;const t=null==(z=H.filter((t=>{if(k){const e=p(t.placement);return e===D||"y"===e}return!0})).map((t=>[t.placement,t.overflows.filter((t=>t>0)).reduce(((t,e)=>t+e),0)])).sort(((t,e)=>t[1]-e[1]))[0])?void 0:z[0];t&&(n=t);break}case"initialPlacement":n=l}if(o!==n)return{reset:{placement:n}}}return{}}}},t.hide=function(t){return void 0===t&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:i="referenceHidden",...o}=f(t,e);switch(i){case"referenceHidden":{const t=L(await E(e,{...o,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:t,referenceHidden:k(t)}}}case"escaped":{const t=L(await E(e,{...o,altBoundary:!0}),n.floating);return{data:{escapedOffsets:t,escaped:k(t)}}}default:return{}}}}},t.inline=function(t){return void 0===t&&(t={}),{name:"inline",options:t,async fn(e){const{placement:n,elements:i,rects:a,platform:l,strategy:s}=e,{padding:m=2,x:u,y:d}=f(t,e),g=Array.from(await(null==l.getClientRects?void 0:l.getClientRects(i.reference))||[]),h=function(t){const e=t.slice().sort(((t,e)=>t.y-e.y)),n=[];let i=null;for(let t=0;ti.height/2?n.push([o]):n[n.length-1].push(o),i=o}return n.map((t=>T(C(t))))}(g),y=T(C(g)),w=D(m);const x=await l.getElementRects({reference:{getBoundingClientRect:function(){if(2===h.length&&h[0].left>h[1].right&&null!=u&&null!=d)return h.find((t=>u>t.left-w.left&&ut.top-w.top&&d=2){if("y"===p(n)){const t=h[0],e=h[h.length-1],i="top"===c(n),o=t.top,r=e.bottom,a=i?t.left:e.left,l=i?t.right:e.right;return{top:o,bottom:r,left:a,right:l,width:l-a,height:r-o,x:a,y:o}}const t="left"===c(n),e=r(...h.map((t=>t.right))),i=o(...h.map((t=>t.left))),a=h.filter((n=>t?n.left===i:n.right===e)),l=a[0].top,s=a[a.length-1].bottom;return{top:l,bottom:s,left:i,right:e,width:e-i,height:s-l,x:i,y:l}}return y}},floating:i.floating,strategy:s});return a.reference.x!==x.reference.x||a.reference.y!==x.reference.y||a.reference.width!==x.reference.width||a.reference.height!==x.reference.height?{reset:{rects:x}}:{}}}},t.limitShift=function(t){return void 0===t&&(t={}),{options:t,fn(e){const{x:n,y:i,placement:o,rects:r,middlewareData:a}=e,{offset:l=0,mainAxis:s=!0,crossAxis:m=!0}=f(t,e),d={x:n,y:i},g=p(o),h=u(g);let y=d[h],w=d[g];const x=f(l,e),v="number"==typeof x?{mainAxis:x,crossAxis:0}:{mainAxis:0,crossAxis:0,...x};if(s){const t="y"===h?"height":"width",e=r.reference[h]-r.floating[t]+v.mainAxis,n=r.reference[h]+r.reference[t]-v.mainAxis;yn&&(y=n)}if(m){var b,A;const t="y"===h?"width":"height",e=S.has(c(o)),n=r.reference[g]-r.floating[t]+(e&&(null==(b=a.offset)?void 0:b[g])||0)+(e?0:v.crossAxis),i=r.reference[g]+r.reference[t]+(e?0:(null==(A=a.offset)?void 0:A[g])||0)-(e?v.crossAxis:0);wi&&(w=i)}return{[h]:y,[g]:w}}}},t.offset=function(t){return void 0===t&&(t=0),{name:"offset",options:t,async fn(e){var n,i;const{x:o,y:r,placement:a,middlewareData:l}=e,s=await async function(t,e){const{placement:n,platform:i,elements:o}=t,r=await(null==i.isRTL?void 0:i.isRTL(o.floating)),a=c(n),l=m(n),s="y"===p(n),u=S.has(a)?-1:1,d=r&&s?-1:1,g=f(e,t);let{mainAxis:h,crossAxis:y,alignmentAxis:w}="number"==typeof g?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:g.mainAxis||0,crossAxis:g.crossAxis||0,alignmentAxis:g.alignmentAxis};return l&&"number"==typeof w&&(y="end"===l?-1*w:w),s?{x:y*d,y:h*u}:{x:h*u,y:y*d}}(e,t);return a===(null==(n=l.offset)?void 0:n.placement)&&null!=(i=l.arrow)&&i.alignmentOffset?{}:{x:o+s.x,y:r+s.y,data:{...s,placement:a}}}}},t.rectToClientRect=T,t.shift=function(t){return void 0===t&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:i,placement:o}=e,{mainAxis:r=!0,crossAxis:a=!1,limiter:l={fn:t=>{let{x:e,y:n}=t;return{x:e,y:n}}},...m}=f(t,e),d={x:n,y:i},g=await E(e,m),h=p(c(o)),y=u(h);let w=d[y],x=d[h];if(r){const t="y"===y?"bottom":"right";w=s(w+g["y"===y?"top":"left"],w,w-g[t])}if(a){const t="y"===h?"bottom":"right";x=s(x+g["y"===h?"top":"left"],x,x-g[t])}const v=l.fn({...e,[y]:w,[h]:x});return{...v,data:{x:v.x-n,y:v.y-i,enabled:{[y]:r,[h]:a}}}}}},t.size=function(t){return void 0===t&&(t={}),{name:"size",options:t,async fn(e){var n,i;const{placement:a,rects:l,platform:s,elements:u}=e,{apply:d=()=>{},...g}=f(t,e),h=await E(e,g),y=c(a),w=m(a),x="y"===p(a),{width:v,height:b}=l.floating;let A,R;"top"===y||"bottom"===y?(A=y,R=w===(await(null==s.isRTL?void 0:s.isRTL(u.floating))?"start":"end")?"left":"right"):(R=y,A="end"===w?"top":"bottom");const P=b-h.top-h.bottom,D=v-h.left-h.right,T=o(b-h[A],P),O=o(v-h[R],D),L=!e.middlewareData.shift;let k=T,C=O;if(null!=(n=e.middlewareData.shift)&&n.enabled.x&&(C=D),null!=(i=e.middlewareData.shift)&&i.enabled.y&&(k=P),L&&!w){const t=r(h.left,0),e=r(h.right,0),n=r(h.top,0),i=r(h.bottom,0);x?C=v-2*(0!==t||0!==e?t+e:r(h.left,h.right)):k=b-2*(0!==n||0!==i?n+i:r(h.top,h.bottom))}await d({...e,availableWidth:C,availableHeight:k});const S=await s.getDimensions(u.floating);return v!==S.width||b!==S.height?{reset:{rects:!0}}:{}}}}})); diff --git a/node_modules/@floating-ui/core/package.json b/node_modules/@floating-ui/core/package.json deleted file mode 100644 index 63279a6e..00000000 --- a/node_modules/@floating-ui/core/package.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "name": "@floating-ui/core", - "version": "1.7.3", - "description": "Positioning library for floating elements: tooltips, popovers, dropdowns, and more", - "publishConfig": { - "access": "public" - }, - "main": "./dist/floating-ui.core.umd.js", - "module": "./dist/floating-ui.core.esm.js", - "unpkg": "./dist/floating-ui.core.umd.min.js", - "types": "./dist/floating-ui.core.d.ts", - "exports": { - "./package.json": "./package.json", - ".": { - "import": { - "types": "./dist/floating-ui.core.d.mts", - "default": "./dist/floating-ui.core.mjs" - }, - "types": "./dist/floating-ui.core.d.ts", - "module": "./dist/floating-ui.core.esm.js", - "default": "./dist/floating-ui.core.umd.js" - } - }, - "sideEffects": false, - "files": [ - "dist" - ], - "author": "atomiks", - "license": "MIT", - "bugs": "https://github.com/floating-ui/floating-ui", - "repository": { - "type": "git", - "url": "https://github.com/floating-ui/floating-ui.git", - "directory": "packages/core" - }, - "homepage": "https://floating-ui.com", - "keywords": [ - "tooltip", - "popover", - "dropdown", - "menu", - "popup", - "positioning" - ], - "dependencies": { - "@floating-ui/utils": "^0.2.10" - }, - "devDependencies": { - "config": "0.0.0" - }, - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch", - "lint": "eslint .", - "format": "prettier --write .", - "clean": "rimraf dist out-tsc", - "dev": "rollup -c -w", - "build": "rollup -c", - "build:api": "build-api --tsc tsconfig.lib.json", - "publint": "publint", - "typecheck": "tsc -b" - } -} \ No newline at end of file diff --git a/node_modules/@floating-ui/dom/LICENSE b/node_modules/@floating-ui/dom/LICENSE deleted file mode 100644 index 639cdc6c..00000000 --- a/node_modules/@floating-ui/dom/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -MIT License - -Copyright (c) 2021-present Floating UI contributors - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/@floating-ui/dom/README.md b/node_modules/@floating-ui/dom/README.md deleted file mode 100644 index 47ef9272..00000000 --- a/node_modules/@floating-ui/dom/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# @floating-ui/dom - -This is the library to use Floating UI on the web, wrapping `@floating-ui/core` -with DOM interface logic. diff --git a/node_modules/@floating-ui/dom/dist/floating-ui.dom.browser.min.mjs b/node_modules/@floating-ui/dom/dist/floating-ui.dom.browser.min.mjs deleted file mode 100644 index f1d7f07e..00000000 --- a/node_modules/@floating-ui/dom/dist/floating-ui.dom.browser.min.mjs +++ /dev/null @@ -1 +0,0 @@ -import{rectToClientRect as t,arrow as e,autoPlacement as n,detectOverflow as o,flip as i,hide as r,inline as c,limitShift as l,offset as s,shift as f,size as u,computePosition as a}from"@floating-ui/core";const h=Math.min,d=Math.max,p=Math.round,g=Math.floor,m=t=>({x:t,y:t});function y(){return"undefined"!=typeof window}function w(t){return b(t)?(t.nodeName||"").toLowerCase():"#document"}function x(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function v(t){var e;return null==(e=(b(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function b(t){return!!y()&&(t instanceof Node||t instanceof x(t).Node)}function L(t){return!!y()&&(t instanceof Element||t instanceof x(t).Element)}function R(t){return!!y()&&(t instanceof HTMLElement||t instanceof x(t).HTMLElement)}function T(t){return!(!y()||"undefined"==typeof ShadowRoot)&&(t instanceof ShadowRoot||t instanceof x(t).ShadowRoot)}const S=new Set(["inline","contents"]);function C(t){const{overflow:e,overflowX:n,overflowY:o,display:i}=A(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!S.has(i)}const E=new Set(["table","td","th"]);function F(t){return E.has(w(t))}const D=[":popover-open",":modal"];function W(t){return D.some((e=>{try{return t.matches(e)}catch(t){return!1}}))}const O=["transform","translate","scale","rotate","perspective"],H=["transform","translate","scale","rotate","perspective","filter"],M=["paint","layout","strict","content"];function P(t){const e=z(),n=L(t)?A(t):t;return O.some((t=>!!n[t]&&"none"!==n[t]))||!!n.containerType&&"normal"!==n.containerType||!e&&!!n.backdropFilter&&"none"!==n.backdropFilter||!e&&!!n.filter&&"none"!==n.filter||H.some((t=>(n.willChange||"").includes(t)))||M.some((t=>(n.contain||"").includes(t)))}function z(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const B=new Set(["html","body","#document"]);function V(t){return B.has(w(t))}function A(t){return x(t).getComputedStyle(t)}function N(t){return L(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function k(t){if("html"===w(t))return t;const e=t.assignedSlot||t.parentNode||T(t)&&t.host||v(t);return T(e)?e.host:e}function I(t){const e=k(t);return V(e)?t.ownerDocument?t.ownerDocument.body:t.body:R(e)&&C(e)?e:I(e)}function q(t,e,n){var o;void 0===e&&(e=[]),void 0===n&&(n=!0);const i=I(t),r=i===(null==(o=t.ownerDocument)?void 0:o.body),c=x(i);if(r){const t=X(c);return e.concat(c,c.visualViewport||[],C(i)?i:[],t&&n?q(t):[])}return e.concat(i,q(i,[],n))}function X(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Y(t){const e=A(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const i=R(t),r=i?t.offsetWidth:n,c=i?t.offsetHeight:o,l=p(n)!==r||p(o)!==c;return l&&(n=r,o=c),{width:n,height:o,$:l}}function $(t){return L(t)?t:t.contextElement}function _(t){const e=$(t);if(!R(e))return m(1);const n=e.getBoundingClientRect(),{width:o,height:i,$:r}=Y(e);let c=(r?p(n.width):n.width)/o,l=(r?p(n.height):n.height)/i;return c&&Number.isFinite(c)||(c=1),l&&Number.isFinite(l)||(l=1),{x:c,y:l}}const j=m(0);function G(t){const e=x(t);return z()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:j}function J(e,n,o,i){void 0===n&&(n=!1),void 0===o&&(o=!1);const r=e.getBoundingClientRect(),c=$(e);let l=m(1);n&&(i?L(i)&&(l=_(i)):l=_(e));const s=function(t,e,n){return void 0===e&&(e=!1),!(!n||e&&n!==x(t))&&e}(c,o,i)?G(c):m(0);let f=(r.left+s.x)/l.x,u=(r.top+s.y)/l.y,a=r.width/l.x,h=r.height/l.y;if(c){const t=x(c),e=i&&L(i)?x(i):i;let n=t,o=X(n);for(;o&&i&&e!==n;){const t=_(o),e=o.getBoundingClientRect(),i=A(o),r=e.left+(o.clientLeft+parseFloat(i.paddingLeft))*t.x,c=e.top+(o.clientTop+parseFloat(i.paddingTop))*t.y;f*=t.x,u*=t.y,a*=t.x,h*=t.y,f+=r,u+=c,n=x(o),o=X(n)}}return t({width:a,height:h,x:f,y:u})}function K(t,e){const n=N(t).scrollLeft;return e?e.left+n:J(v(t)).left+n}function Q(t,e){const n=t.getBoundingClientRect();return{x:n.left+e.scrollLeft-K(t,n),y:n.top+e.scrollTop}}const U=new Set(["absolute","fixed"]);function Z(e,n,o){let i;if("viewport"===n)i=function(t,e){const n=x(t),o=v(t),i=n.visualViewport;let r=o.clientWidth,c=o.clientHeight,l=0,s=0;if(i){r=i.width,c=i.height;const t=z();(!t||t&&"fixed"===e)&&(l=i.offsetLeft,s=i.offsetTop)}const f=K(o);if(f<=0){const t=o.ownerDocument,e=t.body,n=getComputedStyle(e),i="CSS1Compat"===t.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,c=Math.abs(o.clientWidth-e.clientWidth-i);c<=25&&(r-=c)}else f<=25&&(r+=f);return{width:r,height:c,x:l,y:s}}(e,o);else if("document"===n)i=function(t){const e=v(t),n=N(t),o=t.ownerDocument.body,i=d(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),r=d(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let c=-n.scrollLeft+K(t);const l=-n.scrollTop;return"rtl"===A(o).direction&&(c+=d(e.clientWidth,o.clientWidth)-i),{width:i,height:r,x:c,y:l}}(v(e));else if(L(n))i=function(t,e){const n=J(t,!0,"fixed"===e),o=n.top+t.clientTop,i=n.left+t.clientLeft,r=R(t)?_(t):m(1);return{width:t.clientWidth*r.x,height:t.clientHeight*r.y,x:i*r.x,y:o*r.y}}(n,o);else{const t=G(e);i={x:n.x-t.x,y:n.y-t.y,width:n.width,height:n.height}}return t(i)}function tt(t,e){const n=k(t);return!(n===e||!L(n)||V(n))&&("fixed"===A(n).position||tt(n,e))}function et(t,e,n){const o=R(e),i=v(e),r="fixed"===n,c=J(t,!0,r,e);let l={scrollLeft:0,scrollTop:0};const s=m(0);function f(){s.x=K(i)}if(o||!o&&!r)if(("body"!==w(e)||C(i))&&(l=N(e)),o){const t=J(e,!0,r,e);s.x=t.x+e.clientLeft,s.y=t.y+e.clientTop}else i&&f();r&&!o&&i&&f();const u=!i||o||r?m(0):Q(i,l);return{x:c.left+l.scrollLeft-s.x-u.x,y:c.top+l.scrollTop-s.y-u.y,width:c.width,height:c.height}}function nt(t){return"static"===A(t).position}function ot(t,e){if(!R(t)||"fixed"===A(t).position)return null;if(e)return e(t);let n=t.offsetParent;return v(t)===n&&(n=n.ownerDocument.body),n}function it(t,e){const n=x(t);if(W(t))return n;if(!R(t)){let e=k(t);for(;e&&!V(e);){if(L(e)&&!nt(e))return e;e=k(e)}return n}let o=ot(t,e);for(;o&&F(o)&&nt(o);)o=ot(o,e);return o&&V(o)&&nt(o)&&!P(o)?n:o||function(t){let e=k(t);for(;R(e)&&!V(e);){if(P(e))return e;if(W(e))return null;e=k(e)}return null}(t)||n}const rt={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{elements:e,rect:n,offsetParent:o,strategy:i}=t;const r="fixed"===i,c=v(o),l=!!e&&W(e.floating);if(o===c||l&&r)return n;let s={scrollLeft:0,scrollTop:0},f=m(1);const u=m(0),a=R(o);if((a||!a&&!r)&&(("body"!==w(o)||C(c))&&(s=N(o)),R(o))){const t=J(o);f=_(o),u.x=t.x+o.clientLeft,u.y=t.y+o.clientTop}const h=!c||a||r?m(0):Q(c,s);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-s.scrollLeft*f.x+u.x+h.x,y:n.y*f.y-s.scrollTop*f.y+u.y+h.y}},getDocumentElement:v,getClippingRect:function(t){let{element:e,boundary:n,rootBoundary:o,strategy:i}=t;const r=[..."clippingAncestors"===n?W(e)?[]:function(t,e){const n=e.get(t);if(n)return n;let o=q(t,[],!1).filter((t=>L(t)&&"body"!==w(t))),i=null;const r="fixed"===A(t).position;let c=r?k(t):t;for(;L(c)&&!V(c);){const e=A(c),n=P(c);n||"fixed"!==e.position||(i=null),(r?!n&&!i:!n&&"static"===e.position&&i&&U.has(i.position)||C(c)&&!n&&tt(t,c))?o=o.filter((t=>t!==c)):i=e,c=k(c)}return e.set(t,o),o}(e,this._c):[].concat(n),o],c=r[0],l=r.reduce(((t,n)=>{const o=Z(e,n,i);return t.top=d(o.top,t.top),t.right=h(o.right,t.right),t.bottom=h(o.bottom,t.bottom),t.left=d(o.left,t.left),t}),Z(e,c,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}},getOffsetParent:it,getElementRects:async function(t){const e=this.getOffsetParent||it,n=this.getDimensions,o=await n(t.floating);return{reference:et(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}},getClientRects:function(t){return Array.from(t.getClientRects())},getDimensions:function(t){const{width:e,height:n}=Y(t);return{width:e,height:n}},getScale:_,isElement:L,isRTL:function(t){return"rtl"===A(t).direction}};function ct(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function lt(t,e,n,o){void 0===o&&(o={});const{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:c="function"==typeof ResizeObserver,layoutShift:l="function"==typeof IntersectionObserver,animationFrame:s=!1}=o,f=$(t),u=i||r?[...f?q(f):[],...q(e)]:[];u.forEach((t=>{i&&t.addEventListener("scroll",n,{passive:!0}),r&&t.addEventListener("resize",n)}));const a=f&&l?function(t,e){let n,o=null;const i=v(t);function r(){var t;clearTimeout(n),null==(t=o)||t.disconnect(),o=null}return function c(l,s){void 0===l&&(l=!1),void 0===s&&(s=1),r();const f=t.getBoundingClientRect(),{left:u,top:a,width:p,height:m}=f;if(l||e(),!p||!m)return;const y={rootMargin:-g(a)+"px "+-g(i.clientWidth-(u+p))+"px "+-g(i.clientHeight-(a+m))+"px "+-g(u)+"px",threshold:d(0,h(1,s))||1};let w=!0;function x(e){const o=e[0].intersectionRatio;if(o!==s){if(!w)return c();o?c(!1,o):n=setTimeout((()=>{c(!1,1e-7)}),1e3)}1!==o||ct(f,t.getBoundingClientRect())||c(),w=!1}try{o=new IntersectionObserver(x,{...y,root:i.ownerDocument})}catch(t){o=new IntersectionObserver(x,y)}o.observe(t)}(!0),r}(f,n):null;let p,m=-1,y=null;c&&(y=new ResizeObserver((t=>{let[o]=t;o&&o.target===f&&y&&(y.unobserve(e),cancelAnimationFrame(m),m=requestAnimationFrame((()=>{var t;null==(t=y)||t.observe(e)}))),n()})),f&&!s&&y.observe(f),y.observe(e));let w=s?J(t):null;return s&&function e(){const o=J(t);w&&!ct(w,o)&&n();w=o,p=requestAnimationFrame(e)}(),n(),()=>{var t;u.forEach((t=>{i&&t.removeEventListener("scroll",n),r&&t.removeEventListener("resize",n)})),null==a||a(),null==(t=y)||t.disconnect(),y=null,s&&cancelAnimationFrame(p)}}const st=o,ft=s,ut=n,at=f,ht=i,dt=u,pt=r,gt=e,mt=c,yt=l,wt=(t,e,n)=>{const o=new Map,i={platform:rt,...n},r={...i.platform,_c:o};return a(t,e,{...i,platform:r})};export{gt as arrow,ut as autoPlacement,lt as autoUpdate,wt as computePosition,st as detectOverflow,ht as flip,q as getOverflowAncestors,pt as hide,mt as inline,yt as limitShift,ft as offset,rt as platform,at as shift,dt as size}; diff --git a/node_modules/@floating-ui/dom/dist/floating-ui.dom.browser.mjs b/node_modules/@floating-ui/dom/dist/floating-ui.dom.browser.mjs deleted file mode 100644 index 94459791..00000000 --- a/node_modules/@floating-ui/dom/dist/floating-ui.dom.browser.mjs +++ /dev/null @@ -1,948 +0,0 @@ -import { rectToClientRect, arrow as arrow$1, autoPlacement as autoPlacement$1, detectOverflow as detectOverflow$1, flip as flip$1, hide as hide$1, inline as inline$1, limitShift as limitShift$1, offset as offset$1, shift as shift$1, size as size$1, computePosition as computePosition$1 } from '@floating-ui/core'; - -/** - * Custom positioning reference element. - * @see https://floating-ui.com/docs/virtual-elements - */ - -const min = Math.min; -const max = Math.max; -const round = Math.round; -const floor = Math.floor; -const createCoords = v => ({ - x: v, - y: v -}); - -function hasWindow() { - return typeof window !== 'undefined'; -} -function getNodeName(node) { - if (isNode(node)) { - return (node.nodeName || '').toLowerCase(); - } - // Mocked nodes in testing environments may not be instances of Node. By - // returning `#document` an infinite loop won't occur. - // https://github.com/floating-ui/floating-ui/issues/2317 - return '#document'; -} -function getWindow(node) { - var _node$ownerDocument; - return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window; -} -function getDocumentElement(node) { - var _ref; - return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement; -} -function isNode(value) { - if (!hasWindow()) { - return false; - } - return value instanceof Node || value instanceof getWindow(value).Node; -} -function isElement(value) { - if (!hasWindow()) { - return false; - } - return value instanceof Element || value instanceof getWindow(value).Element; -} -function isHTMLElement(value) { - if (!hasWindow()) { - return false; - } - return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement; -} -function isShadowRoot(value) { - if (!hasWindow() || typeof ShadowRoot === 'undefined') { - return false; - } - return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot; -} -const invalidOverflowDisplayValues = /*#__PURE__*/new Set(['inline', 'contents']); -function isOverflowElement(element) { - const { - overflow, - overflowX, - overflowY, - display - } = getComputedStyle$1(element); - return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !invalidOverflowDisplayValues.has(display); -} -const tableElements = /*#__PURE__*/new Set(['table', 'td', 'th']); -function isTableElement(element) { - return tableElements.has(getNodeName(element)); -} -const topLayerSelectors = [':popover-open', ':modal']; -function isTopLayer(element) { - return topLayerSelectors.some(selector => { - try { - return element.matches(selector); - } catch (_e) { - return false; - } - }); -} -const transformProperties = ['transform', 'translate', 'scale', 'rotate', 'perspective']; -const willChangeValues = ['transform', 'translate', 'scale', 'rotate', 'perspective', 'filter']; -const containValues = ['paint', 'layout', 'strict', 'content']; -function isContainingBlock(elementOrCss) { - const webkit = isWebKit(); - const css = isElement(elementOrCss) ? getComputedStyle$1(elementOrCss) : elementOrCss; - - // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block - // https://drafts.csswg.org/css-transforms-2/#individual-transforms - return transformProperties.some(value => css[value] ? css[value] !== 'none' : false) || (css.containerType ? css.containerType !== 'normal' : false) || !webkit && (css.backdropFilter ? css.backdropFilter !== 'none' : false) || !webkit && (css.filter ? css.filter !== 'none' : false) || willChangeValues.some(value => (css.willChange || '').includes(value)) || containValues.some(value => (css.contain || '').includes(value)); -} -function getContainingBlock(element) { - let currentNode = getParentNode(element); - while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) { - if (isContainingBlock(currentNode)) { - return currentNode; - } else if (isTopLayer(currentNode)) { - return null; - } - currentNode = getParentNode(currentNode); - } - return null; -} -function isWebKit() { - if (typeof CSS === 'undefined' || !CSS.supports) return false; - return CSS.supports('-webkit-backdrop-filter', 'none'); -} -const lastTraversableNodeNames = /*#__PURE__*/new Set(['html', 'body', '#document']); -function isLastTraversableNode(node) { - return lastTraversableNodeNames.has(getNodeName(node)); -} -function getComputedStyle$1(element) { - return getWindow(element).getComputedStyle(element); -} -function getNodeScroll(element) { - if (isElement(element)) { - return { - scrollLeft: element.scrollLeft, - scrollTop: element.scrollTop - }; - } - return { - scrollLeft: element.scrollX, - scrollTop: element.scrollY - }; -} -function getParentNode(node) { - if (getNodeName(node) === 'html') { - return node; - } - const result = - // Step into the shadow DOM of the parent of a slotted node. - node.assignedSlot || - // DOM Element detected. - node.parentNode || - // ShadowRoot detected. - isShadowRoot(node) && node.host || - // Fallback. - getDocumentElement(node); - return isShadowRoot(result) ? result.host : result; -} -function getNearestOverflowAncestor(node) { - const parentNode = getParentNode(node); - if (isLastTraversableNode(parentNode)) { - return node.ownerDocument ? node.ownerDocument.body : node.body; - } - if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) { - return parentNode; - } - return getNearestOverflowAncestor(parentNode); -} -function getOverflowAncestors(node, list, traverseIframes) { - var _node$ownerDocument2; - if (list === void 0) { - list = []; - } - if (traverseIframes === void 0) { - traverseIframes = true; - } - const scrollableAncestor = getNearestOverflowAncestor(node); - const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body); - const win = getWindow(scrollableAncestor); - if (isBody) { - const frameElement = getFrameElement(win); - return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []); - } - return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes)); -} -function getFrameElement(win) { - return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null; -} - -function getCssDimensions(element) { - const css = getComputedStyle$1(element); - // In testing environments, the `width` and `height` properties are empty - // strings for SVG elements, returning NaN. Fallback to `0` in this case. - let width = parseFloat(css.width) || 0; - let height = parseFloat(css.height) || 0; - const hasOffset = isHTMLElement(element); - const offsetWidth = hasOffset ? element.offsetWidth : width; - const offsetHeight = hasOffset ? element.offsetHeight : height; - const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight; - if (shouldFallback) { - width = offsetWidth; - height = offsetHeight; - } - return { - width, - height, - $: shouldFallback - }; -} - -function unwrapElement(element) { - return !isElement(element) ? element.contextElement : element; -} - -function getScale(element) { - const domElement = unwrapElement(element); - if (!isHTMLElement(domElement)) { - return createCoords(1); - } - const rect = domElement.getBoundingClientRect(); - const { - width, - height, - $ - } = getCssDimensions(domElement); - let x = ($ ? round(rect.width) : rect.width) / width; - let y = ($ ? round(rect.height) : rect.height) / height; - - // 0, NaN, or Infinity should always fallback to 1. - - if (!x || !Number.isFinite(x)) { - x = 1; - } - if (!y || !Number.isFinite(y)) { - y = 1; - } - return { - x, - y - }; -} - -const noOffsets = /*#__PURE__*/createCoords(0); -function getVisualOffsets(element) { - const win = getWindow(element); - if (!isWebKit() || !win.visualViewport) { - return noOffsets; - } - return { - x: win.visualViewport.offsetLeft, - y: win.visualViewport.offsetTop - }; -} -function shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) { - if (isFixed === void 0) { - isFixed = false; - } - if (!floatingOffsetParent || isFixed && floatingOffsetParent !== getWindow(element)) { - return false; - } - return isFixed; -} - -function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) { - if (includeScale === void 0) { - includeScale = false; - } - if (isFixedStrategy === void 0) { - isFixedStrategy = false; - } - const clientRect = element.getBoundingClientRect(); - const domElement = unwrapElement(element); - let scale = createCoords(1); - if (includeScale) { - if (offsetParent) { - if (isElement(offsetParent)) { - scale = getScale(offsetParent); - } - } else { - scale = getScale(element); - } - } - const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0); - let x = (clientRect.left + visualOffsets.x) / scale.x; - let y = (clientRect.top + visualOffsets.y) / scale.y; - let width = clientRect.width / scale.x; - let height = clientRect.height / scale.y; - if (domElement) { - const win = getWindow(domElement); - const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent; - let currentWin = win; - let currentIFrame = getFrameElement(currentWin); - while (currentIFrame && offsetParent && offsetWin !== currentWin) { - const iframeScale = getScale(currentIFrame); - const iframeRect = currentIFrame.getBoundingClientRect(); - const css = getComputedStyle$1(currentIFrame); - const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x; - const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y; - x *= iframeScale.x; - y *= iframeScale.y; - width *= iframeScale.x; - height *= iframeScale.y; - x += left; - y += top; - currentWin = getWindow(currentIFrame); - currentIFrame = getFrameElement(currentWin); - } - } - return rectToClientRect({ - width, - height, - x, - y - }); -} - -// If has a CSS width greater than the viewport, then this will be -// incorrect for RTL. -function getWindowScrollBarX(element, rect) { - const leftScroll = getNodeScroll(element).scrollLeft; - if (!rect) { - return getBoundingClientRect(getDocumentElement(element)).left + leftScroll; - } - return rect.left + leftScroll; -} - -function getHTMLOffset(documentElement, scroll) { - const htmlRect = documentElement.getBoundingClientRect(); - const x = htmlRect.left + scroll.scrollLeft - getWindowScrollBarX(documentElement, htmlRect); - const y = htmlRect.top + scroll.scrollTop; - return { - x, - y - }; -} - -function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) { - let { - elements, - rect, - offsetParent, - strategy - } = _ref; - const isFixed = strategy === 'fixed'; - const documentElement = getDocumentElement(offsetParent); - const topLayer = elements ? isTopLayer(elements.floating) : false; - if (offsetParent === documentElement || topLayer && isFixed) { - return rect; - } - let scroll = { - scrollLeft: 0, - scrollTop: 0 - }; - let scale = createCoords(1); - const offsets = createCoords(0); - const isOffsetParentAnElement = isHTMLElement(offsetParent); - if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) { - if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) { - scroll = getNodeScroll(offsetParent); - } - if (isHTMLElement(offsetParent)) { - const offsetRect = getBoundingClientRect(offsetParent); - scale = getScale(offsetParent); - offsets.x = offsetRect.x + offsetParent.clientLeft; - offsets.y = offsetRect.y + offsetParent.clientTop; - } - } - const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0); - return { - width: rect.width * scale.x, - height: rect.height * scale.y, - x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x + htmlOffset.x, - y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y + htmlOffset.y - }; -} - -function getClientRects(element) { - return Array.from(element.getClientRects()); -} - -// Gets the entire size of the scrollable document area, even extending outside -// of the `` and `` rect bounds if horizontally scrollable. -function getDocumentRect(element) { - const html = getDocumentElement(element); - const scroll = getNodeScroll(element); - const body = element.ownerDocument.body; - const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth); - const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight); - let x = -scroll.scrollLeft + getWindowScrollBarX(element); - const y = -scroll.scrollTop; - if (getComputedStyle$1(body).direction === 'rtl') { - x += max(html.clientWidth, body.clientWidth) - width; - } - return { - width, - height, - x, - y - }; -} - -// Safety check: ensure the scrollbar space is reasonable in case this -// calculation is affected by unusual styles. -// Most scrollbars leave 15-18px of space. -const SCROLLBAR_MAX = 25; -function getViewportRect(element, strategy) { - const win = getWindow(element); - const html = getDocumentElement(element); - const visualViewport = win.visualViewport; - let width = html.clientWidth; - let height = html.clientHeight; - let x = 0; - let y = 0; - if (visualViewport) { - width = visualViewport.width; - height = visualViewport.height; - const visualViewportBased = isWebKit(); - if (!visualViewportBased || visualViewportBased && strategy === 'fixed') { - x = visualViewport.offsetLeft; - y = visualViewport.offsetTop; - } - } - const windowScrollbarX = getWindowScrollBarX(html); - // `overflow: hidden` + `scrollbar-gutter: stable` reduces the - // visual width of the but this is not considered in the size - // of `html.clientWidth`. - if (windowScrollbarX <= 0) { - const doc = html.ownerDocument; - const body = doc.body; - const bodyStyles = getComputedStyle(body); - const bodyMarginInline = doc.compatMode === 'CSS1Compat' ? parseFloat(bodyStyles.marginLeft) + parseFloat(bodyStyles.marginRight) || 0 : 0; - const clippingStableScrollbarWidth = Math.abs(html.clientWidth - body.clientWidth - bodyMarginInline); - if (clippingStableScrollbarWidth <= SCROLLBAR_MAX) { - width -= clippingStableScrollbarWidth; - } - } else if (windowScrollbarX <= SCROLLBAR_MAX) { - // If the scrollbar is on the left, the width needs to be extended - // by the scrollbar amount so there isn't extra space on the right. - width += windowScrollbarX; - } - return { - width, - height, - x, - y - }; -} - -const absoluteOrFixed = /*#__PURE__*/new Set(['absolute', 'fixed']); -// Returns the inner client rect, subtracting scrollbars if present. -function getInnerBoundingClientRect(element, strategy) { - const clientRect = getBoundingClientRect(element, true, strategy === 'fixed'); - const top = clientRect.top + element.clientTop; - const left = clientRect.left + element.clientLeft; - const scale = isHTMLElement(element) ? getScale(element) : createCoords(1); - const width = element.clientWidth * scale.x; - const height = element.clientHeight * scale.y; - const x = left * scale.x; - const y = top * scale.y; - return { - width, - height, - x, - y - }; -} -function getClientRectFromClippingAncestor(element, clippingAncestor, strategy) { - let rect; - if (clippingAncestor === 'viewport') { - rect = getViewportRect(element, strategy); - } else if (clippingAncestor === 'document') { - rect = getDocumentRect(getDocumentElement(element)); - } else if (isElement(clippingAncestor)) { - rect = getInnerBoundingClientRect(clippingAncestor, strategy); - } else { - const visualOffsets = getVisualOffsets(element); - rect = { - x: clippingAncestor.x - visualOffsets.x, - y: clippingAncestor.y - visualOffsets.y, - width: clippingAncestor.width, - height: clippingAncestor.height - }; - } - return rectToClientRect(rect); -} -function hasFixedPositionAncestor(element, stopNode) { - const parentNode = getParentNode(element); - if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) { - return false; - } - return getComputedStyle$1(parentNode).position === 'fixed' || hasFixedPositionAncestor(parentNode, stopNode); -} - -// A "clipping ancestor" is an `overflow` element with the characteristic of -// clipping (or hiding) child elements. This returns all clipping ancestors -// of the given element up the tree. -function getClippingElementAncestors(element, cache) { - const cachedResult = cache.get(element); - if (cachedResult) { - return cachedResult; - } - let result = getOverflowAncestors(element, [], false).filter(el => isElement(el) && getNodeName(el) !== 'body'); - let currentContainingBlockComputedStyle = null; - const elementIsFixed = getComputedStyle$1(element).position === 'fixed'; - let currentNode = elementIsFixed ? getParentNode(element) : element; - - // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block - while (isElement(currentNode) && !isLastTraversableNode(currentNode)) { - const computedStyle = getComputedStyle$1(currentNode); - const currentNodeIsContaining = isContainingBlock(currentNode); - if (!currentNodeIsContaining && computedStyle.position === 'fixed') { - currentContainingBlockComputedStyle = null; - } - const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === 'static' && !!currentContainingBlockComputedStyle && absoluteOrFixed.has(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode); - if (shouldDropCurrentNode) { - // Drop non-containing blocks. - result = result.filter(ancestor => ancestor !== currentNode); - } else { - // Record last containing block for next iteration. - currentContainingBlockComputedStyle = computedStyle; - } - currentNode = getParentNode(currentNode); - } - cache.set(element, result); - return result; -} - -// Gets the maximum area that the element is visible in due to any number of -// clipping ancestors. -function getClippingRect(_ref) { - let { - element, - boundary, - rootBoundary, - strategy - } = _ref; - const elementClippingAncestors = boundary === 'clippingAncestors' ? isTopLayer(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary); - const clippingAncestors = [...elementClippingAncestors, rootBoundary]; - const firstClippingAncestor = clippingAncestors[0]; - const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => { - const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy); - accRect.top = max(rect.top, accRect.top); - accRect.right = min(rect.right, accRect.right); - accRect.bottom = min(rect.bottom, accRect.bottom); - accRect.left = max(rect.left, accRect.left); - return accRect; - }, getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy)); - return { - width: clippingRect.right - clippingRect.left, - height: clippingRect.bottom - clippingRect.top, - x: clippingRect.left, - y: clippingRect.top - }; -} - -function getDimensions(element) { - const { - width, - height - } = getCssDimensions(element); - return { - width, - height - }; -} - -function getRectRelativeToOffsetParent(element, offsetParent, strategy) { - const isOffsetParentAnElement = isHTMLElement(offsetParent); - const documentElement = getDocumentElement(offsetParent); - const isFixed = strategy === 'fixed'; - const rect = getBoundingClientRect(element, true, isFixed, offsetParent); - let scroll = { - scrollLeft: 0, - scrollTop: 0 - }; - const offsets = createCoords(0); - - // If the scrollbar appears on the left (e.g. RTL systems). Use - // Firefox with layout.scrollbar.side = 3 in about:config to test this. - function setLeftRTLScrollbarOffset() { - offsets.x = getWindowScrollBarX(documentElement); - } - if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) { - if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) { - scroll = getNodeScroll(offsetParent); - } - if (isOffsetParentAnElement) { - const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent); - offsets.x = offsetRect.x + offsetParent.clientLeft; - offsets.y = offsetRect.y + offsetParent.clientTop; - } else if (documentElement) { - setLeftRTLScrollbarOffset(); - } - } - if (isFixed && !isOffsetParentAnElement && documentElement) { - setLeftRTLScrollbarOffset(); - } - const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0); - const x = rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x; - const y = rect.top + scroll.scrollTop - offsets.y - htmlOffset.y; - return { - x, - y, - width: rect.width, - height: rect.height - }; -} - -function isStaticPositioned(element) { - return getComputedStyle$1(element).position === 'static'; -} - -function getTrueOffsetParent(element, polyfill) { - if (!isHTMLElement(element) || getComputedStyle$1(element).position === 'fixed') { - return null; - } - if (polyfill) { - return polyfill(element); - } - let rawOffsetParent = element.offsetParent; - - // Firefox returns the element as the offsetParent if it's non-static, - // while Chrome and Safari return the element. The element must - // be used to perform the correct calculations even if the element is - // non-static. - if (getDocumentElement(element) === rawOffsetParent) { - rawOffsetParent = rawOffsetParent.ownerDocument.body; - } - return rawOffsetParent; -} - -// Gets the closest ancestor positioned element. Handles some edge cases, -// such as table ancestors and cross browser bugs. -function getOffsetParent(element, polyfill) { - const win = getWindow(element); - if (isTopLayer(element)) { - return win; - } - if (!isHTMLElement(element)) { - let svgOffsetParent = getParentNode(element); - while (svgOffsetParent && !isLastTraversableNode(svgOffsetParent)) { - if (isElement(svgOffsetParent) && !isStaticPositioned(svgOffsetParent)) { - return svgOffsetParent; - } - svgOffsetParent = getParentNode(svgOffsetParent); - } - return win; - } - let offsetParent = getTrueOffsetParent(element, polyfill); - while (offsetParent && isTableElement(offsetParent) && isStaticPositioned(offsetParent)) { - offsetParent = getTrueOffsetParent(offsetParent, polyfill); - } - if (offsetParent && isLastTraversableNode(offsetParent) && isStaticPositioned(offsetParent) && !isContainingBlock(offsetParent)) { - return win; - } - return offsetParent || getContainingBlock(element) || win; -} - -const getElementRects = async function (data) { - const getOffsetParentFn = this.getOffsetParent || getOffsetParent; - const getDimensionsFn = this.getDimensions; - const floatingDimensions = await getDimensionsFn(data.floating); - return { - reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy), - floating: { - x: 0, - y: 0, - width: floatingDimensions.width, - height: floatingDimensions.height - } - }; -}; - -function isRTL(element) { - return getComputedStyle$1(element).direction === 'rtl'; -} - -const platform = { - convertOffsetParentRelativeRectToViewportRelativeRect, - getDocumentElement, - getClippingRect, - getOffsetParent, - getElementRects, - getClientRects, - getDimensions, - getScale, - isElement, - isRTL -}; - -function rectsAreEqual(a, b) { - return a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height; -} - -// https://samthor.au/2021/observing-dom/ -function observeMove(element, onMove) { - let io = null; - let timeoutId; - const root = getDocumentElement(element); - function cleanup() { - var _io; - clearTimeout(timeoutId); - (_io = io) == null || _io.disconnect(); - io = null; - } - function refresh(skip, threshold) { - if (skip === void 0) { - skip = false; - } - if (threshold === void 0) { - threshold = 1; - } - cleanup(); - const elementRectForRootMargin = element.getBoundingClientRect(); - const { - left, - top, - width, - height - } = elementRectForRootMargin; - if (!skip) { - onMove(); - } - if (!width || !height) { - return; - } - const insetTop = floor(top); - const insetRight = floor(root.clientWidth - (left + width)); - const insetBottom = floor(root.clientHeight - (top + height)); - const insetLeft = floor(left); - const rootMargin = -insetTop + "px " + -insetRight + "px " + -insetBottom + "px " + -insetLeft + "px"; - const options = { - rootMargin, - threshold: max(0, min(1, threshold)) || 1 - }; - let isFirstUpdate = true; - function handleObserve(entries) { - const ratio = entries[0].intersectionRatio; - if (ratio !== threshold) { - if (!isFirstUpdate) { - return refresh(); - } - if (!ratio) { - // If the reference is clipped, the ratio is 0. Throttle the refresh - // to prevent an infinite loop of updates. - timeoutId = setTimeout(() => { - refresh(false, 1e-7); - }, 1000); - } else { - refresh(false, ratio); - } - } - if (ratio === 1 && !rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) { - // It's possible that even though the ratio is reported as 1, the - // element is not actually fully within the IntersectionObserver's root - // area anymore. This can happen under performance constraints. This may - // be a bug in the browser's IntersectionObserver implementation. To - // work around this, we compare the element's bounding rect now with - // what it was at the time we created the IntersectionObserver. If they - // are not equal then the element moved, so we refresh. - refresh(); - } - isFirstUpdate = false; - } - - // Older browsers don't support a `document` as the root and will throw an - // error. - try { - io = new IntersectionObserver(handleObserve, { - ...options, - // Handle